Re: [PATCH] emacs: fix MML quoting in replies
authorAustin Clements <amdragon@MIT.EDU>
Wed, 14 Mar 2012 22:08:05 +0000 (18:08 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:30 +0000 (09:45 -0800)
db/dbb73ca17486d9529257c7852241d1ea99b35f [new file with mode: 0644]

diff --git a/db/dbb73ca17486d9529257c7852241d1ea99b35f b/db/dbb73ca17486d9529257c7852241d1ea99b35f
new file mode 100644 (file)
index 0000000..66ab60f
--- /dev/null
@@ -0,0 +1,113 @@
+Return-Path: <amdragon@mit.edu>\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 67914431FAF\r
+       for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 15:08:11 -0700 (PDT)\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 fpYRoe7Gsagu for <notmuch@notmuchmail.org>;\r
+       Wed, 14 Mar 2012 15:08:10 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-2.mit.edu (DMZ-MAILSEC-SCANNER-2.MIT.EDU\r
+       [18.9.25.13])\r
+       by olra.theworths.org (Postfix) with ESMTP id B4BD4431FAE\r
+       for <notmuch@notmuchmail.org>; Wed, 14 Mar 2012 15:08:10 -0700 (PDT)\r
+X-AuditID: 1209190d-b7fbf6d0000008ba-19-4f6116c8f306\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 2C.76.02234.8C6116F4; Wed, 14 Mar 2012 18:08:08 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id q2EM87P8013018; \r
+       Wed, 14 Mar 2012 18:08:08 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+       (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q2EM85X9029698\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Wed, 14 Mar 2012 18:08:06 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+       (envelope-from <amdragon@mit.edu>)\r
+       id 1S7wMX-0000rs-O4; Wed, 14 Mar 2012 18:08:05 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Jani Nikula <jani@nikula.org>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] emacs: fix MML quoting in replies\r
+In-Reply-To: <1330849538-24558-1-git-send-email-jani@nikula.org>\r
+References: <87fwdptbir.fsf@dehydrator.spatula.rdu.redhat.com>\r
+       <1330849538-24558-1-git-send-email-jani@nikula.org>\r
+User-Agent: Notmuch/0.11.1+252~gdf1a6d5 (http://notmuchmail.org) Emacs/23.3.1\r
+       (i486-pc-linux-gnu)\r
+Date: Wed, 14 Mar 2012 18:08:05 -0400\r
+Message-ID: <87k42momyi.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrAIsWRmVeSWpSXmKPExsUixCmqrXtCLNHfYNU3LYum6c4W12/OZHZg\r
+       8rh1/zW7x7NVt5gDmKK4bFJSczLLUov07RK4Mpbe6GUsaOCpePVpLlsD40XOLkZODgkBE4mv\r
+       q6+xQdhiEhfurQeyuTiEBPYxShxc8QrK2cAo8WT/elYI5ySTxJIpj6AySxglnj6/xQzSzyag\r
+       IbFt/3JGEFtEwEri3MPXLCC2sICZxKrmw0wgNqeAg8TLXZuBajiAmoskNu4UAQmLCiRKrO+8\r
+       D1bCIqAqMfvIbLCRvEDnTT9xhBXCFpQ4OfMJ2EhmAS2JG/9eMk1gFJiFJDULSWoBI9MqRtmU\r
+       3Crd3MTMnOLUZN3i5MS8vNQiXSO93MwSvdSU0k2M4ICU5N3B+O6g0iFGAQ5GJR7erPp4fyHW\r
+       xLLiytxDjJIcTEqivL1cif5CfEn5KZUZicUZ8UWlOanFhxglOJiVRHhNQXK8KYmVValF+TAp\r
+       aQ4WJXFeVa13fkIC6YklqdmpqQWpRTBZGQ4OJQneBlGgRsGi1PTUirTMnBKENBMHJ8hwHqDh\r
+       fCIgw4sLEnOLM9Mh8qcYFaXEeXmBMS8kAJLIKM2D64UljFeM4kCvCPO+EAaq4gEmG7juV0CD\r
+       mYAGl3yLAxlckoiQkmpgTAvxD/wSciYw/Jtze2GmisCmlmdZPDNz7169r+a/bNXlFt8mG1eL\r
+       I98Yl8t+7Vy6+5ef/8UXmQv5RVokgpMr+aclMe0Iuac1I2nJcoHuGQzlcWkrP66ocbENv/5c\r
+       6m3VooWpT1/oW3/eG3Bcaa6a9O4n6YqObjsefxD0eCgtGSjxzXDBpsVvlViKMxINtZiLihMB\r
+       umAkEPMCAAA=\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: Wed, 14 Mar 2012 22:08:11 -0000\r
+\r
+On Sun,  4 Mar 2012 10:25:38 +0200, Jani Nikula <jani@nikula.org> wrote:\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
+\r
+Under what circumstances can the (re-search-forward "^$" nil t) above\r
+this code fail?  If it does fail, is it possible for the (forward-line 1)\r
+to move past an adversary-controlled line of text and fail to quote that\r
+line?\r