[notmuch] [PATCH 1/2] Expand scope of items considered when saving attachments
authorKeith Amidon <keith@nicira.com>
Sat, 5 Dec 2009 22:53:59 +0000 (14:53 +1600)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:35:50 +0000 (09:35 -0800)
e6/7154723b995661f24f29c3b4d992b665821e2d [new file with mode: 0644]

diff --git a/e6/7154723b995661f24f29c3b4d992b665821e2d b/e6/7154723b995661f24f29c3b4d992b665821e2d
new file mode 100644 (file)
index 0000000..7dced5e
--- /dev/null
@@ -0,0 +1,96 @@
+Return-Path: <keith@nicira.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 5316D431FBC\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Dec 2009 14:54:57 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\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 msYBNShv-moj for <notmuch@notmuchmail.org>;\r
+       Sat,  5 Dec 2009 14:54:56 -0800 (PST)\r
+Received: from mout.perfora.net (mout.perfora.net [74.208.4.194])\r
+       by olra.theworths.org (Postfix) with ESMTP id C2AEE431FAE\r
+       for <notmuch@notmuchmail.org>; Sat,  5 Dec 2009 14:54:56 -0800 (PST)\r
+Received: from vps.nicira.com (66.7.219.28.static.dimenoc.com [66.7.219.28])\r
+       by mx.perfora.net (node=mxus2) with ESMTP (Nemesis)\r
+       id 0MUXvv-1Nh4yJ0ICp-00RByG for notmuch@notmuchmail.org;\r
+       Sat, 05 Dec 2009 17:54:56 -0500\r
+Received: from hq.nicira.com ([209.172.104.10]:40203 helo=kea-nicira-lt)\r
+       by vps.nicira.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69)\r
+       (envelope-from <keith@nicira.com>)\r
+       id 1NH3WW-0001wV-7p; Sat, 05 Dec 2009 17:54:53 -0500\r
+Received: by kea-nicira-lt (sSMTP sendmail emulation);\r
+       Sat, 05 Dec 2009 14:54:42 -0800\r
+From: Keith Amidon <keith@nicira.com>\r
+To: notmuch@notmuchmail.org\r
+Date: Sat,  5 Dec 2009 14:53:59 -0800\r
+Message-Id: <1260053640-10034-2-git-send-email-keith@nicira.com>\r
+X-Mailer: git-send-email 1.6.5.4\r
+In-Reply-To: <1260053640-10034-1-git-send-email-keith@nicira.com>\r
+References: <1260053640-10034-1-git-send-email-keith@nicira.com>\r
+X-AntiAbuse: This header was added to track abuse,\r
+       please include it with any abuse report\r
+X-AntiAbuse: Primary Hostname - vps.nicira.com\r
+X-AntiAbuse: Original Domain - notmuchmail.org\r
+X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12]\r
+X-AntiAbuse: Sender Address Domain - nicira.com\r
+X-Source: \r
+X-Source-Args: \r
+X-Source-Dir: \r
+X-Mailman-Approved-At: Mon, 07 Dec 2009 09:47:22 -0800\r
+Cc: Keith Amidon <keith@nicira.com>\r
+Subject: [notmuch] [PATCH 1/2] Expand scope of items considered when saving\r
+       attachments\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.12\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: Sat, 05 Dec 2009 22:54:57 -0000\r
+\r
+Previously only mime parts that indicated specified a "disposition" of\r
+"attachment" were saved.  However there are time when it is important\r
+to be able to save inline content as well.  After this commit any mime\r
+part that specifies a filename will be considered when saving\r
+attachments.\r
+---\r
+ notmuch.el |    8 ++++++--\r
+ 1 files changed, 6 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/notmuch.el b/notmuch.el\r
+index c504f46..8d51709 100644\r
+--- a/notmuch.el\r
++++ b/notmuch.el\r
+@@ -322,7 +322,9 @@ buffer."\r
+      (lambda (p)\r
+        (let ((disposition (mm-handle-disposition p)))\r
+          (and (listp disposition)\r
+-              (equal (car disposition) "attachment")\r
++              (or (equal (car disposition) "attachment")\r
++                  (and (equal (car disposition) "inline")\r
++                       (assq 'filename disposition)))\r
+               (incf count))))\r
+      mm-handle)\r
+     count))\r
+@@ -332,7 +334,9 @@ buffer."\r
+    (lambda (p)\r
+      (let ((disposition (mm-handle-disposition p)))\r
+        (and (listp disposition)\r
+-            (equal (car disposition) "attachment")\r
++            (or (equal (car disposition) "attachment")\r
++                (and (equal (car disposition) "inline")\r
++                     (assq 'filename disposition)))\r
+             (or (not queryp)\r
+                 (y-or-n-p\r
+                  (concat "Save '" (cdr (assq 'filename disposition)) "' ")))\r
+-- \r
+1.6.5.4\r
+\r