Skip to content

Instantly share code, notes, and snippets.

@conroyp
Created August 23, 2014 17:31
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 7 You must be signed in to fork a gist
  • Save conroyp/741c30c44f5295f41422 to your computer and use it in GitHub Desktop.
Save conroyp/741c30c44f5295f41422 to your computer and use it in GitHub Desktop.
Mailcatcher installation script for Ubuntu 14.04
#!/bin/bash
# Install dependencies
apt-get install libsqlite3-dev ruby1.9.1-dev
# Install the gem
gem install mailcatcher
# Make it start on boot
echo "@reboot $(which mailcatcher) --ip=0.0.0.0" >> /etc/crontab
update-rc.d cron defaults
# Make php use it to send mail
sudo echo "sendmail_path = /usr/bin/env $(which catchmail)" >> /etc/php5/mods-available/mailcatcher.ini
# Notify php mod manager (5.5+)
sudo php5enmod mailcatcher
# Start it now
/usr/bin/env $(which mailcatcher) --ip=0.0.0.0
@loweoj
Copy link

loweoj commented Apr 10, 2016

Tried to use this script and had it abort due to confirmation dialog. It might be worth adding a -y option to apt-get here.

@ahmadmayahi
Copy link

Appending the sendmail_path to the php.ini is not a good idea at all, you must use sed for replacing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment