Thursday, February 20, 2014

Postfix setup on Ubuntu for GMail

Below steps worked 100% for me:

vim /etc/postfix/main.cf
add below to above:

relayhost = [smtp.gmail.com]:587 smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd smtp_sasl_security_options = noanonymous smtp_tls_CAfile = /etc/postfix/cacert.pem smtp_use_tls = yes


vim /etc/postfix/sasl_passwd

[smtp.gmail.com]:587 USERNAME@gmail.com:PASSWORD

sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd

cat /etc/ssl/certs/Thawte_Premium_Server_CA.pem | sudo tee -a /etc/postfix/cacert.pem

sudo /etc/init.d/postfix reload

source: https://rtcamp.com/tutorials/linux/ubuntu-postfix-gmail-smtp/

No comments:

Post a Comment