[PATCH] emacs: Quote MML tags in replies
authorAaron Ecay <aaronecay@gmail.com>
Thu, 19 Jan 2012 18:43:09 +0000 (13:43 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:42:42 +0000 (09:42 -0800)
84/d3fe1ebecb1ec5ab1670b1c8cb5afddbbbbf4c [new file with mode: 0644]

diff --git a/84/d3fe1ebecb1ec5ab1670b1c8cb5afddbbbbf4c b/84/d3fe1ebecb1ec5ab1670b1c8cb5afddbbbbf4c
new file mode 100644 (file)
index 0000000..19711dc
--- /dev/null
@@ -0,0 +1,101 @@
+Return-Path: <aaronecay@gmail.com>\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 6C4FC431FAF\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 10:43:17 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 y-Md3tz8NJQ8 for <notmuch@notmuchmail.org>;\r
+       Thu, 19 Jan 2012 10:43:16 -0800 (PST)\r
+Received: from mail-qy0-f181.google.com (mail-qy0-f181.google.com\r
+       [209.85.216.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id A07AE431FAE\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 10:43:16 -0800 (PST)\r
+Received: by qcpx40 with SMTP id x40so154166qcp.26\r
+       for <notmuch@notmuchmail.org>; Thu, 19 Jan 2012 10:43:16 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=from:to:subject:date:message-id:x-mailer:mime-version:content-type\r
+       :content-transfer-encoding;\r
+       bh=3PgMI83KguoV5yzly1gVPfqpp37bwHfEaidqI9QwmkU=;\r
+       b=IPBkSktLS1ogFxvC9gotQOEerWIwm2WqsLngHCiOmkNBhHj72qQ9KRhA+qiHoTApOE\r
+       f4/dtRCRayt+CTVxoXk7HQPg9RqR7guu4KO/hkWGovN5UZ/sMyX5hP+geVUrOBLGz7VN\r
+       mGRBz3tN1NaD1bdMT/jHRK99RPkq4Fx3QEKVQ=\r
+Received: by 10.224.197.5 with SMTP id ei5mr16556315qab.73.1326998596033;\r
+       Thu, 19 Jan 2012 10:43:16 -0800 (PST)\r
+Received: from wal016.wlan.sas.upenn.edu (wal016.wlan.sas.upenn.edu.\r
+       [128.91.71.145])\r
+       by mx.google.com with ESMTPS id dh10sm1294457qab.19.2012.01.19.10.43.14\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Thu, 19 Jan 2012 10:43:15 -0800 (PST)\r
+From: Aaron Ecay <aaronecay@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: Quote MML tags in replies\r
+Date: Thu, 19 Jan 2012 13:43:09 -0500\r
+Message-Id: <1326998589-37187-1-git-send-email-aaronecay@gmail.com>\r
+X-Mailer: git-send-email 1.7.8.3\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=UTF-8\r
+Content-Transfer-Encoding: 8bit\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: Thu, 19 Jan 2012 18:43:17 -0000\r
+\r
+Emacs message-mode uses certain text strings to indicate how to attach\r
+files to outgoing mail.  If these are present in the text of an email,\r
+and a user is tricked into replying to the message, the user’s files\r
+could be exposed.\r
+---\r
+\r
+To demonstrate this, open a reply to this message then remove the\r
+exclamation marks after the hash marks below.  Create a file in your\r
+home directory called passwd.  Then press C-u M-x mml-preview.  A\r
+(possibly base64-encoded) version of your ~/passwd file will replace\r
+the following lines:\r
+\r
+<#!part type="application/octet-stream" filename="~/passwd"\r
+disposition=attachment description=foo>\r
+<#!/part>\r
+\r
+It works equally well (and more dangerously) with /etc/passwd, but I\r
+didn't use that filename here to avoid the danger of someone\r
+accidentally attaching their /etc/passwd to a reply in this thread!\r
+\r
+ emacs/notmuch-mua.el |    3 ++-\r
+ 1 files changed, 2 insertions(+), 1 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index d8ab822..c25c6b9 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -115,7 +115,8 @@ list."\r
+     (push-mark))\r
+   (set-buffer-modified-p nil)\r
\r
+-  (message-goto-body))\r
++  (message-goto-body)\r
++  (mml-quote-region (point) (mark)))\r
\r
+ (defun notmuch-mua-forward-message ()\r
+   (message-forward)\r
+-- \r
+1.7.8.3\r
+\r