Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

system/3099: sendmail with MILTER option generates premature EOM

From: <dlc(at)lampinc.com>
Date: Tue Feb 18 2003 - 13:34:54 EST


>Number: 3099
>Category: system
>Synopsis: sendmail with -DMILTER generates premature EOM
>Confidential: no
LAMP, Inc.
  Mr Dale Carstensen

  LAMP, Inc.                   office (505)662-2524
  1504 S Sage                     FAX (505)662-3588
  Los Alamos, NM 87544-3037 dlc@lampinc.com
>Environment:
        
	System      : OpenBSD 3.2
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:
        

I want to use the milter feature of sendmail to sort out SPAM, perhaps also virii or worms. I built sendmail with -DMILTER and the other Makefile mods to sendmail required. The resulting sendmail rejected every message sent to it as a daemon with the message

 collect: premature EOM: Resource temporarily unavailable

So I debugged the problem. I still don't know why, but when collect gets called the file structure it uses to read from the network has f_timeout set to -1 instead of something reasonable, but only if the sendmail has been compiled with -DMILTER. So I forced it to be an hour instead, which seems to be the intended default timeout. That eliminates the symptom. The authors of sendmail and/or libmilter may want to fix this some other way, but a context diff of my fix to sendmail/collect.c is included.
>How-To-Repeat:
        

Since I don't want a sendmail daemon running on port 25 that rejects all messages, I used -C/etc/mail/sendmail.cf-miltertest which had these alterations from my version of the proto.cf version and -bd:

231,234c231,235

< O DaemonPortOptions=Family=inet, address=0.0.0.0, Name=MTA
< O DaemonPortOptions=Family=inet6, address=::, Name=MTA6, M=O
< O DaemonPortOptions=Family=inet, address=0.0.0.0, Port=587, Name=MSA, M=E
< O DaemonPortOptions=Family=inet6, address=::, Port=587, Name=MSA6, M=O, M=E
---

> #O DaemonPortOptions=Family=inet, address=0.0.0.0, Name=MTA
> O DaemonPortOptions=Family=inet, address=0.0.0.0, Name=MTA, Port=2525
> #O DaemonPortOptions=Family=inet6, address=::, Name=MTA6, M=O
> #O DaemonPortOptions=Family=inet, address=0.0.0.0, Port=587, Name=MSA, M=E
> #O DaemonPortOptions=Family=inet6, address=::, Port=587, Name=MSA6, M=O, M=E
That is, in /usr/src/gnu/usr.sbin/sendmail/sendmail, with ./sendmail having been made with the MILTER options: #./sendmail -C/etc/mail/sendmail.cf-miltertest -bd Then I used telnet to send a message: telnet localhost 2525 ehlo myhost.dom mail from: myemail@myhost.dom rcpt to: myemail@myhost.dom data at which point I would get 354 Enter mail, end with "." on a line by itself Connection closed by foreign host. before I could enter any text. After the fix, I could enter headers, a blank line, body lines and the "." to finish my message, and "quit" end the session. I tried setting fp->f_timeout = 3600 with gdb, but it didn't appear to change the symptoms. Eventually I saw that the timeout is in milliseconds, so using 3600000 did work. I just couldn't tell the difference between no timeout and 3.6 seconds when I was switching windows between gdb and the telnet. I would kill the sendmail process to clean up. Also note that this corrupts the contents of /var/run/sendmail.pid, so that should be cleaned up, too, at least on openBSD.
>Fix:
*** src/gnu/usr.sbin/sendmail/sendmail/collect.c.orig Tue Feb 18 10:13:00 2003 --- src/gnu/usr.sbin/sendmail/sendmail/collect.c Tue Feb 18 11:25:13 2003 *************** *** 308,313 **** --- 308,314 ---- df = NULL; ignrdot = smtpmode ? false : IgnrDot;
Do you need help?X
dbto = smtpmode ? TimeOuts.to_datablock : 0; + fp->f_timeout = dbto * 1000; /* keep -DMILTER from killing collect */ c = SM_IO_EOF; inputerr = false; headeronly = hdrp != NULL;
>Release-Note:
Received on Tue Feb 18 13:56:57 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:50 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library