Skip to content

Instantly share code, notes, and snippets.

@jbalzar
Last active April 23, 2016 05:52
Show Gist options
  • Save jbalzar/81ecf7948331b0a892e6 to your computer and use it in GitHub Desktop.
Save jbalzar/81ecf7948331b0a892e6 to your computer and use it in GitHub Desktop.
Enable Mailcatcher on Linux
# http://mailcatcher.me/
gem install mailcatcher
# $ mailcatcher --help
# Usage: mailcatcher [options]
# --ip IP Set the ip address of both servers
# --smtp-ip IP Set the ip address of the smtp server
# --smtp-port PORT Set the port of the smtp server
# --http-ip IP Set the ip address of the http server
# --http-port PORT Set the port address of the http server
# -f, --foreground Run in the foreground
# -v, --verbose Be more verbose
# -h, --help Display this help information
mailcatcher --foreground --http-ip=0.0.0.0
# Add to PHP config
# Add config to mods-available for PHP
# -f flag sets "from" header for us
echo "sendmail_path = /usr/bin/env $(which catchmail) -f test@local.dev" | sudo tee /etc/php5/mods-available/mailcatcher.ini
# Enable sendmail config for all php SAPIs (apache2, fpm, cli)
sudo php5enmod mailcatcher
# Restart Apache if using mod_php
sudo service apache2 restart
# Restart PHP-FPM if using FPM
sudo service php5-fpm restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment