Sendmail is only accepting connections from localhost ( IP)

Posted on in Categories FAQ, Troubleshooting last updated May 6, 2006

Q. My sendmail service is running under Linux and whenever I try to telnet it from other LAN IP, it gives connection refuse error. If I connect it from localhost it accept connection. I can only send mail from my server only. How do I force sendmail to accept mail from other hosts/LAN ips?

A. For security reason sendmail is by default configured to accept connection from local system ( This should avoid open mail relay problem.

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

# vi /etc/mail/

Look for line that read as follows:

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

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


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

# m4 /etc/mail/ > /etc/mail/

Restart sendmail service :

# /etc/init.d/sendmail restart

Caution: You should configure firewall and other Sendmail Anti-Spam configuration control to avoid problems.

See also: