-
-
Save ahgood/243572f3ef13f9c1047c31b68fdfacd0 to your computer and use it in GitHub Desktop.
install msmtp gmail, a localhost sendmail alternative
This file contains hidden or 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
# setup msmtp for sending out email | |
# as an alternative to sendmail | |
# i prefer this because it is easier to install and configure than sendmail | |
# especially when using Gmail smtp servers | |
sudo -i | |
apt-get install msmtp | |
ln -s /usr/bin/msmtp /usr/sbin/sendmail | |
touch /var/log/msmtprc && chmod 666 /var/log/msmtprc | |
vim /etc/msmtprc | |
# config options: http://msmtp.sourceforge.net/doc/msmtp.html#A-user-configuration-file | |
defaults | |
logfile /tmp/msmtp.log | |
# gmail account | |
account gmail | |
auth on | |
host smtp.gmail.com | |
port 587 | |
user [email protected] | |
password yourpassword | |
from [email protected] | |
tls on | |
tls_trust_file /usr/share/ca-certificates/mozilla/Equifax_Secure_CA.crt | |
# set default account to use | |
account default : gmail | |
:wq | |
# now test msmtp | |
sendmail [email protected] # use your own email address | |
Subject: testing | |
hello | |
# Ctrl+D to send | |
# check email to ensure it arrived |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment