X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=test%2Ffrom-guessing;h=8b69cf6c7573767a7abad81b725cc39379e68eb5;hp=fab2007fdd2103fb5368a4685e79eef251128a40;hb=b7db7ea42056b96578b329db5a184c9c408062c2;hpb=ba9f9efc9a8ba9d6e509d4041a66e9a2d31171b1 diff --git a/test/from-guessing b/test/from-guessing index fab2007f..8b69cf6c 100755 --- a/test/from-guessing +++ b/test/from-guessing @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash test_description="From line heuristics (with multiple configured addresses)" . ./test-lib.sh @@ -13,7 +13,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -32,7 +31,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -51,7 +49,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -62,8 +59,8 @@ test_begin_subtest "Magic from guessing (Received: .. for ..)" add_message '[from]="Sender "' \ [to]=mailinglist@notmuchmail.org \ [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678 for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' @@ -72,7 +69,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -83,8 +79,8 @@ test_begin_subtest "Magic from guessing (Received: domain)" add_message '[from]="Sender "' \ [to]=mailinglist@notmuchmail.org \ [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.otherdomain.org (some MTA) with ESMTP id 12345678 Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' @@ -93,16 +89,37 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: > from guessing test" +test_begin_subtest "Magic from guessing (multiple Received: headers)" +add_message '[from]="Sender "' \ + [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 ; 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 +Subject: Re: notmuch-reply-test +To: Sender , mailinglist@notmuchmail.org +In-Reply-To: <${gen_msg_id}> +References: <${gen_msg_id}> + +On Tue, 05 Jan 2010 15:43:56 -0000, Sender wrote: +> from guessing test" test_begin_subtest "Testing From line heuristics (with single configured address)" sed -i -e "s/^other_email.*//" "${NOTMUCH_CONFIG}" +test_expect_equal '' '' test_begin_subtest "Magic from guessing (nothing to go on)" add_message '[from]="Sender "' \ @@ -115,7 +132,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -134,7 +150,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -153,7 +168,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -164,8 +178,8 @@ test_begin_subtest "Magic from guessing (Received: .. for ..)" add_message '[from]="Sender "' \ [to]=mailinglist@notmuchmail.org \ [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.notmuchmail.org (some MTA) with ESMTP id 12345678 for ; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' @@ -174,7 +188,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}> @@ -185,8 +198,8 @@ test_begin_subtest "Magic from guessing (Received: domain)" add_message '[from]="Sender "' \ [to]=mailinglist@notmuchmail.org \ [subject]=notmuch-reply-test \ - "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1])\ - by mail.otherdomain.org (some MTA) with ESMTP id 12345678\ + "[header]=\"Received: from mail.example.com (mail.example.com [1.1.1.1]) + by mail.otherdomain.org (some MTA) with ESMTP id 12345678 Sat, 10 Apr 2010 07:54:51 -0400 (EDT)\"" \ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \ '[body]="from guessing test"' @@ -195,7 +208,6 @@ output=$(notmuch reply id:${gen_msg_id}) test_expect_equal "$output" "From: Notmuch Test Suite Subject: Re: notmuch-reply-test To: Sender , mailinglist@notmuchmail.org -Bcc: test_suite@notmuchmail.org In-Reply-To: <${gen_msg_id}> References: <${gen_msg_id}>