summaryrefslogtreecommitdiffstats
path: root/test/T220-reply.sh
diff options
context:
space:
mode:
authorJani Nikula <jani@nikula.org>2016-09-13 20:14:09 +0300
committerDavid Bremner <david@tethera.net>2016-09-17 08:41:29 -0300
commit36416c74e09d07fe3dfff79900171f15c4671412 (patch)
treecad9b05c05353435c79842a0152a3ca8335ce954 /test/T220-reply.sh
parent971cdc72cdb80f060193bc0914dc9badcc29696b (diff)
test: add known broken test for reply to message with multiple Cc headers
As Daniel Kahn Gillmor <dkg@fifthhorseman.net> reports in id:87d1ngv95p.fsf@alice.fifthhorseman.net, notmuch show combines multiple Cc: fields into one, while notmuch reply does not. While such messages are in violation of RFC 5322, it would be reasonable to expect notmuch to be consistent. Add a known broken test to document this expectation. This also starts a new "broken" corpus for messages which are broken. Details: The original message is formatted using the message printing in notmuch-show.c. For Cc:, it uses g_mime_message_get_recipients(), which apparently combines all Cc: fields into one internally. The addresses in the reply headers, OTOH, are based on headers queried through libnotmuch. It boils down to g_mime_object_get_header() in lib/message-file.c, which returns only the first occurence of header.
Diffstat (limited to 'test/T220-reply.sh')
-rwxr-xr-xtest/T220-reply.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/T220-reply.sh b/test/T220-reply.sh
index 30b78f67..a72068dd 100755
--- a/test/T220-reply.sh
+++ b/test/T220-reply.sh
@@ -253,5 +253,18 @@ test_expect_equal_json "$output" '
}
}'
+test_begin_subtest "Reply to a message with multiple Cc headers"
+test_subtest_known_broken
+add_email_corpus broken
+output=$(notmuch reply id:multiple-cc@example.org)
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
+Subject: Re: wowsers!
+To: Alice <alice@example.org>, Daniel <daniel@example.org>
+Cc: Bob <bob@example.org>, Charles <charles@example.org>
+In-Reply-To: <multiple-cc@example.org>
+References: <multiple-cc@example.org>
+
+On Thu, 16 Jun 2016 22:14:41 -0400, Alice <alice@example.org> wrote:
+> Note the Cc: and cc: headers."
test_done