james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Kolomoets (Created) (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Created] (MIME4J-207) Exception while parsing email address with trailing @
Date Fri, 18 Nov 2011 22:02:52 GMT
Exception while parsing email address with trailing @
-----------------------------------------------------

                 Key: MIME4J-207
                 URL: https://issues.apache.org/jira/browse/MIME4J-207
             Project: JAMES Mime4j
          Issue Type: Bug
          Components: dom
    Affects Versions: 0.7
            Reporter: Andrey Kolomoets
            Priority: Critical


Including this test into org.apache.james.mime4j.field.address.LenientAddressBuilderTest:
...
    public void testParseAddressTrailingAt() throws Exception {
        String s = "<@somehost.com@somehost.com>";
        ByteSequence raw = ContentUtil.encode(s);
        ParserCursor cursor = new ParserCursor(0, s.length());

        Mailbox mailbox = parser.parseMailboxAddress(null, raw, cursor);
        assertEquals("@somehost.com@somehost.com", mailbox.getAddress());
    }

leads to this exception:

java.lang.IndexOutOfBoundsException
	at org.apache.james.mime4j.util.ByteArrayBuffer.byteAt(ByteArrayBuffer.java:107)
	at org.apache.james.mime4j.field.address.LenientAddressBuilder.parseRoute(LenientAddressBuilder.java:103)
	at org.apache.james.mime4j.field.address.LenientAddressBuilder.parseMailboxAddress(LenientAddressBuilder.java:129)
	at org.apache.james.mime4j.field.address.LenientAddressBuilderTest.testParseAddressTrailingAt(LenientAddressBuilderTest.java:107)


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message