Re: [PATCH v4 01/16] add util/search-path.{c, h} to test for executables in $PATH
[notmuch-archives.git] / 1d / 859263749134913b39ebc8d54e1609d4dad008
1 Return-Path: <jani@nikula.org>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 38E21431FAF\r
6         for <notmuch@notmuchmail.org>; Sat,  5 Apr 2014 02:18:20 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id 7z23kfWnNqNu for <notmuch@notmuchmail.org>;\r
16         Sat,  5 Apr 2014 02:18:14 -0700 (PDT)\r
17 Received: from mail-we0-f182.google.com (mail-we0-f182.google.com\r
18         [74.125.82.182]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 83889431FAE\r
21         for <notmuch@notmuchmail.org>; Sat,  5 Apr 2014 02:18:14 -0700 (PDT)\r
22 Received: by mail-we0-f182.google.com with SMTP id p61so4532076wes.27\r
23         for <notmuch@notmuchmail.org>; Sat, 05 Apr 2014 02:18:11 -0700 (PDT)\r
24 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
25         d=1e100.net; s=20130820;\r
26         h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\r
27         :references;\r
28         bh=8LJq/kSp1nWUYUrMDz9AGj8wCQkmfW9jh7oagRmZWsE=;\r
29         b=RTgL9pGDL4Wc77oiL7tV/TPOy3CFuSKsUZmpDlwlYFx/2a3zWat/QS5D69yF5xgXpi\r
30         cFThOtfp61570JMwfHTF8ghTcaV+SQL5S+9pRTG2wsVcEp6G6tjvB2Oo3jK04ikbvt6G\r
31         dm9RfJNFnBUdCVgb2XI64kRWu7bSF/KSP2W0MlmEurMifKQUtwR7wevaGWUhhCliyidK\r
32         VS63UGbYCgzcQQawDdkKKrWNqaIRrSiI+NpSjNbebv1qLsiaaxuCWD3DU7KJ6v9NxuZT\r
33         OXjOJeeYMEcavQOwL37rC8RiRr1kWgYqTDrYUQCWqNUiQTrtBDHOnoeWc+tLszCK8rw6\r
34         5hbA==\r
35 X-Gm-Message-State:\r
36  ALoCoQk2g8AQcn5oOslChySuwAC6Rti21+1l/20JxTAWmCSXulqy0ZxKz6RTVXJ1hlxwDqUnGdW3\r
37 X-Received: by 10.194.187.107 with SMTP id fr11mr26542331wjc.70.1396689490550;\r
38         Sat, 05 Apr 2014 02:18:10 -0700 (PDT)\r
39 Received: from localhost (dsl-hkibrasgw2-58c36f-91.dhcp.inet.fi.\r
40         [88.195.111.91])\r
41         by mx.google.com with ESMTPSA id w1sm25636216eel.16.2014.04.05.02.18.08\r
42         for <multiple recipients>\r
43         (version=TLSv1.2 cipher=RC4-SHA bits=128/128);\r
44         Sat, 05 Apr 2014 02:18:09 -0700 (PDT)\r
45 From: Jani Nikula <jani@nikula.org>\r
46 To: notmuch@notmuchmail.org\r
47 Subject: [PATCH] emacs: sign/encrypt replies to signed/encrypted messages\r
48 Date: Sat,  5 Apr 2014 12:18:06 +0300\r
49 Message-Id: <1396689486-19232-1-git-send-email-jani@nikula.org>\r
50 X-Mailer: git-send-email 1.9.1\r
51 In-Reply-To: <87a9f1c8aq.fsf@servo.finestructure.net>\r
52 References: <87a9f1c8aq.fsf@servo.finestructure.net>\r
53 X-BeenThere: notmuch@notmuchmail.org\r
54 X-Mailman-Version: 2.1.13\r
55 Precedence: list\r
56 List-Id: "Use and development of the notmuch mail system."\r
57         <notmuch.notmuchmail.org>\r
58 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
59         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
60 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
61 List-Post: <mailto:notmuch@notmuchmail.org>\r
62 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
63 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
64         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
65 X-List-Received-Date: Sat, 05 Apr 2014 09:18:20 -0000\r
66 \r
67 This is a simple approach to improving security when replying to\r
68 signed or encrypted messages. If the message being replied to was\r
69 signed, add mml tag to sign the reply. If the message being replied to\r
70 was encrypted, add mml tag to sign and encrypt the reply.\r
71 \r
72 This may need configuration; I for one might want to encrypt replies\r
73 to encrypted messages, but not always sign replies to signed messages.\r
74 \r
75 This still includes a slight bug: if any mml tags are added, they are\r
76 included in the region containing the quoted parts. Killing the region\r
77 will kill the mml tags too.\r
78 ---\r
79  emacs/notmuch-mua.el | 14 +++++++++++++-\r
80  1 file changed, 13 insertions(+), 1 deletion(-)\r
81 \r
82 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
83 index ba3ef275ec5e..9fb84b57b030 100644\r
84 --- a/emacs/notmuch-mua.el\r
85 +++ b/emacs/notmuch-mua.el\r
86 @@ -115,6 +115,15 @@ list."\r
87             (push header message-hidden-headers)))\r
88         notmuch-mua-hidden-headers))\r
89  \r
90 +(defun notmuch-mua-reply-crypto (parts)\r
91 +  (loop for part in parts\r
92 +       if (notmuch-match-content-type (plist-get part :content-type) "multipart/signed")\r
93 +         do (mml-secure-message-sign)\r
94 +       else if (notmuch-match-content-type (plist-get part :content-type) "multipart/encrypted")\r
95 +         do (mml-secure-message-sign-encrypt)\r
96 +       else if (notmuch-match-content-type (plist-get part :content-type) "multipart/*")\r
97 +         do (notmuch-mua-reply-crypto (plist-get part :content))))\r
98 +\r
99  (defun notmuch-mua-get-quotable-parts (parts)\r
100    (loop for part in parts\r
101         if (notmuch-match-content-type (plist-get part :content-type) "multipart/alternative")\r
102 @@ -224,7 +233,10 @@ list."\r
103         (set-mark (point))\r
104         (goto-char start)\r
105         ;; Quote the original message according to the user's configured style.\r
106 -       (message-cite-original))))\r
107 +       (message-cite-original)))\r
108 +\r
109 +    ;; Sign and/or encrypt replies to signed and/or encrypted messages.\r
110 +    (notmuch-mua-reply-crypto (plist-get original :body)))\r
111  \r
112    ;; Push mark right before signature, if any.\r
113    (message-goto-signature)\r
114 -- \r
115 1.9.1\r
116 \r