Gnus development mailing list
 help / color / mirror / Atom feed
* Problems trying to decrypt email
@ 2012-05-22  8:57 Luis Henriques
  2012-05-22 23:33 ` Luis Henriques
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Henriques @ 2012-05-22  8:57 UTC (permalink / raw)
  To: ding

Hi,

Recently I have been trying to setup gnus to decrypt email, but
without too much success.  I'm not sure whether this is a gnus or an
epa configuration issue, or a bug somewhere.

Here's my configuration:

(require 'epa)

(setq mml2015-use 'epg)
(setq mml2015-cache-passphrase nil)
(setq gnus-message-replysign t)
(setq gnus-message-replyencrypt t)
(setq gnus-message-replysignencrypted t)
(setq gnus-treat-x-pgp-sig t)
(setq mm-verify-option 'always)
(setq mm-decrypt-option 'always)

To test it, I've used mutt to send an encrypted email to myself.
I can successfully decrypt this email in mutt, but not on gnus.  When
I access this email in summary buffer, I'm asked for a passphrase.
But then I get only this in the message buffer:

  [[PGP Encrypted Part:Corrupted]]
  [1. application/pgp-encrypted; signedkey.msg]...

  [[End of PGP Encrypted Part]]


Any ideas/suggestions?  What am I missing here?

Cheers,
--
Luis



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

* Re: Problems trying to decrypt email
  2012-05-22  8:57 Problems trying to decrypt email Luis Henriques
@ 2012-05-22 23:33 ` Luis Henriques
  2012-05-22 23:37   ` Luis Henriques
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Henriques @ 2012-05-22 23:33 UTC (permalink / raw)
  To: ding

Luis Henriques <henrix@camandro.org> writes:

> Hi,
>
> Recently I have been trying to setup gnus to decrypt email, but
> without too much success.  I'm not sure whether this is a gnus or an
> epa configuration issue, or a bug somewhere.
>
> Here's my configuration:
>
> (require 'epa)
>
> (setq mml2015-use 'epg)
> (setq mml2015-cache-passphrase nil)
> (setq gnus-message-replysign t)
> (setq gnus-message-replyencrypt t)
> (setq gnus-message-replysignencrypted t)
> (setq gnus-treat-x-pgp-sig t)
> (setq mm-verify-option 'always)
> (setq mm-decrypt-option 'always)
>
> To test it, I've used mutt to send an encrypted email to myself.
> I can successfully decrypt this email in mutt, but not on gnus.  When
> I access this email in summary buffer, I'm asked for a passphrase.
> But then I get only this in the message buffer:
>
>   [[PGP Encrypted Part:Corrupted]]
>   [1. application/pgp-encrypted; signedkey.msg]...
>
>   [[End of PGP Encrypted Part]]
>
>
> Any ideas/suggestions?  What am I missing here?

Right, so I did a little bit more testing.  Basically, I removed Ma
Gnus from my Emacs configuration and tried to decrypt the same email
with the Gnus version shipped with Emacs (24.1.50 from git, btw).  And
guess what: it did work.

I'm a complete disaster with lisp, but would I'm available to try out
some suggestions on how to debug this.

Cheers,
--
Luis



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

* Re: Problems trying to decrypt email
  2012-05-22 23:33 ` Luis Henriques
@ 2012-05-22 23:37   ` Luis Henriques
  2012-05-23  2:36     ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Henriques @ 2012-05-22 23:37 UTC (permalink / raw)
  To: ding

(C-c C-c'ed too soon!)

Luis Henriques <henrix@camandro.org> writes:

> Luis Henriques <henrix@camandro.org> writes:
>
>> Hi,
>>
>> Recently I have been trying to setup gnus to decrypt email, but
>> without too much success.  I'm not sure whether this is a gnus or an
>> epa configuration issue, or a bug somewhere.
>>
>> Here's my configuration:
>>
>> (require 'epa)
>>
>> (setq mml2015-use 'epg)
>> (setq mml2015-cache-passphrase nil)
>> (setq gnus-message-replysign t)
>> (setq gnus-message-replyencrypt t)
>> (setq gnus-message-replysignencrypted t)
>> (setq gnus-treat-x-pgp-sig t)
>> (setq mm-verify-option 'always)
>> (setq mm-decrypt-option 'always)
>>
>> To test it, I've used mutt to send an encrypted email to myself.
>> I can successfully decrypt this email in mutt, but not on gnus.  When
>> I access this email in summary buffer, I'm asked for a passphrase.
>> But then I get only this in the message buffer:
>>
>>   [[PGP Encrypted Part:Corrupted]]
>>   [1. application/pgp-encrypted; signedkey.msg]...
>>
>>   [[End of PGP Encrypted Part]]
>>
>>
>> Any ideas/suggestions?  What am I missing here?
>
> Right, so I did a little bit more testing.  Basically, I removed Ma
> Gnus from my Emacs configuration and tried to decrypt the same email
> with the Gnus version shipped with Emacs (24.1.50 from git, btw).  And
> guess what: it did work.

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.

>
> I'm a complete disaster with lisp, but would I'm available to try
>out
> some suggestions on how to debug this.
>
> Cheers,
> --
> Luis



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

* Re: Problems trying to decrypt email
  2012-05-22 23:37   ` Luis Henriques
