sendmail bind to ip address

Red hat Rhel/platform services
March 12, 2011 at 09:03:12
Specs: Linux
I saw a comment on To bind sendmail to a specific ip address you need to edit the /etc/mail/ file. (editing file is bad, unless you really know what you are doing).

In the file, you are looking for the line containing:
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')
Just change "" to the IP Address you are looking to bind the sendmail daemon to. If you want to bind to all IP Addresses on the local system, change it to "" as such:
DAEMON_OPTIONS(`Port=smtp,Addr=, Name=MTA')

To test to see if it is binding properly, check out 'netstat' and the tcp ports. We are looking for port 25 (smtp).

netstat -ntlp

This will bring up all open listening(-l) tcp(-t) ports, and PID (-p) (process id) along with the name of the process. You should see a line as such:

tcp 0 0* LISTEN 5239/sendmail: acce

This shows that we are listening on all IP (v4) addresses, on port 25 (column 3), and will accept connections from all (column 4). The last column is the PID, and the program the PID is associated with. (PID and program will only show if you are running command netstat as root/sudo).

Hope this helps all.

-Captain Mikey

See More: sendmail bind to ip address

Report •

March 12, 2011 at 09:07:33
One last thing. After you edit the file, you need to run:
m4 /etc/mail/ > /etc/mail/
This will update the file. You should always backup your and before editing them. (Always CYA).
Once the file is updated, restart sendmail to pick up the changes
/etc/init.d/sendmail restart
or if you are running Redhat or something derived from it, use:
service sendmail restart

-Captain Mikey

Report •
Related Solutions

Ask Question