NetBSD Problem Report #30534

From wrstuden@netbsd.org  Wed Jun 15 19:12:22 2005
Return-Path: <wrstuden@netbsd.org>
Received: from ftp.netbsd.org (ftp.netbsd.org [204.152.190.13])
	by narn.netbsd.org (Postfix) with ESMTP id D497763B11D
	for <gnats-bugs@gnats.NetBSD.org>; Wed, 15 Jun 2005 19:12:21 +0000 (UTC)
Message-Id: <20050615191221.A26CA3EE43@ftp.netbsd.org>
Date: Wed, 15 Jun 2005 19:12:21 +0000 (UTC)
From: wrstuden@netbsd.org
Reply-To: wrstuden@netbsd.org
To: gnats-bugs@netbsd.org
Subject: mini_sendmail messes up parsing some messages
X-Send-Pr-Version: 3.95

>Number:         30534
>Category:       pkg
>Synopsis:       mini_sendmail messes up parsing some messages
>Confidential:   no
>Severity:       critical
>Priority:       medium
>Responsible:    is
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Jun 15 19:13:00 +0000 2005
>Closed-Date:    Fri Jun 24 18:47:37 +0000 2005
>Last-Modified:  Fri Jun 24 20:51:00 +0000 2005
>Originator:     Bill Studenmund
>Release:        pkgsrc current
>Organization:

>Environment:
>Description:
	I noticed that occasionally I would send EMail and it would just
never appear anywhere. The account with the problem is the only account
I have that uses mini_sendmail.

After turning on debugging, I realized that some EMails work, and some
fail with an error 553. Upon further investigation, I found out
that the problem is mutt will wrap cc: recipients (and probably to:)
to extra lines if there are too many, and mini_sendmail's EMail parse
machine didn't work that right. Problem text looks like:

Cc: 'Torrey Morales' <billntorrey@covad.net>,
        'William Studenmund' <wrstuden@stanfordalumni.org>

mini_sendmail assumes everything fits in one line.
>How-To-Repeat:
1) Set mutt up to use mini_sendmail as its mail transport
2) Send a message with lots of cc: names
3) Watch EMail seem to send yet go nowhere.
>Fix:
The fix is to change mini_sendmail's state machine to handle the case
of a line feed right after a comma, so that it will keep looking on a
following line for recipients.

The following patch fixed mini_sendmail for me.

--- mini_sendmail.c.pkg	Wed Jun  8 23:19:01 2005
+++ mini_sendmail.c	Wed Jun  8 23:24:56 2005
@@ -366,6 +366,7 @@
 #define ST_BC		5
 #define ST_RECIPHEAD	6
 #define ST_RECIPS	7
+#define ST_RECIPMORE	8
     char* cp;
     char* bcc;
     char* recip;
@@ -489,9 +490,18 @@
 		}
 	    break;
 	    case ST_RECIPS:
