From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64797 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general Subject: Re: long encoded filename in mime part is truncated and not decoded Date: Tue, 12 Jun 2007 19:01:01 +0900 Organization: Emacsen advocacy group Message-ID: References: <873b0x3nxi.fsf@roddy.4407.kankyo-u.ac.jp> <87sl8x1sq3.fsf@roddy.4407.kankyo-u.ac.jp> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: sea.gmane.org 1181642550 22151 80.91.229.12 (12 Jun 2007 10:02:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 12 Jun 2007 10:02:30 +0000 (UTC) To: ding@gnus.org Original-X-From: ding-owner+M13308@lists.math.uh.edu Tue Jun 12 12:02:28 2007 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by lo.gmane.org with esmtp (Exim 4.50) id 1Hy3Cm-0001ut-Dq for ding-account@gmane.org; Tue, 12 Jun 2007 12:02:28 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1Hy3C8-0003Xa-7W; Tue, 12 Jun 2007 05:01:48 -0500 Original-Received: from mx1.math.uh.edu ([129.7.128.32]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1Hy3C6-0003XN-DV for ding@lists.math.uh.edu; Tue, 12 Jun 2007 05:01:46 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.67) (envelope-from ) id 1Hy3C5-0005QK-65 for ding@lists.math.uh.edu; Tue, 12 Jun 2007 05:01:46 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1Hy3C3-0008Pj-00 for ; Tue, 12 Jun 2007 12:01:43 +0200 Original-Received: from [66.225.201.151] (port=39015 helo=mail.jpl.org) by orlando.hostforweb.net with esmtpa (Exim 4.63) (envelope-from ) id 1Hy3BS-0000Kj-Fk for ding@gnus.org; Tue, 12 Jun 2007 05:01:07 -0500 X-Hashcash: 1:20:070612:ding@gnus.org::kzAAkQ6n+IY6MQTu:00000FdO X-Face: #kKnN,xUnmKia.'[pp`;Omh}odZK)?7wQSl"4o04=EixTF+V[""w~iNbM9ZL+.b*_CxUmFk B#Fu[*?MZZH@IkN:!"\w%I_zt>[$nm7nQosZ<3eu;B:$Q_:p!',P.c0-_Cy[dz4oIpw0ESA^D*1Lw= L&i*6&( User-Agent: Gnus/5.110007 (No Gnus v0.7) Emacs/22.1.50 (gnu/linux) Cancel-Lock: sha1:R7De7vW4ATZvXunWJ46t7qbwb3U= X-Antivirus-Scanner: Clean mail though you should still use an Antivirus X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - orlando.hostforweb.net X-AntiAbuse: Original Domain - gnus.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - jpl.org X-Source: X-Source-Args: X-Source-Dir: X-Spam-Score: -2.4 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64797 Archived-At: --=-=-= >>>>> In <87sl8x1sq3.fsf@roddy.4407.kankyo-u.ac.jp> >>>>> NAKAJI Hiroyuki wrote: > And here is the header of the part in concern. > --------------050601010802060300010200 > Content-Type: application/msword; > name="=?ISO-2022-JP?B?NDQbJEI/NzUsM1g9LCVLITwlOkJQMX4lVyVtJTAlaSVgO1kxZzdQSHEbKEI=?==?ISO-2022-JP?B?WxskQjpOQnJAKRsoQl0bJEIhS" [...] Here is a program that tries fixing of corrupted B encoded words: --=-=-= Content-Type: application/emacs-lisp Content-Disposition: inline (defadvice rfc2231-parse-qp-string (around try-fixing-corrupted-data (string) activate) "Try fixing corrupted B encoded words." (let ((regexp "=\\?[^\t\n \"?]+\\?b\\?\\([^\t\n \"?]+\\)[\t\n ]*\"") (case-fold-search t)) (if (string-match regexp string) (let ((str1 (substring string 0 (match-end 1))) (str2 (substring string (1- (match-end 0)))) (i 0) dec) (while (and (>= (setq i (1- i)) -3) (condition-case nil (string-match regexp (setq dec (rfc2047-decode-string (concat (substring str1 0 i) "?=" str2)))) (error t)))) (if (>= i -3) (setq ad-return-value (rfc2231-parse-string dec)) ad-do-it)) ad-do-it))) --=-=-= Content-Disposition: inline Use this with care. It will not necessarily fix such ones, moreover it might break correct ones. To disable this, type `M-x ad-unadvise RET rfc2231-parse-qp-string RET'. Regards, --=-=-=--