Re: [PATCH 0/4] Allow specifying alternate names for addresses in other_email
[notmuch-archives.git] / 36 / 0db88360432bc19fb0e48ec6589b25a845162f
1 Return-Path: <jani@nikula.org>\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 4037D429E5B\r
6         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 06:46:57 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References"\r
9 X-Spam-Flag: NO\r
10 X-Spam-Score: -0.7\r
11 X-Spam-Level: \r
12 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
13         tests=[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 RQzGLiiEk75k for <notmuch@notmuchmail.org>;\r
17         Sat, 14 Jan 2012 06:46:54 -0800 (PST)\r
18 Received: from mail-ey0-f181.google.com (mail-ey0-f181.google.com\r
19         [209.85.215.181]) (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 4567F421167\r
22         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 06:46:43 -0800 (PST)\r
23 Received: by mail-ey0-f181.google.com with SMTP id h10so716669eaa.26\r
24         for <notmuch@notmuchmail.org>; Sat, 14 Jan 2012 06:46:42 -0800 (PST)\r
25 Received: by 10.213.29.12 with SMTP id o12mr735494ebc.14.1326552402751;\r
26         Sat, 14 Jan 2012 06:46:42 -0800 (PST)\r
27 Received: from localhost (dsl-hkibrasgw4-fe5cdc00-23.dhcp.inet.fi.\r
28         [80.220.92.23])\r
29         by mx.google.com with ESMTPS id s16sm44688487eef.2.2012.01.14.06.46.40\r
30         (version=SSLv3 cipher=OTHER); Sat, 14 Jan 2012 06:46:41 -0800 (PST)\r
31 From: Jani Nikula <jani@nikula.org>\r
32 To: notmuch@notmuchmail.org\r
33 Subject: [PATCH v5 5/5] test: add tests for "notmuch reply" --reply-to=sender\r
34 Date: Sat, 14 Jan 2012 16:46:19 +0200\r
35 Message-Id:\r
36  <6846f58d924b8f39848a8cd8881cc332129fdf08.1326551350.git.jani@nikula.org>\r
37 X-Mailer: git-send-email 1.7.5.4\r
38 In-Reply-To: <cover.1326551350.git.jani@nikula.org>\r
39 References: <cover.1326551350.git.jani@nikula.org>\r
40 In-Reply-To: <cover.1326551350.git.jani@nikula.org>\r
41 References: <cover.1325794371.git.jani@nikula.org>\r
42         <cover.1326551350.git.jani@nikula.org>\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Sat, 14 Jan 2012 14:46:57 -0000\r
56 \r
57 From: Mark Walters <markwalters1009@gmail.com>\r
58 \r
59 ---\r
60  test/notmuch-test    |    1 +\r
61  test/reply-to-sender |  209 ++++++++++++++++++++++++++++++++++++++++++++++++++\r
62  2 files changed, 210 insertions(+), 0 deletions(-)\r
63  create mode 100755 test/reply-to-sender\r
64 \r
65 diff --git a/test/notmuch-test b/test/notmuch-test\r
66 index e40ef86..6a99ae3 100755\r
67 --- a/test/notmuch-test\r
68 +++ b/test/notmuch-test\r
69 @@ -33,6 +33,7 @@ TESTS="\r
70    thread-naming\r
71    raw\r
72    reply\r
73 +  reply-to-sender\r
74    dump-restore\r
75    uuencode\r
76    thread-order\r
77 diff --git a/test/reply-to-sender b/test/reply-to-sender\r
78 new file mode 100755\r
79 index 0000000..c7d15bb\r
80 --- /dev/null\r
81 +++ b/test/reply-to-sender\r
82 @@ -0,0 +1,209 @@\r
83 +#!/usr/bin/env bash\r
84 +test_description="\"notmuch reply --reply-to=sender\" in several variations"\r
85 +. ./test-lib.sh\r
86 +\r
87 +test_begin_subtest "Basic reply-to-sender"\r
88 +add_message '[from]="Sender <sender@example.com>"' \\r
89 +             [to]=test_suite@notmuchmail.org \\r
90 +             [subject]=notmuch-reply-test \\r
91 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
92 +            '[body]="basic reply-to-sender test"'\r
93 +\r
94 +output=$(notmuch reply --reply-to=sender id:${gen_msg_id})\r
95 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
96 +Subject: Re: notmuch-reply-test\r
97 +To: Sender <sender@example.com>\r
98 +In-Reply-To: <${gen_msg_id}>\r
99 +References: <${gen_msg_id}>\r
100 +\r
101 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
102 +> basic reply-to-sender test"\r
103 +\r
104 +test_begin_subtest "From Us, Basic reply to message"\r
105 +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \\r
106 +            '[to]="Recipient <recipient@example.com>"' \\r
107 +             [subject]=notmuch-reply-test \\r
108 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
109 +            '[body]="basic reply-to-from-us test"'\r
110 +\r
111 +output=$(notmuch reply --reply-to=sender id:${gen_msg_id})\r
112 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
113 +Subject: Re: notmuch-reply-test\r
114 +To: Recipient <recipient@example.com>\r
115 +In-Reply-To: <${gen_msg_id}>\r
116 +References: <${gen_msg_id}>\r
117 +\r
118 +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
119 +> basic reply-to-from-us test"\r
120 +\r
121 +test_begin_subtest "Multiple recipients"\r
122 +add_message '[from]="Sender <sender@example.com>"' \\r
123 +            '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \\r
124 +             [subject]=notmuch-reply-test \\r
125 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
126 +            '[body]="Multiple recipients"'\r
127 +\r
128 +output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})\r
129 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
130 +Subject: Re: notmuch-reply-test\r
131 +To: Sender <sender@example.com>\r
132 +In-Reply-To: <${gen_msg_id}>\r
133 +References: <${gen_msg_id}>\r
134 +\r
135 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
136 +> Multiple recipients"\r
137 +\r
138 +test_begin_subtest "From Us, Multiple TO recipients"\r
139 +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \\r
140 +            '[to]="Recipient <recipient@example.com>, Someone Else <someone@example.com>"' \\r
141 +             [subject]=notmuch-reply-test \\r
142 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
143 +            '[body]="From Us, Multiple TO recipients"'\r
144 +\r
145 +output=$(notmuch reply  --reply-to=sender  id:${gen_msg_id})\r
146 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
147 +Subject: Re: notmuch-reply-test\r
148 +To: Recipient <recipient@example.com>, Someone Else <someone@example.com>\r
149 +In-Reply-To: <${gen_msg_id}>\r
150 +References: <${gen_msg_id}>\r
151 +\r
152 +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
153 +> From Us, Multiple TO recipients"\r
154 +\r
155 +test_begin_subtest "Reply with CC"\r
156 +add_message '[from]="Sender <sender@example.com>"' \\r
157 +             [to]=test_suite@notmuchmail.org \\r
158 +            '[cc]="Other Parties <cc@example.com>"' \\r
159 +             [subject]=notmuch-reply-test \\r
160 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
161 +            '[body]="reply with CC"'\r
162 +\r
163 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
164 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
165 +Subject: Re: notmuch-reply-test\r
166 +To: Sender <sender@example.com>\r
167 +In-Reply-To: <${gen_msg_id}>\r
168 +References: <${gen_msg_id}>\r
169 +\r
170 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
171 +> reply with CC"\r
172 +\r
173 +test_begin_subtest "From Us, Reply with CC"\r
174 +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \\r
175 +            '[to]="Recipient <recipient@example.com>"' \\r
176 +            '[cc]="Other Parties <cc@example.com>"' \\r
177 +             [subject]=notmuch-reply-test \\r
178 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
179 +            '[body]="reply with CC"'\r
180 +\r
181 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
182 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
183 +Subject: Re: notmuch-reply-test\r
184 +To: Recipient <recipient@example.com>\r
185 +In-Reply-To: <${gen_msg_id}>\r
186 +References: <${gen_msg_id}>\r
187 +\r
188 +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
189 +> reply with CC"\r
190 +\r
191 +test_begin_subtest "From Us, Reply no TO but with CC"\r
192 +add_message '[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"' \\r
193 +            '[cc]="Other Parties <cc@example.com>"' \\r
194 +             [subject]=notmuch-reply-test \\r
195 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
196 +            '[body]="reply with CC"'\r
197 +\r
198 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
199 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
200 +Subject: Re: notmuch-reply-test\r
201 +Cc: Other Parties <cc@example.com>\r
202 +In-Reply-To: <${gen_msg_id}>\r
203 +References: <${gen_msg_id}>\r
204 +\r
205 +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
206 +> reply with CC"\r
207 +\r
208 +test_begin_subtest "Reply from alternate address"\r
209 +add_message '[from]="Sender <sender@example.com>"' \\r
210 +             [to]=test_suite_other@notmuchmail.org \\r
211 +             [subject]=notmuch-reply-test \\r
212 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
213 +            '[body]="reply from alternate address"'\r
214 +\r
215 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
216 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>\r
217 +Subject: Re: notmuch-reply-test\r
218 +To: Sender <sender@example.com>\r
219 +In-Reply-To: <${gen_msg_id}>\r
220 +References: <${gen_msg_id}>\r
221 +\r
222 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
223 +> reply from alternate address"\r
224 +\r
225 +test_begin_subtest "Support for Reply-To"\r
226 +add_message '[from]="Sender <sender@example.com>"' \\r
227 +             [to]=test_suite@notmuchmail.org \\r
228 +             [subject]=notmuch-reply-test \\r
229 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
230 +            '[body]="support for reply-to"' \\r
231 +            '[reply-to]="Sender <elsewhere@example.com>"'\r
232 +\r
233 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
234 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
235 +Subject: Re: notmuch-reply-test\r
236 +To: Sender <elsewhere@example.com>\r
237 +In-Reply-To: <${gen_msg_id}>\r
238 +References: <${gen_msg_id}>\r
239 +\r
240 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
241 +> support for reply-to"\r
242 +\r
243 +test_begin_subtest "Support for Reply-To with multiple recipients"\r
244 +add_message '[from]="Sender <sender@example.com>"' \\r
245 +            '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \\r
246 +             [subject]=notmuch-reply-test \\r
247 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
248 +            '[body]="support for reply-to with multiple recipients"' \\r
249 +            '[reply-to]="Sender <elsewhere@example.com>"'\r
250 +\r
251 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
252 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
253 +Subject: Re: notmuch-reply-test\r
254 +To: Sender <elsewhere@example.com>\r
255 +In-Reply-To: <${gen_msg_id}>\r
256 +References: <${gen_msg_id}>\r
257 +\r
258 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
259 +> support for reply-to with multiple recipients"\r
260 +\r
261 +test_begin_subtest "Un-munging Reply-To"\r
262 +add_message '[from]="Sender <sender@example.com>"' \\r
263 +            '[to]="Some List <list@example.com>"' \\r
264 +             [subject]=notmuch-reply-test \\r
265 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
266 +            '[body]="Un-munging Reply-To"' \\r
267 +            '[reply-to]="Evil Munging List <list@example.com>"'\r
268 +\r
269 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
270 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
271 +Subject: Re: notmuch-reply-test\r
272 +To: Sender <sender@example.com>\r
273 +In-Reply-To: <${gen_msg_id}>\r
274 +References: <${gen_msg_id}>\r
275 +\r
276 +On Tue, 05 Jan 2010 15:43:56 -0000, Sender <sender@example.com> wrote:\r
277 +> Un-munging Reply-To"\r
278 +\r
279 +test_begin_subtest "Message with header of exactly 200 bytes"\r
280 +add_message '[subject]="This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces"' \\r
281 +            '[date]="Tue, 05 Jan 2010 15:43:56 -0000"' \\r
282 +            '[body]="200-byte header"'\r
283 +output=$(notmuch reply  --reply-to=sender id:${gen_msg_id})\r
284 +test_expect_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>\r
285 +Subject: Re: This subject is exactly 200 bytes in length. Other than its length there is not much of note here. Note that the length of 200 bytes includes the Subject: and Re: prefixes with two spaces\r
286 +In-Reply-To: <${gen_msg_id}>\r
287 +References: <${gen_msg_id}>\r
288 +\r
289 +On Tue, 05 Jan 2010 15:43:56 -0000, Notmuch Test Suite <test_suite@notmuchmail.org> wrote:\r
290 +> 200-byte header"\r
291 +test_done\r
292 -- \r
293 1.7.5.4\r
294 \r