From owner-freebsd-stable@FreeBSD.ORG Wed Apr 14 16:33:54 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 446C5106566B for ; Wed, 14 Apr 2010 16:33:54 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2001:470:9a47::1]) by mx1.freebsd.org (Postfix) with ESMTP id F2CA78FC23 for ; Wed, 14 Apr 2010 16:33:53 +0000 (UTC) Received: from acme.spoerlein.net (localhost.spoerlein.net [IPv6:::1]) by acme.spoerlein.net (Postfix) with ESMTPS id 495475C74; Wed, 14 Apr 2010 18:33:53 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1271262833; bh=3i+D9eys3iewBusqCPUHm0WuiuLyBpfinxHggWJ17ps=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=pabHRPhBW8qbqsielgcQhqn7cWAlS4y/w+M355xMtMgE0Py7LPQ8OsqRm54bGJ9XQ TcB1lVZd5U4/aP6UphtRmgL4x1fQWBfd2G4LlEBIw4SznK3Ew9sM07w9JTjgGpu1Aw 2HMksELtlU/ghoy+i89alnSGSo6Xo9VMo1j6GpuU= Received: (from uqs@localhost) by acme.spoerlein.net (8.14.4/8.14.4/Submit) id o3EGXr0Z067265; Wed, 14 Apr 2010 18:33:53 +0200 (CEST) (envelope-from uqs@spoerlein.net) Date: Wed, 14 Apr 2010 18:33:53 +0200 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Pete French Message-ID: <20100414163352.GS85798@acme.spoerlein.net> Mail-Followup-To: Pete French , freebsd-stable@freebsd.org References: <20100414142530.GR85798@acme.spoerlein.net> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="J+eNKFoVC4T1DV3f" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Cc: freebsd-stable@freebsd.org Subject: Re: Any chance of someone commiting the patch in bin/131861 ? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Apr 2010 16:33:54 -0000 --J+eNKFoVC4T1DV3f Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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: foo@domain.com,bar@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: , 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? --J+eNKFoVC4T1DV3f Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="mail.diff" Content-Transfer-Encoding: 8bit commit 59a3e2a82bdeafb7bb46e8d5c39dcb2474d7f826 Author: Ulrich Spörlein 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: ,"Mr Foo" The following line now splits into the right tokens: Cc: f@b.com,z@y.de, ,, "foo" ,"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; } --J+eNKFoVC4T1DV3f--