On Wed, 14.04.2010 at 15:38:21 +0100, Pete French wrote:
> > Sorry Pete, but the patch still seems incomplete. You merely catch the
> > case when a comma is followed by space or quotation marks, but the email
> > header might look like this:
> > To: [email protected],[email protected]
> 
> I think the original code handles cases like that fine, my patch merely
> looks for an extra possibility. I've just tested it with the
> above, and it works.
> 
> Can you give me an example of one which doesn't work for you ? Either
> in the original /usr/bin/mail or in my patched version ?

Well, the following header didn't work:
Cc: <[email protected]>,<[email protected]>

Postfix will re-write this as part of sanitization, so I had to revert
to creating mbox files by hand. Anyway, could you please test the
following patch with a wider variety of mails?
commit 59a3e2a82bdeafb7bb46e8d5c39dcb2474d7f826
Author: Ulrich Spörlein <[email protected]>
Date:   Wed Apr 14 17:07:10 2010 +0200

    bin/131861: [patch] mail(1) misses addresses when replying to all
    
    There's a parsing error for fields where addresses are not separated by
    space. This is often produced by MS Outlook, eg.:
    Cc: <[email protected]>,"Mr Foo" <[email protected]>
    
    The following line now splits into the right tokens:
    Cc: [email protected],[email protected], <[email protected]>,<[email protected]>, "foo" <foo>,"bar" <bar>

diff --git a/usr.bin/mail/util.c b/usr.bin/mail/util.c
index df2d840..af962c8 100644
--- a/usr.bin/mail/util.c
+++ b/usr.bin/mail/util.c
@@ -496,10 +496,11 @@ skin(name)
 				*cp2++ = ' ';
 			}
 			*cp2++ = c;
-			if (c == ',' && *cp == ' ' && !gotlt) {
+			if (c == ',' && !gotlt &&
+			    (*cp == ' ' || *cp == '"' || *cp == '<')) {
 				*cp2++ = ' ';
-				while (*++cp == ' ')
-					;
+				while (*cp == ' ')
+					cp++;
 				lastsp = 0;
 				bufend = cp2;
 			}
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[email protected]"

Reply via email to