Sendmail 'collect: premature EOM: unexpected close' solution

If you are getting a 'collect: premature EOM: unexpected close' in your mail logs, or if you have people complaining that they cannot send email to your server and you have this error, then I might have a solution to your problem. To solve this error I found this link by searching in Google: http://www.sendmail.org/faq/section3.html#3.10 which led me to: http://www.sendmail.org/faq/section3.html#3.12 Now although the exact answer wasn't in there, the line about define(`confTO_IDENT',`0s')dnl made me think that I have an issue in my sendmail.cf file. So next I checked one of my domains with the great service DNS Stuff. DNS Stuff apparently could not connect to my mail server either, and told me the last communication with the mail server was RCPT TO:. To verify this I openen a telnet session from one of my servers to my troubled server on port 25 (SMTP). Here is the session that took place:
telnet secure.brokensmtp.org 25
Trying 123.123.123.123...
Connected to secure.brokensmtp.org (123.123.123.123).
Escape character is '^]'.
220 secure.brokensmtp.org ESMTP Sendmail 8.13.1/8.13.1; Wed, 28 Feb 2007 04:47:18 -0800
HELO secure.workingserver.org
250 secure.brokensmtp.org Hello server5.outofcontrol.ca [123.123.123.254], pleased to meet you
MAIL FROM:james@workingserver.org
250 2.1.0 james@workingserver.org... Sender ok
RCPT TO:webmaster@workingserver.org
After the last line RCPT TO: my session hung for almost two minutes. So it was obvious that my sendmail service was really really slow. After a good nights sleep it dawned on me that I had over time installed several Black List denies in my sendmail.cf config file, and that perhaps one of these was not responding anymore. By commenting out each Black List deny one at a time, I quickly discovered that relays.ordb.org was no longer responding, or perhaps it never was and I never noticed. To comment out a line in the main sendmail.mc file, simply put dnl at the start of the line. This now is what I have in my sendmail.mc file:
FEATURE(`dnsbl',`list.dsbl.org',`"550 Denied RBL " $&{client_addr} " by list.dsbl.org"')dnl
FEATURE(`dnsbl',`sbl-xbl.spamhaus.org',`"550 Denied RBL " $&{client_addr} " by sbl-xbl.spamhaus.org"')dnl
FEATURE(`dnsbl',`dnsbl.njabl.org',`"550 Denied RBL " $&{client_addr} " by dnsbl.njabl.org"')dnl
For those so inclined to mess with the sendmail.mc file, please make a backup first. This file must be errors free, or your mailer server will cease to serve. On the RHEL4 Ensim box I am on, the mail sendmail.mc file is found at /usr/lib/opcenter/sendmail/install/sendmail.mc Once you have made changes to it, you must use m4, a macro processor, to build a new sendmail.cf file. So before doing that, please backup your good /etc/mail/sendmail.cf file. Then run the command:
m4 /usr/lib/opcenter/sendmail/install/sendmail.mc > /etc/mail/sendmail.cf
m4 will not ask you to verify if it needs to overwrite an existing file, so once you run that command it's done. Then simply restart sendmail. There has been a fair amount of talk lately about the 'premature EOM' error over at forums.theplanet.com, and I have posted my solution there as well. A special thanks to pblinux Catalyst over at the planet forums for helping everyone get these Black Lists working in the first place.

Comments