--- /dev/null
+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 olra.theworths.org (Postfix) with ESMTP id C906A431FBF\r
+ for <notmuch@notmuchmail.org>; Fri, 11 May 2012 07:32:34 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id N6f9zUSHyr7X for <notmuch@notmuchmail.org>;\r
+ Fri, 11 May 2012 07:32:33 -0700 (PDT)\r
+Received: from mail-lpp01m010-f53.google.com (mail-lpp01m010-f53.google.com\r
+ [209.85.215.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id E89C4431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 11 May 2012 07:32:32 -0700 (PDT)\r
+Received: by mail-lpp01m010-f53.google.com with SMTP id u2so2102841lag.26\r
+ for <notmuch@notmuchmail.org>; Fri, 11 May 2012 07:32:32 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=google.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references\r
+ :in-reply-to:references:x-gm-message-state;\r
+ bh=qC5c/NItUFBzSL/nL+wBx2Me/81jeJ7NiqJEvoNTnxU=;\r
+ b=ARprC1zK77cHqMPE2I2NJJq1wxBbYeRzQ2CA7oSgXvYQFFPP68TvRJIcYo1RZNQiYr\r
+ AO8Y/lPEBnRjnkg5kIS/G1y9+yAsBpFgh9Qz/HNqaHQUSot1r+qxPAjKBM6QCBJr1eYS\r
+ SlR2CYEauZGlKHcmUPc0qhqjK42ODMb2AeXZCrGE50PscIEVIiHhotxGxfnJE4020ksn\r
+ YyKWejcTKUM6JYPHh+Touq4TkdMM2An6VA86ELJgcH9daY0BV37+73wESwtrZVYXVKqj\r
+ kmqjzdc01LAkit1sRdUa2rGLaZw1Zwy6ucCSBD/1wnIRDqoFP73qfvBCYmmfS05b4k9E\r
+ T58w==\r
+Received: by 10.152.105.173 with SMTP id gn13mr8560050lab.20.1336746752440;\r
+ Fri, 11 May 2012 07:32:32 -0700 (PDT)\r
+Received: from localhost (dsl-hkibrasgw4-fe50dc00-68.dhcp.inet.fi.\r
+ [80.220.80.68])\r
+ by mx.google.com with ESMTPS id k3sm11985973lbz.4.2012.05.11.07.32.30\r
+ (version=SSLv3 cipher=OTHER); Fri, 11 May 2012 07:32:31 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 2/2] test: add tests for notmuch reply From guessing\r
+Date: Fri, 11 May 2012 17:32:23 +0300\r
+Message-Id:\r
+ <d41bbd141106f1049fd0c5462368f30ac1de8811.1336746160.git.jani@nikula.org>\r
+X-Mailer: git-send-email 1.7.9.5\r
+In-Reply-To:\r
+ <21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org>\r
+References:\r
+ <21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org>\r
+In-Reply-To:\r
+ <21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org>\r
+References:\r
+ <21a946917c5c8dd63295b7c87b7c2d1ebcb6e71e.1336746160.git.jani@nikula.org>\r
+X-Gm-Message-State:\r
+ ALoCoQntfuiIIVCvxSoMoKdOZ8W3EmS560WVu+Nn2qX4ApYSqTz47euk04b7CC7pySsWIzD657Fx\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 11 May 2012 14:32:35 -0000\r
+\r
+Add tests for picking up user's From address from fallback headers\r
+Envelope-To, X-Original-To, and Delivered-To.\r
+\r
+Signed-off-by: Jani Nikula <jani@nikula.org>\r
+---\r
+ test/reply | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 file changed, 55 insertions(+)\r
+\r
+diff --git a/test/reply b/test/reply\r
+index 00f4bea..ee5d361 100755\r
+--- a/test/reply\r
++++ b/test/reply\r
+@@ -138,4 +138,59 @@ References: <${gen_msg_id}>\r
+ \r
+ On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
+ > 200-byte header"\r
++\r
++test_begin_subtest "From guessing: Envelope-To"\r
++add_message '[from]="Sender <sender@example.com>"' \\r
++ '[to]="Recipient <recipient@example.com>"' \\r
++ '[subject]="From guessing"' \\r
++ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
++ '[body]="From guessing"' \\r
++ '[header]="Envelope-To: test_suite_other@notmuchmail.org"'\r
++\r
++output=$(notmuch reply id:${gen_msg_id})\r
++test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>\r
++Subject: Re: From guessing\r
++To: Sender <sender@example.com>, Recipient <recipient@example.com>\r
++In-Reply-To: <${gen_msg_id}>\r
++References: <${gen_msg_id}>\r
++\r
++On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
++> From guessing"\r
++\r
++test_begin_subtest "From guessing: X-Original-To"\r
++add_message '[from]="Sender <sender@example.com>"' \\r
++ '[to]="Recipient <recipient@example.com>"' \\r
++ '[subject]="From guessing"' \\r
++ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
++ '[body]="From guessing"' \\r
++ '[header]="X-Original-To: test_suite@otherdomain.org"'\r
++\r
++output=$(notmuch reply id:${gen_msg_id})\r
++test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>\r
++Subject: Re: From guessing\r
++To: Sender <sender@example.com>, Recipient <recipient@example.com>\r
++In-Reply-To: <${gen_msg_id}>\r
++References: <${gen_msg_id}>\r
++\r
++On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
++> From guessing"\r
++\r
++test_begin_subtest "From guessing: Delivered-To"\r
++add_message '[from]="Sender <sender@example.com>"' \\r
++ '[to]="Recipient <recipient@example.com>"' \\r
++ '[subject]="From guessing"' \\r
++ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
++ '[body]="From guessing"' \\r
++ '[header]="Delivered-To: test_suite_other@notmuchmail.org"'\r
++\r
++output=$(notmuch reply id:${gen_msg_id})\r
++test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>\r
++Subject: Re: From guessing\r
++To: Sender <sender@example.com>, Recipient <recipient@example.com>\r
++In-Reply-To: <${gen_msg_id}>\r
++References: <${gen_msg_id}>\r
++\r
++On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
++> From guessing"\r
++\r
+ test_done\r
+-- \r
+1.7.9.5\r
+\r