aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/from-guessing
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2011-06-10 16:53:45 -0700
committerGravatar Carl Worth <cworth@cworth.org>2011-06-10 17:03:14 -0700
commitac43a96988091d1ac7356e618b496ff8eef5a31c (patch)
tree54d4eda9cfa3eac9098e4bbad840b4ff7734bb4c /test/from-guessing
parentd5edb1122db86dadd0d98dd8ccf3431e4d021337 (diff)
test: Extend from-guessing test with a test with multiple Received headers
This is much more realistic, as most messages in the wild will have multiple Received headers. Also, this demonstrates a current bug in the Received header parsing, (multiple Received headers are not properly concatenated depending on the order in which headers are parsed in a message).
Diffstat (limited to 'test/from-guessing')
-rwxr-xr-xtest/from-guessing21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/from-guessing b/test/from-guessing
index d8727bbf..e0f25b5c 100755
--- a/test/from-guessing
+++ b/test/from-guessing
@@ -95,6 +95,27 @@ References: <${gen_msg_id}>
On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
> from guessing test"
+test_begin_subtest "Magic from guessing (multiple Received: headers)"
+add_message '[from]="Sender <sender@example.com>"' \
+ [to]=mailinglist@notmuchmail.org \
+ [subject]=notmuch-reply-test \
+ "[header]=\"Received: from extraneous.example.com (extraneous.example.com [1.1.1.1])
+Received: from mail.example.com (mail.example.com [1.1.1.1])
+ by mail.otherdomain.org (some MTA) with ESMTP id 12345678
+ for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)
+Received: from extraneous.example.com (extraneous.example.com [1.1.1.1])\"" \
+ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \
+ '[body]="from guessing test"'
+
+output="$(notmuch reply id:${gen_msg_id})"
+test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
+Subject: Re: notmuch-reply-test
+To: Sender <sender@example.com>, mailinglist@notmuchmail.org
+In-Reply-To: <${gen_msg_id}>
+References: <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:
+> from guessing test"
test_begin_subtest "Testing From line heuristics (with single configured address)"
sed -i -e "s/^other_email.*//" "${NOTMUCH_CONFIG}"