[
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<[email protected]>". I assume this is another instance of
the same parser behavior.
Also note that I tried new javax.mail.internet.InternetAddress("joe@my company
<[email protected]>"), 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
> <[email protected]>");
> 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
> <[email protected]>");
> assertThat(add.getAddress(), is("[email protected]"));
> assertThat(add.getLocalPart(), is("joe@my company"));
--
This message was sent by Atlassian JIRA
(v6.2#6252)