From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Katsumi Yamaoka Newsgroups: gmane.emacs.bugs Subject: bug#3648: Gnus doubles MIME tags Date: Mon, 22 Jun 2009 21:11:49 +0900 Organization: Emacsen advocacy group Message-ID: Reply-To: Katsumi Yamaoka , 3648@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1245674297 28720 80.91.229.12 (22 Jun 2009 12:38:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 22 Jun 2009 12:38:17 +0000 (UTC) Cc: ding@gnus.org To: emacs-pretest-bug@gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jun 22 14:38:14 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MIimm-00079X-Bt for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 14:38:09 +0200 Original-Received: from localhost ([127.0.0.1]:60913 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIiml-0002w7-O8 for geb-bug-gnu-emacs@m.gmane.org; Mon, 22 Jun 2009 08:38:07 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MIimA-0002qo-57 for bug-gnu-emacs@gnu.org; Mon, 22 Jun 2009 08:37:30 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MIim5-0002pn-Sd for bug-gnu-emacs@gnu.org; Mon, 22 Jun 2009 08:37:29 -0400 Original-Received: from [199.232.76.173] (port=40097 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MIim5-0002pk-Km for bug-gnu-emacs@gnu.org; Mon, 22 Jun 2009 08:37:25 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:60939) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MIim5-0002Gp-2p for bug-gnu-emacs@gnu.org; Mon, 22 Jun 2009 08:37:25 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5MCbMxu021145; Mon, 22 Jun 2009 05:37:23 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.14.3/8.14.3/Submit) id n5MCK5EX018086; Mon, 22 Jun 2009 05:20:05 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Katsumi Yamaoka Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Mon, 22 Jun 2009 12:20:05 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: report 3648 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124567273817031 (code B ref -1); Mon, 22 Jun 2009 12:20:05 +0000 Original-Received: (at submit) by emacsbugs.donarmstrong.com; 22 Jun 2009 12:12:18 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.14.3/8.14.3/Debian-5) with ESMTP id n5MCCENL017019 for ; Mon, 22 Jun 2009 05:12:15 -0700 Original-Received: from mail.gnu.org ([199.232.76.166]:40865 helo=mx10.gnu.org) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1MIiNg-0000AJ-Uf for emacs-pretest-bug@gnu.org; Mon, 22 Jun 2009 08:12:13 -0400 Original-Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1MIiNf-0004FS-05 for emacs-pretest-bug@gnu.org; Mon, 22 Jun 2009 08:12:12 -0400 Original-Received: from orlando.hostforweb.net ([216.246.45.90]:58012) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MIiNe-0004Eu-J3 for emacs-pretest-bug@gnu.org; Mon, 22 Jun 2009 08:12:10 -0400 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 - gnu.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-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) Resent-Date: Mon, 22 Jun 2009 08:37:29 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:28902 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,