GNU bug report logs - #7797
24.0.50; [EasyPG/Gnus] always pick up the first key from `gpg --list-key $SENDER`

Previous Next

Packages: emacs, gnus;

Reported by: Luca Capello <luca <at> pca.it>

Date: Thu, 6 Jan 2011 23:24:02 UTC

Severity: normal

Found in version 24.0.50

Done: Chong Yidong <cyd <at> stupidchicken.com>

Bug is archived. No further changes may be made.

Full log


Message #24 received at 7797 <at> debbugs.gnu.org (full text, mbox):

From: Daniel Dehennin <daniel.dehennin <at> baby-gnu.org>
To: ding <at> gnus.org
Cc: rfrancoise <at> debian.org, Ashish SHUKLA <wahjava.ml <at> gmail.com>,
	Daiki Ueno <ueno <at> unixuser.org>, 7797 <at> debbugs.gnu.org,
	Luca Capello <luca <at> pca.it>
Subject: Configure the use of from header for epg signing.
Date: Fri, 07 Jan 2011 18:29:01 +0100
[Message part 1 (text/plain, inline)]
Here is a patch to make the use of from header conditional, this solve
issue 1 in [1].

It can be fetched from my Gnus git repository [2].

I do not update the Changelog to avoid conflict, I think changelog can
be automatically handled by hook when Lars pull in its branch ;-)

This patch is tested by me.

Regards.

* lisp/mml2015.el (mml2015-use-from-address): New variable for optional
  from header use.
  (mml2015-epg-sign): Use it.
  (mml2015-epg-encrypt): Ditto.
---
 lisp/mml2015.el |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/lisp/mml2015.el b/lisp/mml2015.el
index 9831b33..dde8a08 100644
--- a/lisp/mml2015.el
+++ b/lisp/mml2015.el
@@ -121,6 +121,12 @@ Whether the passphrase is cached at all is controlled by
   :group 'mime-security
   :type '(repeat (string :tag "Key ID")))
 
+(defcustom mml2015-use-from-address nil
+  "If t, use from header mail address before mml2015-signers when
+signing."
+  :group 'mime-security
+  :type 'boolean)
+
 (defcustom mml2015-encrypt-to-self nil
   "If t, add your own key ID to recipient list when encryption."
   :group 'mime-security
@@ -960,7 +966,8 @@ Whether the passphrase is cached at all is controlled by
   (let* ((inhibit-redisplay t)
 	 (context (epg-make-context))
 	 (boundary (mml-compute-boundary cont))
-	 (sender (message-options-get 'message-sender))
+	 (sender (if mml2015-use-from-address
+		     (message-options-get 'message-sender)))
 	 signer-key
 	 (signers
 	  (or (message-options-get 'mml2015-epg-signers)
@@ -1035,7 +1042,8 @@ If no one is selected, default secret key is used.  "
   (let ((inhibit-redisplay t)
 	(context (epg-make-context))
 	(config (epg-configuration))
-	(sender (message-options-get 'message-sender))
+	 (sender (if mml2015-use-from-address
+		     (message-options-get 'message-sender)))
 	(recipients (message-options-get 'mml2015-epg-recipients))
 	cipher signers
 	(boundary (mml-compute-boundary cont))
-- 
1.7.2.3



Footnotes: 
[1]  http://lists.gnu.org/archive/html/bug-gnu-emacs/2011-01/msg00207.html

[2]  http://www.baby-gnu.org/~nebu/archives/gnus/gnus.git/ dad/mml2015-epg-use-from-to-sign-if-configured

-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1
[Message part 2 (application/pgp-signature, inline)]

This bug report was last modified 14 years and 182 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.