From 809fde057f0f7c2d04825c910e3f323e38a9d342 Mon Sep 17 00:00:00 2001 From: Daniel Dehennin Date: Tue, 16 Nov 2010 23:05:02 +0000 Subject: [PATCH] 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. --- lisp/gnus/ChangeLog | 4 ++++ lisp/gnus/mml2015.el | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index ddaa2266530..2cf48e24c7c 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,3 +1,7 @@ +2010-11-16 Daniel Dehennin + + * mml2015.el (mml2015-epg-sign): Use From header. + 2010-11-15 Lars Magne Ingebrigtsen * gnus-html.el (gnus-html-wash-images): Register a displayer. diff --git a/lisp/gnus/mml2015.el b/lisp/gnus/mml2015.el index 55ebf8cbf0d..5a515fa282a 100644 --- a/lisp/gnus/mml2015.el +++ b/lisp/gnus/mml2015.el @@ -941,6 +941,7 @@ 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)) signer-key (signers (or (message-options-get 'mml2015-epg-signers) @@ -950,8 +951,8 @@ Whether the passphrase is cached at all is controlled by (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 @@ If no one is selected, default secret key is used. " 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 @@ 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)) @@ -1025,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 (cons sender mml2015-signers)))) (if (eq mm-encrypt-option 'guided) (setq recipients (epa-select-keys context "\ @@ -1060,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 + (cons mml2015-signers) t) + (if (or sender mml2015-signers) (delq nil (mapcar (lambda (signer) @@ -1075,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))))))) + (cons mml2015-signers)))))))) (epg-context-set-signers context signers)) (epg-context-set-armor context t) (epg-context-set-textmode context t)