I can't send email externally postfix

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 []: 25: Connection timed out Nov 17 12:11:29 panel postfix / smtp [16273]: connect to []: 25: Connection timed out Nov 17 12:11:44 panel postfix / smtp [16165]: connect to []: 25: Connection timed out Nov 17 12:11:44 panel postfix / smtp [16165]: 0E31F4085F: to =, relay = none, delay = 151, delays = 0.07 / 0.06 / 150/0, ds (connect to []: 25: Connection timed out) Nov 17 12:11:59 panel postfix / smtp [16273]: connect to []: 25: Connection timed out [root @ log panel] # telnet 25

I’m using postfix with zpanel / sentora.

Can someone help me?

Submit an 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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.


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).