james-mime4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Oleg Kalnichevski (JIRA)" <mime4j-...@james.apache.org>
Subject [jira] [Resolved] (MIME4J-229) AddressListParser cannot parse address with email address repeated as name
Date Tue, 23 Apr 2013 14:21:17 GMT

     [ https://issues.apache.org/jira/browse/MIME4J-229?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Oleg Kalnichevski resolved MIME4J-229.

    Resolution: Invalid


With due respect I do not think the behavior of the default (strict) address parser is incorrect.
Name components containing reserved characters MUST be enclosed in quote marks in order to
be unambiguous. The lenient address builder also fails to parse the address in line with your
expectation. One can argue that this is wrong. However, given the  unambiguity of the input
there is simply no way to parse it as you expect without making multiple parsing scans. This
is precisely the reason why tokens must follow a particular syntax or scheme so that parsing
code could always be written in such a way that tokens once parsed would not never need to
be parsed again. 'Never skip back' is the rule of efficient parsing.

I added a number of new unit tests demonstrating the present behavior of both strict and lenient


If you disagree with this resolution feel free to re-open the issue as a change request or
improvement for LenientAddressBuilder but personally I would not be in favor of changing the
existing approach.

> AddressListParser cannot parse address with email address repeated as name
> --------------------------------------------------------------------------
>                 Key: MIME4J-229
>                 URL: https://issues.apache.org/jira/browse/MIME4J-229
>             Project: James Mime4j
>          Issue Type: Bug
>          Components: parser (core)
>    Affects Versions: 0.7.2
>            Reporter: Clément Denis
> This code is OK:
> AddressBuilder.DEFAULT.parseAddress("test <test@test.com>")
> This code throws a ParseException:
> AddressBuilder.DEFAULT.parseAddress("test@test.com <test@test.com>")
> It should be tolerated as a valid address.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

View raw message