Gnus development mailing list
 help / color / mirror / Atom feed
* EasyPG and attachment with ``.pgp'' extension
@ 2007-01-21  9:28 Juliusz Chroboczek
  2007-01-22  1:23 ` Daiki Ueno
  0 siblings, 1 reply; 3+ messages in thread
From: Juliusz Chroboczek @ 2007-01-21  9:28 UTC (permalink / raw)


Hi Ueno-san, hello to everyone,

I'm running the bundled Gnus 5.11 on Emacs 22.0.92.1 with EasyPG 0.0.7
and pgg-epg.

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.

Thanks for your help,

                                        Juliusz








^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: EasyPG and attachment with ``.pgp'' extension
  2007-01-21  9:28 EasyPG and attachment with ``.pgp'' extension Juliusz Chroboczek
@ 2007-01-22  1:23 ` Daiki Ueno
  2007-01-22  7:02   ` Daiki Ueno
  0 siblings, 1 reply; 3+ messages in thread
From: Daiki Ueno @ 2007-01-22  1:23 UTC (permalink / raw)
  Cc: ding

[-- Attachment #1: Type: text/plain, Size: 949 bytes --]

>>>>> In <7ivej0u3tp.fsf@lanthane.pps.jussieu.fr> 
>>>>>	Juliusz Chroboczek <jch@pps.jussieu.fr> 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  <ueno@unixuser.org>

	* mm-decode.el (mm-save-part-to-file): Use `mm-write-region' instead of
	`write-region' to respect `mm-inhibit-file-name-handlers'.


[-- Attachment #2: mm-decode.el.diff --]
[-- Type: application/octet-stream, Size: 1268 bytes --]

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)

[-- Attachment #3: Type: text/plain, Size: 225 bytes --]


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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: EasyPG and attachment with ``.pgp'' extension
  2007-01-22  1:23 ` Daiki Ueno
@ 2007-01-22  7:02   ` Daiki Ueno
  0 siblings, 0 replies; 3+ messages in thread
From: Daiki Ueno @ 2007-01-22  7:02 UTC (permalink / raw)
  Cc: ding

>>>>> In <9049cb44-9ae5-4f98-b191-b69b23e39587@well-done.deisui.org> 
>>>>>	Daiki Ueno <ueno@unixuser.org> 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.

Alternatively, `M-x epa-file-disable' might help.

Regards,
-- 
Daiki Ueno



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-01-22  7:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-21  9:28 EasyPG and attachment with ``.pgp'' extension Juliusz Chroboczek
2007-01-22  1:23 ` Daiki Ueno
2007-01-22  7:02   ` Daiki Ueno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).