changeset 111565:88b67190d0b2

mml2015-epg-sign: Use From header. mml2015.el (mml2015-epg-sign): 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.
author Katsumi Yamaoka <yamaoka@jpl.org>
date Tue, 16 Nov 2010 23:05:02 +0000
parents 8e4172d91b56
children b4dbe6c4111e
files lisp/gnus/ChangeLog lisp/gnus/mml2015.el
diffstat 2 files changed, 15 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/gnus/ChangeLog	Tue Nov 16 16:47:43 2010 -0500
+++ b/lisp/gnus/ChangeLog	Tue Nov 16 23:05:02 2010 +0000
@@ -1,3 +1,7 @@
+2010-11-16  Daniel Dehennin  <daniel.dehennin@baby-gnu.org>
+
+	* mml2015.el (mml2015-epg-sign): Use From header.
+
 2010-11-15  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
 	* gnus-html.el (gnus-html-wash-images): Register a displayer.
--- a/lisp/gnus/mml2015.el	Tue Nov 16 16:47:43 2010 -0500
+++ b/lisp/gnus/mml2015.el	Tue Nov 16 23:05:02 2010 +0000
@@ -941,6 +941,7 @@
   (let* ((inhibit-redisplay t)
 	 (context (epg-make-context))
 	 (boundary (mml-compute-boundary cont))
+	 (sender (message-options-get 'message-sender))
 	 signer-key
 	 (signers
 	  (or (message-options-get 'mml2015-epg-signers)
@@ -950,8 +951,8 @@
 		   (epa-select-keys context "\
 Select keys for signing.
 If no one is selected, default secret key is used.  "
-				    mml2015-signers t)
-		 (if mml2015-signers
+				    (cons sender mml2015-signers) t)
+		 (if (or sender mml2015-signers)
 		     (delq nil
 			   (mapcar
 			    (lambda (signer)
@@ -965,7 +966,7 @@
 					    signer)))
 				(error "No secret key for %s" signer))
 			      signer-key)
-			    mml2015-signers)))))))
+			    (cons sender mml2015-signers))))))))
 	 signature micalg)
     (epg-context-set-armor context t)
     (epg-context-set-textmode context t)
@@ -1008,6 +1009,7 @@
   (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))
@@ -1025,9 +1027,9 @@
 					      (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 (cons sender mml2015-signers))))
       (if (eq mm-encrypt-option 'guided)
 	  (setq recipients
 		(epa-select-keys context "\
@@ -1060,8 +1062,8 @@
 		     (epa-select-keys context "\
 Select keys for signing.
 If no one is selected, default secret key is used.  "
-				      mml2015-signers t)
-		   (if mml2015-signers
+				      (cons mml2015-signers) t)
+		   (if (or sender mml2015-signers)
 		       (delq nil
 			     (mapcar
 			      (lambda (signer)
@@ -1075,7 +1077,7 @@
 					      signer)))
 				  (error "No secret key for %s" signer))
 				signer-key)
-			      mml2015-signers)))))))
+			      (cons mml2015-signers))))))))
       (epg-context-set-signers context signers))
     (epg-context-set-armor context t)
     (epg-context-set-textmode context t)