OSX: Getting Mails Sent Out By Your Script On Your Local System With MailCatcher

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:// instead of your default SMTP server, then check out to see the mail that's arrived so far.


Setting Up

Normally, the command below should work:

$ gem install mailcatcher

But if you are having challenges, try this:

$ gem install mailcatcher -- --with-cflags="-Wno-error=implicit-function-declaration"

At the time of this tutorial, I was testing this one:

OSX Catalina.

$ rvm --version

rvm 1.29.12-next (master) by Michal Papis, Piotr Kuczynski, Wayne E. Seguin [https://rvm.io]

$ ruby --version

ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin19]


To start mailcatcher:

$ mailcatcher

Starting MailCatcher

== smtp://

/usr/local/rvm/gems/ruby-2.4.0/gems/thin-1.5.1/lib/thin/server.rb:104: warning: constant ::Fixnum is deprecated


*** MailCatcher runs as a daemon by default. Go to the web interface to quit.


Starting Mail-Catcher On Login


Place me.mailcatcher.plist into ~/Library/LaunchAgents, then run launchctl load ~/Library/LaunchAgents/me.mailcatcher.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<string>$SHELL --login -c "mailcatcher --foreground"</string>

No comments

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.