php-imap icon indicating copy to clipboard operation
php-imap copied to clipboard

Part parse does not work when attachment names are in name* ja filename* headers

Open TeroJarvinen opened this issue 3 years ago • 1 comments

Part::parse() cannot parse attachment name when headers contain filename in following format:

Content-Type: application/octet-stream; 
	name*=UTF-8''ReturnForm%20Sein%C3%A4joki.doc
Content-Transfer-Encoding: base64
Content-Disposition: attachment; 
	filename*=UTF-8''ReturnForm%20Sein%C3%A4joki.doc

Attachment name should be "ReturnForm Seinäjoki.doc". Currently parsed name is "undefined".

Content-Disposition spec says following:

The parameters "filename" and "filename*" differ only in that "filename*" uses the encoding defined in [RFC5987], allowing the use of characters not present in the ISO-8859-1 character set ([ISO-8859-1]).

TeroJarvinen avatar Aug 29 '22 12:08 TeroJarvinen

Hi @TeroJarvinen , many thanks for your report. How would you suggest to implement this?

Please feel free to push a pull request.

Best regards & happy coding,

Webklex avatar Sep 14 '22 07:09 Webklex

Please update to v5.1 and give it another try. If you are currently using an older version below v5.0, please read the breaking changes leading up to v5.1 before upgrading.

Best regards,

Webklex avatar Mar 16 '23 00:03 Webklex