Reputation: 139
We have recently upgraded JavaMail API to latest version 1.5.4. After upgrading we found that attachments (with filename > 60 characters ) are received as .dat
filename in Outlook (which is configured with POP3).
Please note this issue only comes when filename is more than 60 characters and Outlook is configured with POP3.
We noted that name and filename attributes are coming as multiple line after JavaMail upgrade.
Content-Type: application/octet-stream;
name=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252272708.PDF
Content-Disposition: attachment;
filename=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252272708.PDF
Content-Type: application/octet-stream;
name*0=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252;
name*1=272708.PDF
Content-Disposition: attachment;
filename*0=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252;
filename*1=272708.PDF
How can we fix the issue so that it will show attachment properly in Outlook with POP3?
Upvotes: 2
Views: 2658
Reputation: 61
I came here because I had the same issue with attachments being emailed out of newer versions of Coldfusion 11, 2016 and 2018 that had received recent patches upgrading their Java Mail.
This reaffirmed an entry found on a Japanese website that you can put this property into Coldfusion by adding it to the JVM properties, either through the Admin screen or editing the jvm.config file.
http://cfassociates.samuraiz.co.jp/index.cfm/faq/cftech/cfmail-attachfilename-garbled/
The property to add then is:
-Dmail.mime.encodeparameters=false
You will find that it changes the style of header used to define the attachments as described above.
Upvotes: 1
Reputation: 29971
Set the System property mail.mime.encodeparameters
to false
. This disables the RFC 2231 support when creating messages.
Upvotes: 5