summaryrefslogtreecommitdiff
path: root/lisp/gnus/mml-smime.el
diff options
context:
space:
mode:
authorUwe Brauer <oub@mat.ucm.es>2013-01-11 03:06:13 +0000
committerKatsumi Yamaoka <yamaoka@jpl.org>2013-01-11 03:06:13 +0000
commit0b2780df4579dc3657e43f5be1afc8a4aa49c03c (patch)
treede7a53b619dfbbadc85a8b5f414287e506c8e028 /lisp/gnus/mml-smime.el
parentb895642720aaf1d89e22c7cdda11990919622a72 (diff)
downloademacs-0b2780df4579dc3657e43f5be1afc8a4aa49c03c.tar.gz
lisp/gnus/mml-smime.el: Add mml-smime-encrypt-to-self
* mml-smime.el (mml-smime-encrypt-to-self): New user option analogous to mml2015-encrypt-to-self. (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self.
Diffstat (limited to 'lisp/gnus/mml-smime.el')
-rw-r--r--lisp/gnus/mml-smime.el28
1 files changed, 21 insertions, 7 deletions
diff --git a/lisp/gnus/mml-smime.el b/lisp/gnus/mml-smime.el
index e5e99dedcbe..6ea55377e02 100644
--- a/lisp/gnus/mml-smime.el
+++ b/lisp/gnus/mml-smime.el
@@ -80,6 +80,12 @@ Whether the passphrase is cached at all is controlled by
:version "24.4"
:type 'boolean)
+(defcustom mml-smime-encrypt-to-self nil
+ "If t, add your own key ID to recipient list when encryption."
+ :group 'mime-security
+ :version "24.4"
+ :type 'boolean)
+
(defun mml-smime-sign (cont)
(let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist))))
(if func
@@ -475,13 +481,17 @@ Content-Disposition: attachment; filename=smime.p7s
(goto-char (point-max))))
(defun mml-smime-epg-encrypt (cont)
- (let ((inhibit-redisplay t)
- (context (epg-make-context 'CMS))
- (config (epg-configuration))
- (recipients (message-options-get 'mml-smime-epg-recipients))
- cipher signers
- (boundary (mml-compute-boundary cont))
- recipient-key)
+ (let* ((inhibit-redisplay t)
+ (context (epg-make-context 'CMS))
+ (config (epg-configuration))
+ (recipients (message-options-get 'mml-smime-epg-recipients))
+ cipher signers
+ (sender (message-options-get 'message-sender))
+ (signer-names (or mml-smime-signers
+ (if (and mml-smime-sign-with-sender sender)
+ (list (concat "<" sender ">")))))
+ (boundary (mml-compute-boundary cont))
+ recipient-key)
(unless recipients
(setq recipients
(apply #'nconc
@@ -494,6 +504,10 @@ Content-Disposition: attachment; filename=smime.p7s
(message-options-set 'message-recipients
(read-string "Recipients: ")))
"[ \f\t\n\r\v,]+"))))
+ (when mml-smime-encrypt-to-self
+ (unless signer-names
+ (error "Neither message sender nor mml-smime-signers are set"))
+ (setq recipients (nconc recipients signer-names)))
(if (eq mm-encrypt-option 'guided)
(setq recipients
(epa-select-keys context "\