Setup EXIM QMAIL SENDMAIL to listen on additional SMTP port
With the recent mitigation spam exercise in TM Network, I received phone calls from my friends complaining on unable to access remote SMTP server listening on port 25 from TM Network. TM Net took an immediate action on the same day itself the email notification was sent out as well as the news notification was published in their website. I quickly relay this message to my friends and they got frustrated. To overcome this email relay issue on SMTP port 25, some of the local web hosting provider had created an additional SMTP port for email relaying to their affected clients.
So, I would like to share on how to setup EXIM, QMAIL or SENDMAIL to listen on additional SMTP port using iptables in a Linux mail server box if you are a web hosting provider or you have a co-located server in a data center. Make sure iptables is installed. Just run the following command below: -
/sbin/iptables -t nat -A PREROUTING -p tcp -m tcp --dport 2525 -j REDIRECT --to-ports 25
The iptables command above will redirect any request access to TCP destination port 2525 to port 25. You can change the port number 2525 to your preferred port number. Hope this help you guys. Good nite.
If you found these helpful, please contribute to help:







A simple guy trying to put his name into the WWW place.
December 7th, 2007 at 9:05 am
Bravo bro, a very simple step to redirect port. I’ll do a howto on how to configure sendmail to accept port 587.
December 7th, 2007 at 9:38 am
It’s work on my qmail box. Thanks for the tips
December 7th, 2007 at 12:54 pm
Exabytes did provide a solution by changing its SMTP port from 25 to 26. But for gmail users, i believe that we can only use SMTP server that provide by TMNET.
December 8th, 2007 at 12:52 am
simon, cool…can’t wait to read your howto,
mazuhan, great to hear that it works for you,
dicky, I can send email via smtp.gmail.com with SMTPS port 465 (SSL) using Thunderbird.
December 9th, 2007 at 2:55 pm
Phew..Lucky I’m not using TM Net whatever. I heard a lot of bad rumors about them. Nevertheless, i won’t be long here anyway..
Cheers!!
December 11th, 2007 at 10:48 pm
[...] that’s mean your sendmail now is accepting both port 25 and 587. My friend Siew, have another how-to on using IPTABLES to redirect port 25 to another [...]
September 8th, 2008 at 8:25 pm
You’re little guide fixed a problem i have been working on for DAYS! Tried installing PostFix and SendMail, and it turned out to be a simple solution, adding an additional port for EXIM to listen to…
September 10th, 2008 at 1:42 am
Jeremy, glad to hear you are not using TMnet…
Liam, glad to hear this simple solution works for you…