Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install Mailhog with a Forge recipe
#run as root
apt-get install golang-go -yqq
mkdir gocode
export GOPATH=$HOME/gocode
go get
go get
cp /root/gocode/bin/MailHog /usr/local/bin/mailhog
cp /root/gocode/bin/mhsendmail /usr/local/bin/mhsendmail
cat >/etc/systemd/system/mailhog.service <<EOL
Description=MailHog service
cp /etc/php/7.1/cli/php.ini /etc/php/7.1/cli/php.ini.bak
cp /etc/php/7.1/fpm/php.ini /etc/php/7.1/fpm/php.ini.bak
sed -i 's/^\;sendmail_path =$/sendmail_path = \/usr\/local\/bin\/mhsendmail/' /etc/php/7.1/cli/php.ini
sed -i 's/^\;sendmail_path =$/sendmail_path = \/usr\/local\/bin\/mhsendmail/' /etc/php/7.1/fpm/php.ini
systemctl restart nginx
systemctl restart php7.1-fpm
systemctl start mailhog
systemctl enable mailhog
php -r "\$from = \$to = ''; \$x = mail(\$to, 'subject'.time(), 'Hello from Forge recipes!', 'From: '. \$from); var_dump(\$x);"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.