From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/64267 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: EasyPG and attachment with ``.pgp'' extension Date: Mon, 22 Jan 2007 10:23:15 +0900 Message-ID: <9049cb44-9ae5-4f98-b191-b69b23e39587@well-done.deisui.org> References: <7ivej0u3tp.fsf@lanthane.pps.jussieu.fr> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Multipart_Mon_Jan_22_10:23:15_2007-1" X-Trace: sea.gmane.org 1169429170 3882 80.91.229.12 (22 Jan 2007 01:26:10 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 22 Jan 2007 01:26:10 +0000 (UTC) Cc: ding@gnus.org Original-X-From: ding-owner+M12791@lists.math.uh.edu Mon Jan 22 02:26:08 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 1H8nwh-0007sm-Vh for ding-account@gmane.org; Mon, 22 Jan 2007 02:26:04 +0100 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 1H8nuJ-0005ph-Mc; Sun, 21 Jan 2007 19:23:35 -0600 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 1H8nuH-0005pJ-Fy for ding@lists.math.uh.edu; Sun, 21 Jan 2007 19:23:33 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx1.math.uh.edu with esmtp (Exim 4.63) (envelope-from ) id 1H8nuD-0004op-L2 for ding@lists.math.uh.edu; Sun, 21 Jan 2007 19:23:33 -0600 Original-Received: from g96069.scn-net.ne.jp ([210.231.96.69] helo=well-done.deisui.org) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1H8nuC-0005HT-00 for ; Mon, 22 Jan 2007 02:23:28 +0100 Original-Received: from [150.82.173.223] (helo=well-done.deisui.org) by well-done.deisui.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1H8nu1-0006Z9-0y; Mon, 22 Jan 2007 10:23:17 +0900 Original-To: Juliusz Chroboczek X-Attribution: DU Mail-Copies-To: poster In-Reply-To: <7ivej0u3tp.fsf@lanthane.pps.jussieu.fr> (Juliusz Chroboczek's message of "Sun, 21 Jan 2007 10:28:02 +0100") X-Spam-Score: -1.5 (-) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:64267 Archived-At: --Multipart_Mon_Jan_22_10:23:15_2007-1 Content-Type: text/plain; charset=US-ASCII >>>>> In <7ivej0u3tp.fsf@lanthane.pps.jussieu.fr> >>>>> Juliusz Chroboczek wrote: > I recently received an unencrypted e-mail with an encrypted attachment > with was of MIME type ``application/octet-stream'' and an extension of > ``.pgp''. When I tried to save the attachment to disk, EasyPG asked > me to select a destination key and insisted that I must encrypt it. Again. > This was worked around by saving the attachment to a different > filename and then renaming it from the shell, but it's still mightily > inconvenient. It's not so easy to be solved because mm-save-part-to-file avoids only re-compression, and there is no option to avoid re-encryption as well. Preliminarily, I just installed the following change to the Gnus trunk. 2007-01-22 Daiki Ueno * mm-decode.el (mm-save-part-to-file): Use `mm-write-region' instead of `write-region' to respect `mm-inhibit-file-name-handlers'. --Multipart_Mon_Jan_22_10:23:15_2007-1 Content-Type: application/octet-stream; type=patch Content-Disposition: attachment; filename="mm-decode.el.diff" Content-Transfer-Encoding: 7bit Index: lisp/mm-decode.el =================================================================== RCS file: /usr/local/cvsroot/gnus/lisp/mm-decode.el,v retrieving revision 7.48 retrieving revision 7.49 diff -u -w -r7.48 -r7.49 --- lisp/mm-decode.el 1 Jan 2007 07:25:51 -0000 7.48 +++ lisp/mm-decode.el 22 Jan 2007 01:01:21 -0000 7.49 @@ -1210,17 +1210,13 @@ (defun mm-save-part-to-file (handle file) (mm-with-unibyte-buffer (mm-insert-part handle) - (let ((coding-system-for-write 'binary) - (current-file-modes (default-file-modes)) + (let ((current-file-modes (default-file-modes))) + (set-default-file-modes mm-attachment-file-modes) + (unwind-protect ;; Don't re-compress .gz & al. Arguably we should make ;; `file-name-handler-alist' nil, but that would chop ;; ange-ftp, which is reasonable to use here. - (inhibit-file-name-operation 'write-region) - (inhibit-file-name-handlers - (cons 'jka-compr-handler inhibit-file-name-handlers))) - (set-default-file-modes mm-attachment-file-modes) - (unwind-protect - (write-region (point-min) (point-max) file) + (mm-write-region (point-min) (point-max) file nil nil nil 'binary t) (set-default-file-modes current-file-modes))))) (defun mm-pipe-part (handle) --Multipart_Mon_Jan_22_10:23:15_2007-1 Content-Type: text/plain; charset=US-ASCII After this change, with the following setting, mm-save-part-to-file will not attempt to re-encrypt. (setq mm-inhibit-file-name-handlers (cons 'epa-file-handler mm-inhibit-file-name-handlers)) Regards, -- Daiki Ueno --Multipart_Mon_Jan_22_10:23:15_2007-1--