How I do for use postfix with relay from gmail?

June 19, 2014 6.1k views
I'm trying to do my postfix send email with relay in gmail. But I'm receiving a time out error. My firewall is open. My dns is answering. When I use the command "telnet 587" I don't have answer.
1 Answer
Generally to setup postfix to relay to Gmail, the first thing you need to do is edit your /etc/postfix/ file to include:
relayhost = []:587
smtp_sasl_auth_enable = yes
smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
smtp_sasl_security_options = noanonymous
smtp_tls_CAfile = /etc/ssl/certs/Equifax_Secure_CA.pem
smtp_use_tls = yes
Then you need to set your gmail password and address in /etc/postfix/sasl_passwd like so:
Now make sure it's permissions are correct and update it with:
sudo chmod 400 /etc/postfix/sasl_passwd
sudo postmap /etc/postfix/sasl_passwd
And finally, restart postfix with:
sudo service postfix restart
In your specific case, since you can't telnet to it sounds like you might have your SMTP port blocked. This happens in some specific cases in order to fight against spam. Please open a support ticket, and the team should be able to help you get that fixed:
  • Same problem with me. Tryed a lot of firewall configurations, even the more
    permissive ones and could not telnet

    Will try to open a support ticket.

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!