Last active
February 5, 2022 18:19
-
-
Save kas-cor/c4e8e0bd7a41bff13b72472e971267c0 to your computer and use it in GitHub Desktop.
Install MailHog in Manjaro Linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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
inphp.ini
file to...