[jira] [Commented] (GERONIMO-6656) If email display name has quotes and spaces in between words, while reading to mail address, It is throwing an error

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (GERONIMO-6656) If email display name has quotes and spaces in between words, while reading to mail address, It is throwing an error

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/GERONIMO-6656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16698869#comment-16698869 ]

Santhosh commented on GERONIMO-6656:
------------------------------------

Scenario:
 We implemented mailConnector which uses sun's mail API. There another project called restservice.war which is deployed to TomEE server where we are using default geronimo mail.jar for mail API.
 User replied to the mail which configured in mailConnector and restservice Project. After received the mail in configured mail, connector polls on INBOX of configured mail using javax.mail.Folder.getMessages() for received mails.

    Folder.getMessages()[0].getAllRecipients() API returns the to mail addresses as below
    
    (javax.mail.internet.InternetAddress[]) ["[hidden email]" <[hidden email]>, "\"sailaja \\ ravipati (EXT/PET-ICT\"" <[hidden email]>]
    
After that we encoded the mail into base64 and call the webservice receiveMail, where we used below geronimo mail API
message.getRecipients( new RecipientType("To"));

Here To mail id consists two email ids and second mail id display name consists quotes in it and due to white spaces in between quotes we received to mail addresses with added carriage return. Because of that above API thrown below exception.

 syntaxError("Illegal line end in literal", this.position);

> 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
>
> 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
(v7.6.3#76005)