Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-207

Exception while parsing email address with a leading @

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.7
    • 0.7.2
    • dom
    • None

    Description

      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)

      Attachments

        Activity

          People

            Unassigned Unassigned
            muffinmad Andrey Kolomoets
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: