From peter@dataloss.net  Mon Feb 19 17:11:34 2001
Return-Path: <peter@dataloss.net>
Received: from dataloss.net (massive.dataloss.net [212.189.232.193])
	by hub.freebsd.org (Postfix) with SMTP id 5993037B503
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 19 Feb 2001 17:11:33 -0800 (PST)
Received: (qmail 1197 invoked by uid 1000); 20 Feb 2001 01:08:38 -0000
Message-Id: <20010220010838.1196.qmail@massive.dataloss.net>
Date: 20 Feb 2001 01:08:38 -0000
From: peter@dataloss.net
Reply-To: peter@dataloss.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: mailwrapper invokes sendmail when resources are tight
X-Send-Pr-Version: 3.2

>Number:         25218
>Category:       bin
>Synopsis:       mailwrapper(8) invokes sendmail when resources are tight
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 19 17:20:02 PST 2001
>Closed-Date:    
>Last-Modified:  Sat Jun 14 06:09:43 UTC 2008
>Originator:     Peter van Dijk
>Release:        FreeBSD 4.2-STABLE i386
>Organization:
Vuurwerk Internet
>Environment:

FreeBSD 4.2-STABLE. This code hasn't changed for a while, I think :)

>Description:

If mailwrapper can't open /etc/mail/mailer.conf (which may happen when
resources are tight) it defaults to starting sendmail instead of aborting.
This is a terrible bug. Mail administrators everywhere have chosen an MTA
*other* than sendmail. The sendmail configuration on a box might not be
setup correctly. These admins expect mailwrapper to start their MTA :)

>How-To-Repeat:

I have not reproduced the situation. It should be obvious from the code.

>Fix:

Make mailwrapper abort if it can't read /etc/mail/mailer.conf, like it does
when it can't find a mapping.

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->peter 
Responsible-Changed-By: kris 
Responsible-Changed-When: Fri Feb 23 23:57:07 PST 2001 
Responsible-Changed-Why:  
peter imported mailwrapper 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25218 

From: Peter Pentchev <roam@orbitel.bg>
To: peter@dataloss.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/25218: mailwrapper invokes sendmail when resources are tight
Date: Fri, 6 Apr 2001 15:09:09 +0300

 On Tue, Feb 20, 2001 at 01:08:38AM -0000, peter@dataloss.net wrote:
 > 
 > >Number:         25218
 > >Category:       misc
 > >Synopsis:       mailwrapper invokes sendmail when resources are tight
 > >Originator:     Peter van Dijk
 > >Release:        FreeBSD 4.2-STABLE i386
 > >Organization:
 > Vuurwerk Internet
 > >Environment:
 > 
 > FreeBSD 4.2-STABLE. This code hasn't changed for a while, I think :)
 > 
 > >Description:
 > 
 > If mailwrapper can't open /etc/mail/mailer.conf (which may happen when
 > resources are tight) it defaults to starting sendmail instead of aborting.
 > This is a terrible bug. Mail administrators everywhere have chosen an MTA
 > *other* than sendmail. The sendmail configuration on a box might not be
 > setup correctly. These admins expect mailwrapper to start their MTA :)
 > 
 > >How-To-Repeat:
 > 
 > I have not reproduced the situation. It should be obvious from the code.
 > 
 > >Fix:
 > 
 > Make mailwrapper abort if it can't read /etc/mail/mailer.conf, like it does
 > when it can't find a mapping.
 
 OK, how about the attached patch?  Made against -current, but applies
 cleanly to -stable, too.  I wonder if this could make it into 4.3 :)
 (running an unconfigured MTA when resources are tight, possibly to
 deliver a critical 'help, I need help!' email, only to fail because
 sendmail was not configured properly, does qualify as a serious bug
 in my book; and this is not even mentioning the possibility that sendmail
 does something wrong in an already messed-up situation..)
 
 G'luck,
 Peter
 
 -- 
 I had to translate this sentence into English because I could not read the original Sanskrit.
 
 Index: src/usr.sbin/mailwrapper/mailwrapper.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
 retrieving revision 1.5
 diff -u -r1.5 mailwrapper.c
 --- src/usr.sbin/mailwrapper/mailwrapper.c	2000/05/28 15:02:26	1.5
 +++ src/usr.sbin/mailwrapper/mailwrapper.c	2001/04/06 12:04:13
 @@ -123,15 +123,10 @@
  		addarg(&al, argv[len], 0);
  
  	if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL) {
 -		addarg(&al, NULL, 0);
  		openlog("mailwrapper", LOG_PID, LOG_MAIL);
 -		syslog(LOG_INFO, "can't open %s, using %s as default MTA",
 -		    _PATH_MAILERCONF, _PATH_DEFAULTMTA);
 +		syslog(LOG_INFO, "can't open %s, aborting", _PATH_MAILERCONF);
  		closelog();
 -		execve(_PATH_DEFAULTMTA, al.argv, envp);
 -		freearg(&al, 0);
 -		free(line);
 -		err(1, "execing %s", _PATH_DEFAULTMTA);
 +		err(1, "opening %s", _PATH_MAILERCONF);
  		/*NOTREACHED*/
  	}
  

