From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/81851 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: Problems trying to decrypt email Date: Thu, 24 May 2012 10:56:15 +0900 Message-ID: References: <877gw4wq33.fsf@camandro.org> <87d35vn640.fsf@camandro.org> <877gw3n5wr.fsf@camandro.org> <87txz7s08q.fsf@camandro.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: dough.gmane.org 1337824671 5888 80.91.229.3 (24 May 2012 01:57:51 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 24 May 2012 01:57:51 +0000 (UTC) Cc: ding@gnus.org To: Luis Henriques Original-X-From: ding-owner+M30121@lists.math.uh.edu Thu May 24 03:57:48 2012 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SXNJ7-00036G-HA for ding-account@gmane.org; Thu, 24 May 2012 03:57:41 +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 1SXNI2-0006fq-3Z; Wed, 23 May 2012 20:56:34 -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 1SXNI0-0006fg-Ce for ding@lists.math.uh.edu; Wed, 23 May 2012 20:56:32 -0500 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1SXNHw-00035K-3S for ding@lists.math.uh.edu; Wed, 23 May 2012 20:56:32 -0500 Original-Received: from du-a.org ([219.94.251.20] helo=www6246ue.sakura.ne.jp) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1SXNHu-0002FT-7R for ding@gnus.org; Thu, 24 May 2012 03:56:26 +0200 In-Reply-To: <87txz7s08q.fsf@camandro.org> (Luis Henriques's message of "Wed, 23 May 2012 10:41:25 +0100") User-Agent: Gnus/5.130006 (Ma Gnus v0.6) Emacs/24.1.50 (gnu/linux) X-Spam-Score: -0.2 (/) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:81851 Archived-At: --=-=-= Content-Type: text/plain Luis Henriques writes: >>> I forgot to refer the different behaviour between the 2 Gnus versions: >>> >>> - Gnus shipped with Emacs: >>> I select the email (summary buffer) and I get the question "Decrypt >>> (PGP) part? (y or n)". When I answer 'y', I'm asked for the >>> passphrase and get the email decrypted >>> >>> - Ma Gnus: >>> I get the same question ("Decrypt (PGP) part? (y or n)") and when I >>> reply 'y', I get another question: "Decrypt pgp encrypted part? (y >>> or n)". Only after answering 'y' to this question I'm asked for the >>> passphrase. >> >> Can't reproduce it with either Gnus shipped with Emacs (bzr trunk) nor Ma >> Gnus (git master). > I've sent you (privately) an encrypted email. Thanks, I could reproduce it. It seems indeed to be caused by the recent changes to Ma Gnus: 2012-02-16 Lars Ingebrigtsen * mm-decode.el (mm-dissect-singlepart): Guess what the type of application/octet-stream parts really is. I'm attaching a patch. Lars? --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-mm-decode-don-t-touch-MIME-type-for-multipart-encryp.patch >From c08fe16a3e5c84195d449ee65e2bf33104cc870e Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 24 May 2012 10:45:38 +0900 Subject: [PATCH] mm-decode: don't touch MIME type for multipart/encrypted children The commit 1bf64efe introduced auto detection of actual MIME types for application/octet-stream. That changes the MIME type of encrypted part to "text/plain" when it has filename parameter with ".asc", and causes decryption failure. --- lisp/mm-decode.el | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lisp/mm-decode.el b/lisp/mm-decode.el index 8076b2e..0ac3254 100644 --- a/lisp/mm-decode.el +++ b/lisp/mm-decode.el @@ -458,6 +458,7 @@ If not set, `default-directory' will be used." (defvar mm-last-shell-command "") (defvar mm-content-id-alist nil) (defvar mm-postponed-undisplay-list nil) +(defvar mm-inhibit-auto-detect-attachement nil) ;; According to RFC2046, in particular, in a digest, the default ;; Content-Type value for a body part is changed from "text/plain" to @@ -668,7 +669,8 @@ MIME-Version header before proceeding." ;; Guess what the type of application/octet-stream parts should ;; really be. (let ((filename (cdr (assq 'filename (cdr cdl))))) - (when (and (equal (car ctl) "application/octet-stream") + (when (and (not mm-inhibit-auto-detect-attachement) + (equal (car ctl) "application/octet-stream") filename (string-match "\\.\\([^.]+\\)$" filename)) (let ((new-type (mailcap-extension-to-mime (match-string 1 filename)))) @@ -694,7 +696,9 @@ MIME-Version header before proceeding." (goto-char (point-max)) (if (re-search-backward close-delimiter nil t) (match-beginning 0) - (point-max))))) + (point-max)))) + (mm-inhibit-auto-detect-attachement + (equal (car ctl) "multipart/encrypted"))) (setq boundary (concat (regexp-quote boundary) "[ \t]*$")) (while (and (< (point) end) (re-search-forward boundary end t)) (goto-char (match-beginning 0)) -- 1.7.10.1 --=-=-= Content-Type: text/plain Regards, -- Daiki Ueno --=-=-=--