[PATCH 1/2] lib: content disposition values are not case-sensitive
authorJani Nikula <jani@nikula.org>
Sat, 26 Sep 2015 09:35:21 +0000 (12:35 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:38 +0000 (14:49 -0700)
25/5fde3754ca7c4bcf734d7ce65a43a4b6b8b5fb [new file with mode: 0644]

diff --git a/25/5fde3754ca7c4bcf734d7ce65a43a4b6b8b5fb b/25/5fde3754ca7c4bcf734d7ce65a43a4b6b8b5fb
new file mode 100644 (file)
index 0000000..a393259
--- /dev/null
@@ -0,0 +1,93 @@
+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 arlo.cworth.org (Postfix) with ESMTP id 4F42D6DE0924\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 02:37:58 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.525\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.525 tagged_above=-999 required=5 tests=[AWL=0.195,\r
+  RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01]\r
+ autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id c9jL9FXIQniP for <notmuch@notmuchmail.org>;\r
+ Sat, 26 Sep 2015 02:37:56 -0700 (PDT)\r
+Received: from mail-wi0-f171.google.com (mail-wi0-f171.google.com\r
+ [209.85.212.171])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 0ABDC6DE00AC\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 02:35:45 -0700 (PDT)\r
+Received: by wicge5 with SMTP id ge5so48404252wic.0\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 02:35:42 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=IHb2oN5B4FZk2q1bRdNtlR9rHZgU2qvg+XAFJmPm+TQ=;\r
+ b=cOZfeh7d8a6wdUGVnLE0wWoZ2cpzLE+KTZoULWh3Z3cTlbgIodNQox57y9p1+/x8ig\r
+ QuCpxVxNHQcDbBv+LvWg+gDfPpdk87OOz7GyMktOw0+VMkr+5T0EqUODzJFy2wvpdrIn\r
+ WEl2h4iq6eOd6Yw/N6oso45gIMFtseBVruFo1lTLQmcXm40iL2oxV/QkquKH+BIPhIPK\r
+ YFdg+FuEDEn4bdpnP4mCxuNGy9b+tg63+4fsdbP7sqMyk5KsIETNbTsq0FhSk8KsVUw9\r
+ LTngSgG4OC1ksaLX/tHxQmB/6Tdl8HinpF2xCMbgu2cS6Gij9su8ssRaOAGojazs+N9z\r
+ FbCQ==\r
+X-Gm-Message-State:\r
+ ALoCoQlW+0qXNQ5AhCyowipLliVq8VAGKuylcRK3dA5jiTLOMX/uRb0F3LSO5lnSLyGpFZ55T9OK\r
+X-Received: by 10.180.37.133 with SMTP id y5mr7802320wij.15.1443260142761;\r
+ Sat, 26 Sep 2015 02:35:42 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee63-221.dhcp.inet.fi.\r
+ [188.238.99.221])\r
+ by smtp.gmail.com with ESMTPSA id pk7sm7566731wjb.2.2015.09.26.02.35.40\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 26 Sep 2015 02:35:42 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, Johannes Schauer <josch@debian.org>,\r
+ notmuch@notmuchmail.org\r
+Subject: [PATCH 1/2] lib: content disposition values are not case-sensitive\r
+Date: Sat, 26 Sep 2015 12:35:21 +0300\r
+Message-Id: <1443260122-5122-1-git-send-email-jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <871tdvvoyf.fsf@tesseract.cs.unb.ca>\r
+References: <871tdvvoyf.fsf@tesseract.cs.unb.ca>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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, 26 Sep 2015 09:37:58 -0000\r
+\r
+Per RFC 2183, the values for Content-Disposition values are not\r
+case-sensitive. While at it, use the gmime function for getting at the\r
+disposition string instead of referencing the field directly.\r
+\r
+This fixes "attachment" tagging and filename term generation for\r
+attachments while indexing.\r
+---\r
+ lib/index.cc | 3 ++-\r
+ 1 file changed, 2 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/lib/index.cc b/lib/index.cc\r
+index e81aa8190288..f166aefd2fc1 100644\r
+--- a/lib/index.cc\r
++++ b/lib/index.cc\r
+@@ -377,7 +377,8 @@ _index_mime_part (notmuch_message_t *message,\r
\r
+     disposition = g_mime_object_get_content_disposition (part);\r
+     if (disposition &&\r
+-      strcmp (disposition->disposition, GMIME_DISPOSITION_ATTACHMENT) == 0)\r
++      strcasecmp (g_mime_content_disposition_get_disposition (disposition),\r
++                  GMIME_DISPOSITION_ATTACHMENT) == 0)\r
+     {\r
+       const char *filename = g_mime_part_get_filename (GMIME_PART (part));\r
\r
+-- \r
+2.1.4\r
+\r