Mailboxer is a web service helping you test applications that send emails without much hassle. It lets you programmatically open virtual accounts, send emails to them, query the emails that were received and even inject faults to make the mailserver abuse senders.
We assume you take yourself seriously as a developer, and thus you write tests for software you create. This is awesome.
However, in some cases you need to test products that send out emails as a part of their normal operation. Some of these may be alerts, telemetry information, invites, password reset emails, and what not. This is where it usually gets ugly - do you set up a server of your own? Do you ask your local IT guy to create a mailbox for you to use?
Mailboxer fixes that.
Creating a mailbox is just an API call away:
$ curlish -X POST http://your.server.address/v2/mailboxes -J [email protected]
From this point forward, mailboxer will start collecting emails sent to [email protected]
.
$ curlish http://your.server.address/v2/mailboxes/[email protected]/emails
You can also query unread emails only (marking the ones returned as read):
$ curlish http://your.server.address/v2/mailboxes/[email protected]/unread_emails
Mailboxer supports the STARTTLS extension, and will also let you know by which method each message was sent.
Mailboxer can be instructed to abuse mail senders by closing connections unexpectedly, sleeping and lagging, and more.
Mailboxes automatically get cleaned up after a week of inactivity
Mailboxer is distributed under the MIT license, and is completely free to use, fork or modify.
- Create a directory for the installation:
$ mkdir /opt/mailboxer
- Clone the source:
$ git clone https://github.com/getslash/mailboxer /opt/mailboxer/src
- Copy the systemd unit file over to
/etc/systemd/system
:
$ cp /opt/mailboxer/src/deployment/mailboxer.service /etc/systemd/system/
$ systemctl daemon-reload
- Start the service:
$ systemctl enable --now mailboxer.service