flanker icon indicating copy to clipboard operation
flanker copied to clipboard

Improve parsing of MIME parameter part

Open stefanw opened this issue 10 years ago • 3 comments

I have mails with MIME headers like this:

Content-Type: application/pdf; name=30676_2015.pdf;name*=iso-8859-1''%33%30%36%37%36%5F%32%30%31%35%2E%70%64%66
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename=30676_2015.pdf;
 filename*=iso-8859-1''%33%30%36%37%36%5F%32%30%31%35%2E%70%64%66

The parameter name and filename are present as single encoded and single unencoded. This leads to an interpretation as a parameter continuation and to a concatenation of the values so that the result would be "30676_2015.pdf30676_2015.pdf".

I added code to avoid joining parameter values of the same name if they are not actually continuations, but just different encodings of the same value. Test is included!

stefanw avatar Sep 08 '15 18:09 stefanw

Can one of the admins verify this patch?

mailgun-ci avatar Sep 08 '15 18:09 mailgun-ci

Any news on this? Should be an easy-picking!

stefanw avatar Dec 02 '15 19:12 stefanw

Can one of the admins verify this patch?

mailgun-ci avatar Dec 12 '16 20:12 mailgun-ci