Thursday, 3 January 2008

Forcing Sendmail to send mails over specific IP

If you have a sendmail mail server with multiple IP addresses and you want sendmail to send emails through a specific IP, do the following

Edit sendmail.cf file with your favourite editor

Search for # SMTP client options

Uncomment the line under it and put the address you want sendmail to bind itself to for all outgoing mails.

O ClientPortOptions=Family=inet, Address=xxx.xxx.xxx.xxx

Replace xxx.xxx.xxx.xxx with the IP you want. Stop and restart Sendmail and thats it! The HELO will go from the new IP you have set.

Very useful if you have a PTR record on just one if the public IPs on your server. ISPs like AOL now completely block emails if email is received from an IP that oesn't have a relevant reverse DNS mapping. Most ISPs are not specific about the reverse DNS that is mapped to the IP, so you can use the same IP to send emails for your other registered domains on the server! Good Luck.

No comments: