From 8c0bebedc5edbff5ddc46b66da1177ec18f48c69 Mon Sep 17 00:00:00 2001 From: Hannu Hartikainen Date: Fri, 2 Jul 2021 12:13:08 +0300 Subject: [PATCH] reply: add test for multiple Delivered-To headers Add a known broken subtest for guessing From: correctly when there are multiple Delivered-To: headers. The address configured as primary_email should get picked. --- test/T220-reply.sh | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/test/T220-reply.sh b/test/T220-reply.sh index b6d8f42a..9f711a04 100755 --- a/test/T220-reply.sh +++ b/test/T220-reply.sh @@ -245,6 +245,27 @@ On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: > From guessing OK" +test_begin_subtest "From guessing: multiple Delivered-To" +test_subtest_known_broken +add_message '[from]="Sender "' \ + '[to]="Recipient "' \ + '[subject]="From guessing"' \ + '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ + '[body]="From guessing"' \ + '[header]="Delivered-To: test_suite_other@notmuchmail.org +Delivered-To: test_suite@notmuchmail.org"' + +output=$(notmuch reply id:${gen_msg_id} 2>&1 && echo OK) +test_expect_equal "$output" "From: Notmuch Test Suite +Subject: Re: From guessing +To: Sender , Recipient +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> From guessing +OK" + test_begin_subtest "Reply with RFC 2047-encoded headers" add_message '[subject]="=?iso-8859-1?q?=e0=df=e7?="' \ '[from]="=?utf-8?q?=e2=98=83?= "' \ @@ -281,7 +302,7 @@ test_expect_equal_json "$output" ' "crypto": {}, "date_relative": "2010-01-05", "excluded": false, - "filename": ["'${MAIL_DIR}'/msg-014"], + "filename": ["'${MAIL_DIR}'/msg-015"], "headers": { "Date": "Tue, 05 Jan 2010 15:43:56 +0000", "From": "\u2603 ",