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: which led me to: 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 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 25
Connected to (
Escape character is '^]'.
220 ESMTP Sendmail 8.13.1/8.13.1; Wed, 28 Feb 2007 04:47:18 -0800
250 Hello [], pleased to meet you
250 2.1.0 Sender ok
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 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 was no longer responding, or perhaps it never was and I never noticed. To comment out a line in the main file, simply put dnl at the start of the line. This now is what I have in my file:
FEATURE(`dnsbl',`',`"550 Denied RBL " $&{client_addr} " by"')dnl
FEATURE(`dnsbl',`',`"550 Denied RBL " $&{client_addr} " by"')dnl
FEATURE(`dnsbl',`',`"550 Denied RBL " $&{client_addr} " by"')dnl
For those so inclined to mess with the 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 file is found at /usr/lib/opcenter/sendmail/install/ Once you have made changes to it, you must use m4, a macro processor, to build a new file. So before doing that, please backup your good /etc/mail/ file. Then run the command:
m4 /usr/lib/opcenter/sendmail/install/ > /etc/mail/
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, 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.