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 ECDB511D13 for ; Sat, 14 Jun 2014 18:52:02 +0000 (UTC) Received: (qmail 75902 invoked by uid 500); 14 Jun 2014 18:52:01 -0000 Delivered-To: apmail-james-mime4j-dev-archive@james.apache.org Received: (qmail 75855 invoked by uid 500); 14 Jun 2014 18:52:01 -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 75844 invoked by uid 99); 14 Jun 2014 18:52:01 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 14 Jun 2014 18:52:01 +0000 Date: Sat, 14 Jun 2014 18:52:01 +0000 (UTC) From: "Stefano Bagnara (JIRA)" To: mime4j-dev@james.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (MIME4J-239) AddressBuilder#parseMailbox fails when the local part contains a '@' MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/MIME4J-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14031650#comment-14031650 ] Stefano Bagnara commented on MIME4J-239: ---------------------------------------- This doesn't sounds as a bug. The "mailbox" you're trying to parse is invalid. the syntax si [phrase] [routeaddress] the "<...>" part is the routeaddress. The phrase syntax is defined as: - A phrase is a word or a sequence of words. - An word is either an atom or a quoted string. - An atom is a sequence of printable ASCII characters except space or any of the following: ()<>@,;:\".[] So , the "@" can't be contained in an atom, so it must be quoted. Also the space must be quoted. So, these 2 should pass: joe"@my "company "joe@my company" but joe@my company without quotes is not valid. > AddressBuilder#parseMailbox fails when the local part contains a '@' > -------------------------------------------------------------------- > > Key: MIME4J-239 > URL: https://issues.apache.org/jira/browse/MIME4J-239 > Project: James Mime4j > Issue Type: Bug > Affects Versions: 0.7.2 > Reporter: Nitsan Seniak > Priority: Critical > > The following calls throws an exception: > Mailbox add = AddressBuilder.DEFAULT.parseMailbox("joe@my company "); > The exception is: > org.apache.james.mime4j.field.address.ParseException: Atoms in domain names must be separated by '.' > The expected result is (Hamcrest syntax): > Mailbox add = AddressBuilder.DEFAULT.parseMailbox("joe@my company "); > assertThat(add.getAddress(), is("joe.foo@company.com")); > assertThat(add.getLocalPart(), is("joe@my company")); -- This message was sent by Atlassian JIRA (v6.2#6252)