Thursday, January 1, 2009

Sendmail MTA Outbound Mail Problem.

One of the most used mail transport agents, the one that basically built the early years of the Internet was Sendmail. Simple, and Rock solid this has worked for many many years but now It's software that is showing it's age. With the increasing problem of spam default servers like this one are being forced to take a safe approach. In Sendmail's case, a default install on Ubuntu for example is set not to allow external mailing. This is a good idea in a world where a default unsecure setup can leave a person with a serious problem when some script kiddie from another land uses your computer to mass email thousands of people. Quickly your ISP will spot you and you will end up with a blacklisted IP and no internet service at all.

I am not going to elaborate on the securing of sendmail, I would just hope that you would seek out the answers to that yourself. But I do know that to get a mail server up and running quickly you need to be able to get mail flowing out of the lan and into the wan...

Since sendmail is by default configured to accept connection from local system (127.0.0.1). Which would avoid open mail relay problem.

To allow connections from ALL hosts/LAN IPs open sendmail.mc file (login as the root):

# vi /etc/mail/sendmail.mc

Look for line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl

Comment or remove above line and insert new line that read as follows:

DAEMON_OPTIONS(`Port=smtp,Name=MTA')dnl

Above line will force to accept connection from any host. Save the file. Regenerate sendmail configuration file using m4:

# m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf

Restart sendmail service :

# /etc/init.d/sendmail restart

"That's IT!" Yup, you've been struggling for days with this problem but it's really very simple when you know where to look eh?
I hope you found it useful...

No comments:

Post a Comment