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: f...@domain.com,b...@otherdomain.com
> 
> 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: <a...@a.a>,<b...@b.b>

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 <u...@spoerlein.net>
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: <f...@bar.com>,"Mr Foo" <f...@baz.com>
    
    The following line now splits into the right tokens:
    Cc: f...@b.com,z...@y.de, <a...@a.de>,<c...@c.de>, "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;
 			}
_______________________________________________
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Reply via email to