From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/68623 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.gnus.general,gmane.emacs.pretest.bugs Subject: Gnus doubles MIME tags Date: Mon, 22 Jun 2009 21:11:49 +0900 Organization: Emacsen advocacy group Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245672845 24031 80.91.229.12 (22 Jun 2009 12:14:05 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 12:14:05 +0000 (UTC) Cc: ding@gnus.org To: emacs-pretest-bug@gnu.org Original-X-From: ding-owner+M17050@lists.math.uh.edu Mon Jun 22 14:14:02 2009 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 1MIiPQ-0005YY-BB for ding-account@gmane.org; Mon, 22 Jun 2009 14:14:00 +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 1MIiOK-00076k-Ve; Mon, 22 Jun 2009 07:12:53 -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 1MIiOJ-00076Y-3R for ding@lists.math.uh.edu; Mon, 22 Jun 2009 07:12:51 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.69) (envelope-from ) id 1MIiOC-0005K6-Kp for ding@lists.math.uh.edu; Mon, 22 Jun 2009 07:12:51 -0500 Original-Received: from orlando.hostforweb.net ([216.246.45.90]) by quimby.gnus.org with esmtp (Exim 3.36 #1 (Debian)) id 1MIiOh-0006vR-00 for ; Mon, 22 Jun 2009 14:13:15 +0200 Original-Received: from localhost ([127.0.0.1]:53791) by orlando.hostforweb.net with esmtpa (Exim 4.69) (envelope-from ) id 1MIiNU-0004Sc-Tf; Mon, 22 Jun 2009 07:12:01 -0500 X-Hashcash: 1:20:090622:emacs-pretest-bug@gnu.org::uMdT0xd2q+d4cv+b:000000000000000000000000000000000000DJQR X-Hashcash: 1:20:090622:ding@gnus.org::NetOqFUSwgLXp7Yq:00008x7/ 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.110011 (No Gnus v0.11) Emacs/23.1.50 (gnu/linux) Cancel-Lock: sha1:w5XYJcgohFRMwBAT78FmbNfj9NQ= 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.6 (--) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:68623 gmane.emacs.pretest.bugs:24672 Archived-At: Hi, You might have ever seen a MIME tag in the Gnus article buffer like this: [2. non-ascii-filename.pdf --- application/pdf; non-ascii-filename.pdf]... Note that the tag is broken into two lines. In such a case, typing the `E' command there to display the attachment externally doubles the tag like: [2. non-ascii-filename.pdf --- application/pdf; non-ascii-filename.pdf]... non-ascii-filename.pdf --- application/pdf; non-ascii-filename.pdf]... or [2. [2. non-ascii-filename.pdf --- application/pdf; non-ascii-filename.pdf]... I found this is due to M$'s MIME encoder. In the raw form, the MIME header it made looks like this: Content-Description: =?iso-8859-1?Q?non-ascii-filename.pdf?= It's ugly but is not a bug. Gnus decodes it including the first newline and displays it in the MIME tag as is. However, Gnus works properly only with a MIME tag drawn in a single line. The following patch solves it. It uses `message-fetch-field' that strips newlines instead of `mail-fetch-field'. (I don't know how I commit it to the Emacs trunk and also the branches, so I post it here.) 2009-06-22 Katsumi Yamaoka * mm-decode.el (mm-dissect-buffer): Use message-fetch-field instead of mail-fetch-field to fetch Content-Description header in order to exclude newlines. --- mm-decode.el~ 2009-01-22 08:09:02 +0000 +++ mm-decode.el 2009-06-22 11:52:50 +0000 @@ -563,7 +563,7 @@ ctl (and ct (mail-header-parse-content-type ct)) cte (mail-fetch-field "content-transfer-encoding") cd (mail-fetch-field "content-disposition") - description (mail-fetch-field "content-description") + description (message-fetch-field "content-description") id (mail-fetch-field "content-id")) (unless from (setq from (mail-fetch-field "from"))) Regards,