Gnus development mailing list
 help / color / mirror / Atom feed
* mml2015-epg-encrypt do not use from header to sign.
@ 2010-11-15 23:14 Daniel Dehennin
  0 siblings, 0 replies; only message in thread
From: Daniel Dehennin @ 2010-11-15 23:14 UTC (permalink / raw)
  To: ding

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

* lisp/mml2015.el (mml2015-epg-encrypt): New variable 'sender'
  is (message-options-get 'message-sender) and append it to
  mml2015-signers. If mm-sign-option is not 'guided, mml2015-signers and
  sender sign the mail.
---
 lisp/mml2015.el |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/lisp/mml2015.el b/lisp/mml2015.el
index 71329f0..7697f8a 100644
--- a/lisp/mml2015.el
+++ b/lisp/mml2015.el
@@ -1009,6 +1009,7 @@ 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))
 	(recipients (message-options-get 'mml2015-epg-recipients))
 	cipher signers
 	(boundary (mml-compute-boundary cont))
@@ -1026,9 +1027,9 @@ If no one is selected, default secret key is used.  "
 					      (read-string "Recipients: ")))
 		     "[ \f\t\n\r\v,]+"))))
       (when mml2015-encrypt-to-self
-	(unless mml2015-signers
-	  (error "mml2015-signers not set"))
-	(setq recipients (nconc recipients mml2015-signers)))
+	(unless (or sender mml2015-signers)
+	  (error "Message sender and mml2015-signers not set"))
+	(setq recipients (nconc recipients (append mml2015-signers (list sender)))))
       (if (eq mm-encrypt-option 'guided)
 	  (setq recipients
 		(epa-select-keys context "\
@@ -1061,8 +1062,8 @@ If no one is selected, symmetric encryption will be performed.  "
 		     (epa-select-keys context "\
 Select keys for signing.
 If no one is selected, default secret key is used.  "
-				      mml2015-signers t)
-		   (if mml2015-signers
+				      (append mml2015-signers (list sender)) t)
+		   (if (or sender mml2015-signers)
 		       (delq nil
 			     (mapcar
 			      (lambda (signer)
@@ -1076,7 +1077,7 @@ If no one is selected, default secret key is used.  "
 					      signer)))
 				  (error "No secret key for %s" signer))
 				signer-key)
-			      mml2015-signers)))))))
+			      (append mml2015-signers (list sender)))))))))
       (epg-context-set-signers context signers))
     (epg-context-set-armor context t)
     (epg-context-set-textmode context t)
-- 
1.7.2.3


-- 
Daniel Dehennin
Récupérer ma clef GPG:
gpg --keyserver pgp.mit.edu --recv-keys 0x6A2540D1

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-11-15 23:14 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-15 23:14 mml2015-epg-encrypt do not use from header to sign Daniel Dehennin

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