msmtp notes

Install

# debian
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.wdm.net.ua
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.wdm.net.ua tls=on auth=on [email protected] [email protected] [email protected] mailsize=76 smtpstatus=250 smtpmsg='250 OK id=1kZ23k-0002ZV-Qd' exitcode=EX_OK