Clone the mailcatcher repo to a directory, here I use ~/.mailcatcher
.
git clone https://github.com/sj26/mailcatcher.git ~/.mailcatcher
Navigate to the directory and setup the dependencies:
cd ~/.mailcatcher
bundle install
bundle exec rake assets
Now create the upstart configuration:
sudo tee /etc/init/mailcatcher.conf <<-EOF
start on runlevel [2345]
stop on runlevel [!2345]
respawn
env PATH='$HOME/.rbenv/shims:$HOME/.rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
setuid $USER
chdir $HOME/.mailcatcher
exec bundle exec bin/mailcatcher --http-ip=0.0.0.0 --http-port=1080 --foreground
EOF
To start MailCatcher you now simply run:
sudo start mailcatcher
And it will automatically start on boot.