Allow Port 26 for SMTP in IPtables

Last modified: February 24, 2020
You are here:
Estimated reading time: 1 min

Please take note that Malaysia and in some countries, or better said some ISPs are now blocking SMTP. Port 25 to mitigate Spam in their network.

An approach lots of systems administrators are taking is to use port 26, so you can configure your email client and your colleagues. Email’s clients to use port 26 instead of 25 to send emails.

Here I will show you how to configure your smtp server to accept email connections on port 26, independent of the server you are using, Postfix, or Sendmail or any other server. First you need to open port 26, to do so, insert this line in your firewall configuration.

iptables -A INPUT -p tcp –dport 26 -j ACCEPT

This will enable the server to accept connections on port 26, from all over the world, next redirect the connections on port 26 to 25, this way you do not need to reconfigure your email server to listen on port 26.

iptables -A PREROUTING -t nat -p tcp –dport 26 -j REDIRECT –to-port 25

With these two line you will make your email server to accept emails on port 26.

Was this article helpful?
Dislike 0
Views: 23