Mar 24, 2015
Sometimes a piece of software needs a mailserver to function but you don’t have one for some reason. Mailcatcher may come in handy then:
Catches mail and serves it through a dream.
MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface. Run mailcatcher, set your favourite app to deliver to smtp://127.0.0.1:1025 instead of your default SMTP server, then check out http://127.0.0.1:1080 to see the mail that’s arrived so far.
And, I must say, it works like a charm!
mailcatcher –help
--ip IP | Set the ip address of both servers |
--smtp-ip IP | Set the ip address of the smtp server |
--smtp-port PORT | |
Set the port of the smtp server | |
--http-ip IP | Set the ip address of the http server |
--http-port PORT | |
Set the port address of the http server | |
--no-quit | Don’t allow quitting the process |
-f, --foreground | |
Run in the foreground | |
-v, --verbose | Be more verbose |
-h, --help | Display this help information |
For example, in my case, I simply start mailcatcher this way, to make it ready for development with a Discourse Docker instance:
mailcatcher -f --smtp-ip 172.17.42.1 --smtp-port 1025
Note the -f switch which keeps the task in the foreground. Otherwise you have to find out which process it is (ps aux) and kill that task. To stop it as a foreground task is easier.
Email services for developers may be an alternative:
But: Mailcatcher is local and great!