flanker icon indicating copy to clipboard operation
flanker copied to clipboard

Allow Encoded Attachment Filenames

Open travelton opened this issue 11 years ago • 0 comments

According to the HTTP RFC 2388:

Field names originally in non-ASCII character sets may be encoded   
within the value of the "name" parameter using the standard method   
described in RFC 2047.

This may occur in cases where an HTTP payload is converted in to SMTP MIME. An HTTP payload uses the Content-Type to define that the file is an "application/octet-stream". This is invalid for SMTP MIME, thus, Flanker's conversion methods.

If Content-Type value is broken or missing, Flanker will attempt to reconstruct in method fix_content_type().

As a result, if an encoded file name is present, value.lower().split("/"), could truncate the name if a slash exists in the filename.

This method should probably check and ignore encoded filenames by inspecting the string for UTF prefixes. "=?UTF-8?b?0L/RgNC+0LHQu9C10LzQsC5wbmc=?="

travelton avatar Jan 10 '14 19:01 travelton