Skip to content

Instantly share code, notes, and snippets.

@kas-cor
Last active February 5, 2022 18:19
Show Gist options
  • Save kas-cor/c4e8e0bd7a41bff13b72472e971267c0 to your computer and use it in GitHub Desktop.
Save kas-cor/c4e8e0bd7a41bff13b72472e971267c0 to your computer and use it in GitHub Desktop.
Install MailHog in Manjaro Linux
#!/bin/bash
# Install Go
sudo pacman -S --noconfirm go
# Build MailHog and mhsendmail from source in GitHub
go get github.com/mailhog/MailHog
go get github.com/mailhog/mhsendmail
# Copy execucate files
sudo cp ~/go/bin/MailHog /usr/local/bin/mailhog
sudo cp ~/go/bin/mhsendmail /usr/local/bin/mhsendmail
# Create Deamon for backgraund run
sudo echo <<EOF
[Unit]
Description=MailHog service
[Service]
ExecStart=/usr/local/bin/mailhog \
-api-bind-addr 127.0.0.1:8025 \
-ui-bind-addr 127.0.0.1:8025 \
-smtp-bind-addr 127.0.0.1:1025
[Install]
WantedBy=multi-user.target
EOF > /etc/systemd/system/mailhog.service
# Start and enable Deamon
sudo systemctl start mailhog
sudo systemctl enable mailhog
@kas-cor
Copy link
Author

kas-cor commented Feb 5, 2022

Install

wget -O - https://bit.ly/3GBsyIE | bash

Use

Web interface

http://localhost:8025

SMTP server

Host: localhost
Port: 1025
Without SSL

For sendmail in PHP

Change sendmail_path in php.ini file to...

sendmail_path = /usr/local/bin/mhsendmail

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