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 (127.0.0.1). This should 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
Caution: You should configure firewall and other Sendmail Anti-Spam configuration control to avoid problems.
See also:
You should follow me on twitter here or grab rss feed to keep track of new changes.
Featured Articles:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 5 comments… read them below or add one }
THanks!!! I was about to pull my hair out thinking it was my host. Such a simple fix.
That does not work. Sendmail still does not allow incoming connections, however it is now sending out mail.
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 =(
I gave up and just started using gmail for organizations. You can access via POP/SMTP or web.
Best of all it’s free
nice!! helped me a lot…
thnx for posting!