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 smtp.gmail.com 587” I don’t have answer.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Generally to setup postfix to relay to Gmail, the first thing you need to do is edit your <code>/etc/postfix/main.cf</code> file to include: <pre> 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/ssl/certs/Equifax_Secure_CA.pem smtp_use_tls = yes </pre> Then you need to set your gmail password and address in <code>/etc/postfix/sasl_passwd</code> like so: <pre> [smtp.gmail.com]:587 user@gmail.com:PASSWORD </pre> Now make sure it’s permissions are correct and update it with: <pre> sudo chmod 400 /etc/postfix/sasl_passwd sudo postmap /etc/postfix/sasl_passwd </pre> And finally, restart postfix with: <pre> sudo service postfix restart </pre>
In your specific case, since you can’t telnet to <code>smtp.gmail.com </code> 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:
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.