emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r111479: lisp/gnus/mml-smime.el: Add


From: Katsumi Yamaoka
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r111479: lisp/gnus/mml-smime.el: Add mml-smime-encrypt-to-self
Date: Fri, 11 Jan 2013 03:06:13 +0000
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111479
author: Uwe Brauer <address@hidden> (tiny change)
committer: Katsumi Yamaoka <address@hidden>
branch nick: trunk
timestamp: Fri 2013-01-11 03:06:13 +0000
message:
  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.
modified:
  lisp/gnus/ChangeLog
  lisp/gnus/mml-smime.el
=== modified file 'lisp/gnus/ChangeLog'
--- a/lisp/gnus/ChangeLog       2013-01-09 05:11:16 +0000
+++ b/lisp/gnus/ChangeLog       2013-01-11 03:06:13 +0000
@@ -1,3 +1,9 @@
+2013-01-10  Uwe Brauer  <address@hidden>  (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  <address@hidden>
 
        * mml-smime.el (epg-sub-key-fingerprint): Autoload for

=== modified file 'lisp/gnus/mml-smime.el'
--- a/lisp/gnus/mml-smime.el    2013-01-09 05:11:16 +0000
+++ b/lisp/gnus/mml-smime.el    2013-01-11 03:06:13 +0000
@@ -80,6 +80,12 @@
   :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 @@
     (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 @@
                         (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 "\


reply via email to

[Prev in Thread] Current Thread [Next in Thread]