Due to our country new policy of blocking all dynamic IP broadband user from being spammer where they have blocked port 25 and force to used the broadband provider smtp to send all the email out. It also affect those SOHO office that host their email in third party hosting and most of the provider have change to different port to cater this problem.
Here I’ll show you on how to set sendmail to listen on port other then 25 or using the MSA port 587. This how-to based on “Centos 5.0”
1. Make sure you have the 2 packages installed on your Linux machine. It can be any version as all the setting is done through the .mc files. To check if the packages is install by issuing this command:-
# rpm -qa | grep sendmail
2. Go to the “/etc/mail” folder and edit the sendmail.mc file.
# cd /etc/mail
# vi sendmail.mc
After edit the “sendmail.mc” file, look for the following lines:-
dnl DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea’)dnl
to activate this option, remove the word “dnl” infront of the statement like:-
DAEMON_OPTIONS(`Port=submission, Name=MSA, M=Ea’)dnl
Save the file.
3. Backup your sendmail.cf configuration file first before you make the new sendmail.cf file.
# cp /etc/mail/sendmail.cf /etc/mail/sendmail.cf.<date>
then you can run the following command to create the new sendmail.cf file
# make -C /etc/mail
now restart your sendmail
# /sbin/service sendmail restart
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
Starting sendmail: [ OK ]
Starting sm-client: [ OK ]
4. Test to telnet to port 587 and see if its working
# telnet localhost 587
[root@mmix mail]# telnet localhost 587
Connected to localhost.localdomain (127.0.0.1).
Escape character is ‘^]’.
220 abc.com.my ESMTP Sendmail 8.13.8/8.13.8; Fri, 7 Dec 2007 03:41:16 +0800
once you can see the above msg, that’s mean your sendmail now is accepting both port 25 and 587. My friend Wing loon, have another how-to on using IPTABLES to redirect port 25 to another port.
Source : Sendmail.org | Wingloon.com