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

Richard Zowalla closed GERONIMO-6656.
-------------------------------------
    Resolution: Fixed

Fixed on main in commit 39e6b14, shipping in Mail_2.1_1.1.1.

Thanks for the ReceivedMail.txt attachment - it was what pinned down the cause. 
The To: header in it is folded inside the quoted display name:

  To: "[email protected]" <[email protected]>, "\"sailaja \\ ravipati
   (EXT/PET-ICT\"" <[email protected]>

RFC 5322 section 3.2.2 allows folding white space inside a quoted string, and 
section 2.2.3 unfolds it by removing the line break and keeping the white space 
that follows. AddressParser rejected CR outright in its quoted string, domain 
literal and comment scanners, so the parse failed with "Illegal line end in 
literal" - the carriage return in the display name you described. This was on 
the default path, since mail.mime.address.strict defaults to true.

The three scanners now recognise a fold and step over just the line break. 
Behaviour outside a fold is deliberately unchanged: a line break not followed 
by white space is not folding white space, so a bare CR is still a syntax error.

Your message now parses end to end, giving personal=["sailaja \ ravipati 
(EXT/PET-ICT"] with no embedded CR, in both strict and lenient mode. Jakarta 
Mail 2.1 TCK: 321/321.

Note that reading that message also required GERONIMO-6908, which is linked and 
fixed in the same push.

> If email display name has quotes and spaces in between words, while reading 
> to mail address, It is throwing an error
> --------------------------------------------------------------------------------------------------------------------
>
>                 Key: GERONIMO-6656
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-6656
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>    Affects Versions: 1.x
>         Environment: TomEE 7
>            Reporter: Santhosh
>            Priority: Major
>         Attachments: ReceivedMail.txt
>
>
> User send mail using multiple to mail ids. If second or third mail id in to 
> address diaplay name contains quotes in it and in between quotes if it has 
> any space, It is adding carriage return to mail displayname. Here the 
> geronimo-javamail_1.4_mail-1.9.0-alpha-2.jar in TomEE7 throwing an error when 
> it find carriage return in displayname.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to