From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/82827 Path: news.gmane.org!not-for-mail From: Daiki Ueno Newsgroups: gmane.emacs.gnus.general Subject: Re: mml-smime: mml-sime-encrypt-to-self Date: Thu, 10 Jan 2013 18:08:47 +0900 Message-ID: References: <87hamuioot.fsf@mat.ucm.es> <87ip78ylhp.fsf@gilgamesch.quim.ucm.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1357809009 2682 80.91.229.3 (10 Jan 2013 09:10:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 10 Jan 2013 09:10:09 +0000 (UTC) Cc: ding@gnus.org To: Uwe Brauer Original-X-From: ding-owner+M31093@lists.math.uh.edu Thu Jan 10 10:10:26 2013 Return-path: Envelope-to: ding-account@gmane.org Original-Received: from util0.math.uh.edu ([129.7.128.18]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TtE9Z-0007CO-UW for ding-account@gmane.org; Thu, 10 Jan 2013 10:10:26 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.math.uh.edu) by util0.math.uh.edu with smtp (Exim 4.63) (envelope-from ) id 1TtE8B-0001it-DS; Thu, 10 Jan 2013 03:08:59 -0600 Original-Received: from mx2.math.uh.edu ([129.7.128.33]) by util0.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.63) (envelope-from ) id 1TtE89-0001ih-Mn for ding@lists.math.uh.edu; Thu, 10 Jan 2013 03:08:57 -0600 Original-Received: from quimby.gnus.org ([80.91.231.51]) by mx2.math.uh.edu with esmtps (TLSv1:AES256-SHA:256) (Exim 4.76) (envelope-from ) id 1TtE88-0003QX-1x for ding@lists.math.uh.edu; Thu, 10 Jan 2013 03:08:57 -0600 Original-Received: from fencepost.gnu.org ([208.118.235.10] ident=Debian-exim) by quimby.gnus.org with esmtp (Exim 4.72) (envelope-from ) id 1TtE86-0002Hm-8a for ding@gnus.org; Thu, 10 Jan 2013 10:08:54 +0100 Original-Received: from [2001:e41:db5e:fb14::1] (port=41865 helo=localhost.localdomain) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TtE83-0004fd-P2; Thu, 10 Jan 2013 04:08:52 -0500 In-Reply-To: <87ip78ylhp.fsf@gilgamesch.quim.ucm.es> (Uwe Brauer's message of "Tue, 08 Jan 2013 12:14:58 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-Spam-Score: -7.9 (-------) List-ID: Precedence: bulk Xref: news.gmane.org gmane.emacs.gnus.general:82827 Archived-At: Uwe Brauer writes: > I think I have implemented it. I attach a patch, since I am not > familiar with bzr. Thanks, looks almost good. I'm going to push a slightly modified version (attached). By the way, could you please preserve indentation from the next time when you send a patch? Also good to use "git diff" or "git format-patch" to generate diff. Regards, -- Daiki Ueno >From 0abd8b04f1c3e1cbe29de65bd6f2b8eac9204ab9 Mon Sep 17 00:00:00 2001 From: Uwe Brauer Date: Thu, 10 Jan 2013 18:00:56 +0900 Subject: [PATCH] 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. --- lisp/ChangeLog | 6 ++++++ lisp/mml-smime.el | 28 +++++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cd8ea7c..2ed5647 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-01-10 Uwe Brauer (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 * mml-smime.el (epg-sub-key-fingerprint): Autoload for diff --git a/lisp/mml-smime.el b/lisp/mml-smime.el index e5e99de..6ea5537 100644 --- a/lisp/mml-smime.el +++ b/lisp/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 "\ -- 1.8.1