[PATCH v2 01/14] test: add known broken test for reply to message with multiple Cc...
authorJani Nikula <jani@nikula.org>
Sat, 13 Aug 2016 11:37:25 +0000 (14:37 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:22:24 +0000 (16:22 -0700)
f5/2fbd23bd082a2ba0342546504f5a6b52eec929 [new file with mode: 0644]

diff --git a/f5/2fbd23bd082a2ba0342546504f5a6b52eec929 b/f5/2fbd23bd082a2ba0342546504f5a6b52eec929
new file mode 100644 (file)
index 0000000..197dae4
--- /dev/null
@@ -0,0 +1,140 @@
+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 813CF6DE38DE\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:14 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.287\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.287 tagged_above=-999 required=5 tests=[AWL=1.007, \r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] 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 A4O2DLaEoskB for <notmuch@notmuchmail.org>;\r
+ Sat, 13 Aug 2016 04:39:05 -0700 (PDT)\r
+Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
+ [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id ED02E6DE3856 for\r
+ <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:04 -0700 (PDT)\r
+Received: by mail-wm0-f67.google.com with SMTP id i5so2016185wmg.2\r
+ for <notmuch@notmuchmail.org>; Sat, 13 Aug 2016 04:39:04 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:cc:subject:date:message-id:in-reply-to:references\r
+ :in-reply-to:references;\r
+ bh=MqUvdPEzLcM1AS99XOhBgD9cHCnU0FvV2NoTJNRdIJM=;\r
+ b=qn4O3wb+YSpif6ZLd9oPuwyfHL/OUPOEJEBe/UAJQi8aLy5IVsS7Jk7yRF9WkiQjEm\r
+ YTHX3Sg62vfiDOyPdDO73gWSdoAe5/vY+nt0Ql/6iBl7QbjKeMaFZbqHD1mlstpwe1Cs\r
+ ZCov9RMoq+ObyDcWVA7UO2jpWPuzlHa29/FjgSvtsYDkNNafoVFTYom4+9Kpos6CcbJ1\r
+ eY2ONvJvHpBUBLr6F+/Tt+hLa6+9qRuevgjSLJ+t1M3G01wSLJCAypbb46RiGS8hXHag\r
+ lkAfRyHjz65YnR8VSzK/zcIPPkvzdWvvEmPOO0FqE2uUmevSdielU4ds2UBGqOayA3sR\r
+ EDUw==\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:cc:subject:date:message-id:in-reply-to\r
+ :references:in-reply-to:references;\r
+ bh=MqUvdPEzLcM1AS99XOhBgD9cHCnU0FvV2NoTJNRdIJM=;\r
+ b=OyclY3Ey4+i9sWRyuMIOPZP/o6g60KAhErKlBp2NIkYcPEzEQA40cUvdKCXmIFN1mp\r
+ uMZd4qvY7n3NEed3WOBCHZFryaYjVmVBL23NF3QofzJKr7g5ewms6G+bcyKX0sZVEnoc\r
+ mGOJUvQ8f+kwypHLE/5C7l4lW7wMMgSyTE55pMpuI06N39cg2Vz/E6WNJlNNDuKqUNkb\r
+ d+ui6ZsIpC3RW+kTlZeXjXRBkECuyeWghv8udQANDFBFLE5taue0JUOMf7PyLNJt0pOO\r
+ /OyzDyW7yRvnv8yM2pZsMTG4XKxrtoUYvKaAKQIAyH3nq8FPpSH98ACOKhjxxLq9k+hP\r
+ sq7Q==\r
+X-Gm-Message-State:\r
+ AEkoout3UZLNPHyWC7hZggnTX8WY0tFPmSuxtcojUB7VeSUbWsDA0LAn6KNvP8zl/LGhgw==\r
+X-Received: by 10.195.13.18 with SMTP id eu18mr19662613wjd.121.1471088343587; \r
+ Sat, 13 Aug 2016 04:39:03 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw2-58c368-70.dhcp.inet.fi.\r
+ [88.195.104.70])\r
+ by smtp.gmail.com with ESMTPSA id d7sm11802590wjg.13.2016.08.13.04.39.02\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Sat, 13 Aug 2016 04:39:03 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Cc: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+       jani@nikula.org\r
+Subject: [PATCH v2 01/14] test: add known broken test for reply to message\r
+ with multiple Cc headers\r
+Date: Sat, 13 Aug 2016 14:37:25 +0300\r
+Message-Id:\r
+ <8c280fe978c12eccb662b0ebc97d9d3c794f6688.1471088022.git.jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <cover.1471088022.git.jani@nikula.org>\r
+References: <cover.1471088022.git.jani@nikula.org>\r
+In-Reply-To: <cover.1471088022.git.jani@nikula.org>\r
+References: <cover.1471088022.git.jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Sat, 13 Aug 2016 11:39:14 -0000\r
+\r
+As Daniel Kahn Gillmor <dkg@fifthhorseman.net> reports in\r
+id:87d1ngv95p.fsf@alice.fifthhorseman.net, notmuch show combines\r
+multiple Cc: fields into one, while notmuch reply does not. While such\r
+messages are in violation of RFC 5322, it would be reasonable to\r
+expect notmuch to be consistent. Add a known broken test to document\r
+this expectation.\r
+\r
+Details:\r
+\r
+The original message is formatted using the message printing in\r
+notmuch-show.c. For Cc:, it uses g_mime_message_get_recipients(),\r
+which apparently combines all Cc: fields into one internally.\r
+\r
+The addresses in the reply headers, OTOH, are based on headers queried\r
+through libnotmuch. It boils down to g_mime_object_get_header() in\r
+lib/message-file.c, which returns only the first occurence of header.\r
+---\r
+ test/T220-reply.sh | 25 +++++++++++++++++++++++++\r
+ 1 file changed, 25 insertions(+)\r
+\r
+diff --git a/test/T220-reply.sh b/test/T220-reply.sh\r
+index 30b78f679d97..d6f3a839ca48 100755\r
+--- a/test/T220-reply.sh\r
++++ b/test/T220-reply.sh\r
+@@ -253,5 +253,30 @@ test_expect_equal_json "$output" '\r
+     }\r
+ }'\r
\r
++test_begin_subtest "Reply to a message with multiple Cc headers"\r
++test_subtest_known_broken\r
++cat > "${MAIL_DIR}"/broken_cc <<EOF\r
++From: Alice <alice@example.org>\r
++To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
++Cc: Bob <bob@example.org>\r
++Subject: wowsers!\r
++cc: Charles <charles@example.org>\r
++Message-Id: <abc123@example.org>\r
++Date: Thu, 16 Jun 2016 22:14:41 -0400\r
++\r
++Note the Cc: and cc: headers.\r
++EOF\r
++notmuch new >/dev/null\r
++output=$(notmuch reply id:abc123@example.org)\r
++notmuch reply id:abc123@example.com\r
++test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++Subject: Re: wowsers!\r
++To: Alice <alice@example.org>, Daniel Kahn Gillmor <dkg@fifthhorseman.net>\r
++Cc: Bob <bob@example.org>, Charles <charles@example.org>\r
++In-Reply-To: <abc123@example.org>\r
++References: <abc123@example.org>\r
++\r
++On Thu, 16 Jun 2016 22:14:41 -0400, Alice <alice@example.org> wrote:\r
++> Note the Cc: and cc: headers."\r
\r
+ test_done\r
+-- \r
+2.1.4\r
+\r