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