[WIP] tests: add test for case insensitive Content-Disposition
authorDavid Bremner <david@tethera.net>
Tue, 6 Oct 2015 10:20:46 +0000 (07:20 +2100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:43 +0000 (14:49 -0700)
3e/167b13d4c5c6141b61474694a8b36ece82ef1e [new file with mode: 0644]

diff --git a/3e/167b13d4c5c6141b61474694a8b36ece82ef1e b/3e/167b13d4c5c6141b61474694a8b36ece82ef1e
new file mode 100644 (file)
index 0000000..51ba0c8
--- /dev/null
@@ -0,0 +1,181 @@
+Return-Path: <bremner@tethera.net>\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 6346F6DE014A\r
+ for <notmuch@notmuchmail.org>; Tue,  6 Oct 2015 03:23:38 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.477\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.477 tagged_above=-999 required=5 tests=[AWL=-0.267,\r
+  URIBL_SBL=0.644, URIBL_SBL_A=0.1] 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 fMbeMFI32QaI for <notmuch@notmuchmail.org>;\r
+ Tue,  6 Oct 2015 03:23:36 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id B3EDD6DE005F\r
+ for <notmuch@notmuchmail.org>; Tue,  6 Oct 2015 03:23:35 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1ZjPMq-0003gC-Oa; Tue, 06 Oct 2015 10:21:08 +0000\r
+Received: (nullmailer pid 1998 invoked by uid 1000); Tue, 06 Oct 2015\r
+ 10:20:49 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Jani Nikula <jani@nikula.org>, David Bremner <david@tethera.net>,\r
+ Johannes Schauer <josch@debian.org>, notmuch@notmuchmail.org\r
+Subject: [WIP] tests: add test for case insensitive Content-Disposition\r
+Date: Tue,  6 Oct 2015 07:20:46 -0300\r
+Message-Id: <1444126846-1918-1-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.5.3\r
+In-Reply-To: <1443260122-5122-2-git-send-email-jani@nikula.org>\r
+References: <1443260122-5122-2-git-send-email-jani@nikula.org>\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: Tue, 06 Oct 2015 10:23:38 -0000\r
+\r
+These broken now, but will be fixed in the next commit\r
+---\r
+\r
+The first test is OK, but the second one currently fails. It isn't\r
+clear to me if content dispositions permit RFC2047 style\r
+encoding. GMime does not decode them automatically (hence this test is\r
+failing).  What is true is that the RFC states "Unrecognized\r
+disposition types should be treated as `attachment'". So maybe the\r
+logic in patch 1 should be reversed to check != 'inline'.\r
+\r
+ test/T190-multipart.sh | 109 +++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 109 insertions(+)\r
+\r
+diff --git a/test/T190-multipart.sh b/test/T190-multipart.sh\r
+index 7c4c9f7..0f55e10 100755\r
+--- a/test/T190-multipart.sh\r
++++ b/test/T190-multipart.sh\r
+@@ -763,4 +763,113 @@ test_begin_subtest "indexes mime-type #3"\r
+ output=$(notmuch search from:todd and mimetype:multipart/alternative | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2014-01-12 [1/1] Todd; odd content types (inbox unread)"\r
\r
++test_begin_subtest "case of Content-Disposition doesn't matter for indexing"\r
++test_subtest_known_broken\r
++cat <<EOF > ${MAIL_DIR}/content-disposition\r
++Return-path: <david@tethera.net>\r
++Envelope-to: david@tethera.net\r
++Delivery-date: Sun, 04 Oct 2015 09:16:03 -0300\r
++Received: from gitolite.debian.net ([87.98.215.224])\r
++      by yantan.tethera.net with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)\r
++      (Exim 4.80)\r
++      (envelope-from <david@tethera.net>)\r
++      id 1ZiiCx-0007iz-RK\r
++      for david@tethera.net; Sun, 04 Oct 2015 09:16:03 -0300\r
++Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
++      (envelope-from <david@tethera.net>)\r
++      id 1ZiiC8-0002Rz-Uf; Sun, 04 Oct 2015 12:15:12 +0000\r
++Received: (nullmailer pid 28621 invoked by uid 1000); Sun, 04 Oct 2015\r
++ 12:14:53 -0000\r
++From: David Bremner <david@tethera.net>\r
++To: David Bremner <david@tethera.net>\r
++Subject: test attachment\r
++User-Agent: Notmuch/0.20.2+93~g33c8777 (http://notmuchmail.org) Emacs/24.5.1\r
++ (x86_64-pc-linux-gnu)\r
++Date: Sun, 04 Oct 2015 09:14:53 -0300\r
++Message-ID: <87io6m96f6.fsf@zancas.localnet>\r
++MIME-Version: 1.0\r
++Content-Type: multipart/mixed; boundary="=-=-="\r
++\r
++--=-=-=\r
++Content-Type: text/plain\r
++Content-Disposition: ATTACHMENT; filename=hello.txt\r
++Content-Description: this is a very exciting file\r
++\r
++hello\r
++\r
++--=-=-=\r
++Content-Type: text/plain\r
++\r
++\r
++world\r
++\r
++--=-=-=--\r
++\r
++EOF\r
++NOTMUCH_NEW\r
++\r
++cat <<EOF > EXPECTED\r
++attachment\r
++inbox\r
++unread\r
++EOF\r
++\r
++notmuch search --output=tags id:87io6m96f6.fsf@zancas.localnet > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
++test_begin_subtest "encoded Content-Disposition header"\r
++test_subtest_known_broken\r
++cat <<EOF > ${MAIL_DIR}/content-disposition2\r
++Return-path: <david@tethera.net>\r
++Envelope-to: david@tethera.net\r
++Delivery-date: Sun, 04 Oct 2015 09:16:03 -0300\r
++Received: from gitolite.debian.net ([87.98.215.224])\r
++      by yantan.tethera.net with esmtps (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128)\r
++      (Exim 4.80)\r
++      (envelope-from <david@tethera.net>)\r
++      id 1ZiiCx-0007iz-RK\r
++      for david@tethera.net; Sun, 04 Oct 2015 09:16:03 -0300\r
++Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
++      (envelope-from <david@tethera.net>)\r
++      id 1ZiiC8-0002Rz-Uf; Sun, 04 Oct 2015 12:15:12 +0000\r
++Received: (nullmailer pid 28621 invoked by uid 1000); Sun, 04 Oct 2015\r
++ 12:14:53 -0000\r
++From: David Bremner <david@tethera.net>\r
++To: David Bremner <david@tethera.net>\r
++Subject: test attachment\r
++User-Agent: Notmuch/0.20.2+93~g33c8777 (http://notmuchmail.org) Emacs/24.5.1\r
++ (x86_64-pc-linux-gnu)\r
++Date: Sun, 04 Oct 2015 09:14:53 -0300\r
++Message-ID: <87io6m96f6.fsf.2@zancas.localnet>\r
++MIME-Version: 1.0\r
++Content-Type: multipart/mixed; boundary="=-=-="\r
++\r
++--=-=-=\r
++Content-Type: text/plain\r
++Content-Disposition: =?utf-8?b?YXR0YWNobWVudDsgZmlsZW5hbWU9ImJlZ3LDvMOfdW5n?=\r
++ =?utf-8?b?LnBkZiI=?=\r
++Content-Description: this is a very exciting file\r
++\r
++hello\r
++\r
++--=-=-=\r
++Content-Type: text/plain\r
++\r
++\r
++world\r
++\r
++--=-=-=--\r
++\r
++EOF\r
++NOTMUCH_NEW\r
++\r
++cat <<EOF > EXPECTED\r
++attachment\r
++inbox\r
++unread\r
++EOF\r
++\r
++notmuch search --output=tags id:87io6m96f6.fsf.2@zancas.localnet > OUTPUT\r
++test_expect_equal_file EXPECTED OUTPUT\r
++\r
+ test_done\r
+-- \r
+2.5.3\r
+\r