+		/* FALLTHROUGH */
+	    case ST_RECIPMORE:
 	    switch ( *cp )
 		{
 		case '\n':
+		if ( cp == recip && state == ST_RECIPMORE )
+		    {
+		    /* Just parsed a ",\n", so ignore the \n */
+		    recip = cp + 1;
+		    state = ST_RECIPS;
+		    break;
+		    }
 		add_recipient( recip, ( cp - recip ) );
 		state = ST_BOL;
 		if ( bcc != (char*) 0 )

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->is
Responsible-Changed-By: reed@netbsd.org
Responsible-Changed-When: Wed, 15 Jun 2005 19:16:52 +0000
Responsible-Changed-Why:
Assigned to maintainer.


State-Changed-From-To: open->analyzed
State-Changed-By: is@netbsd.org
State-Changed-When: Thu, 16 Jun 2005 08:02:02 +0000
State-Changed-Why:
From code reading, your fix is not quite right. It uses ,\n as a hint to
a continuation line, but this approach allows for false positives as well
as false negatives.

Instead, we have to check (in a new state) for whitespace at the start of
a line, and delay add_recipient() until we have checked that a new line
is no continuation line. add_recpient will have to make sure not to use
the \n verbatim afterwards.

Fix pending implementation and test.


State-Changed-From-To: analyzed->feedback
State-Changed-By: is@netbsd.org
State-Changed-When: Thu, 16 Jun 2005 15:39:49 +0000
State-Changed-Why:
Does mini_sendmail-1.3.2nb5 address the problem you observed?


From: Ignatios Souvatzis <is@netbsd.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: PR/30534 CVS commit: pkgsrc/doc
Date: Thu, 16 Jun 2005 15:41:20 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	is
 Date:		Thu Jun 16 15:41:20 UTC 2005

 Modified Files:
 	pkgsrc/doc: CHANGES

 Log Message:
 mini_sendmail 1.3.2nb5 fixinig PR pkg/30534.


 To generate a diff of this commit:
 cvs rdiff -r1.10372 -r1.10373 pkgsrc/doc/CHANGES

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Bill Studenmund <wrstuden@netbsd.org>
To: is@netbsd.org
Cc: pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	wrstuden@netbsd.org
Subject: Re: pkg/30534
Date: Thu, 16 Jun 2005 10:36:21 -0700

 --eAbsdosE1cNLO4uF
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On Thu, Jun 16, 2005 at 03:39:52PM +0000, is@netbsd.org wrote:
 > Synopsis: mini_sendmail messes up parsing some messages
 >=20
 > State-Changed-From-To: analyzed->feedback
 > State-Changed-By: is@netbsd.org
 > State-Changed-When: Thu, 16 Jun 2005 15:39:49 +0000
 > State-Changed-Why:
 > Does mini_sendmail-1.3.2nb5 address the problem you observed?

 Seems fine.

 Take care,

 Bill

 --eAbsdosE1cNLO4uF
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (NetBSD)

 iD8DBQFCsbiVWz+3JHUci9cRAsEgAJ0bO+lmP5moW9Z9gywMLurKIasp4ACfR+9w
 py47KJz4PWg51jSsqWR4wXw=
 =ir63
 -----END PGP SIGNATURE-----

 --eAbsdosE1cNLO4uF--

State-Changed-From-To: feedback->closed
State-Changed-By: is@netbsd.org
State-Changed-When: Fri, 24 Jun 2005 18:47:37 +0000
State-Changed-Why:
Submitter confirms problem fixed.


From: Bill Studenmund <wrstuden@netbsd.org>
To: is@netbsd.org
Cc: pkgsrc-bugs@netbsd.org, gnats-admin@netbsd.org,
	wrstuden@netbsd.org
Subject: Re: pkg/30534
Date: Fri, 24 Jun 2005 13:49:49 -0700

 --3Pql8miugIZX0722
 Content-Type: text/plain; charset=us-ascii
 Content-Disposition: inline
 Content-Transfer-Encoding: quoted-printable

 On Fri, Jun 24, 2005 at 06:47:41PM +0000, is@netbsd.org wrote:
 > Synopsis: mini_sendmail messes up parsing some messages
 >=20
 > State-Changed-From-To: feedback->closed
 > State-Changed-By: is@netbsd.org
 > State-Changed-When: Fri, 24 Jun 2005 18:47:37 +0000
 > State-Changed-Why:
 > Submitter confirms problem fixed.

 Thanks!

 Take care,

 Bill

 --3Pql8miugIZX0722
 Content-Type: application/pgp-signature
 Content-Disposition: inline

 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.2.3 (NetBSD)

 iD8DBQFCvHHtWz+3JHUci9cRAjGQAKCVE99n8kbRFfCKJRIk4FfkhbF4TwCfUboh
 NcMWTQucdStWqfllXBQNAXY=
 =Nych
 -----END PGP SIGNATURE-----

 --3Pql8miugIZX0722--

>Unformatted:
 		mini_sendmail-1.3.2nb3

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.