Information and Links
Join the fray by commenting, tracking what others have to say, or linking to it from your blog.
Getting Ensim sendmail to listen on an alternate port
Setup a new server today! This time, instead of using port 465 and setting up the SSL certs etc, I wanted something a little easier to use. So, according to RFC 2476 at this link, I can use port 587.
On our Ensim 10.3 box which runs on RHEL 5, this is an easy change to make. Note this should work equally well on RHEL4 and Ensim 4.0.x and Ensim 4.1.x.
As usual, lets modify the sendmail.mc file and NOT try to modify sendmail.cf, as a lot of others suggest. Modifying sendmail.cf will cause your changes to be lost next time you upgrade Ensim.
-
cd /usr/lib/opcenter/sendmail/install
-
cp sendmail.mc sendmail.mc.GOOD # Always make a backup before proceeding!
-
pico -w sendmail.mc # Or us vi or whatever your favourite editor is.
Next, you will scroll down until you find this line:
-
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
and immediately below it, add this line:
-
DAEMON_OPTIONS(`Port=587,Name=MTA')dnl
A couple of things here worth mentioning. You don't have to use port 587, you can use pretty much any available port you want. If you wish to RFC compliant however, then port 587 is the right port to use as an alternative sendmail port. Also, for those of us not familiar with the sendmail.mc file, the dnl in front of the line, basically comments the line out. To uncomment the line, simply move the dnl to the end of the line.
Don't uncomment that first DAEMON_OPTIONS line unless you want to block every one on the internet from being able to send email from your server. Uncommenting that line essentially tells the server to listen to port 25 (SMTP) on the localhost (127.0.0.1) only, and ignore all other IP's address (the world!).
Alright, so by now you have made the changes above and are ready to get sendmail.cf updated.
-
cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.GOOD # Remember, always make a backup!
-
m4 sendmail.mc> /etc/mail/sendmail.cf
-
/etc/init.d/sendmail restart
If you use a firewall, be sure to unblock port 587! Many people seem to over look this one (myself included!) and struggle trying to figure out why this little fix doesn't work.
If you have comments or suggestions, I would love to hear them on this topic.
Update: March 30th 2008
Some people have discovered that turning on this feature causes email to stop sending email out from the server with the following error:
-
stat=Deferred: Connection refused by [127.0.0.1]
This can be resolved by add this code immediately before this line DAEMON_OPTIONS(`Port=587,Name=MTA')dnl:
-
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
Further more, I noticed that sendmail now has the 587 line already in the sendmail.mc file, but it is simply commented out. So instead of all of the above, you can look for this line:
-
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl
and replace it for these two line:
-
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
-
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea')dnl

