Forcing sendmail to use a different port for outgoing mail
In the world of Linux (specifically CentOS 5 in this case) sendmail is a very useful utility. It is what allows linux to send email to regular ole mail servers. But, if you’re reading this, you likely know that.
Typically sendmail uses standard SMTP port 25 to do its business. In most cases, this works fine as is, but more and more now I am seeing ISP’s block port 25 and leave the customer with no recourse (coughAT&Tcough). This makes it particularly difficult for sendmail to do its thing since it is supposed to work on port 25.
The simplest solution is to reconfigure sendmail to send out on a port other than 25. The only catch-22 here is that the mail server must accept mail on that port as well. Now, I’ve already set that up using iptables with a simple REDIRECT function and tested to make sure my CentOS box can communicate to it on that port using telnet, so I’m not going to get in to that, as anyone can forward a port).