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

Oleg Kalnichevski resolved MIME4J-229.
--------------------------------------

    Resolution: Invalid

Clément

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 versions.

http://svn.apache.org/viewvc?view=revision&revision=r1470968

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.

Oleg 
                
> 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 <[email protected]>")
> This code throws a ParseException:
> AddressBuilder.DEFAULT.parseAddress("[email protected] <[email protected]>")
> 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

Reply via email to