]> code.delx.au - gnu-emacs/commitdiff
lisp/gnus/mml-smime.el: Add mml-smime-encrypt-to-self
authorUwe Brauer <oub@mat.ucm.es>
Fri, 11 Jan 2013 03:06:13 +0000 (03:06 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 11 Jan 2013 03:06:13 +0000 (03:06 +0000)
* 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.

lisp/gnus/ChangeLog
lisp/gnus/mml-smime.el

index dd93c7b22fef6bf7d18b0d429c5a519f26499e37..4c6e66604d217696676fb24688d214af9cc32294 100644 (file)
@@ -1,3 +1,9 @@
+2013-01-10  Uwe Brauer  <oub@mat.ucm.es>  (tiny change)
+
+       * 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.
+
 2013-01-09  Daiki Ueno  <ueno@gnu.org>
 
        * mml-smime.el (epg-sub-key-fingerprint): Autoload for
index e5e99dedcbeae155e1c5d5481a7fe08d3a79a740..6ea55377e024e21ba3d181c804b264cf07632123 100644 (file)
@@ -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 "\