Edit the /etc/postfix/main.cf
Do below modifications.
##################
#Set the relayhost to the Gmail SMTP server
relayhost = smtp.gmail.com:587
mynetworks = 168.168.10.220/32, 127.0.0.0/8, 192.168.10.20
#
#Set the required TLS options
smtp_tls_security_level = secure
smtp_tls_mandatory_protocols = TLSv1
smtp_tls_mandatory_ciphers = high
smtp_tls_secure_cert_match = nexthop
#Check that this path exists -- these are the certificates used by TLS
smtp_tls_CAfile = /etc/pki/tls/certs/ca-bundle.crt
#Set the sasl options smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
#message_size_limit = 40960000
Restart the service.
systemctl restart postfix.service
OR
system postfix restart
Troubleshooting
Send a test mail through telenet . Refer this article https://mbmanjula.wordpress.com/2017/02/05/how-to-test-the-google-smtp-relay-service-with-telnet/
Log
tail -f /var/log/mail | “recipient@domain.com”
Mail Queue
mailq
Log
tail -f /var/log/mail | “recipient@domain.com”
Mail Queue
mailq
Leave a comment