--- /dev/null
+Return-Path: <awg@lagos.xvx.ca>\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 201C5431FD0\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Mar 2012 17:27:23 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_NONE=-0.0001] 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 RvsWILTlauGp for <notmuch@notmuchmail.org>;\r
+ Sat, 24 Mar 2012 17:27:21 -0700 (PDT)\r
+Received: from idcmail-mo2no.shaw.ca (idcmail-mo2no.shaw.ca [64.59.134.9])\r
+ by olra.theworths.org (Postfix) with ESMTP id 90760431FAF\r
+ for <notmuch@notmuchmail.org>; Sat, 24 Mar 2012 17:27:21 -0700 (PDT)\r
+Received: from lb7f8hsrpno-svcs.dcs.int.inet (HELO pd7ml3no-ssvc.prod.shaw.ca)\r
+ ([10.0.144.222])\r
+ by pd6mo1no-svcs.prod.shaw.ca with ESMTP; 24 Mar 2012 18:27:19 -0600\r
+X-Cloudmark-SP-Filtered: true\r
+X-Cloudmark-SP-Result: v=1.1 cv=aDUJ/pRHNXkohnfhaDKKve0FfU8uPxX8npdo6G126bI=\r
+ c=1 sm=1\r
+ a=iDS7w7XbxqMA:10 a=BLceEmwcHowA:10 a=yQp6g8lIsgqumF79BAsFDg==:17\r
+ a=7343-z1_AAAA:8 a=A1X0JdhQAAAA:8 a=1ozStsCKCd0xQMKWjKkA:9\r
+ a=0c-eHkXYtrgA:10 a=Y6qChIQXU1wA:10 a=b78p_PsnVuVXcX8E:21\r
+ a=3lUvF6MWi1r_zXaT:21 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117\r
+Received: from unknown (HELO lagos.xvx.ca) ([96.52.216.56])\r
+ by pd7ml3no-dmz.prod.shaw.ca with ESMTP; 24 Mar 2012 18:27:19 -0600\r
+Received: by lagos.xvx.ca (Postfix, from userid 1000)\r
+ id 0E82E800422C; Sat, 24 Mar 2012 18:27:18 -0600 (MDT)\r
+From: Adam Wolfe Gordon <awg+notmuch@xvx.ca>\r
+To: notmuch@notmuchmail.org\r
+Subject: [BUG/PATCH 1/2] test: Tests for reply from alternate addresses in\r
+ emacs\r
+Date: Sat, 24 Mar 2012 18:27:11 -0600\r
+Message-Id: <1332635232-15269-2-git-send-email-awg+notmuch@xvx.ca>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1332635232-15269-1-git-send-email-awg+notmuch@xvx.ca>\r
+References: <1332635232-15269-1-git-send-email-awg+notmuch@xvx.ca>\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: Sun, 25 Mar 2012 00:27:23 -0000\r
+\r
+Since the recent reply changes were pushed, there has been a bug that\r
+causes emacs to always reply from the primary address, even if the\r
+JSON or default CLI reply output uses an alternate address.\r
+\r
+This adds two tests to the emacs test library based on the two "Reply\r
+form..." tests in the reply test library. One is currently marked\r
+broken.\r
+---\r
+ test/emacs | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+ 1 files changed, 52 insertions(+), 0 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 8a28705..fa5d706 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -274,6 +274,58 @@ Notmuch Test Suite <test_suite@notmuchmail.org> writes:\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+ \r
++test_begin_subtest "Reply from alternate address within emacs"\r
++test_subtest_known_broken\r
++add_message '[from]="Sender <sender@example.com>"' \\r
++ [to]=test_suite_other@notmuchmail.org \\r
++ [subject]=notmuch-reply-test \\r
++ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
++ '[body]="reply from alternate address"'\r
++\r
++test_emacs "(notmuch-search \"id:\\\"${gen_msg_id}\\\"\")\r
++ (notmuch-test-wait)\r
++ (notmuch-search-reply-to-thread)\r
++ (test-output)"\r
++sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite_other@notmuchmail.org>\r
++To: Sender <sender@example.com>\r
++Subject: Re: notmuch-reply-test\r
++In-Reply-To: <XXX>\r
++Fcc: ${MAIL_DIR}/sent\r
++--text follows this line--\r
++Sender <sender@example.com> writes:\r
++\r
++> reply from alternate address\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
++test_begin_subtest "Reply from address in named group list within emacs"\r
++add_message '[from]="Sender <sender@example.com>"' \\r
++ '[to]=group:test_suite@notmuchmail.org,someone@example.com\;' \\r
++ [cc]=test_suite_other@notmuchmail.org \\r
++ [subject]=notmuch-reply-test \\r
++ '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
++ '[body]="Reply from address in named group list"'\r
++\r
++test_emacs "(notmuch-search \"id:\\\"${gen_msg_id}\\\"\")\r
++ (notmuch-test-wait)\r
++ (notmuch-search-reply-to-thread)\r
++ (test-output)"\r
++sed -i -e 's/^In-Reply-To: <.*>$/In-Reply-To: <XXX>/' OUTPUT\r
++cat <<EOF >EXPECTED\r
++From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
++To: Sender <sender@example.com>, someone@example.com\r
++Subject: Re: notmuch-reply-test\r
++In-Reply-To: <XXX>\r
++Fcc: ${MAIL_DIR}/sent\r
++--text follows this line--\r
++Sender <sender@example.com> writes:\r
++\r
++> Reply from address in named group list\r
++EOF\r
++test_expect_equal_file OUTPUT EXPECTED\r
++\r
+ test_begin_subtest "Reply within emacs to a multipart/mixed message"\r
+ test_emacs '(notmuch-show "id:20091118002059.067214ed@hikari")\r
+ (notmuch-show-reply)\r
+-- \r
+1.7.5.4\r
+\r