@ 2012-05-23  2:36     ` Daiki Ueno
  2012-05-23  9:41       ` Luis Henriques
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2012-05-23  2:36 UTC (permalink / raw)
  To: Luis Henriques; +Cc: ding

Luis Henriques <henrix@camandro.org> 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'm a complete disaster with lisp, but would I'm available to try out
>> some suggestions on how to debug this.

FWIW, try (info "(epa) Bug Reports").  And if possible, send me an email
encrypted with mutt (my key ID is D7E69871).

Regards,
-- 
Daiki Ueno



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

* Re: Problems trying to decrypt email
  2012-05-23  2:36     ` Daiki Ueno
@ 2012-05-23  9:41       ` Luis Henriques
  2012-05-24  1:56         ` Daiki Ueno
  0 siblings, 1 reply; 7+ messages in thread
From: Luis Henriques @ 2012-05-23  9:41 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: ding

Daiki Ueno <ueno@unixuser.org> writes:

> Luis Henriques <henrix@camandro.org> 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).

Interesting, so it has to be my configuration.  Any chances of sharing
the relevant parts of your configuration?

>
>>> I'm a complete disaster with lisp, but would I'm available to try out
>>> some suggestions on how to debug this.
>
> FWIW, try (info "(epa) Bug Reports").  And if possible, send me an email
> encrypted with mutt (my key ID is D7E69871).

I've sent you (privately) an encrypted email.

Cheers,
--
Luis



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

* Re: Problems trying to decrypt email
  2012-05-23  9:41       ` Luis Henriques
@ 2012-05-24  1:56         ` Daiki Ueno
  2012-05-24  9:02           ` Luis Henriques
  0 siblings, 1 reply; 7+ messages in thread
From: Daiki Ueno @ 2012-05-24  1:56 UTC (permalink / raw)
  To: Luis Henriques; +Cc: ding

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

Luis Henriques <henrix@camandro.org> 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  <larsi@gnus.org>

        * mm-decode.el (mm-dissect-singlepart): Guess what the type of
        application/octet-stream parts really is.

I'm attaching a patch.  Lars?


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-mm-decode-don-t-touch-MIME-type-for-multipart-encryp.patch --]
[-- Type: text/x-patch, Size: 2034 bytes --]

From c08fe16a3e5c84195d449ee65e2bf33104cc870e Mon Sep 17 00:00:00 2001
From: Daiki Ueno <ueno@unixuser.org>
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


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


Regards,
-- 
Daiki Ueno

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

* Re: Problems trying to decrypt email
  2012-05-24  1:56         ` Daiki Ueno
@ 2012-05-24  9:02           ` Luis Henriques
  0 siblings, 0 replies; 7+ messages in thread
From: Luis Henriques @ 2012-05-24  9:02 UTC (permalink / raw)
  To: Daiki Ueno; +Cc: ding

Daiki Ueno <ueno@unixuser.org> writes:

> Luis Henriques <henrix@camandro.org> 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  <larsi@gnus.org>
>
>         * mm-decode.el (mm-dissect-singlepart): Guess what the type of
>         application/octet-stream parts really is.
>
> I'm attaching a patch.  Lars?

Great, thanks a lot!  I confirm this has solved the problem -- I am
now able to successfully decrypt emails with this patch applied.

Cheers,
--
Luis

> From c08fe16a3e5c84195d449ee65e2bf33104cc870e Mon Sep 17 00:00:00 2001
> From: Daiki Ueno <ueno@unixuser.org>
> 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
>
>
> Regards,



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

end of thread, other threads:[~2012-05-24  9:02 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-22  8:57 Problems trying to decrypt email Luis Henriques
2012-05-22 23:33 ` Luis Henriques
2012-05-22 23:37   ` Luis Henriques
2012-05-23  2:36     ` Daiki Ueno
2012-05-23  9:41       ` Luis Henriques
2012-05-24  1:56         ` Daiki Ueno
2012-05-24  9:02           ` Luis Henriques

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).