Can't Open Port 25

  • Posted April 1, 2014

I’ve been trying to open port 25 for postfix, and I can’t figure out what I’m doing wrong. I can’t telnet to the server with port 25, while I can telnet to other, like TeamSpeak3s port (30033). This is what my iptables looks like.

Generated by iptables-save v1.4.7 on Tue Apr 1 15:24:14 2014

*filter :INPUT ACCEPT [1326:1570360] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [841:176823] -A INPUT -p tcp -m tcp --dport 25 -j ACCEPT COMMIT

Completed on Tue Apr 1 15:24:14 2014


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

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.

Hello all,

You can use UFW in order to allow connections on ports 25, 465 and 587

UFW, or Uncomplicated Firewall, is a simplified firewall management interface that hides the complexity of lower-level packet filtering technologies such as iptables and nftables

To allow connections on ports 25, 465, 587 execute the following commands:

sudo ufw allow 25/tcp

sudo ufw allow 465/tcp

sudo ufw allow 587/tcp

You can check our existing tutorial on how to setup a Firewall with UFW here:

If you’re still unable to send emails I will recommend you to try using alternative ports as 587 and 465, because a lot of providers will block connections/emails sent without authentication on port 25 as well.

Hope that this helps! Regards, Alex

Postfix is listening on the loopback interface. You have to configure it to listen on See <a href=“”></a>.

I am trying to open the port for posfix, but the server can’t receive any emails. After a while I get this response on gmail, trying to send an email: <br> <br>Technical details of temporary failure: <br>The recipient server did not accept our requests to connect. Learn more at <br>[(0) []:25: Connection refused]

sudo netstat -plutn | grep 25 <br>tcp 0 0* LISTEN 28291/master <br>tcp 0 0 ::1:25 :::* LISTEN 28291/master <br>

Is there anything running on port 25? <pre>sudo netstat -plutn | grep 25</pre>