From: Peter Pentchev <roam@orbitel.bg>
To: peter@dataloss.net
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/25218: mailwrapper invokes sendmail when resources are tight
Date: Fri, 6 Apr 2001 15:20:46 +0300

 On Fri, Apr 06, 2001 at 03:09:09PM +0300, Peter Pentchev wrote:
 [snip]
 > 
 > OK, how about the attached patch?  Made against -current, but applies
 > cleanly to -stable, too.  I wonder if this could make it into 4.3 :)
 
 Mmmm here's an updated patch, which also removes the now-unused
 default MTA define from pathnames.h (hint given by the submitter
 in private e-mail).
 
 G'luck,
 Peter
 
 -- 
 Thit sentence is not self-referential because "thit" is not a word.
 
 Index: src/usr.sbin/mailwrapper/mailwrapper.c
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/mailwrapper/mailwrapper.c,v
 retrieving revision 1.5
 diff -u -r1.5 mailwrapper.c
 --- src/usr.sbin/mailwrapper/mailwrapper.c	2000/05/28 15:02:26	1.5
 +++ src/usr.sbin/mailwrapper/mailwrapper.c	2001/04/06 12:19:18
 @@ -123,15 +123,10 @@
  		addarg(&al, argv[len], 0);
  
  	if ((config = fopen(_PATH_MAILERCONF, "r")) == NULL) {
 -		addarg(&al, NULL, 0);
  		openlog("mailwrapper", LOG_PID, LOG_MAIL);
 -		syslog(LOG_INFO, "can't open %s, using %s as default MTA",
 -		    _PATH_MAILERCONF, _PATH_DEFAULTMTA);
 +		syslog(LOG_INFO, "can't open %s, aborting", _PATH_MAILERCONF);
  		closelog();
 -		execve(_PATH_DEFAULTMTA, al.argv, envp);
 -		freearg(&al, 0);
 -		free(line);
 -		err(1, "execing %s", _PATH_DEFAULTMTA);
 +		err(1, "opening %s", _PATH_MAILERCONF);
  		/*NOTREACHED*/
  	}
  
 Index: src/usr.sbin/mailwrapper/pathnames.h
 ===================================================================
 RCS file: /home/ncvs/src/usr.sbin/mailwrapper/pathnames.h,v
 retrieving revision 1.3
 diff -u -r1.3 pathnames.h
 --- src/usr.sbin/mailwrapper/pathnames.h	2000/01/10 03:20:13	1.3
 +++ src/usr.sbin/mailwrapper/pathnames.h	2001/04/06 12:19:18
 @@ -32,4 +32,3 @@
   */
  
  #define _PATH_MAILERCONF	"/etc/mail/mailer.conf"
 -#define _PATH_DEFAULTMTA	"/usr/libexec/sendmail/sendmail"

From: Peter van Dijk <peter@dataloss.net>
To: Peter Pentchev <roam@orbitel.bg>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: misc/25218: mailwrapper invokes sendmail when resources are tight
Date: Fri, 6 Apr 2001 14:24:15 +0200

 On Fri, Apr 06, 2001 at 03:20:46PM +0300, Peter Pentchev wrote:
 > On Fri, Apr 06, 2001 at 03:09:09PM +0300, Peter Pentchev wrote:
 > [snip]
 > > 
 > > OK, how about the attached patch?  Made against -current, but applies
 > > cleanly to -stable, too.  I wonder if this could make it into 4.3 :)
 > 
 > Mmmm here's an updated patch, which also removes the now-unused
 > default MTA define from pathnames.h (hint given by the submitter
 > in private e-mail).
 
 Looks good to me :)
 
 Greetz, Peter [submitter]
 -- 
 dataloss networks
 '/ignore-ance is bliss' - me
 'Het leven is een stuiterbal, maar de mijne plakt aan t plafond!' - me
Responsible-Changed-From-To: peter->freebsd-bugs 
Responsible-Changed-By: peter 
Responsible-Changed-When: Mon Mar 29 11:21:09 PST 2004 
Responsible-Changed-Why:  
Return neglected PR to the pool.  BTW; I strongly object to the 
patches enclosed.  Making a last ditch effort is no worse than 
discarding email without trying. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=25218 

From: Peter Pentchev <roam@ringlet.net>
To: Peter Wemm <peter@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: misc/25218: mailwrapper invokes sendmail when resources are tight
Date: Fri, 4 Jun 2004 09:41:11 +0300

 --VS++wcV0S1rZb1Fb
 Content-Type: text/plain; charset=windows-1251
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable
 
 On Mon, Mar 29, 2004 at 11:23:55AM -0800, Peter Wemm wrote:
 > Synopsis: mailwrapper invokes sendmail when resources are tight
 >=20
 > Responsible-Changed-From-To: peter->freebsd-bugs
 > Responsible-Changed-By: peter
 > Responsible-Changed-When: Mon Mar 29 11:21:09 PST 2004
 > Responsible-Changed-Why:=20
 > Return neglected PR to the pool.  BTW; I strongly object to the
 > patches enclosed.  Making a last ditch effort is no worse than
 > discarding email without trying.
 
 FWIW (as the author of the enclosed patches), with time I've come round
 to agree with this point of view.  Even if the default MTA does not
 actually succeed in delivering the e-mail, there is a good chance that
 it will at least attempt to queue it somewhere so that it is at least
 available to be rescued later on.  Peter (submitter), what do you think?
 
 G'luck,
 Peter
 
 --=20
 Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 What would this sentence be like if pi were 3?
 
 --VS++wcV0S1rZb1Fb
 Content-Type: application/pgp-signature
 Content-Disposition: inline
 
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.4 (FreeBSD)
 
 iD8DBQFAwBmG7Ri2jRYZRVMRAmREAJ9NWEPz5jagVw+yLbO33S1eG5g3YQCbBx5e
 HBmyAD3cV254fzbmlo/+odM=
 =NAli
 -----END PGP SIGNATURE-----
 
 --VS++wcV0S1rZb1Fb--
>Unformatted:
