Sendmail is only accepting connections from localhost ( IP)

by on May 6, 2006 · 5 comments· LAST UPDATED December 18, 2007


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:

TwitterFacebookGoogle+PDF versionFound an error/typo on this page? Help us!

{ 5 comments… read them below or add one }

1 Moeed October 9, 2006 at 3:50 am

THanks!!! I was about to pull my hair out thinking it was my host. Such a simple fix.


2 Trent August 17, 2008 at 9:11 pm

That does not work. Sendmail still does not allow incoming connections, however it is now sending out mail.


3 juraj October 29, 2008 at 7:54 pm

Hello, this solution doesn’t work for me either, i tried even to specify to run the daemon on specific address but it still binds to localhost =(


4 Trent October 30, 2008 at 3:45 am

I gave up and just started using gmail for organizations. You can access via POP/SMTP or web.

Best of all it’s free


5 tom February 14, 2012 at 11:27 am

nice!! helped me a lot…
thnx for posting!


Leave a Comment

Tagged as: , , , , , , , , , , , , , ,

Previous post:

Next post: