Re: [feature request] emacs: use `notmuch insert` for FCC
[notmuch-archives.git] / e2 / dfaf1393c79c57e36e745e284312a397e54ed6
1 Return-Path: <dmitry.kurochkin@gmail.com>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id C2F8C429E2E\r
6         for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 20:54:28 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -0.799\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
12         tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
13         FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id IRS1r6AJ0AZz for <notmuch@notmuchmail.org>;\r
17         Sun, 26 Jun 2011 20:54:27 -0700 (PDT)\r
18 Received: from mail-bw0-f53.google.com (mail-bw0-f53.google.com\r
19         [209.85.214.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id 74CCC431FD0\r
22         for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 20:54:27 -0700 (PDT)\r
23 Received: by bwg12 with SMTP id 12so3975366bwg.26\r
24         for <notmuch@notmuchmail.org>; Sun, 26 Jun 2011 20:54:25 -0700 (PDT)\r
25 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;\r
26         h=domainkey-signature:from:to:cc:subject:date:message-id:x-mailer\r
27         :in-reply-to:references;\r
28         bh=/r5jJrUuGuDqfRQIE5Evpg1/b3QAUDpHbQcECQEdy3w=;\r
29         b=ckyt/0hLW9Sr2owCxMZpCROYVNB2zpyFfgBKcOAaXqji9irHb5t7gAyYA9aA4hQDl4\r
30         Ok/D5SzaT7Zj7UJoqxC9MLbh3T0ezHgZgHrddodS9DrVvljpNrgX+L4rYrwlg3TmTgs3\r
31         y3apmNeE54bmcS0t209SiA9nuC5g0eZ8oIVt4=\r
32 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma;\r
33         h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references;\r
34         b=HRrsqezT2pk1e+iB0EhUmUHELGo3+vad2fCfd3ClfdUPJdavmiyMiSse8BbKxYeIsi\r
35         5E1Crh3R7lMyXuoDj9BuA0PdR6kv982NJk/t3Kjz4GgBa5aDfeKu1Am6Ck0VI0obvHli\r
36         iKfTj+lpwfxWDyKVL2JttZV0xspi+PHdmYS1g=\r
37 Received: by 10.204.156.25 with SMTP id u25mr2446868bkw.43.1309146865721;\r
38         Sun, 26 Jun 2011 20:54:25 -0700 (PDT)\r
39 Received: from localhost ([91.144.186.21])\r
40         by mx.google.com with ESMTPS id ag6sm3780629bkc.6.2011.06.26.20.54.24\r
41         (version=TLSv1/SSLv3 cipher=OTHER);\r
42         Sun, 26 Jun 2011 20:54:24 -0700 (PDT)\r
43 From: Dmitry Kurochkin <dmitry.kurochkin@gmail.com>\r
44 To: notmuch@notmuchmail.org\r
45 Subject: [PATCH 1/2] test: use emacs_deliver_message in Emacs SMTP send test\r
46 Date: Mon, 27 Jun 2011 07:54:05 +0400\r
47 Message-Id: <1309146846-30991-1-git-send-email-dmitry.kurochkin@gmail.com>\r
48 X-Mailer: git-send-email 1.7.5.4\r
49 In-Reply-To: <1309132379-24089-1-git-send-email-dmitry.kurochkin@gmail.com>\r
50 References: <1309132379-24089-1-git-send-email-dmitry.kurochkin@gmail.com>\r
51 X-BeenThere: notmuch@notmuchmail.org\r
52 X-Mailman-Version: 2.1.13\r
53 Precedence: list\r
54 List-Id: "Use and development of the notmuch mail system."\r
55         <notmuch.notmuchmail.org>\r
56 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
57         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
58 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
59 List-Post: <mailto:notmuch@notmuchmail.org>\r
60 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
61 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
62         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
63 X-List-Received-Date: Mon, 27 Jun 2011 03:54:28 -0000\r
64 \r
65 Minor changes to expected results of other Emacs tests were\r
66 needed because the message Date header changed.\r
67 ---\r
68  test/emacs |   34 +++++++++-------------------------\r
69  1 files changed, 9 insertions(+), 25 deletions(-)\r
70 \r
71 diff --git a/test/emacs b/test/emacs\r
72 index f3239ea..4f16b41 100755\r
73 --- a/test/emacs\r
74 +++ b/test/emacs\r
75 @@ -118,28 +118,12 @@ output=$(notmuch search 'id:"123..456@example"' | notmuch_search_sanitize)\r
76  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
77  \r
78  test_begin_subtest "Sending a message via (fake) SMTP"\r
79 -\r
80 -# Before we can send a message, we have to prepare the FCC maildir\r
81 -mkdir -p mail/sent/cur\r
82 -mkdir -p mail/sent/new\r
83 -mkdir -p mail/sent/tmp\r
84 -\r
85 -../smtp-dummy sent_message &\r
86 -smtp_dummy_pid=$!\r
87 -test_emacs "(setq message-send-mail-function 'message-smtpmail-send-it)\r
88 -           (setq smtpmail-smtp-server \"localhost\")\r
89 -           (setq smtpmail-smtp-service \"25025\")\r
90 -           (notmuch-hello)\r
91 -           (notmuch-mua-mail)\r
92 -           (message-goto-to)\r
93 -           (insert \"user@example.com\nDate: Fri, 29 Mar 1974 10:00:00 -0000\")\r
94 -           (message-goto-subject)\r
95 -           (insert \"Testing message sent via SMTP\")\r
96 -           (message-goto-body)\r
97 -           (insert \"This is a test that messages are sent via SMTP\")\r
98 -           (message-send-and-exit)" >/dev/null 2>&1\r
99 -wait ${smtp_dummy_pid}\r
100 -\r
101 +emacs_deliver_message \\r
102 +    'Testing message sent via SMTP' \\r
103 +    'This is a test that messages are sent via SMTP' \\r
104 +    '(message-goto-to)\r
105 +     (kill-whole-line)\r
106 +     (insert "To: user@example.com\n")'\r
107  sed \\r
108      -e s',^User-Agent: Notmuch/.* Emacs/.*,User-Agent: Notmuch/XXX Emacs/XXX,' \\r
109      -e s',^Message-ID: <.*>$,Message-ID: <XXX>,' < sent_message >OUTPUT\r
110 @@ -147,7 +131,7 @@ cat <<EOF >EXPECTED\r
111  From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
112  To: user@example.com\r
113  Subject: Testing message sent via SMTP\r
114 -Date: Fri, 29 Mar 1974 10:00:00 -0000\r
115 +Date: 01 Jan 2000 12:00:00 -0000\r
116  User-Agent: Notmuch/XXX Emacs/XXX\r
117  Message-ID: <XXX>\r
118  MIME-Version: 1.0\r
119 @@ -160,7 +144,7 @@ test_expect_equal_file OUTPUT EXPECTED\r
120  test_begin_subtest "Verify that sent messages are saved/searchable (via FCC)"\r
121  notmuch new > /dev/null\r
122  output=$(notmuch search 'subject:"testing message sent via SMTP"' | notmuch_search_sanitize)\r
123 -test_expect_equal "$output" "thread:XXX   1974-03-29 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
124 +test_expect_equal "$output" "thread:XXX   2000-01-01 [1/1] Notmuch Test Suite; Testing message sent via SMTP (inbox)"\r
125  \r
126  test_begin_subtest "notmuch-fcc-dirs set to nil"\r
127  test_emacs "(setq notmuch-fcc-dirs nil)\r
128 @@ -262,7 +246,7 @@ Subject: Re: Testing message sent via SMTP\r
129  In-Reply-To: <XXX>\r
130  Fcc: $(pwd)/mail/sent\r
131  --text follows this line--\r
132 -On Fri, 29 Mar 1974 10:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
133 +On 01 Jan 2000 12:00:00 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
134  > This is a test that messages are sent via SMTP\r
135  EOF\r
136  test_expect_equal_file OUTPUT EXPECTED\r
137 -- \r
138 1.7.5.4\r
139 \r