Skip to content

Instantly share code, notes, and snippets.

@nathanmac
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nathanmac/f59e8116e9dd186b21dd to your computer and use it in GitHub Desktop.
Save nathanmac/f59e8116e9dd186b21dd to your computer and use it in GitHub Desktop.
Install MailCatcher Ubuntu Vagrant - Section from Vagrant install.sh file
# Install MailCatcher (Vagrant)
# Install RVM (ruby)
sudo apt-get --purge remove ruby-rvm
sudo rm -rf /usr/share/ruby-rvm /etc/rvmrc /etc/profile.d/rvm.sh
env | grep rvm
\curl -L https://get.rvm.io | bash -s stable --ruby --autolibs=enable --auto-dotfiles --gems=mailcatcher
source /usr/local/rvm/scripts/rvm
# Start Mailcatcher for testing email
mailcatcher --ip=0.0.0.0 # run unbounded
# Start up file (mailcatcher)
echo 'description "Mailcatcher"' | sudo tee /etc/init/mailcatcher.conf
echo 'start on runlevel [2345]' | sudo tee -a /etc/init/mailcatcher.conf
echo 'stop on runlevel [!2345]' | sudo tee -a /etc/init/mailcatcher.conf
echo 'respawn' | sudo tee -a /etc/init/mailcatcher.conf
echo 'pre-start script' | sudo tee -a /etc/init/mailcatcher.conf
echo 'bash << "EOF"' | sudo tee -a /etc/init/mailcatcher.conf
echo " mkdir -p /var/log/mailcatcher" | sudo tee -a /etc/init/mailcatcher.conf
echo " chown -R vagrant /var/log/mailcatcher" | sudo tee -a /etc/init/mailcatcher.conf
echo "EOF" | sudo tee -a /etc/init/mailcatcher.conf
echo 'end script' | sudo tee -a /etc/init/mailcatcher.conf
echo "exec su - vagrant -c 'mailcatcher --http-ip=0.0.0.0 &>>/var/log/mailcatcher/mailcatcher.log'" | sudo tee -a /etc/init/mailcatcher.conf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment