[PATCH 07/10] test: use emacs_deliver_message in Emacs SMTP send test
authorDmitry Kurochkin <dmitry.kurochkin@gmail.com>
Tue, 28 Jun 2011 04:45:08 +0000 (08:45 +0400)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:45 +0000 (09:38 -0800)
6b/cc7bec478b4b7ffeb698afb81c937632505063 [new file with mode: 0644]

diff --git a/6b/cc7bec478b4b7ffeb698afb81c937632505063 b/6b/cc7bec478b4b7ffeb698afb81c937632505063
new file mode 100644 (file)
index 0000000..c25fcd1
--- /dev/null
@@ -0,0 +1,139 @@
+Return-Path: <dmitry.kurochkin@gmail.com>\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 01A8A429E4A\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 21:45:52 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, 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 HjB72jxnMKYf for <notmuch@notmuchmail.org>;\r
+       Mon, 27 Jun 2011 21:45:50 -0700 (PDT)\r
+Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
+       [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 9B3CC421167\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 21:45:43 -0700 (PDT)\r
+Received: by mail-bw0-f53.google.com with SMTP id 12so4889638bwg.26\r
+       for <notmuch@notmuchmail.org>; Mon, 27 Jun 2011 21:45:43 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
+       h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
+       :in-reply-to:references;\r
+       bh=U6dv3iz9dDzB5rTWhH+TaYXiEjWXUD6wx7+GbykXkqA=;\r
+       b=UK9emUzGoUM+Lmt4wNIAf7SvF7b6n/M2h9ynKW9WSQmbA0aO3VCZoP4jSEvAEjc5JR\r
+       wmENDjUkV5TrYmHX//9qICRJYrUgSFSS+mhrPBMbG6n4JrRJzz9/4qri/9vqL/4NIXkd\r
+       jWgz2K9gFz5K5NGPH9ylaSuiJz/TsxhpzLGmI=\r
+DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
+       h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
+       b=dOdMv+AH8G51bDwaeY3uVi1iQSOWY3o7vQS0K1q4nsLWTKiaCnhd8NFcgmAJ4xp1Wz\r
+       Rf/7bqE9tvOPwZUUKSEEQ1HYQamflueEIcFgmes8OX+Lm4wW5xlG97NTjMO4SA9aL1yQ\r
+       f/IWHcre6+t2dlP5/g5QGRn46EbMcWe75nxMI=\r
+Received: by 10.204.32.207 with SMTP id e15mr5104137bkd.60.1309236343321;\r
+       Mon, 27 Jun 2011 21:45:43 -0700 (PDT)\r
+Received: from localhost ([91.144.186.21])\r
+       by mx.google.com with ESMTPS id o3sm1547386bka.0.2011.06.27.21.45.42\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Mon, 27 Jun 2011 21:45:42 -0700 (PDT)\r
+From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 07/10] test: use emacs_deliver_message in Emacs SMTP send test\r
+Date: Tue, 28 Jun 2011 08:45:08 +0400\r
+Message-Id: <1309236311-2162-7-git-send-email-dmitry.kurochkin@gmail.com>\r
+X-Mailer: git-send-email 1.7.5.4\r
+In-Reply-To: <1309236311-2162-1-git-send-email-dmitry.kurochkin@gmail.com>\r
+References: <1309236311-2162-1-git-send-email-dmitry.kurochkin@gmail.com>\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: Tue, 28 Jun 2011 04:45:52 -0000\r
+\r
+Minor changes to expected results of other Emacs tests were\r
+needed because the message Date header changed.\r
+---\r
+ test/emacs |   34 +++++++++-------------------------\r
+ 1 files changed, 9 insertions(+), 25 deletions(-)\r
+\r
+diff --git a/test/emacs b/test/emacs\r
+index 4592005..409e033 100755\r
+--- a/test/emacs\r
++++ b/test/emacs\r
+@@ -118,28 +118,12 @@ output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)\r
+ test_expect_equal "$output" "thread:XXX   2001-01-05 [1/1] Notmuch Test Suite; Message with .. in Message-Id (inbox search-add show-add)"\r
\r
+ test_begin_subtest "Sending a message via (fake) SMTP"\r
+-\r
+-# Before we can send a message, we have to prepare the FCC maildir\r
+-mkdir -p mail/sent/cur\r
+-mkdir -p mail/sent/new\r
+-mkdir -p mail/sent/tmp\r
+-\r
+-../smtp-dummy sent_message &\r
+-smtp_dummy_pid=$!\r
+-test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it)\r
+-          (setq smtpmail-smtp-server \"localhost\")\r
+-          (setq smtpmail-smtp-service \"25025\")\r
+-          (notmuch-hello)\r
+-          (notmuch-mua-mail)\r
+-          (message-goto-to)\r
+-          (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\")\r
+-          (message-goto-subject)\r
+-          (insert \"Testing message sent via SMTP\")\r
+-          (message-goto-body)\r
+-          (insert \"This is a test that messages are sent via SMTP\")\r
+-          (message-send-and-exit)" >/dev/null 2>&1\r
+-wait ${smtp_dummy_pid}\r
+-\r
++emacs_deliver_message \\r
++    'Testing message sent via SMTP' \\r
++    'This is a test that messages are sent via SMTP' \\r
++    '(message-goto-to)\r
++     (kill-whole-line)\r
++     (insert "To: user@example.com\n")'\r
+ sed \\r
+     -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \\r
+     -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message >OUTPUT\r
+@@ -147,7 +131,7 @@ cat <<EOF >EXPECTED\r
+ From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
+ To: user@example.com\r
+ Subject: Testing message sent via SMTP\r
+-Date: Fri, 29 Mar 1974 10:00:00 -0000\r
++Date: 01 Jan 2000 12:00:00 -0000\r
+ User-Agent: Notmuch/XXX Emacs/XXX\r
+ Message-ID: <XXX>\r
+ MIME-Version: 1.0\r
+@@ -160,7 +144,7 @@ test_expect_equal_file OUTPUT EXPECTED\r
+ test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"\r
+ notmuch new > /dev/null\r
+ output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)\r
+-test_expect_equal "$output" "thread:XXX   1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
++test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
\r
+ test_begin_subtest "notmuch-fcc-dirs set to nil"\r
+ test_emacs "(setq notmuch-fcc-dirs nil)\r
+@@ -262,7 +246,7 @@ Subject: Re: Testing message sent via SMTP\r
+ In-Reply-To: <XXX>\r
+ Fcc: $(pwd)/mail/sent\r
+ --text follows this line--\r
+-On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
++On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
+ > This is a test that messages are sent via SMTP\r
+ EOF\r
+ test_expect_equal_file OUTPUT EXPECTED\r
+-- \r
+1.7.5.4\r
+\r