5 messages in net.sourceforge.lists.courier-maildrop[maildropl] reformime doesn't decode ...
FromSent OnAttachments
Andreas HasenackFeb 1, 2005 11:20 am.patch
Sam VarshavchikFeb 1, 2005 3:52 pm 
Andreas HasenackFeb 2, 2005 5:04 am 
Sam VarshavchikFeb 2, 2005 4:35 pm 
Andreas HasenackFeb 2, 2005 4:47 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:[maildropl] reformime doesn't decode (QP nor base64) filenames (PATCH)Actions...
From:Andreas Hasenack (andr@conectiva.com.br)
Date:Feb 1, 2005 11:20:04 am
List:net.sourceforge.lists.courier-maildrop
Attachments:

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.

The attached patch seems to fix it for me. Please let me know if I'm wrong, I'm
still going over the details of what exactly this function does and if strdup there was really a
mistake.

--- maildrop-1.8.0/rfc2045/reformime.c~ 2004-06-26 12:20:14.000000000 -0300 +++ maildrop-1.8.0/rfc2045/reformime.c 2005-02-01 16:50:14.283092882 -0200 @@ -357,11 +357,11 @@ if (!disposition_filename_s || !*disposition_filename_s) disposition_filename_s=disposition_name; if (!disposition_filename_s || !*disposition_filename_s) disposition_filename_s=content_name;

- filename_buf=strdup(disposition_filename_s); + filename_buf=rfc2047_decode_simple(disposition_filename_s);

if (!filename_buf) { perror("rfc2047_decode_simple"); exit(1);