Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Run MailCatcher in the background, always, on OS X

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

If you use pow, echo 1080 > ~/.pow/mailcatcher and go to http://mailcatcher.dev, otherwise use http://localhost:1080.

Currently pow doesn't seem to pass websockets through correctly. Looking into this.

<?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">
<dict>
<key>Label</key>
<string>me.mailcatcher</string>
<key>ProgramArguments</key>
<array>
<string>sh</string>
<string>-i</string>
<string>-c</string>
<string>$SHELL --login -c "mailcatcher --foreground"</string>
</array>
<key>KeepAlive</key>
<true/>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
@ozzyaaron

This comment has been minimized.

Copy link

@ozzyaaron ozzyaaron commented Feb 10, 2012

❤️

@bbenezech

This comment has been minimized.

Copy link

@bbenezech bbenezech commented Nov 5, 2013

👍

@b2un0

This comment has been minimized.

Copy link

@b2un0 b2un0 commented Feb 13, 2014

thanks

@dasgib

This comment has been minimized.

Copy link

@dasgib dasgib commented May 13, 2014

THX!

If you use RVM you need to install Mailcatcher into a dedicated gemset (https://github.com/sj26/mailcatcher#rvm) and maybe use the full path to the mailcatcher executable inside the .plist ("~/.rvm/bin/mailcatcher").

@sineld

This comment has been minimized.

Copy link

@sineld sineld commented Jan 27, 2015

Worked for me.
Thanks.

@junxy

This comment has been minimized.

Copy link

@junxy junxy commented Apr 30, 2015

👍

@nathanielvarona

This comment has been minimized.

Copy link

@nathanielvarona nathanielvarona commented Oct 24, 2015

Replace pow with mehserve. Websockets feature works using http://mailcatcher.dev/

Checkout https://www.npmjs.com/package/mehserve

@jeremiahsmall

This comment has been minimized.

Copy link

@jeremiahsmall jeremiahsmall commented Jun 6, 2017

Nice. Still works in 2017

@karlhepler

This comment has been minimized.

Copy link

@karlhepler karlhepler commented Aug 4, 2017

Is there a reason why you are using the foreground flag? Will this still work without it?

@sj26

This comment has been minimized.

Copy link
Owner Author

@sj26 sj26 commented Aug 22, 2018

@oldtimeguitarguy yes it needs to run in foreground or launchd will lose track of the process and assume it failed.

@yemartin

This comment has been minimized.

Copy link

@yemartin yemartin commented Dec 5, 2018

In case that helps anyone using chruby, here is what worked for me:

https://gist.github.com/yemartin/179369661ff880df5563a1d932329ed0

(Note: using chruby-exec did not work for some reason).

@jamesfawcett

This comment has been minimized.

Copy link

@jamesfawcett jamesfawcett commented Jul 20, 2020

This is still working in 2020. Installed MailCatcha via Homebrew and worked straight out the box!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.