-
Undo all your changes to
master.cf
. -
In
main.cf
, add these settings:relayhost = [smtp.gmail.com]:587 smtp_tls_security_level = verify smtp_tls_CAfile = /etc/ssl/certs/ca-certificates.crt smtp_tls_session_cache_database = btree:/var/run/smtp_tls_session_cache smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous
-
In
/etc/postfix/sasl_passwd
, add your Gmail username and password, like this:[smtp.gmail.com]:587 user@gmail.com:mypassword
-
Run
postmap /etc/postfix/sasl_passwd postfix reload