[PATCH] emacs: fix MML quoting in replies
authorJani Nikula <jani@nikula.org>
Sun, 4 Mar 2012 08:25:38 +0000 (10:25 +0200)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:14 +0000 (09:45 -0800)
a1/d48298ac66e37a3695fa26f57fdb4d288ea1d4 [new file with mode: 0644]

diff --git a/a1/d48298ac66e37a3695fa26f57fdb4d288ea1d4 b/a1/d48298ac66e37a3695fa26f57fdb4d288ea1d4
new file mode 100644 (file)
index 0000000..edb0533
--- /dev/null
@@ -0,0 +1,114 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id D87DF431FAF\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Mar 2012 00:25:45 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 7TBKAv37peMJ for <notmuch@notmuchmail.org>;\r
+       Sun,  4 Mar 2012 00:25:45 -0800 (PST)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+       [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id EC042431FAE\r
+       for <notmuch@notmuchmail.org>; Sun,  4 Mar 2012 00:25:44 -0800 (PST)\r
+Received: by lahc1 with SMTP id c1so3802307lah.26\r
+       for <notmuch@notmuchmail.org>; Sun, 04 Mar 2012 00:25:42 -0800 (PST)\r
+Received-SPF: pass (google.com: domain of jani@nikula.org designates\r
+       10.112.44.225 as permitted sender) client-ip=10.112.44.225; \r
+Authentication-Results: mr.google.com;\r
+       spf=pass (google.com: domain of jani@nikula.org\r
+       designates 10.112.44.225 as permitted sender)\r
+       smtp.mail=jani@nikula.org\r
+Received: from mr.google.com ([10.112.44.225])\r
+       by 10.112.44.225 with SMTP id h1mr7629690lbm.34.1330849542073 (num_hops\r
+       = 1); Sun, 04 Mar 2012 00:25:42 -0800 (PST)\r
+MIME-Version: 1.0\r
+Received: by 10.112.44.225 with SMTP id h1mr6321557lbm.34.1330849541999;\r
+       Sun, 04 Mar 2012 00:25:41 -0800 (PST)\r
+Received: from localhost (dsl-hkibrasgw4-fe50f800-253.dhcp.inet.fi.\r
+       [84.248.80.253])\r
+       by mx.google.com with ESMTPS id k4sm17000996lbw.10.2012.03.04.00.25.39\r
+       (version=SSLv3 cipher=OTHER); Sun, 04 Mar 2012 00:25:40 -0800 (PST)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: fix MML quoting in replies\r
+Date: Sun,  4 Mar 2012 10:25:38 +0200\r
+Message-Id: <1330849538-24558-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <87fwdptbir.fsf@dehydrator.spatula.rdu.redhat.com>\r
+References: <87fwdptbir.fsf@dehydrator.spatula.rdu.redhat.com>\r
+X-Gm-Message-State:\r
+ ALoCoQlRL9vUDPWI+xdOiwaE6CDp+OiT4/v+jQ0+D/kETzO00E6yzRVsd7MXu2oLcX+45mCsmlmm\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sun, 04 Mar 2012 08:25:46 -0000\r
+\r
+The reply MML quoting added in commit ae438cc unintentionally MML\r
+quotes also the signature/encryption MML tags added via\r
+message-setup-hook, causing the reply not to be signed/encrypted.\r
+\r
+MML quote just the original message in the temp buffer before\r
+inserting it to the message buffer, to not interfere with message mode\r
+hooks or message construction in general.\r
+\r
+See [1] and [2] for bug reports.\r
+\r
+Thanks to Tim Bielawa <tbielawa@redhat.com> for testing.\r
+\r
+[1] id:"87hay78x6l.fsf@wyzanski.jamesvasile.com"\r
+[2] id:"1330812262-28272-1-git-send-email-tbielawa@redhat.com".\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ emacs/notmuch-mua.el |   10 ++++------\r
+ 1 files changed, 4 insertions(+), 6 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 4be7c13..13244eb 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -95,6 +95,9 @@ list."\r
+             (goto-char (point-min))\r
+             (setq headers (mail-header-extract)))))\r
+       (forward-line 1)\r
++      ;; Original message may contain (malicious) MML tags. We must\r
++      ;; properly quote them in the reply.\r
++      (mml-quote-region (point) (point-max))\r
+       (setq body (buffer-substring (point) (point-max))))\r
+     ;; If sender is non-nil, set the From: header to its value.\r
+     (when sender\r
+@@ -116,12 +119,7 @@ list."\r
+     (push-mark))\r
+   (set-buffer-modified-p nil)\r
+ \r
+-  (message-goto-body)\r
+-  ;; Original message may contain (malicious) MML tags.  We must\r
+-  ;; properly quote them in the reply.  Note that using `point-max'\r
+-  ;; instead of `mark' here is wrong.  The buffer may include user's\r
+-  ;; signature which should not be MML-quoted.\r
+-  (mml-quote-region (point) (mark)))\r
++  (message-goto-body))\r
+ \r
+ (defun notmuch-mua-forward-message ()\r
+   (message-forward)\r
+-- \r
+1.7.5.4\r
+\r