james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nitsan Seniak (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Commented] (MIME4J-239) AddressBuilder#parseMailbox fails when the local part contains a '@'
Date Sat, 14 Jun 2014 19:03:02 GMT

    [ https://issues.apache.org/jira/browse/MIME4J-239?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14031658#comment-14031658
] 

Nitsan Seniak commented on MIME4J-239:
--------------------------------------

Thank you for getting back to me so quickly.

I understand why this might not be a bug, however my system does receive emails whose mime
header contains addresses with this syntax; I have no control over that. I need to be able
to make sense of these addresses. I haven't been able to find a workaround to this problem;
maybe you can help me on this?

Note that when the header contains such a buggy address, the mime4j parser does not throw
an exception but generates a Mailbox with name=null, localPart="joe" and domain="company<joe.foo@company.com>".
I assume this is another instance of the same parser behavior.

Also note that I tried new javax.mail.internet.InternetAddress("joe@my company <joe.foo@company.com>"),
and it does successfully parse the address.


> 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 <joe.foo@company.com>");
> 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 <joe.foo@company.com>");
> 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)

Mime
View raw message