I can't send email externally postfix

November 17, 2015 10.1k views

Hello friends, I installed with problems sending email externally already tried several posts related to this and I am not able to make it work.
Recalling that normally get, and can also send, however only for local mails.

Externally happens this error in the log.

Nov 17 12:11:14 panel postfix / smtp [16165]: connect to alt4.aspmx.l.google.com []: 25: Connection timed out
Nov 17 12:11:29 panel postfix / smtp [16273]: connect to gmail-smtp-in.l.google.com []: 25: Connection timed out
Nov 17 12:11:44 panel postfix / smtp [16165]: connect to alt3.aspmx.l.google.com []: 25: Connection timed out
Nov 17 12:11:44 panel postfix / smtp [16165]: 0E31F4085F: to = <...@wdkdigital.com.br>, relay = none, delay = 151, delays = 0.07 / 0.06 / 150/0, ds (connect to alt3.aspmx.l.google.com []: 25: Connection timed out)
Nov 17 12:11:59 panel postfix / smtp [16273]: connect to alt1.gmail-smtp-in.l.google.com []: 25: Connection timed out
[root @ log panel] # telnet aspmx.l.google.com 25

I'm using postfix with zpanel / sentora.

Can someone help me?

1 Answer


The error is stating that the connection to Port 25 is timing out, which would indicate that connections to Port 25 are being accepted, but effectively nulled, otherwise you'd simply be denied. Since this is a case of an outgoing connection, would you by chance be new to DigitalOcean? If so, you would need to either contact support (as Port 25 is often blocked by many providers as it's frequently abused) or, a better option, would be to simply choose another port and use it (which will honestly save you some hassle in the future).

To change the port, you'll want to modify:


and look for:

smtp inet n – n – – smtpd

and change that to:

NEW_PORT inet n – n – – smtpd

....where NEW_PORT is the port number of your choosing.


The port should be above 2048 (i.e. from 2049 up) and should not be a port that is often used by another service, unless you're sure that the service is not going to be used on your server. An example would, for instance, be Port 8080. This is common for Tomcat, Varnish Cache and quite a few others.

Ports 2082 & 2083 are used by cPanel, so for zPanel, simply make sure that they do not utilize the specific port that you choose and once set, simply restart and see if this fixes the issue for you.


If you have a firewall enabled, make sure that the port you choose is defined and allowed to make connections outside (the same should be done for all mail ports).

Have another answer? Share your knowledge.