I looked around at quite a few solutions and most ended up being Windows service based. Being on a Mac they were less than useful, and given that my requirements included the need to move the configuration across multiple environments which are shared by a team of developers, those fell short as none included a web interface for reviewing emails. They all seemed to favor a desktop GUI which could not be viewed without logging in to each server for viewing.
Enter Maildev. Maildev is actively maintained and looks like it has been around for almost year now (probably longer, I'm just going by github commits).
There are a few ways to install, but I installed via npm. It couldn't be simpler:
- Download and install NodeJS/NPM, unless you already have them (as you should!)
- Install Maildev using npm (npm install -g maildev). You'll need to sudo for Mac/Linux.
- Start maildev by typing maildev
Pretty straightforward stuff. Maildev starts on port 1025 by default. The web interface is available at port 1080. Maildev will listen on all IPs by default (0.0.0.0). These are easy to configure using the command line options -s, -w, and --ip.
Installing this across environments permits you to capture emails on each specific environment, and binding Maildev instances to various IPs allows you to isolate email on a per application basis. If you are on windows you can always install Maildev as a service using nssm. On Linux you'd use a combination of forever (maybe) and upstart or chkconfig or whatever your flavor permits. Let's face it, you're on Linux. You'll figure it out.
Maildev also has some nice features like testing your emails in various viewports and viewing headers and attachments.
For my purposes using ACF or Railo, the mail config was moved to the app configuration and switches across environments using Ant filter tasks triggered by Jenkins. I'm sure whatever language you are using has a similar simple configuration option to simplify the task.
Kudos to Dan Farrelly for creating such a useful development tool.
Thanks for your great write up Nic!
ReplyDeleteStill a major tool in our toolbox, thank you.
Delete