4 # Messages contain time/date values with time zone and notmuch
5 # displays them converted to the local time zone. We need to set fixed
6 # timezone here so that the output of the tests is always the same
7 # without regard to the time zone of where the test suite is run.
10 find_notmuch_binary ()
14 while [ -n "$dir" ]; do
21 if [ "$dir" = "/" ]; then
29 increment_mtime_amount=0
34 increment_mtime_amount=$((increment_mtime_amount + 1))
35 touch -d "+${increment_mtime_amount} seconds" $dir
38 # Generate a new message in the mail directory, with a unique message
39 # ID and subject. The message is not added to the index.
41 # After this function returns, the filename of the generated message
42 # is available as $gen_msg_filename and the message ID is available as
45 # This function supports named parameters with the bash syntax for
46 # assigning a value to an associative array ([name]=value). The
47 # supported parameters are:
49 # [dir]=directory/of/choice
51 # Generate the message in directory 'directory/of/choice' within
52 # the mail store. The directory will be created if necessary.
56 # Text to use as the body of the email message
58 # '[from]="Some User <user@example.com>"'
59 # '[to]="Some User <user@example.com>"'
60 # '[subject]="Subject of email message"'
61 # '[date]="RFC 822 Date"'
63 # Values for email headers. If not provided, default values will
64 # be generated instead.
66 # '[cc]="Some User <user@example.com>"'
67 # [reply-to]=some-address
68 # [in-reply-to]=<message-id>
69 # '[header]=full header line, including keyword'
71 # Additional values for email headers. If these are not provided
72 # then the relevant headers will simply not appear in the
77 # Controls the message-id of the created message.
83 # This is our (bash-specific) magic for doing named parameters
84 local -A template="($@)"
85 local additional_headers
87 if [ -z "${template[id]}" ]; then
88 gen_msg_cnt=$((gen_msg_cnt + 1))
89 gen_msg_name=msg-$(printf "%03d" $gen_msg_cnt)
90 gen_msg_id="${gen_msg_name}@notmuch-test-suite"
92 gen_msg_name="msg-${template[id]}"
93 gen_msg_id="${template[id]}"
96 if [ -z "${template[dir]}" ]; then
97 gen_msg_filename="${MAIL_DIR}/$gen_msg_name"
99 gen_msg_filename="${MAIL_DIR}/${template[dir]}/$gen_msg_name"
100 mkdir -p $(dirname $gen_msg_filename)
103 if [ -z "${template[body]}" ]; then
104 template[body]="This is just a test message (#${gen_msg_cnt})"
107 if [ -z "${template[from]}" ]; then
108 template[from]="Notmuch Test Suite <test_suite@notmuchmail.org>"
111 if [ -z "${template[to]}" ]; then
112 template[to]="Notmuch Test Suite <test_suite@notmuchmail.org>"
115 if [ -z "${template[subject]}" ]; then
116 template[subject]="Test message #${gen_msg_cnt}"
119 if [ -z "${template[date]}" ]; then
120 template[date]="Tue, 05 Jan 2001 15:43:57 -0800"
123 additional_headers=""
124 if [ ! -z "${template[header]}" ]; then
125 additional_headers="${template[header]}
126 ${additional_headers}"
129 if [ ! -z "${template[reply-to]}" ]; then
130 additional_headers="Reply-To: ${template[reply-to]}
131 ${additional_headers}"
134 if [ ! -z "${template[in-reply-to]}" ]; then
135 additional_headers="In-Reply-To: ${template[in-reply-to]}
136 ${additional_headers}"
139 if [ ! -z "${template[cc]}" ]; then
140 additional_headers="Cc: ${template[cc]}
141 ${additional_headers}"
145 cat <<EOF >$gen_msg_filename
146 From: ${template[from]}
148 Message-Id: <${gen_msg_id}>
149 Subject: ${template[subject]}
150 Date: ${template[date]}
151 ${additional_headers}
155 # Ensure that the mtime of the containing directory is updated
156 increment_mtime $(dirname ${gen_msg_filename})
159 # Generate a new message and add it to the index.
161 # All of the arguments and return values supported by generate_message
162 # are also supported here, so see that function for details.
165 generate_message "$@"
167 $NOTMUCH new > /dev/null
180 if [ "$output" = "$expected" ]; then
184 testname=test-$(printf "%03d" $tests)
185 echo "$expected" > $testname.expected
186 echo "$output" > $testname.output
187 diff -u $testname.expected $testname.output || true
188 test_failures=$((test_failures + 1))
192 TEST_DIR=$(pwd)/test.$$
193 MAIL_DIR=${TEST_DIR}/mail
194 export NOTMUCH_CONFIG=${TEST_DIR}/notmuch-config
195 NOTMUCH=$(find_notmuch_binary $(pwd))
199 $NOTMUCH new | grep -v -E -e '^Processed [0-9]*( total)? file|Found [0-9]* total file'
202 notmuch_search_sanitize ()
204 sed -r -e 's/("?thread"?: ?)("?)................("?)/\1\2XXX\3/'
207 NOTMUCH_SHOW_FILENAME_SQUELCH='s,filename:.*/mail,filename:/XXX/mail,'
208 notmuch_show_sanitize ()
210 sed -e "$NOTMUCH_SHOW_FILENAME_SQUELCH"
219 cat <<EOF > ${NOTMUCH_CONFIG}
224 name=Notmuch Test Suite
225 primary_email=test_suite@notmuchmail.org
226 other_email=test_suite_other@notmuchmail.org;test_suite@otherdomain.org
229 printf "Testing \"notmuch new\" in several variations:\n"
230 printf " No new messages...\t\t\t\t"
231 output=$(NOTMUCH_NEW)
232 pass_if_equal "$output" "No new mail."
234 printf " Single new message...\t\t\t\t"
236 output=$(NOTMUCH_NEW)
237 pass_if_equal "$output" "Added 1 new message to the database."
239 printf " Multiple new messages...\t\t\t"
242 output=$(NOTMUCH_NEW)
243 pass_if_equal "$output" "Added 2 new messages to the database."
245 printf " No new messages (non-empty DB)...\t\t"
246 output=$(NOTMUCH_NEW)
247 pass_if_equal "$output" "No new mail."
249 printf " New directories...\t\t\t\t"
250 rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
251 mkdir ${MAIL_DIR}/def
252 mkdir ${MAIL_DIR}/ghi
253 generate_message [dir]=def
255 output=$(NOTMUCH_NEW)
256 pass_if_equal "$output" "Added 1 new message to the database."
258 printf " Alternate inode order...\t\t\t"
260 rm -rf ${MAIL_DIR}/.notmuch
261 mv ${MAIL_DIR}/ghi ${MAIL_DIR}/abc
263 generate_message [dir]=abc
265 output=$(NOTMUCH_NEW)
266 pass_if_equal "$output" "Added 1 new message to the database."
268 printf " Message moved in...\t\t\t\t"
269 rm -rf ${MAIL_DIR}/* ${MAIL_DIR}/.notmuch
271 tmp_msg_filename=tmp/$gen_msg_filename
272 mkdir -p $(dirname $tmp_msg_filename)
273 mv $gen_msg_filename $tmp_msg_filename
274 increment_mtime ${MAIL_DIR}
275 $NOTMUCH new > /dev/null
276 mv $tmp_msg_filename $gen_msg_filename
277 increment_mtime ${MAIL_DIR}
278 output=$(NOTMUCH_NEW)
279 pass_if_equal "$output" "Added 1 new message to the database."
281 printf " Renamed message...\t\t\t\t"
284 $NOTMUCH new > /dev/null
285 mv $gen_msg_filename ${gen_msg_filename}-renamed
286 increment_mtime ${MAIL_DIR}
287 output=$(NOTMUCH_NEW)
288 pass_if_equal "$output" "No new mail. Detected 1 file rename."
290 printf " Deleted message...\t\t\t\t"
292 rm ${gen_msg_filename}-renamed
293 increment_mtime ${MAIL_DIR}
294 output=$(NOTMUCH_NEW)
295 pass_if_equal "$output" "No new mail. Removed 1 message."
297 printf " Renamed directory...\t\t\t\t"
299 generate_message [dir]=dir
300 generate_message [dir]=dir
301 generate_message [dir]=dir
303 $NOTMUCH new > /dev/null
305 mv ${MAIL_DIR}/dir ${MAIL_DIR}/dir-renamed
306 increment_mtime ${MAIL_DIR}
308 output=$(NOTMUCH_NEW)
309 pass_if_equal "$output" "No new mail. Detected 3 file renames."
311 printf " Deleted directory...\t\t\t\t"
313 rm -rf ${MAIL_DIR}/dir-renamed
314 increment_mtime ${MAIL_DIR}
316 output=$(NOTMUCH_NEW)
317 pass_if_equal "$output" "No new mail. Removed 3 messages."
319 printf " New directory (at end of list)...\t\t"
321 generate_message [dir]=zzz
322 generate_message [dir]=zzz
323 generate_message [dir]=zzz
325 output=$(NOTMUCH_NEW)
326 pass_if_equal "$output" "Added 3 new messages to the database."
328 printf " Deleted directory (end of list)...\t\t"
330 rm -rf ${MAIL_DIR}/zzz
331 increment_mtime ${MAIL_DIR}
333 output=$(NOTMUCH_NEW)
334 pass_if_equal "$output" "No new mail. Removed 3 messages."
336 printf " New symlink to directory...\t\t\t"
338 rm -rf ${MAIL_DIR}/.notmuch
339 mv ${MAIL_DIR} ${TEST_DIR}/actual_maildir
342 ln -s ${TEST_DIR}/actual_maildir ${MAIL_DIR}/symlink
344 output=$(NOTMUCH_NEW)
345 pass_if_equal "$output" "Added 1 new message to the database."
347 printf " New symlink to a file...\t\t\t"
349 external_msg_filename=${TEST_DIR}/external/$(basename $gen_msg_filename)
350 mkdir -p $(dirname $external_msg_filename)
351 mv $gen_msg_filename $external_msg_filename
352 ln -s $external_msg_filename $gen_msg_filename
353 increment_mtime ${MAIL_DIR}
354 output=$(NOTMUCH_NEW)
355 pass_if_equal "$output" "Added 1 new message to the database."
357 printf " New two-level directory...\t\t\t"
359 generate_message [dir]=two/levels
360 generate_message [dir]=two/levels
361 generate_message [dir]=two/levels
363 output=$(NOTMUCH_NEW)
364 pass_if_equal "$output" "Added 3 new messages to the database."
366 printf " Deleted two-level directory...\t\t\t"
368 rm -rf ${MAIL_DIR}/two
369 increment_mtime ${MAIL_DIR}
371 output=$(NOTMUCH_NEW)
372 pass_if_equal "$output" "No new mail. Removed 3 messages."
374 printf "\nTesting \"notmuch search\" in several variations:\n"
376 printf " Search body...\t\t\t\t\t"
377 add_message '[subject]="body search"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [body]=bodysearchtest
378 output=$($NOTMUCH search bodysearchtest | notmuch_search_sanitize)
379 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)"
381 printf " Search by from:...\t\t\t\t"
382 add_message '[subject]="search by from"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom
383 output=$($NOTMUCH search from:searchbyfrom | notmuch_search_sanitize)
384 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)"
386 printf " Search by to:...\t\t\t\t"
387 add_message '[subject]="search by to"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto
388 output=$($NOTMUCH search to:searchbyto | notmuch_search_sanitize)
389 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)"
391 printf " Search by subject:...\t\t\t\t"
392 add_message [subject]=subjectsearchtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
393 output=$($NOTMUCH search subject:subjectsearchtest | notmuch_search_sanitize)
394 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread)"
396 printf " Search by id:...\t\t\t\t"
397 add_message '[subject]="search by id"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
398 output=$($NOTMUCH search id:${gen_msg_id} | notmuch_search_sanitize)
399 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread)"
401 printf " Search by tag:...\t\t\t\t"
402 add_message '[subject]="search by tag"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
403 $NOTMUCH tag +searchbytag id:${gen_msg_id}
404 output=$($NOTMUCH search tag:searchbytag | notmuch_search_sanitize)
405 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread)"
407 printf " Search by thread:...\t\t\t\t"
408 add_message '[subject]="search by thread"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
409 thread_id=$($NOTMUCH search id:${gen_msg_id} | sed -e 's/thread:\([a-f0-9]*\).*/\1/')
410 output=$($NOTMUCH search thread:${thread_id} | notmuch_search_sanitize)
411 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread)"
413 printf " Search body (phrase)...\t\t\t"
414 add_message '[subject]="body search (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="body search (phrase)"'
415 add_message '[subject]="negative result"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="This phrase should not match the body search"'
416 output=$($NOTMUCH search '\"body search (phrase)\"' | notmuch_search_sanitize)
417 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread)"
419 printf " Search by from: (address)...\t\t\t"
420 add_message '[subject]="search by from (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [from]=searchbyfrom@example.com
421 output=$($NOTMUCH search from:searchbyfrom@example.com | notmuch_search_sanitize)
422 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (address) (inbox unread)"
424 printf " Search by from: (name)...\t\t\t"
425 add_message '[subject]="search by from (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[from]="Search By From Name <test@example.com>"'
426 output=$($NOTMUCH search from:'Search By From Name' | notmuch_search_sanitize)
427 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)"
429 printf " Search by to: (address)...\t\t\t"
430 add_message '[subject]="search by to (address)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' [to]=searchbyto@example.com
431 output=$($NOTMUCH search to:searchbyto@example.com | notmuch_search_sanitize)
432 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (inbox unread)"
434 printf " Search by to: (name)...\t\t\t"
435 add_message '[subject]="search by to (name)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[to]="Search By To Name <test@example.com>"'
436 output=$($NOTMUCH search to:'Search By To Name' | notmuch_search_sanitize)
437 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)"
439 printf " Search by subject: (phrase)...\t\t\t"
440 add_message '[subject]="subject search test (phrase)"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
441 add_message '[subject]="this phrase should not match the subject search test"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
442 output=$($NOTMUCH search 'subject:\"subject search test (phrase)\"' | notmuch_search_sanitize)
443 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread)"
445 printf " Search for all messages (\"*\"):...\t\t"
446 output=$($NOTMUCH search '*' | notmuch_search_sanitize)
447 pass_if_equal "$output" "thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #6 (inbox unread)
448 thread:XXX 2001-01-05 [1/1] Notmuch Test Suite; Test message #14 (inbox unread)
449 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (inbox unread)
450 thread:XXX 2000-01-01 [1/1] searchbyfrom; search by from (inbox unread)
451 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (inbox unread)
452 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subjectsearchtest (inbox unread)
453 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by id (inbox unread)
454 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by tag (inbox searchbytag unread)
455 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by thread (inbox unread)
456 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; body search (phrase) (inbox unread)
457 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; negative result (inbox unread)
458 thread:XXX 2000-01-01 [1/1] searchbyfrom@example.com; search by from (address) (inbox unread)
459 thread:XXX 2000-01-01 [1/1] Search By From Name; search by from (name) (inbox unread)
460 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (address) (inbox unread)
461 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; search by to (name) (inbox unread)
462 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; subject search test (phrase) (inbox unread)
463 thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; this phrase should not match the subject search test (inbox unread)"
465 printf " Search body (utf-8):...\t\t\t"
466 add_message '[subject]="utf8-message-body-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="message body utf8: bödý"'
467 output=$($NOTMUCH search 'bödý' | notmuch_search_sanitize)
468 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-message-body-subject (inbox unread)"
470 printf "\nTesting --format=json output:\n"
472 printf " Show message: json...\t\t\t\t"
473 add_message '[subject]="json-show-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="json-show-message"'
474 output=$($NOTMUCH show --format=json 'json-show-message')
475 pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "filename": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-subject", "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", "Cc": "", "Bcc": "", "Date": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id": 1, "content-type": "text/plain", "content": "json-show-message\n"}]}, []]]]'
477 printf " Search message: json...\t\t\t"
478 add_message '[subject]="json-search-subject"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="json-search-message"'
479 output=$($NOTMUCH search --format=json 'json-search-message' | notmuch_search_sanitize)
480 pass_if_equal "$output" '[{"thread": "XXX",
481 "timestamp": 946728000,
484 "authors": "Notmuch Test Suite",
485 "subject": "json-search-subject",
486 "tags": ["inbox", "unread"]}]'
488 printf " Search by subject (utf-8):...\t\t\t"
489 add_message [subject]=utf8-sübjéct '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
490 output=$($NOTMUCH search subject:utf8-sübjéct | notmuch_search_sanitize)
491 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; utf8-sübjéct (inbox unread)"
493 printf " Show message: json, utf-8...\t\t\t"
494 add_message '[subject]="json-show-utf8-body-sübjéct"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="jsön-show-méssage"'
495 output=$($NOTMUCH show --format=json 'jsön-show-méssage')
496 pass_if_equal "$output" '[[[{"id": "'${gen_msg_id}'", "match": true, "filename": "'${gen_msg_filename}'", "timestamp": 946728000, "date_relative": "2000-01-01", "tags": ["inbox","unread"], "headers": {"Subject": "json-show-utf8-body-sübjéct", "From": "Notmuch Test Suite <test_suite@notmuchmail.org>", "To": "Notmuch Test Suite <test_suite@notmuchmail.org>", "Cc": "", "Bcc": "", "Date": "Sat, 01 Jan 2000 12:00:00 -0000"}, "body": [{"id": 1, "content-type": "text/plain", "content": "jsön-show-méssage\n"}]}, []]]]'
498 printf " Search message: json, utf-8...\t\t\t"
499 add_message '[subject]="json-search-utf8-body-sübjéct"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' '[body]="jsön-search-méssage"'
500 output=$($NOTMUCH search --format=json 'jsön-search-méssage' | notmuch_search_sanitize)
501 pass_if_equal "$output" '[{"thread": "XXX",
502 "timestamp": 946728000,
505 "authors": "Notmuch Test Suite",
506 "subject": "json-search-utf8-body-sübjéct",
507 "tags": ["inbox", "unread"]}]'
509 printf "\nTesting naming of threads with changing subject:\n"
510 add_message '[subject]="thread-naming: Initial thread subject"' \
511 '[date]="Fri, 05 Jan 2001 15:43:56 -0800"'
514 add_message '[subject]="thread-naming: Older changed subject"' \
515 '[date]="Sat, 06 Jan 2001 15:43:56 -0800"' \
516 "[in-reply-to]=\<$parent\>"
517 add_message '[subject]="thread-naming: Newer changed subject"' \
518 '[date]="Sun, 07 Jan 2001 15:43:56 -0800"' \
519 "[in-reply-to]=\<$parent\>"
520 add_message '[subject]="thread-naming: Final thread subject"' \
521 '[date]="Mon, 08 Jan 2001 15:43:56 -0800"' \
522 "[in-reply-to]=\<$parent\>"
525 printf " Initial thread name (oldest-first search)...\t"
526 output=$($NOTMUCH search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
527 pass_if_equal "$output" "thread:XXX 2001-01-05 [4/4] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
529 printf " Initial thread name (newest-first search)...\t"
530 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
531 pass_if_equal "$output" "thread:XXX 2001-01-08 [4/4] Notmuch Test Suite; thread-naming: Final thread subject (inbox unread)"
533 # Remove oldest and newest messages from search results
534 $NOTMUCH tag -inbox id:$parent or id:$final
536 printf " Changed thread name (oldest-first search)...\t"
537 output=$($NOTMUCH search --sort=oldest-first thread-naming and tag:inbox | notmuch_search_sanitize)
538 pass_if_equal "$output" "thread:XXX 2001-01-06 [2/4] Notmuch Test Suite; thread-naming: Older changed subject (inbox unread)"
540 printf " Changed thread name (newest-first search)...\t"
541 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
542 pass_if_equal "$output" "thread:XXX 2001-01-07 [2/4] Notmuch Test Suite; thread-naming: Newer changed subject (inbox unread)"
544 printf " Ignore added reply prefix (Re:)...\t\t"
545 add_message '[subject]="Re: thread-naming: Initial thread subject"' \
546 '[date]="Tue, 09 Jan 2001 15:43:45 -0800"' \
547 "[in-reply-to]=\<$parent\>"
548 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
549 pass_if_equal "$output" "thread:XXX 2001-01-09 [3/5] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
551 printf " Ignore added reply prefix (Aw:)...\t\t"
552 add_message '[subject]="Aw: thread-naming: Initial thread subject"' \
553 '[date]="Wed, 10 Jan 2001 15:43:45 -0800"' \
554 "[in-reply-to]=\<$parent\>"
555 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
556 pass_if_equal "$output" "thread:XXX 2001-01-10 [4/6] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
558 printf " Ignore added reply prefix (Vs:)...\t\t"
559 add_message '[subject]="Vs: thread-naming: Initial thread subject"' \
560 '[date]="Thu, 11 Jan 2001 15:43:45 -0800"' \
561 "[in-reply-to]=\<$parent\>"
562 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
563 pass_if_equal "$output" "thread:XXX 2001-01-11 [5/7] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
565 printf " Ignore added reply prefix (Sv:)...\t\t"
566 add_message '[subject]="Sv: thread-naming: Initial thread subject"' \
567 '[date]="Fri, 12 Jan 2001 15:43:45 -0800"' \
568 "[in-reply-to]=\<$parent\>"
569 output=$($NOTMUCH search --sort=newest-first thread-naming and tag:inbox | notmuch_search_sanitize)
570 pass_if_equal "$output" "thread:XXX 2001-01-12 [6/8] Notmuch Test Suite; thread-naming: Initial thread subject (inbox unread)"
572 printf " Test order of messages in \"notmuch show\"\t"
573 output=$($NOTMUCH show thread-naming | notmuch_show_sanitize)
574 pass_if_equal "$output" "
\fmessage{ id:msg-$(printf "%03d" $first)@notmuch-test-suite depth:0 match:1 filename:/XXX/mail/msg-$(printf "%03d" $first)
576 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-05) (unread)
577 Subject: thread-naming: Initial thread subject
578 From: Notmuch Test Suite <test_suite@notmuchmail.org>
579 To: Notmuch Test Suite <test_suite@notmuchmail.org>
580 Date: Fri, 05 Jan 2001 15:43:56 -0800
583 \fpart{ ID: 1, Content-type: text/plain
584 This is just a test message (#$first)
588 \fmessage{ id:msg-$(printf "%03d" $((first + 1)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 1)))
590 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-06) (inbox unread)
591 Subject: thread-naming: Older changed subject
592 From: Notmuch Test Suite <test_suite@notmuchmail.org>
593 To: Notmuch Test Suite <test_suite@notmuchmail.org>
594 Date: Sat, 06 Jan 2001 15:43:56 -0800
597 \fpart{ ID: 1, Content-type: text/plain
598 This is just a test message (#$((first + 1)))
602 \fmessage{ id:msg-$(printf "%03d" $((first + 2)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 2)))
604 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-07) (inbox unread)
605 Subject: thread-naming: Newer changed subject
606 From: Notmuch Test Suite <test_suite@notmuchmail.org>
607 To: Notmuch Test Suite <test_suite@notmuchmail.org>
608 Date: Sun, 07 Jan 2001 15:43:56 -0800
611 \fpart{ ID: 1, Content-type: text/plain
612 This is just a test message (#$((first + 2)))
616 \fmessage{ id:msg-$(printf "%03d" $((first + 3)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 3)))
618 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-08) (unread)
619 Subject: thread-naming: Final thread subject
620 From: Notmuch Test Suite <test_suite@notmuchmail.org>
621 To: Notmuch Test Suite <test_suite@notmuchmail.org>
622 Date: Mon, 08 Jan 2001 15:43:56 -0800
625 \fpart{ ID: 1, Content-type: text/plain
626 This is just a test message (#$((first + 3)))
630 \fmessage{ id:msg-$(printf "%03d" $((first + 4)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 4)))
632 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-09) (inbox unread)
633 Subject: Re: thread-naming: Initial thread subject
634 From: Notmuch Test Suite <test_suite@notmuchmail.org>
635 To: Notmuch Test Suite <test_suite@notmuchmail.org>
636 Date: Tue, 09 Jan 2001 15:43:45 -0800
639 \fpart{ ID: 1, Content-type: text/plain
640 This is just a test message (#$((first + 4)))
644 \fmessage{ id:msg-$(printf "%03d" $((first + 5)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 5)))
646 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-10) (inbox unread)
647 Subject: Aw: thread-naming: Initial thread subject
648 From: Notmuch Test Suite <test_suite@notmuchmail.org>
649 To: Notmuch Test Suite <test_suite@notmuchmail.org>
650 Date: Wed, 10 Jan 2001 15:43:45 -0800
653 \fpart{ ID: 1, Content-type: text/plain
654 This is just a test message (#$((first + 5)))
658 \fmessage{ id:msg-$(printf "%03d" $((first + 6)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 6)))
660 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-11) (inbox unread)
661 Subject: Vs: thread-naming: Initial thread subject
662 From: Notmuch Test Suite <test_suite@notmuchmail.org>
663 To: Notmuch Test Suite <test_suite@notmuchmail.org>
664 Date: Thu, 11 Jan 2001 15:43:45 -0800
667 \fpart{ ID: 1, Content-type: text/plain
668 This is just a test message (#$((first + 6)))
672 \fmessage{ id:msg-$(printf "%03d" $((first + 7)))@notmuch-test-suite depth:1 match:1 filename:/XXX/mail/msg-$(printf "%03d" $((first + 7)))
674 Notmuch Test Suite <test_suite@notmuchmail.org> (2001-01-12) (inbox unread)
675 Subject: Sv: thread-naming: Initial thread subject
676 From: Notmuch Test Suite <test_suite@notmuchmail.org>
677 To: Notmuch Test Suite <test_suite@notmuchmail.org>
678 Date: Fri, 12 Jan 2001 15:43:45 -0800
681 \fpart{ ID: 1, Content-type: text/plain
682 This is just a test message (#$((first + 7)))
687 printf "\nTesting \"notmuch reply\" in several variations:\n"
689 printf " Basic reply...\t\t\t\t\t"
690 add_message '[from]="Sender <sender@example.com>"' \
691 [to]=test_suite@notmuchmail.org \
692 [subject]=notmuch-reply-test \
693 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
694 '[body]="basic reply test"'
696 output=$($NOTMUCH reply id:${gen_msg_id})
697 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
698 Subject: Re: notmuch-reply-test
699 To: Sender <sender@example.com>
700 Bcc: test_suite@notmuchmail.org
701 In-Reply-To: <${gen_msg_id}>
702 References: <${gen_msg_id}>
704 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
707 printf " Multiple recipients...\t\t\t\t"
708 add_message '[from]="Sender <sender@example.com>"' \
709 '[to]="test_suite@notmuchmail.org, Someone Else <someone@example.com>"' \
710 [subject]=notmuch-reply-test \
711 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
712 '[body]="Multiple recipients"'
714 output=$($NOTMUCH reply id:${gen_msg_id})
715 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
716 Subject: Re: notmuch-reply-test
717 To: Sender <sender@example.com>, Someone Else <someone@example.com>
718 Bcc: test_suite@notmuchmail.org
719 In-Reply-To: <${gen_msg_id}>
720 References: <${gen_msg_id}>
722 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
723 > Multiple recipients"
725 printf " Reply with CC...\t\t\t\t"
726 add_message '[from]="Sender <sender@example.com>"' \
727 [to]=test_suite@notmuchmail.org \
728 '[cc]="Other Parties <cc@example.com>"' \
729 [subject]=notmuch-reply-test \
730 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
731 '[body]="reply with CC"'
733 output=$($NOTMUCH reply id:${gen_msg_id})
734 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
735 Subject: Re: notmuch-reply-test
736 To: Sender <sender@example.com>
737 Cc: Other Parties <cc@example.com>
738 Bcc: test_suite@notmuchmail.org
739 In-Reply-To: <${gen_msg_id}>
740 References: <${gen_msg_id}>
742 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
745 printf " Reply from alternate address...\t\t"
746 add_message '[from]="Sender <sender@example.com>"' \
747 [to]=test_suite_other@notmuchmail.org \
748 [subject]=notmuch-reply-test \
749 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
750 '[body]="reply from alternate address"'
752 output=$($NOTMUCH reply id:${gen_msg_id})
753 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
754 Subject: Re: notmuch-reply-test
755 To: Sender <sender@example.com>
756 Bcc: test_suite@notmuchmail.org
757 In-Reply-To: <${gen_msg_id}>
758 References: <${gen_msg_id}>
760 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
761 > reply from alternate address"
763 printf " Support for Reply-To...\t\t\t"
764 add_message '[from]="Sender <sender@example.com>"' \
765 [to]=test_suite@notmuchmail.org \
766 [subject]=notmuch-reply-test \
767 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
768 '[body]="support for reply-to"' \
769 '[reply-to]="Sender <elsewhere@example.com>"'
771 output=$($NOTMUCH reply id:${gen_msg_id})
772 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
773 Subject: Re: notmuch-reply-test
774 To: Sender <elsewhere@example.com>
775 Bcc: test_suite@notmuchmail.org
776 In-Reply-To: <${gen_msg_id}>
777 References: <${gen_msg_id}>
779 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
780 > support for reply-to"
782 printf " Un-munging Reply-To...\t\t\t\t"
783 add_message '[from]="Sender <sender@example.com>"' \
784 '[to]="Some List <list@example.com>"' \
785 [subject]=notmuch-reply-test \
786 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
787 '[body]="Un-munging Reply-To"' \
788 '[reply-to]="Evil Munging List <list@example.com>"'
790 output=$($NOTMUCH reply id:${gen_msg_id})
791 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
792 Subject: Re: notmuch-reply-test
793 To: Sender <sender@example.com>, Some List <list@example.com>
794 Bcc: test_suite@notmuchmail.org
795 In-Reply-To: <${gen_msg_id}>
796 References: <${gen_msg_id}>
798 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
799 > Un-munging Reply-To"
801 printf "\nTesting handling of uuencoded data:\n"
803 add_message [subject]=uuencodetest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"' \
804 '[body]="This message is used to ensure that notmuch correctly handles a
805 message containing a block of uuencoded data. First, we have a marker
806 this content beforeuudata . Then we beging the uunencoded data itself:
808 begin 644 bogus-uuencoded-data
809 M0123456789012345678901234567890123456789012345678901234567890
810 MOBVIOUSLY, THIS IS NOT ANY SORT OF USEFUL UUNECODED DATA.
811 MINSTEAD THIS IS JUST A WAY TO ENSURE THAT THIS BLOCK OF DATA
812 MIS CORRECTLY IGNORED WHEN NOTMUCH CREATES ITS INDEX. SO WE
813 MINCLUDE A DURINGUUDATA MARKER THAT SHOULD NOT RESULT IN ANY
818 Finally, we have our afteruudata marker as well."'
820 printf " Ensure content before uu data is indexed...\t"
821 output=$($NOTMUCH search beforeuudata | notmuch_search_sanitize)
822 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)"
823 printf " Ensure uu data is not indexed...\t\t"
824 output=$($NOTMUCH search DURINGUUDATA | notmuch_search_sanitize)
825 pass_if_equal "$output" ""
826 printf " Ensure content after uu data is indexed...\t"
827 output=$($NOTMUCH search afteruudata | notmuch_search_sanitize)
828 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; uuencodetest (inbox unread)"
830 printf "\nTesting \"notmuch dump\" and \"notmuch restore\":\n"
832 printf " Dumping all tags...\t\t\t\t"
833 $NOTMUCH dump dump.expected
834 pass_if_equal "$?" "0"
836 printf " Clearing all tags...\t\t\t\t"
837 sed -e 's/(\([^(]*\))$/()/' < dump.expected > clear.expected
838 $NOTMUCH restore clear.expected
839 $NOTMUCH dump clear.actual
840 pass_if_equal "$(< clear.actual)" "$(< clear.expected)"
842 printf " Restoring original tags...\t\t\t"
843 $NOTMUCH restore dump.expected
844 $NOTMUCH dump dump.actual
845 pass_if_equal "$(< dump.actual)" "$(< dump.expected)"
847 printf " Restore with nothing to do...\t\t\t"
848 $NOTMUCH restore dump.expected
849 pass_if_equal "$?" "0"
851 printf "\nTesting threading when messages received out of order:\n"
852 printf " Adding initial child message...\t\t"
853 generate_message [body]=foo '[in-reply-to]=\<parent-id\>' [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
854 output=$(NOTMUCH_NEW)
855 pass_if_equal "$output" "Added 1 new message to the database."
856 printf " Searching returns the message...\t\t"
857 output=$($NOTMUCH search foo | notmuch_search_sanitize)
858 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/1] Notmuch Test Suite; brokenthreadtest (inbox unread)"
859 printf " Adding second child message...\t\t\t"
860 generate_message [body]=foo '[in-reply-to]=\<parent-id\>' [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
861 output=$(NOTMUCH_NEW)
862 pass_if_equal "$output" "Added 1 new message to the database."
863 printf " Searching returns both messages in one thread..."
864 output=$($NOTMUCH search foo | notmuch_search_sanitize)
865 pass_if_equal "$output" "thread:XXX 2000-01-01 [2/2] Notmuch Test Suite; brokenthreadtest (inbox unread)"
866 printf " Adding parent message...\t\t\t"
867 generate_message [body]=foo [id]=parent-id [subject]=brokenthreadtest '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
868 output=$(NOTMUCH_NEW)
869 pass_if_equal "$output" "Added 1 new message to the database."
870 printf " Searching returns all three messages in one thread..."
871 output=$($NOTMUCH search foo | notmuch_search_sanitize)
872 pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] Notmuch Test Suite; brokenthreadtest (inbox unread)"
874 printf "\nTesting author reordering;\n"
875 printf " Adding parent message...\t\t\t"
876 generate_message [body]=findme [id]=new-parent-id [subject]=author-reorder-threadtest '[from]="User <user@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
877 output=$(NOTMUCH_NEW)
878 pass_if_equal "$output" "Added 1 new message to the database."
879 printf " Adding initial child message...\t\t"
880 generate_message [body]=findme '[in-reply-to]=\<new-parent-id\>' [subject]=author-reorder-threadtest '[from]="User1 <user1@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
881 output=$(NOTMUCH_NEW)
882 pass_if_equal "$output" "Added 1 new message to the database."
883 printf " Adding second child message...\t\t\t"
884 generate_message [body]=findme '[in-reply-to]=\<new-parent-id\>' [subject]=author-reorder-threadtest '[from]="User2 <user2@example.com>"' '[date]="Sat, 01 Jan 2000 12:00:00 -0000"'
885 output=$(NOTMUCH_NEW)
886 pass_if_equal "$output" "Added 1 new message to the database."
887 printf " Searching when all three messages match...\t"
888 output=$($NOTMUCH search findme | notmuch_search_sanitize)
889 pass_if_equal "$output" "thread:XXX 2000-01-01 [3/3] User, User1, User2; author-reorder-threadtest (inbox unread)"
890 printf " Searching when two messages match...\t\t"
891 output=$($NOTMUCH search User1 or User2 | notmuch_search_sanitize)
892 pass_if_equal "$output" "thread:XXX 2000-01-01 [2/3] User1, User2| User; author-reorder-threadtest (inbox unread)"
893 printf " Searching when only one message matches...\t"
894 output=$($NOTMUCH search User2 | notmuch_search_sanitize)
895 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User2| User, User1; author-reorder-threadtest (inbox unread)"
896 printf " Searching when only first message matches...\t"
897 output=$($NOTMUCH search User | notmuch_search_sanitize)
898 pass_if_equal "$output" "thread:XXX 2000-01-01 [1/3] User| User1, User2; author-reorder-threadtest (inbox unread)"
900 printf "\nTesting From line heuristics;\n"
901 printf " Magic from guessing (nothing to go on)...\t"
902 add_message '[from]="Sender <sender@example.com>"' \
903 [to]=mailinglist@notmuchmail.org \
904 [subject]=notmuch-reply-test \
905 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
906 '[body]="from guessing test"'
908 output=$($NOTMUCH reply id:${gen_msg_id})
909 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@notmuchmail.org>
910 Subject: Re: notmuch-reply-test
911 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
912 Bcc: test_suite@notmuchmail.org
913 In-Reply-To: <${gen_msg_id}>
914 References: <${gen_msg_id}>
916 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
917 > from guessing test"
919 printf " Magic from guessing (Envelope-to:)...\t\t"
920 add_message '[from]="Sender <sender@example.com>"' \
921 [to]=mailinglist@notmuchmail.org \
922 [subject]=notmuch-reply-test \
923 '[header]="Envelope-To: test_suite_other@notmuchmail.org"' \
924 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
925 '[body]="from guessing test"'
927 output=$($NOTMUCH reply id:${gen_msg_id})
928 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
929 Subject: Re: notmuch-reply-test
930 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
931 Bcc: test_suite@notmuchmail.org
932 In-Reply-To: <${gen_msg_id}>
933 References: <${gen_msg_id}>
935 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
936 > from guessing test"
938 printf " Magic from guessing (X-Original-To:)...\t"
939 add_message '[from]="Sender <sender@example.com>"' \
940 [to]=mailinglist@notmuchmail.org \
941 [subject]=notmuch-reply-test \
942 '[header]="X-Original-To: test_suite_other@notmuchmail.org"' \
943 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
944 '[body]="from guessing test"'
946 output=$($NOTMUCH reply id:${gen_msg_id})
947 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
948 Subject: Re: notmuch-reply-test
949 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
950 Bcc: test_suite@notmuchmail.org
951 In-Reply-To: <${gen_msg_id}>
952 References: <${gen_msg_id}>
954 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
955 > from guessing test"
957 printf " Magic from guessing (Received: .. for ..)...\t"
958 add_message '[from]="Sender <sender@example.com>"' \
959 [to]=mailinglist@notmuchmail.org \
960 [subject]=notmuch-reply-test \
961 '[header]="Received: from mail.example.com (mail.example.com [1.1.1.1])\
962 by mail.notmuchmail.org (some MTA) with ESMTP id 12345678\
963 for <test_suite_other@notmuchmail.org>; Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \
964 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
965 '[body]="from guessing test"'
967 output=$($NOTMUCH reply id:${gen_msg_id})
968 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite_other@notmuchmail.org>
969 Subject: Re: notmuch-reply-test
970 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
971 Bcc: test_suite@notmuchmail.org
972 In-Reply-To: <${gen_msg_id}>
973 References: <${gen_msg_id}>
975 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
976 > from guessing test"
978 printf " Magic from guessing (Received: domain)...\t"
979 add_message '[from]="Sender <sender@example.com>"' \
980 [to]=mailinglist@notmuchmail.org \
981 [subject]=notmuch-reply-test \
982 '[header]="Received: from mail.example.com (mail.example.com [1.1.1.1])\
983 by mail.otherdomain.org (some MTA) with ESMTP id 12345678\
984 Sat, 10 Apr 2010 07:54:51 -0400 (EDT)"' \
985 '[date]="Tue, 05 Jan 2010 15:43:56 -0800"' \
986 '[body]="from guessing test"'
988 output=$($NOTMUCH reply id:${gen_msg_id})
989 pass_if_equal "$output" "From: Notmuch Test Suite <test_suite@otherdomain.org>
990 Subject: Re: notmuch-reply-test
991 To: Sender <sender@example.com>, mailinglist@notmuchmail.org
992 Bcc: test_suite@notmuchmail.org
993 In-Reply-To: <${gen_msg_id}>
994 References: <${gen_msg_id}>
996 On Tue, 05 Jan 2010 15:43:56 -0800, Sender <sender@example.com> wrote:
997 > from guessing test"
1000 echo "Notmuch test suite complete."
1002 if [ "$test_failures" = "0" ]; then
1003 echo "All $tests tests passed."
1006 echo "$test_failures/$tests tests failed. The failures can be investigated in:"