[comp.mail.sendmail] sendmail munges lists

bruce@sonyd1.Broadcast.Sony.COM (Bruce Lilly) (08/03/90)

A few weeks ago, I posted:
> Given a list per RFC822 [*] such as:
> To: address-list: First Name <foo@bar.edu>,
> 	fribble@whatsit.com,
> 	<user@somewhere.else> (Comment) ;
> sendmail places the "(Comment)" *after* the semicolon. This
> only happens with a parenthesized comment which immediately
> precedes the terminating semicolon. It happens with the
> [ ... ]

Well, apparently this problem is well entrenched in the code of
sendmail itself.  Fortunately, it seems rather easy to fix. I
checked RFC822, RFC1123, and even the (obsolete) RFC733, and it
seems that semicolons are only used in group addresses. The
approach I've taken, therefore, is to ignore semicolons entirely
in breaking down an address into tokens, and to simply copy them
verbatim (without moving them about) in rewriting the addresses.

As I said, the changes are quite simple: (context diff's are sooo
verbose, so I won't use them)

add the lines:
	if (c == ';')
		c = NOCHAR;
right before the lines
	if (c == NOCHAR)
		continue;
in function "prescan" in file parseaddr.c (around line 370 in the
5.64 distribution), and add:
	if (*p == ';')
		*bp++ = *p;
before the comment which reads:
	/* if this is the first "real" character ....
in function "crackaddr" in file headers.c (around line 573).

That seems to fix the problem.  If anybody knows of any valid
addresses which would be broken by this change, please let me
know via email.  If I don't haer anything by the middle of the
month, I'll send this off to UCB as a bug report/patch.
-- 
    Bruce Lilly, Product Manager,        | bruce@sonyd1.Broadcast.Sony.COM
    Digital Television Tape Recording,   | uunet!{sonyusa,vmp}!sonyd1!bruce
    Sony Communications Products Co.,    | lilb@sony.compuserve.com (slow)
    Teaneck, NJ 07666  |  Telephone: 1(201)833-5693   | FAX: 1(201)833-9279