Configure Sendmail to listen on multiple ports
I'm not a fan of Sendmail, as anyone I've worked with can attest to. There are other MTAs out there that are every bit as capable while being much easier to work with. I like Postfix, personally, but Exim is pretty decent too.
I was recently tasked with configuring Sendmail to listen on port 587 as well as port 25 for the use of some of the system’s users who found their outbound port 25 access restricted on their new home cable modem.
A few minutes Googling for help showed me that there's a real lack of clear instruction out there on this. Some instructions say to edit sendmail.cf directly, which is a bad idea, while other say to comment out FEATURE(`no_default_msa',`dnl') before adding the additional port configuration. This last caused the MTA to stop listening entirely (oops). So here's what I did to get Sendmail to listen on the additional port 587 as well as the default port 25. This was done on a Red Hat system but should work on any distribution running Sendmail.
In /etc/mail/sendmail.mc, you need the following two lines:
DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
The second line may already be there, but commented out. This enables listening on port 587. The first line is required if you want to also continue listening on port 25, which is necessary if this machine receives mail from the public at large.
Reload sendmail and you’re ready to go.