Andreas Hasenack writes:
I'm chasing a problem with encoded filename attachments (QP and base64)
where reformime isn't decoding them. Like:
------=_NextPart_000_0015_01C50864.97F08000
Content-Type: text/plain; format=flowed;
name="=?iso-8859-1?B?YmzhYmzhLnR4dA==?="; reply-type=original
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment; filename="=?iso-8859-1?B?YmzhYmzhLnR4dA==?="
When used with reformime -x, the suggested filename is:
_iso-8859-1_B_YmzhYmzhLnR4dA____
An ancient changelog mentions that this should be fixed:
* V1.2 - Switched installation layout to GNU layout. Packaged development
libraries. reformime -x option now MIME decodes 8-bit filenames
(then promptly strips 8bit characters :-) ).
However, even with current version (1.8.0), get_suitable_filename() would not
do it. It would only strip 8bit characters.
That's because the above mutation is not the correct way to encode 8bit
characters in MIME headers. This type of QP/Base64 encoding is valid only
for the Subject/From/To/Cc/Bcc headers, and a few others.
See RFC 2231 for the correct way to encode these headers.