Postfix smtp client authentication with SASL
The Postfix SMTP client can authenticate to a remote SMTP server.
[smtp.gmail.com]:587 [email protected]:password
postmap /etc/postfix/sasl/sasl_passwd
ls /etc/postfix/sasl/sasl_passwd.db
relayhost = [smtp.gmail.com]:587
# Enable SASL authentication
smtp_sasl_auth_enable = yes
# Disallow methods that allow anonymous authentication
smtp_sasl_security_options = noanonymous
# Location of sasl_passwd
smtp_sasl_password_maps = hash:/etc/postfix/sasl/sasl_passwd
# Enable STARTTLS encryption
smtp_tls_security_level = encrypt
# Location of CA certificates
smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt