[RFC PATCH] test: add devel/test-in-docker.sh
[notmuch-archives.git] / ee / 26490d51a310518fbe26e6a9d95cb9b7c69179
1 Return-Path: <tbielawa@redhat.com>\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 023B4431FAF\r
6         for <notmuch@notmuchmail.org>; Sat,  3 Mar 2012 14:04:24 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -5\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-5 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_HI=-5] 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 XsH9TmQCrV49 for <notmuch@notmuchmail.org>;\r
16         Sat,  3 Mar 2012 14:04:24 -0800 (PST)\r
17 Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28])\r
18         by olra.theworths.org (Postfix) with ESMTP id 527AC431FAE\r
19         for <notmuch@notmuchmail.org>; Sat,  3 Mar 2012 14:04:24 -0800 (PST)\r
20 Received: from int-mx09.intmail.prod.int.phx2.redhat.com\r
21         (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22])\r
22         by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q23M4NF1018015\r
23         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)\r
24         for <notmuch@notmuchmail.org>; Sat, 3 Mar 2012 17:04:23 -0500\r
25 Received: from localhost.localdomain (ovpn-113-28.phx2.redhat.com\r
26         [10.3.113.28])\r
27         by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP\r
28         id q23M4MVC007561\r
29         (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)\r
30         for <notmuch@notmuchmail.org>; Sat, 3 Mar 2012 17:04:23 -0500\r
31 From: Tim Bielawa <tbielawa@redhat.com>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH] Fix mml-quoting in responses where pgp-signing is enabled\r
34 Date: Sat,  3 Mar 2012 17:04:22 -0500\r
35 Message-Id: <1330812262-28272-1-git-send-email-tbielawa@redhat.com>\r
36 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22\r
37 X-BeenThere: notmuch@notmuchmail.org\r
38 X-Mailman-Version: 2.1.13\r
39 Precedence: list\r
40 List-Id: "Use and development of the notmuch mail system."\r
41         <notmuch.notmuchmail.org>\r
42 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
44 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
45 List-Post: <mailto:notmuch@notmuchmail.org>\r
46 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
47 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
48         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
49 X-List-Received-Date: Sat, 03 Mar 2012 22:04:25 -0000\r
50 \r
51 The addition of mml-quote-region (notmuch-mua.el) in 2c6710e3 breaks\r
52 automatic signing in replies. When replies are mml-quoted and signing\r
53 is enabled by default the "<#part sign=pgpmime>" string will appear on\r
54 line 1. This will be consumed during the application of the\r
55 mml-quote-region function and transform into the inert string\r
56 "<#!part sign=pgpmime>". The result is that responses will no longer\r
57 be signed by default.\r
58 \r
59 This fix moves the point forward one line before applying the quoting\r
60 function.\r
61 \r
62 Consideration: Clients not signing mail by default. The first line of\r
63 their responses would be skipped when the quoting function is\r
64 applied. This string takes this general form:\r
65 \r
66     On Sat, 03 Mar 2012 12:55:14 -0800, notmuch-request@notmuchmail.org wrote:\r
67 \r
68 Because the string is generated by notmuch I don't believe this fix\r
69 introduces the possibility for malicious mml commands being omitted\r
70 from the quoting.\r
71 ---\r
72  emacs/notmuch-mua.el |   15 +++++++++++++--\r
73  1 files changed, 13 insertions(+), 2 deletions(-)\r
74 \r
75 diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
76 index 4be7c13..d8ab2c0 100644\r
77 --- a/emacs/notmuch-mua.el\r
78 +++ b/emacs/notmuch-mua.el\r
79 @@ -114,14 +114,25 @@ list."\r
80        (goto-char (point-max)))\r
81      (insert body)\r
82      (push-mark))\r
83 -  (set-buffer-modified-p nil)\r
84  \r
85    (message-goto-body)\r
86    ;; Original message may contain (malicious) MML tags.  We must\r
87    ;; properly quote them in the reply.  Note that using `point-max'\r
88    ;; instead of `mark' here is wrong.  The buffer may include user's\r
89    ;; signature which should not be MML-quoted.\r
90 -  (mml-quote-region (point) (mark)))\r
91 +  ;;\r
92 +  ;; Note also that we skip the first line of the response as it is\r
93 +  ;; either: the "<#part sign=pgpmime>" string when clients use\r
94 +  ;; automatic signing, or it is the generated string from notmuch\r
95 +  ;; indicating the date and author of the message which is being\r
96 +  ;; responded to, "on date x, y z -0000, foo@bar.com wrote:"\r
97 +  (forward-line 1)\r
98 +  (mml-quote-region (point) (mark))\r
99 +\r
100 +  ;; Quoting the message may modify the contents of the buffer,\r
101 +  ;; however, we shouldn't consider mml-quoting a modification because\r
102 +  ;; it's preformed by the mua, not the user.\r
103 +  (set-buffer-modified-p nil))\r
104  \r
105  (defun notmuch-mua-forward-message ()\r
106    (message-forward)\r
107 -- \r
108 1.7.4.4\r
109 \r