Return-Path: X-Original-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Delivered-To: apmail-james-mime4j-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 44D7BCCF5 for ; Fri, 7 Mar 2014 16:06:44 +0000 (UTC) Received: (qmail 46133 invoked by uid 500); 7 Mar 2014 16:06:43 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 46047 invoked by uid 500); 7 Mar 2014 16:06:43 -0000 Mailing-List: contact mime4j-dev-help@james.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: mime4j-dev@james.apache.org Delivered-To: mailing list mime4j-dev@james.apache.org Received: (qmail 46032 invoked by uid 99); 7 Mar 2014 16:06:42 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Mar 2014 16:06:42 +0000 Date: Fri, 7 Mar 2014 16:06:42 +0000 (UTC) From: "Oleg Kalnichevski (JIRA)" To: mime4j-dev@james.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (MIME4J-237) The address list parser does not properly parse encoded display names that contain a comma. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-237?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:all-tabpanel ] Oleg Kalnichevski resolved MIME4J-237. -------------------------------------- Resolution: Fixed Fixed in SVN trunk and 0.7.x branch. Please review / test. Oleg > The address list parser does not properly parse encoded display names tha= t contain a comma. > -------------------------------------------------------------------------= ------------------ > > Key: MIME4J-237 > URL: https://issues.apache.org/jira/browse/MIME4J-237 > Project: James Mime4j > Issue Type: Bug > Affects Versions: 0.7.2 > Reporter: Nitsan Seniak > Fix For: 0.7.3 > > > The address list parser doesn't correctly parse an address that contains = an encoded display names that contain a comma, for example: > =3D?utf-8?Q?"Dupont,_Gr=3DC3=3DA9goire"?=3D > Here's the code to reproduce the problem: > String str =3D "=3D?utf-8?Q?\"Dupont,_Gr=3DC3=3DA9goire\"?=3D "; > AddressList addressList =3D LenientAddressBuilder.DEFAULT.parseAddressLis= t(str); > Mailbox mbox =3D (Mailbox) addressList.get(0); > System.out.println("Name: " + mbox.getName()); > System.out.println("Address: " + mbox.getAddress()); > The execution of this code yields: > Name: null // Should be gregoire.dupont@= gmail.com > Address: =3D?utf-8?Q?"Dupont // Should be Dupont, Gr=C3=A9goire > The problem seems to be in RawFieldParser#parseValue. Double quotes are n= ot properly handled when the first double quote is the first character of t= he text to parse, which can happen with encoded addresses. In that case, if= the name contains a comma and the passed delimiter bitset include the comm= a, then the comma in the name is mistakenly taken for a delimiter. -- This message was sent by Atlassian JIRA (v6.2#6252)