You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by "Hendrik Saly (JIRA)" <ji...@apache.org> on 2014/11/09 21:18:33 UTC

[jira] [Updated] (GERONIMO-4594) The javamail provider should have a way to decode attachment names

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

Hendrik Saly updated GERONIMO-4594:
-----------------------------------
    Component/s: mail

> The javamail provider should have a way to decode attachment names
> ------------------------------------------------------------------
>
>                 Key: GERONIMO-4594
>                 URL: https://issues.apache.org/jira/browse/GERONIMO-4594
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>          Components: mail
>            Reporter: Guillaume Nodet
>            Assignee: Hendrik Saly
>
> Something has been written in the api, but not for the provider.
> The IMAPMimeBodyPart code follows:
> {code}
>     public String getFileName() throws MessagingException {
>         String filename = bodyStructure.disposition.getParameter("filename");
>         if (filename == null) {
>             filename = bodyStructure.mimeType.getParameter("name");
>         }
>         return filename;
>     }
> {code}
> I think it should be more something like:
> {code}
>     public String getFileName() throws MessagingException {
>         String filename = bodyStructure.disposition.getParameter("filename");
>         if (filename == null) {
>             filename = bodyStructure.mimeType.getParameter("name");
>         }
>         if (filename != null && SessionUtil.getBooleanProperty(MIME_DECODEFILENAME, false)) {
>             try {
>                 filename = MimeUtility.decodeText(filename);
>             } catch (UnsupportedEncodingException e) {
>                 throw new MessagingException("Unable to decode filename", e);
>             }
>         }
>         return filename;
>     }
> {code}
> With the MIME_DECODEFILENAME being the same property as in the javax.mail.internet.MimeBodyPart from the specs.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)