Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Feb 2002 18:19:59 -0600 (CST)
From:      "Scot W. Hetzel" <hetzels@westbend.net>
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        dinoex@freebsd.org, gshapiro@freebsd.org
Subject:   ports/35363: Bug in Sendmail Milter causes milter daemons to fail
Message-ID:  <200202270019.g1R0Jx794986@mail.westbend.net>

next in thread | raw e-mail | index | archive | help

>Number:         35363
>Category:       ports
>Synopsis:       Bug in Sendmail Milter causes milter daemons to fail
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb 26 16:30:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Scot W. Hetzel
>Release:        FreeBSD 4.5-STABLE i386
>Organization:
West Bend Internet
>Environment:
System: FreeBSD wbiW009.westbend.net 4.5-STABLE FreeBSD 4.5-STABLE #2: Sat Feb 23 10:52:23 CST 2002 root@wbiW009.westbend.net:/usr/obj/usr/src/sys/GENERIC-SMP i386

>Description:
	Sendmail 8.12.x has an implementation bug in the milter
	code that causes the milter daemons to fail when they
	are bombarded with 20-30 messages from a mail server.

	This problem was recently disscussed on the AMAViS mailing
	list and comp.mail.sendmail

> ----- Original Message -----
> From: "Mike Atkinson"
> Newsgroups: comp.mail.sendmail
> Sent: Saturday, February 23, 2002 4:19 PM
> Subject: Re: MILTER timeout problems
> 
>
> >
> > "Claus A=DFmann"
> > wrote in message news:a58k9j$a3s$1@zardoc.esmtp.org...
> > > Mike Atkinson wrote:
> > >
> > > > "Claus A=DFmann"
> > >
> > > > > Maybe you run into a bug in the MTA wrt milter (error handling for
> > > > > select()), take a look at:
> > >
> > > > > http://www.sendmail.org/~ca/email/sm-812.html
> > >
> > > > Feb 23 00:03:56 mail sendmail[82323]: g1N53lNY082323: Milter
> > > > (milter-amavis): select(read): Interrupted system call
> > >                    ^^^^^^        ^^^^^^^^^^^^^^^^^^^^^^
> > >
> > > That's fixed by the patch. The code didn't check for
> > > EINTR when select() returned an error.
> >
> > Yes, the patch corrected the problem at our site.
> >
> > Thanks again!
> >
> > Mike
>
> The patch available at the link above definitely fixes the Milter timeout
> problem.  Before applying the patch, I would see this every 5 to 15 minutes
> in our logs.
>
> There hasn't been another one since I applied the patch 5 hours ago.
> (Do I hear sighs of relief that this problem is generic to sendmail rather
> than some obscure problem with amavis-milter? :-)
>
> Mike Atkinson - mikea@kconline.com
> KC Online, Inc. - System Administration


>How-To-Repeat:
	Install the port and configure it to use a milter daemon,
	then bombard it with 20-30 messages from another mail
	server.

>Fix:

	Apply the following patch:

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/mail/sendmail/Makefile,v
retrieving revision 1.37
diff -u -r1.37 Makefile
--- Makefile	17 Feb 2002 20:22:22 -0000	1.37
+++ Makefile	26 Feb 2002 23:48:53 -0000
@@ -7,7 +7,7 @@
 
 PORTNAME=	sendmail
 PORTVERSION=	8.12.2
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	mail ipv6
 MASTER_SITES=	ftp://ftp.sendmail.org/pub/sendmail/ \
 		${MASTER_SITE_RINGSERVER:S,%SUBDIR%,net/mail/sendmail/&,}
Index: files/patch-sendmail::milter.c
===================================================================
RCS file: files/patch-sendmail::milter.c
diff -N files/patch-sendmail::milter.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ files/patch-sendmail::milter.c	26 Feb 2002 23:48:39 -0000
@@ -0,0 +1,39 @@
+Sendmail 8.12.x
+ 
+The MTA may erroneously detect a communication failure with libmilter
+(EINTR in select(2)). [ http://www.sendmail.org/~ca/email/sm-812.html ]
+
+Index: milter.c
+===================================================================
+RCS file: /cvs/sendmail/milter.c,v
+retrieving revision 8.187
+retrieving revision 8.188
+diff -u -r8.187 -r8.188
+--- sendmail/milter.c	2002/01/19 00:48:57	8.187
++++ sendmail/milter.c	2002/01/21 04:07:02	8.188
+@@ -139,14 +139,17 @@
+ 		return NULL; \
+ 	} \
+  \
+-	FD_ZERO(&fds); \
+-	SM_FD_SET(m->mf_sock, &fds); \
+-	tv.tv_sec = (secs); \
+-	tv.tv_usec = 0; \
+-	ret = select(m->mf_sock + 1, \
+-		     (write) ? NULL : &fds, \
+-		     (write) ? &fds : NULL, \
+-		     NULL, &tv); \
++	do \
++	{ \
++		FD_ZERO(&fds); \
++		SM_FD_SET(m->mf_sock, &fds); \
++		tv.tv_sec = (secs); \
++		tv.tv_usec = 0; \
++		ret = select(m->mf_sock + 1, \
++			     (write) ? NULL : &fds, \
++			     (write) ? &fds : NULL, \
++			     NULL, &tv); \
++	} while (ret < 0 && errno == EINTR); \
+  \
+ 	switch (ret) \
+ 	{ \
gshapiro@FreeBSD.org
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200202270019.g1R0Jx794986>