notmuch-test: Test "notmuch reply" from alternate address.
authorCarl Worth <cworth@cworth.org>
Thu, 4 Feb 2010 19:39:31 +0000 (11:39 -0800)
committerCarl Worth <cworth@cworth.org>
Thu, 4 Feb 2010 20:10:43 +0000 (12:10 -0800)
When reply to a message addresses to an address configured in the
other_email setting in the configuration file, the reply should use
that address in the From header. Test this.

test/notmuch-test

index 835545a7b738f270652ed2645faa5f85895bc74a..a771f477d7a071cc35ff0e13a9862c355699d343 100755 (executable)
@@ -163,6 +163,7 @@ path=${MAIL_DIR}
 [user]
 name=Notmuch Test Suite
 primary_email=test_suite@notmuchmail.org
+other_email=test_suite_other@notmuchmail.org
 EOF
 
 printf "Testing \"notmuch new\" in several variations:\n"
@@ -313,6 +314,24 @@ References:  <${gen_msg_id}>
 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
 > notmuch-reply-test"
 
+printf " Reply from alternate address...\t"
+generate_message '[from]="Sender <sender@example.com>"' \
+                 [to]=test_suite_other@notmuchmail.org \
+                 [subject]=notmuch-reply-test \
+                 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
+                 [body]=notmuch-reply-test    
+
+$NOTMUCH new > /dev/null
+execute_expecting "reply id:${gen_msg_id}" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
+Subject: Re: notmuch-reply-test
+To: Sender <sender@example.com>
+Bcc: test_suite@notmuchmail.org
+In-Reply-To: <${gen_msg_id}>
+References:  <${gen_msg_id}>
+
+On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
+> notmuch-reply-test"
+
 cat <<EOF
 Notmuch test suite complete.