Skip to content

msmtp

Install

apt install msmtp msmtp-mta

Config

vim /etc/msmtprc 
# -------
defaults
tls on
auth on
logfile /var/log/msmtp
tls_trust_file /etc/ssl/certs/ca-certificates.crt
# -------
account noreply
host mail.domain.com
from [email protected]
port 25
tls on
tls_starttls on
tls_certcheck off
user [email protected]
password [PASSWORD]
# -------
account default : noreply

Test

echo "msmtp test message" | /usr/bin/msmtp [email protected]
# with debug
echo "msmtp test message" | /usr/bin/msmtp --debug [email protected]

Log

tail -f /var/log/msmtp

Nov 01 03:21:28 host=mail.domain.com tls=on auth=on user=[email protected] from=[email protected] recipients=[email protected] mailsize=76 smtpstatus=250 smtpmsg='250 OK id=1kZ23k-0002ZV-Qd' exitcode=EX_OK