A NOTE has been added to this issue. ====================================================================== http://www.dbmail.org/mantis/view.php?id=975 ====================================================================== Reported By: fabiangergely Assigned To: ====================================================================== Project: DBMail Issue ID: 975 Category: General Reproducibility: always Severity: text Priority: normal Status: new target: ====================================================================== Date Submitted: 20-Jun-12 10:50 CEST Last Modified: 03-Aug-12 13:46 CEST ====================================================================== Summary: Cyrillic email attachment filename is cut in Bodystructure response Description: I have a test email source, that contains a message part with an encoded Cyrillic attachment name. If I add that email to my mailbox with "dbmail-deliver -u username < source" then when requesting the bodystructure for the just inserted email through IMAP, the message part's filename will be truncated.
Example: --------------050301060007080305070709 Content-Type: message/rfc822; name="=?UTF-8?B?0KHRgtC+0LvRjCDQvdC10YLRgNC40LLQuNCw0LvRjNC90L7QtSDQvdCw0LfQstCw?==?UTF-8?B?0L3QuNC1ICjQttCw0YDQtdC90L3Ri9C1ICkuZW1s?=" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename*0*=UTF-8''%D0%A1%D1%82%D0%BE%D0%BB%D1%8C%20%D0%BD%D0%B5%D1%82%D1; filename*1*=%80%D0%B8%D0%B2%D0%B8%D0%B0%D0%BB%D1%8C%D0%BD%D0%BE%D0%B5%20; filename*2*=%D0%BD%D0%B0%D0%B7%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5%20%28%D0%B6; filename*3*=%D0%B0%D1%80%D0%B5%D0%BD%D0%BD%D1%8B%D0%B5%20%29%2E%65%6D%6C The expected filename based on the above should be: php > echo iconv_mime_decode("Subject: =?UTF-8?B?0KHRgtC+0LvRjCDQvdC10YLRgNC40LLQuNCw0LvRjNC90L7QtSDQvdCw0LfQstCw?==?UTF-8?B?0L3QuNC1ICjQttCw0YDQtdC90L3Ri9C1ICkuZW1s?=", 0, "utf-8"); Subject: Столь нетривиальное название (жаренные ).eml However on IMAP, when I request the bodystructure, I get this: .. select INBOX * 43 EXISTS * 1 RECENT * FLAGS (\Seen \Answered \Deleted \Flagged \Draft NonJunk) * OK [PERMANENTFLAGS (\Seen \Answered \Deleted \Flagged \Draft NonJunk \*)] Flags allowed. * OK [UIDNEXT 213] Predicted next UID * OK [UIDVALIDITY 1] UID value * OK [UNSEEN 1] first unseen message .. OK [READ-WRITE] SELECT completed .. uid search undeleted * SEARCH 128 130 132 134 136 138 140 142 144 146 148 150 152 154 156 158 160 162 164 166 168 170 172 174 176 178 180 182 184 186 188 190 192 194 196 198 200 202 204 206 208 210 212 .. OK UID SEARCH completed .. uid fetch 212 (bodystructure) * 43 FETCH (UID 212 BODYSTRUCTURE (("text" "plain" ("charset" "UTF-8" "format" "flowed") NIL NIL "8bit" 15 2 NIL NIL NIL NIL)("message" "rfc822" ("name" "=?iso-8859-5?b?weLe2+wg3dXi4NjS2NDb7N3e1Q==?= =?iso-8859-5?b?IN3Q19LQ?=") NIL NIL "7bit" 359 ("Tue, 17 Mar 2009 18:59:53 +0100" "=?gb2312?B?p7On5Kfgp92n7iCn36fWp+Sn4qfap9On2qfRp92n7qffp+Cn1iCn3w==?= =?gb2312?B?p9Gn2afTp9Gn36fap9YgKKfYp9Gn4qfWp9+n36ftp9YgKQ==?=" ((NIL NIL "test" "account.com"))((NIL NIL "test" "account.com"))((NIL NIL "test" "account.com"))((NIL NIL "test2" "account.com")) NIL NIL NIL "<9cb90697eb2b7f49899dac506aa45ed901f47...@example.com>")("text" "plain" NIL NIL NIL "7BIT" 14 2 NIL NIL NIL NIL) 11) "mixed" ("boundary" "------------050301060007080305070709") NIL NIL NIL)) .. OK UID FETCH completed php > echo iconv_mime_decode("Subject: =?iso-8859-5?b?weLe2+wg3dXi4NjS2NDb7N3e1Q==?= =?iso-8859-5?b?IN3Q19LQ?=", 0, "utf-8"); Subject: Столь нетривиальное назва This is not visible with all email clients, eg. with Thunderbird the correct filename will be shown, because it doesn't seem to use this information. ====================================================================== ---------------------------------------------------------------------- (0003470) fabiangergely (reporter) - 03-Aug-12 13:46 http://www.dbmail.org/mantis/view.php?id=975#c3470 ---------------------------------------------------------------------- I debugged this issue a bit. This is a GMime problem. The string provided to GMime in dbmail_message_init_with_string() is the original message's text. Then the content-type's parameter returned by GMime is already truncated. I guess that most probably it's because of missing folding in the name parameter: Content-Type: message/rfc822; name="=?UTF-8?B?0KHRgtC+0LvRjCDQvdC10YLRgNC40LLQuNCw0LvRjNC90L7QtSDQvdCw0LfQstCw?==?UTF-8?B?0L3QuNC1ICjQttCw0YDQtdC90L3Ri9C1ICkuZW1s?=" If I change the source, and add a folding to the name param, and deliver that message to dbmail, then the returned output is ok: Content-Type: message/rfc822; name="=?UTF-8?B?0KHRgtC+0LvRjCDQvdC10YLRgNC40LLQuNCw0LvRjNC90L7QtSDQvdCw0LfQstCw?= =?UTF-8?B?0L3QuNC1ICjQttCw0YDQtdC90L3Ri9C1ICkuZW1s?=" Issue History Date Modified Username Field Change ====================================================================== 20-Jun-12 10:50 fabiangergely New Issue 20-Jun-12 10:50 fabiangergely File Added: dbmail3_message_part_imap_problem.eml 03-Aug-12 13:46 fabiangergely Note Added: 0003470 ====================================================================== _______________________________________________ Dbmail-dev mailing list Dbmail-dev@dbmail.org http://mailman.fastxs.nl/cgi-bin/mailman/listinfo/dbmail-dev