Need help configuring Sendmail relay/Connection refused errors

sendmailubuntu-10.04

I am running Ubuntu 10.04 with Sendmail in a VMWare VM.
In my mail.log file I have thousands of Connection Refused errors, and I'd like to get rid of them. There are multiple errors each second and I'm convinced this problem is causing some of our legit email to not be sent.

Example:

Jul 13 08:20:02 mail sm-msp-queue[28076]: s6C3K6e0008595: to=root, ctladdr=smmsp (115/126), delay=1+08:59:56, xdelay=00:00:00, mailer=relay, pri=8940371, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6C3K19D008593: to=smmsp, delay=1+08:59:58, xdelay=00:00:00, mailer=relay, pri=8941647, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6D2K2lX023270: to=postmaster, delay=09:59:56, xdelay=00:00:00, mailer=relay, pri=9331939, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6C7e3Cp010618: to=postmaster, delay=1+04:39:47, xdelay=00:00:00, mailer=relay, pri=9754324, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6BNe474006871: to=root, ctladdr=smmsp (115/126), delay=1+12:39:58, xdelay=00:00:00, mailer=relay, pri=9930371, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6CMK1lb021417: to=root, delay=13:59:57, xdelay=00:00:00, mailer=relay, pri=10410356, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6BLK2Bk005641: to=postmaster, delay=1+14:59:56, xdelay=00:00:00, mailer=relay, pri=10571717, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]
Jul 13 08:20:02 mail sm-msp-queue[28076]: s6BK01i9004244: to=postmaster, delay=1+16:20:00, xdelay=00:00:00, mailer=relay, pri=10926911, relay=[127.0.0.1] [127.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by [127.0.0.1]`

I've read where a potential problem is sendmail is not listening on port 25, so I ran this command

# sudo netstat -a -n -p |grep 0.0.0.0:25
tcp        0      0 0.0.0.0:25                  0.0.0.0:*               LISTEN      1137/sendmail: MTA:`

I have also tried changing the lines:

DAEMON_OPTIONS('Name=MTA, Addr=127.0.0.1, Port=smtp')dnl`
DAEMON_OPTIONS('Name=MSP, Addr=127.0.0.1, Port=submission')dnl`

in my sendmail.mc and rebuilding the sendmail config, but I was unable to send email at all when I did that.

I'm attaching a copy of my hosts file as well, since I am not 100% sure that it is correct.

127.0.0.1 example.org localhost localhost.localdomain mail.example.org.localdomain`
10.1.1.204 example.org mail.example.org mail.example.ci.oh.us mail-server`

Our mail server 'mail.example.org' handles all relayed mail from our web server 'example.org'
This part always confuses me, but it was set up this way when I took over managing these servers.

Thanks for any help and let me know if you need me to post anything else. I'll do whatever I have to in order to fix these errors.

Best Answer

Have you searched sendmail logs for rejecting connections ...?
Sendmail may refuse to accept incoming connections when system load average is too high.

Check number of message in "client queue" (mailq -Ac) - in some cases such problems have been caused by huge number of spam messages in client queue e.g. due to hosted/hacked "spam friendly" web pages.
How to read HUGE clientmqueue in human format?


You may increase "refuse Load Average" from default 12 using the following line in your sendmail.mc file:

define(`confREFUSE_LA',`20')  

"Sendmail Performance Tuning" by Nick Christenson (page 139) talks about setting it between 12 and 20 on dedicated non Linux server and even higher on dedicated Linux server. [Linux calculates Load Average in a different way]

Sendmail-8.14.0 introduced option to set it as DaemonPortOptions parameter. You may use it to set different refuseLA for loopback (127.0.0.1), internal and public IP addresses.

Related Topic