diff options
| author | Uwe Brauer | 2013-01-11 03:06:13 +0000 |
|---|---|---|
| committer | Katsumi Yamaoka | 2013-01-11 03:06:13 +0000 |
| commit | 0b2780df4579dc3657e43f5be1afc8a4aa49c03c (patch) | |
| tree | de7a53b619dfbbadc85a8b5f414287e506c8e028 | |
| parent | b895642720aaf1d89e22c7cdda11990919622a72 (diff) | |
| download | emacs-0b2780df4579dc3657e43f5be1afc8a4aa49c03c.tar.gz emacs-0b2780df4579dc3657e43f5be1afc8a4aa49c03c.zip | |
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.
| -rw-r--r-- | lisp/gnus/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/gnus/mml-smime.el | 28 |
2 files changed, 27 insertions, 7 deletions
diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index dd93c7b22fe..4c6e66604d2 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2013-01-10 Uwe Brauer <oub@mat.ucm.es> (tiny change) | ||
| 2 | |||
| 3 | * mml-smime.el (mml-smime-encrypt-to-self): New user option analogous | ||
| 4 | to mml2015-encrypt-to-self. | ||
| 5 | (mml-smime-epg-encrypt): Respect mml-smime-encrypt-to-self. | ||
| 6 | |||
| 1 | 2013-01-09 Daiki Ueno <ueno@gnu.org> | 7 | 2013-01-09 Daiki Ueno <ueno@gnu.org> |
| 2 | 8 | ||
| 3 | * mml-smime.el (epg-sub-key-fingerprint): Autoload for | 9 | * mml-smime.el (epg-sub-key-fingerprint): Autoload for |
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 | |||
| 80 | :version "24.4" | 80 | :version "24.4" |
| 81 | :type 'boolean) | 81 | :type 'boolean) |
| 82 | 82 | ||
| 83 | (defcustom mml-smime-encrypt-to-self nil | ||
| 84 | "If t, add your own key ID to recipient list when encryption." | ||
| 85 | :group 'mime-security | ||
| 86 | :version "24.4" | ||
| 87 | :type 'boolean) | ||
| 88 | |||
| 83 | (defun mml-smime-sign (cont) | 89 | (defun mml-smime-sign (cont) |
| 84 | (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) | 90 | (let ((func (nth 1 (assq mml-smime-use mml-smime-function-alist)))) |
| 85 | (if func | 91 | (if func |
| @@ -475,13 +481,17 @@ Content-Disposition: attachment; filename=smime.p7s | |||
| 475 | (goto-char (point-max)))) | 481 | (goto-char (point-max)))) |
| 476 | 482 | ||
| 477 | (defun mml-smime-epg-encrypt (cont) | 483 | (defun mml-smime-epg-encrypt (cont) |
| 478 | (let ((inhibit-redisplay t) | 484 | (let* ((inhibit-redisplay t) |
| 479 | (context (epg-make-context 'CMS)) | 485 | (context (epg-make-context 'CMS)) |
| 480 | (config (epg-configuration)) | 486 | (config (epg-configuration)) |
| 481 | (recipients (message-options-get 'mml-smime-epg-recipients)) | 487 | (recipients (message-options-get 'mml-smime-epg-recipients)) |
| 482 | cipher signers | 488 | cipher signers |
| 483 | (boundary (mml-compute-boundary cont)) | 489 | (sender (message-options-get 'message-sender)) |
| 484 | recipient-key) | 490 | (signer-names (or mml-smime-signers |
| 491 | (if (and mml-smime-sign-with-sender sender) | ||
| 492 | (list (concat "<" sender ">"))))) | ||
| 493 | (boundary (mml-compute-boundary cont)) | ||
| 494 | recipient-key) | ||
| 485 | (unless recipients | 495 | (unless recipients |
| 486 | (setq recipients | 496 | (setq recipients |
| 487 | (apply #'nconc | 497 | (apply #'nconc |
| @@ -494,6 +504,10 @@ Content-Disposition: attachment; filename=smime.p7s | |||
| 494 | (message-options-set 'message-recipients | 504 | (message-options-set 'message-recipients |
| 495 | (read-string "Recipients: "))) | 505 | (read-string "Recipients: "))) |
| 496 | "[ \f\t\n\r\v,]+")))) | 506 | "[ \f\t\n\r\v,]+")))) |
| 507 | (when mml-smime-encrypt-to-self | ||
| 508 | (unless signer-names | ||
| 509 | (error "Neither message sender nor mml-smime-signers are set")) | ||
| 510 | (setq recipients (nconc recipients signer-names))) | ||
| 497 | (if (eq mm-encrypt-option 'guided) | 511 | (if (eq mm-encrypt-option 'guided) |
| 498 | (setq recipients | 512 | (setq recipients |
| 499 | (epa-select-keys context "\ | 513 | (epa-select-keys context "\ |