Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
None
-
None
-
Security Level: public (Regular issues)
-
None
Description
Something has been written in the api, but not for the provider.
The IMAPMimeBodyPart code follows:
public String getFileName() throws MessagingException { String filename = bodyStructure.disposition.getParameter("filename"); if (filename == null) { filename = bodyStructure.mimeType.getParameter("name"); } return filename; }
I think it should be more something like:
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; }
With the MIME_DECODEFILENAME being the same property as in the javax.mail.internet.MimeBodyPart from the specs.