Subject: Sendmail: extraneous duplicate detection
To: None <netbsd-bugs@sun-lamp.cs.berkeley.edu>
From: Havard Eidnes <Havard.Eidnes@runit.sintef.no>
List: netbsd-bugs
Date: 12/12/1993 01:10:37
------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"

Hi,

I think we have found a bug in sendmail having to do with detection and
removal of duplicate mail addresses during eg. list expansion and/or
delivery.  One example of when the error occurs is if you have a local
mailing list with two members, and they each have identical .forward files
specifying the same program, eg.

"|/local/bin/slocal"

slocal detects what user it runs as, and does "the right thing".  However,
in the above case with the mailing list, sendmail refuses to deliver to
more than one user having such a .forward file.  I think this is a bug, and
the attached diff seems to fix it sufficiently well.  This is apparently
also a long-standing bug in sendmail, as the same problem exists in IDA
sendmail version 5.67b and also probably older variants as well.

This is with sendmail 8.6.4.


- Havard

PS. while we were at it we fixed a small typo :-)

------- =_aaaaaaaaaa0
Content-Type: text/plain; charset="us-ascii"
Content-Description: diff to parseaddr.c

*** 1.1	1993/12/11 23:23:23
--- parseaddr.c	1993/12/11 23:33:35
***************
*** 1509,1514 ****
  		return (FALSE);
  
! 	/* if we have good uids for both but the differ, these are different */
  	if (bitset(QGOODUID, a->q_flags & b->q_flags) && a->q_uid != b->q_uid)
  		return (FALSE);
  
--- 1509,1519 ----
  		return (FALSE);
  
! 	/* if we have good uids for both but they differ, these are different */
  	if (bitset(QGOODUID, a->q_flags & b->q_flags) && a->q_uid != b->q_uid)
+ 		return (FALSE);
+ 
+ 	/* Be careful about prog mailers, only same if same user name and/or same command (and possibly not even then) */
+ 	/* But we can't really test for "same user name" here, as it's "|", so we punt. */
+ 	if (a->q_mailer == ProgMailer)
  		return (FALSE);
  

------- =_aaaaaaaaaa0--

------------------------------------------------------------------------------