Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ScottPhillips/4c29000315808ce4e9da578553040187 to your computer and use it in GitHub Desktop.
Save ScottPhillips/4c29000315808ce4e9da578553040187 to your computer and use it in GitHub Desktop.
Mailhog Bash Script
#!/usr/bin/env bash
echo ">>> Installing Mailhog"
# Download binary from github
wget --quiet -O ~/mailhog https://github.com/mailhog/MailHog/releases/download/v0.2.1/MailHog_linux_amd64
# Make it executable
chmod +x ~/mailhog
# Make it start on reboot
sudo tee /etc/init/mailhog.conf <<EOL
description "Mailhog"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
pre-start script
exec su - vagrant -c "/usr/bin/env ~/mailhog > /dev/null 2>&1 &"
end script
EOL
# Start it now in the background
sudo service mailhog start
@saimuthu38
Copy link

The MailHog Bash Script (Upstart) is a very useful script for managing MailHog as a service on Linux-based systems. It helps developers efficiently test emails in a local environment without the need for an external SMTP server.

With this script, you can easily start, stop, and manage MailHog as a background service, ensuring smooth email testing during development.

Thanks to its simplicity and effectiveness, this script is a must-have for developers working with email testing setups!

For more gaming guides and tech tips, visit:
๐Ÿ”— https://gameypro.in/
๐Ÿ”— https://gameypro.in/fc-mobile/

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