You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mime4j-dev@james.apache.org by "Igor (JIRA)" <mi...@james.apache.org> on 2019/06/11 10:18:00 UTC
[jira] [Created] (MIME4J-288) Email address without domain is not
parsed correctly
Igor created MIME4J-288:
---------------------------
Summary: Email address without domain is not parsed correctly
Key: MIME4J-288
URL: https://issues.apache.org/jira/browse/MIME4J-288
Project: James Mime4j
Issue Type: Bug
Affects Versions: master
Reporter: Igor
Hello,
It looks like an email address without domain (like LDAP addresses) is not parsed properly. Here is a simple example to demonstrate the issue:
{code:java}
DefaultMessageBuilder builder = new DefaultMessageBuilder();
Message message = builder.newMessage();
String address = "To: \"John Doe\" <johndoe>";
try (InputStream stream = new ByteArrayInputStream(address.getBytes(UTF_8))) {
message.setHeader(builder.parseHeader(stream));
System.out.println(message.getTo());
}
{code}
The result is two email addresses:
{code:java}
[johndoe, >]
{code}
But only one address is expected.
I have tested it with 0.7.2 and the latest 0.8.3.
Such email addresses can often be found in corporate environments and typically look like this:
{{"John Doe" </O=COMPANY/OU=First Administrative Group/cn=Recipients/cn=johndoe>}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)