tracker issue : CF-4197582

select a category, or use search below
(searches all categories and all time range)
Title:

<cfmailparam> attachment header is not generated with the RFC 2231 standard

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/Fixed

Reporter/Name(from Bugbase): Sammy Saeed / Sammy Saeed (Sammy Saeed)

Created: 11/10/2016

Components: Language, Tags

Versions: 2016

Failure Type:

Found In Build/Fixed In Build: CF2016_Update3 / 2018.0.0.303899

Priority/Frequency: Normal / Some users will encounter

Locale/System: German / Windows 10 64 bit

Vote Count: 0

Problem Description: When using cfmailparam with a attachment that needs character encoding, the generated attachment header is not generated with the RFC 2231 standard. I realize that outlook is not fully compatible with RFC 2231, but give us the option to choose which standard we want.

Steps to Reproduce: Send an email with cfmail and attach a file which needs character encoding, in my example:

<cfmail from="test@nextron.ch"  to="sammy.saeed@nextron.ch" subject="test" type="HTML">
<cfmailparam file = "\\nextron_sv7\home\satc\www\Revised AEOI Act (EN).pdf" type="application/pdf">
<cfmailparam file = "\\nextron_sv7\home\satc\www\Revised Draft AEOI Ordinance (EN).pdf" type="application/pdf">
</cfmail>

Actual Result:

 ------=_Part_4_11663860.1478773849599
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*=Revised%20AEOI%20Act%20%28EN%29.pdf    <-- important line

Expected Result:

------=_Part_4_11663860.1478773849599
Content-Type: application/pdf
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
 filename*=us-ascii'en-us'Revised%20AEOI%20Act%20%28EN%29.pdf  <--- important line

Any Workarounds:

Give us the option with a cfmailparam Attribute to use the RFC 2231 standard if we need it.

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	4197582

External Customer Info:
External Company:  
External Customer Name: Sammy Saeed
External Customer Email:  
External Test Config: My Hardware and Environment details: do not matter

Attachments:

Comments:

According to RFC 2231: "4. Parameter Value Character Set and Language Information" If asterix (*) is used for value, the character encoding and langauge must be present: Content-Type: application/x-stuff; title*=us-ascii'en-us'This%20is%20%2A%2A%2Afun%2A%2A%2A https://tools.ietf.org/html/rfc2231
Comment by External U.
1498 | November 10, 2016 05:14:32 AM GMT
CF is appending the charset information in the content-disposition header when the filename contains non ascii characters. <cfprocessingdirective pageencoding="utf-8"> <cfmail from="pavan@sample.sample" to="pavan@sample.sample" subject="test" type="HTML" server="localhost" username="pavan@sample.sample" password="password" spoolenable="false"> <cfmailparam file = "c:\??????.pdf" type="application/pdf"> <cfmailparam file = "c:\??????1.pdf" type="application/pdf"> </cfmail> When sending such mail content-disposition header is set as (language is optional currently) Content-Disposition: attachment; filename*0*=UTF-8''%e3%81%be%e3%81%a9%e3%81%8b%e5%a4%89%e8%ba%ab%e5%be%8c; filename*1=.pdf charset is appended and non ascii characters are encoded. But as you said CF is not currently adhering to the rfc 2231 as below when asterisk is specified: Note that it is perfectly permissible to leave either the character set or language field blank. Note also that the single quote delimiters MUST be present even when one of the field values is omitted. This is done when either character set, language, or both are not relevant to the parameter value at hand. Thanks, Pavan.
Comment by S V.
1499 | August 02, 2017 07:55:27 AM GMT