Mailcatcher

Installation von Mailcatcher unter Xubuntu 18.04 LTS

setup_mailcatcher.sh

#!/bin/bash

# Install dependencies
apt install build-essential libsqlite3-dev ruby-dev

# Install the gem
gem install mailcatcher --no-ri --no-rdoc

# Make it start on boot
echo "@reboot root $(which mailcatcher) --ip=0.0.0.0" >> /etc/crontab
update-rc.d cron defaults

# Make php use it to send mail
echo "sendmail_path = /usr/bin/env $(which catchmail) -f 'www-data@localhost'" >> /etc/php/7.2/mods-available/mailcatcher.ini

# Notify php mod manager (5.5+)
phpenmod mailcatcher

# Start it now
/usr/bin/env $(which mailcatcher) --ip=0.0.0.0