2 test_description="output of multipart message"
5 cat <<EOF > embedded_message
6 From: Carl Worth <cworth@cworth.org>
9 Date: Fri, 05 Jan 2001 15:42:57 +0000
10 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
11 Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>
13 Content-Type: multipart/alternative; boundary="==-=-=="
16 Content-Type: text/html
18 <p>This is an embedded message, with a multipart/alternative part.</p>
21 Content-Type: text/plain
23 This is an embedded message, with a multipart/alternative part.
28 cat <<EOF > ${MAIL_DIR}/multipart
29 From: Carl Worth <cworth@cworth.org>
31 Subject: Multipart message
32 Date: Fri, 05 Jan 2001 15:43:57 +0000
33 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
34 Message-ID: <87liy5ap00.fsf@yoom.home.cworth.org>
36 Content-Type: multipart/signed; boundary="==-=-=";
37 micalg=pgp-sha1; protocol="application/pgp-signature"
40 Content-Type: multipart/mixed; boundary="=-=-="
43 Content-Type: message/rfc822
44 Content-Disposition: inline
47 cat embedded_message >> ${MAIL_DIR}/multipart
48 cat <<EOF >> ${MAIL_DIR}/multipart
51 Content-Disposition: attachment; filename=attachment
53 This is a text attachment.
57 And this message is signed.
64 Content-Type: application/pgp-signature
66 -----BEGIN PGP SIGNATURE-----
67 Version: GnuPG v1.4.11 (GNU/Linux)
69 iEYEARECAAYFAk3SA/gACgkQ6JDdNq8qSWj0sACghqVJEQJUs3yV8zbTzhgnSIcD
70 W6cAmQE4dcYrx/LPLtYLZm1jsGauE5hE
72 -----END PGP SIGNATURE-----
76 cat <<EOF > ${MAIL_DIR}/base64-part-with-crlf
77 From: Carl Worth <cworth@cworth.org>
79 Subject: Test message with a BASE64 encoded binary containing CRLF pair
80 Date: Fri, 05 Jan 2001 15:43:57 +0000
81 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
82 Message-ID: <base64-part-with-crlf>
84 Content-Type: multipart/mixed; boundary="==-=-=";
88 The attached BASE64-encoded part expands to a binary containing a CRLF
89 pair (that is one bye of 0x0D followed by one byte of 0x0A). This is
90 designed to ensure that notmuch is not corrupting the output of this
91 part by converting the CRLF pair to an LF only (as would be appropriate
92 for display of a text part on a Linux system, for example).
94 The part should be a 3-byte file with the following sequence of 3
100 Content-Type: application/octet-stream
101 Content-Disposition: attachment; filename=crlf.bin
102 Content-Transfer-Encoding: base64
107 notmuch new > /dev/null
109 test_begin_subtest "--format=text --part=0, full message"
110 notmuch show --format=text --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
112 \fmessage{ id:87liy5ap00.fsf@yoom.home.cworth.org depth:0 match:1 excluded:0 filename:${MAIL_DIR}/multipart
114 Carl Worth <cworth@cworth.org> (2001-01-05) (attachment inbox signed unread)
115 Subject: Multipart message
116 From: Carl Worth <cworth@cworth.org>
117 To: cworth@cworth.org
118 Date: Fri, 05 Jan 2001 15:43:57 +0000
121 \fpart{ ID: 1, Content-type: multipart/signed
122 \fpart{ ID: 2, Content-type: multipart/mixed
123 \fpart{ ID: 3, Content-type: message/rfc822
125 Subject: html message
126 From: Carl Worth <cworth@cworth.org>
127 To: cworth@cworth.org
128 Date: Fri, 05 Jan 2001 15:42:57 +0000
131 \fpart{ ID: 4, Content-type: multipart/alternative
132 \fpart{ ID: 5, Content-type: text/html
133 Non-text part: text/html
135 \fpart{ ID: 6, Content-type: text/plain
136 This is an embedded message, with a multipart/alternative part.
141 \fattachment{ ID: 7, Filename: attachment, Content-type: text/plain
142 This is a text attachment.
144 \fpart{ ID: 8, Content-type: text/plain
145 And this message is signed.
150 \fpart{ ID: 9, Content-type: application/pgp-signature
151 Non-text part: application/pgp-signature
157 test_expect_equal_file OUTPUT EXPECTED
159 test_begin_subtest "--format=text --part=1, message body"
160 notmuch show --format=text --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
162 \fpart{ ID: 1, Content-type: multipart/signed
163 \fpart{ ID: 2, Content-type: multipart/mixed
164 \fpart{ ID: 3, Content-type: message/rfc822
166 Subject: html message
167 From: Carl Worth <cworth@cworth.org>
168 To: cworth@cworth.org
169 Date: Fri, 05 Jan 2001 15:42:57 +0000
172 \fpart{ ID: 4, Content-type: multipart/alternative
173 \fpart{ ID: 5, Content-type: text/html
174 Non-text part: text/html
176 \fpart{ ID: 6, Content-type: text/plain
177 This is an embedded message, with a multipart/alternative part.
182 \fattachment{ ID: 7, Filename: attachment, Content-type: text/plain
183 This is a text attachment.
185 \fpart{ ID: 8, Content-type: text/plain
186 And this message is signed.
191 \fpart{ ID: 9, Content-type: application/pgp-signature
192 Non-text part: application/pgp-signature
196 test_expect_equal_file OUTPUT EXPECTED
198 test_begin_subtest "--format=text --part=2, multipart/mixed"
199 notmuch show --format=text --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
201 \fpart{ ID: 2, Content-type: multipart/mixed
202 \fpart{ ID: 3, Content-type: message/rfc822
204 Subject: html message
205 From: Carl Worth <cworth@cworth.org>
206 To: cworth@cworth.org
207 Date: Fri, 05 Jan 2001 15:42:57 +0000
210 \fpart{ ID: 4, Content-type: multipart/alternative
211 \fpart{ ID: 5, Content-type: text/html
212 Non-text part: text/html
214 \fpart{ ID: 6, Content-type: text/plain
215 This is an embedded message, with a multipart/alternative part.
220 \fattachment{ ID: 7, Filename: attachment, Content-type: text/plain
221 This is a text attachment.
223 \fpart{ ID: 8, Content-type: text/plain
224 And this message is signed.
230 test_expect_equal_file OUTPUT EXPECTED
232 test_begin_subtest "--format=text --part=3, rfc822 part"
233 notmuch show --format=text --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
235 \fpart{ ID: 3, Content-type: message/rfc822
237 Subject: html message
238 From: Carl Worth <cworth@cworth.org>
239 To: cworth@cworth.org
240 Date: Fri, 05 Jan 2001 15:42:57 +0000
243 \fpart{ ID: 4, Content-type: multipart/alternative
244 \fpart{ ID: 5, Content-type: text/html
245 Non-text part: text/html
247 \fpart{ ID: 6, Content-type: text/plain
248 This is an embedded message, with a multipart/alternative part.
254 test_expect_equal_file OUTPUT EXPECTED
256 test_begin_subtest "--format=text --part=4, rfc822's multipart"
257 notmuch show --format=text --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
259 \fpart{ ID: 4, Content-type: multipart/alternative
260 \fpart{ ID: 5, Content-type: text/html
261 Non-text part: text/html
263 \fpart{ ID: 6, Content-type: text/plain
264 This is an embedded message, with a multipart/alternative part.
268 test_expect_equal_file OUTPUT EXPECTED
270 test_begin_subtest "--format=text --part=5, rfc822's html part"
271 notmuch show --format=text --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
273 \fpart{ ID: 5, Content-type: text/html
274 Non-text part: text/html
277 test_expect_equal_file OUTPUT EXPECTED
279 test_begin_subtest "--format=text --part=6, rfc822's text part"
280 notmuch show --format=text --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
282 \fpart{ ID: 6, Content-type: text/plain
283 This is an embedded message, with a multipart/alternative part.
286 test_expect_equal_file OUTPUT EXPECTED
288 test_begin_subtest "--format=text --part=7, inline attachement"
289 notmuch show --format=text --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
291 \fattachment{ ID: 7, Filename: attachment, Content-type: text/plain
292 This is a text attachment.
295 test_expect_equal_file OUTPUT EXPECTED
297 test_begin_subtest "--format=text --part=8, plain text part"
298 notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
300 \fpart{ ID: 8, Content-type: text/plain
301 And this message is signed.
306 test_expect_equal_file OUTPUT EXPECTED
308 test_begin_subtest "--format=text --part=9, pgp signature (unverified)"
309 notmuch show --format=text --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
311 \fpart{ ID: 9, Content-type: application/pgp-signature
312 Non-text part: application/pgp-signature
315 test_expect_equal_file OUTPUT EXPECTED
317 test_expect_success \
318 "--format=text --part=8, no part, expect error" \
319 "notmuch show --format=text --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
321 test_begin_subtest "--format=json --part=0, full message"
322 notmuch show --format=json --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
323 echo >>OUTPUT # expect *no* newline at end of output
326 {"id": "87liy5ap00.fsf@yoom.home.cworth.org", "match": true, "excluded": false, "filename": "${MAIL_DIR}/multipart", "timestamp": 978709437, "date_relative": "2001-01-05", "tags": ["attachment","inbox","signed","unread"], "headers": {"Subject": "Multipart message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:43:57 +0000"}, "body": [
327 {"id": 1, "content-type": "multipart/signed", "content": [
328 {"id": 2, "content-type": "multipart/mixed", "content": [
329 {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [
330 {"id": 4, "content-type": "multipart/alternative", "content": [
331 {"id": 5, "content-type": "text/html"},
332 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]},
333 {"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"},
334 {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]},
335 {"id": 9, "content-type": "application/pgp-signature"}]}]}
337 test_expect_equal_file OUTPUT EXPECTED
339 test_begin_subtest "--format=json --part=1, message body"
340 notmuch show --format=json --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
341 echo >>OUTPUT # expect *no* newline at end of output
344 {"id": 1, "content-type": "multipart/signed", "content": [
345 {"id": 2, "content-type": "multipart/mixed", "content": [
346 {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [
347 {"id": 4, "content-type": "multipart/alternative", "content": [
348 {"id": 5, "content-type": "text/html"},
349 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]},
350 {"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"},
351 {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]},
352 {"id": 9, "content-type": "application/pgp-signature"}]}
354 test_expect_equal_file OUTPUT EXPECTED
356 test_begin_subtest "--format=json --part=2, multipart/mixed"
357 notmuch show --format=json --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
358 echo >>OUTPUT # expect *no* newline at end of output
361 {"id": 2, "content-type": "multipart/mixed", "content": [
362 {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [
363 {"id": 4, "content-type": "multipart/alternative", "content": [
364 {"id": 5, "content-type": "text/html"},
365 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]},
366 {"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"},
367 {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}]}
369 test_expect_equal_file OUTPUT EXPECTED
371 test_begin_subtest "--format=json --part=3, rfc822 part"
372 notmuch show --format=json --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
373 echo >>OUTPUT # expect *no* newline at end of output
376 {"id": 3, "content-type": "message/rfc822", "content": [{"headers": {"Subject": "html message", "From": "Carl Worth <cworth@cworth.org>", "To": "cworth@cworth.org", "Date": "Fri, 05 Jan 2001 15:42:57 +0000"}, "body": [
377 {"id": 4, "content-type": "multipart/alternative", "content": [
378 {"id": 5, "content-type": "text/html"},
379 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}]}]}
381 test_expect_equal_file OUTPUT EXPECTED
383 test_begin_subtest "--format=json --part=4, rfc822's multipart/alternative"
384 notmuch show --format=json --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
385 echo >>OUTPUT # expect *no* newline at end of output
388 {"id": 4, "content-type": "multipart/alternative", "content": [
389 {"id": 5, "content-type": "text/html"},
390 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}]}
392 test_expect_equal_file OUTPUT EXPECTED
394 test_begin_subtest "--format=json --part=5, rfc822's html part"
395 notmuch show --format=json --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
396 echo >>OUTPUT # expect *no* newline at end of output
399 {"id": 5, "content-type": "text/html"}
401 test_expect_equal_file OUTPUT EXPECTED
403 test_begin_subtest "--format=json --part=6, rfc822's text part"
404 notmuch show --format=json --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
405 echo >>OUTPUT # expect *no* newline at end of output
408 {"id": 6, "content-type": "text/plain", "content": "This is an embedded message, with a multipart/alternative part.\n"}
410 test_expect_equal_file OUTPUT EXPECTED
412 test_begin_subtest "--format=json --part=7, inline attachment"
413 notmuch show --format=json --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
414 echo >>OUTPUT # expect *no* newline at end of output
417 {"id": 7, "content-type": "text/plain", "filename": "attachment", "content": "This is a text attachment.\n"}
419 test_expect_equal_file OUTPUT EXPECTED
421 test_begin_subtest "--format=json --part=8, plain text part"
422 notmuch show --format=json --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
423 echo >>OUTPUT # expect *no* newline at end of output
426 {"id": 8, "content-type": "text/plain", "content": "And this message is signed.\n\n-Carl\n"}
428 test_expect_equal_file OUTPUT EXPECTED
430 test_begin_subtest "--format=json --part=9, pgp signature (unverified)"
431 notmuch show --format=json --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' | sed 's|{"id":|\n{"id":|g' >OUTPUT
432 echo >>OUTPUT # expect *no* newline at end of output
435 {"id": 9, "content-type": "application/pgp-signature"}
437 test_expect_equal_file OUTPUT EXPECTED
439 test_expect_success \
440 "--format=json --part=10, no part, expect error" \
441 "notmuch show --format=json --part=10 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
443 test_begin_subtest "--format=raw"
444 notmuch show --format=raw 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
445 test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart
447 test_begin_subtest "--format=raw --part=0, full message"
448 notmuch show --format=raw --part=0 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
449 test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart
451 test_begin_subtest "--format=raw --part=1, message body"
452 notmuch show --format=raw --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
453 test_expect_equal_file OUTPUT "${MAIL_DIR}"/multipart
455 test_begin_subtest "--format=raw --part=2, multipart/mixed"
456 notmuch show --format=raw --part=2 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
458 Content-Type: multipart/mixed; boundary="=-=-="
461 Content-Type: message/rfc822
462 Content-Disposition: inline
464 From: Carl Worth <cworth@cworth.org>
465 To: cworth@cworth.org
466 Subject: html message
467 Date: Fri, 05 Jan 2001 15:42:57 +0000
468 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
469 Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>
471 Content-Type: multipart/alternative; boundary="==-=-=="
474 Content-Type: text/html
476 <p>This is an embedded message, with a multipart/alternative part.</p>
479 Content-Type: text/plain
481 This is an embedded message, with a multipart/alternative part.
486 Content-Disposition: attachment; filename=attachment
488 This is a text attachment.
492 And this message is signed.
498 test_expect_equal_file OUTPUT EXPECTED
500 test_begin_subtest "--format=raw --part=3, rfc822 part"
501 notmuch show --format=raw --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
502 test_expect_equal_file OUTPUT embedded_message
504 test_begin_subtest "--format=raw --part=4, rfc822's multipart"
505 notmuch show --format=raw --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
507 From: Carl Worth <cworth@cworth.org>
508 To: cworth@cworth.org
509 Subject: html message
510 Date: Fri, 05 Jan 2001 15:42:57 +0000
511 User-Agent: Notmuch/0.5 (http://notmuchmail.org) Emacs/23.3.1 (i486-pc-linux-gnu)
512 Message-ID: <87liy5ap01.fsf@yoom.home.cworth.org>
514 Content-Type: multipart/alternative; boundary="==-=-=="
517 Content-Type: text/html
519 <p>This is an embedded message, with a multipart/alternative part.</p>
522 Content-Type: text/plain
524 This is an embedded message, with a multipart/alternative part.
528 test_expect_equal_file OUTPUT EXPECTED
530 test_begin_subtest "--format=raw --part=5, rfc822's html part"
531 notmuch show --format=raw --part=5 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
533 <p>This is an embedded message, with a multipart/alternative part.</p>
535 test_expect_equal_file OUTPUT EXPECTED
537 test_begin_subtest "--format=raw --part=6, rfc822's text part"
538 notmuch show --format=raw --part=6 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
540 This is an embedded message, with a multipart/alternative part.
542 test_expect_equal_file OUTPUT EXPECTED
544 test_begin_subtest "--format=raw --part=7, inline attachment"
545 notmuch show --format=raw --part=7 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
547 This is a text attachment.
549 test_expect_equal_file OUTPUT EXPECTED
551 test_begin_subtest "--format=raw --part=8, plain text part"
552 notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
554 And this message is signed.
558 test_expect_equal_file OUTPUT EXPECTED
560 test_begin_subtest "--format=raw --part=9, pgp signature (unverified)"
561 notmuch show --format=raw --part=9 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
562 # output should *not* include newline
565 -----BEGIN PGP SIGNATURE-----
566 Version: GnuPG v1.4.11 (GNU/Linux)
568 iEYEARECAAYFAk3SA/gACgkQ6JDdNq8qSWj0sACghqVJEQJUs3yV8zbTzhgnSIcD
569 W6cAmQE4dcYrx/LPLtYLZm1jsGauE5hE
571 -----END PGP SIGNATURE-----
573 test_expect_equal_file OUTPUT EXPECTED
575 test_expect_success \
576 "--format=raw --part=10, no part, expect error" \
577 "notmuch show --format=raw --part=8 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
579 test_begin_subtest "--format=mbox"
580 notmuch show --format=mbox 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
581 printf "From cworth@cworth.org Fri Jan 5 15:43:57 2001\n" >EXPECTED
582 cat "${MAIL_DIR}"/multipart >>EXPECTED
583 # mbox output is expected to include a blank line
585 test_expect_equal_file OUTPUT EXPECTED
587 test_expect_success \
588 "--format=mbox --part=1, incompatible, expect error" \
589 "! notmuch show --format=mbox --part=1 'id:87liy5ap00.fsf@yoom.home.cworth.org'"
591 test_begin_subtest "'notmuch reply' to a multipart message"
592 notmuch reply 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
594 From: Notmuch Test Suite <test_suite@notmuchmail.org>
595 Subject: Re: Multipart message
596 To: Carl Worth <cworth@cworth.org>, cworth@cworth.org
597 In-Reply-To: <87liy5ap00.fsf@yoom.home.cworth.org>
598 References: <87liy5ap00.fsf@yoom.home.cworth.org>
600 On Fri, 05 Jan 2001 15:43:57 +0000, Carl Worth <cworth@cworth.org> wrote:
601 > From: Carl Worth <cworth@cworth.org>
602 > To: cworth@cworth.org
603 > Subject: html message
604 > Date: Fri, 05 Jan 2001 15:42:57 +0000
606 Non-text part: text/html
607 > This is an embedded message, with a multipart/alternative part.
608 > This is a text attachment.
609 > And this message is signed.
613 test_expect_equal_file OUTPUT EXPECTED
615 test_begin_subtest "'notmuch reply' to a multipart message with json format"
616 notmuch reply --format=json 'id:87liy5ap00.fsf@yoom.home.cworth.org' | notmuch_json_show_sanitize >OUTPUT
618 {"reply-headers": {"Subject": "Re: Multipart message",
619 "From": "Notmuch Test Suite <test_suite@notmuchmail.org>",
620 "To": "Carl Worth <cworth@cworth.org>,
622 "In-reply-to": "<87liy5ap00.fsf@yoom.home.cworth.org>",
623 "References": " <87liy5ap00.fsf@yoom.home.cworth.org>"},
624 "original": {"id": "XXXXX",
628 "timestamp": 978709437,
629 "date_relative": "2001-01-05",
630 "tags": ["attachment","inbox","signed","unread"],
631 "headers": {"Subject": "Multipart message",
632 "From": "Carl Worth <cworth@cworth.org>",
633 "To": "cworth@cworth.org",
635 05 Jan 2001 15:43:57 +0000"},
637 "content-type": "multipart/signed",
638 "content": [{"id": 2,
639 "content-type": "multipart/mixed",
640 "content": [{"id": 3,
641 "content-type": "message/rfc822",
642 "content": [{"headers": {"Subject": "html message",
643 "From": "Carl Worth <cworth@cworth.org>",
644 "To": "cworth@cworth.org",
646 05 Jan 2001 15:42:57 +0000"},
648 "content-type": "multipart/alternative",
649 "content": [{"id": 5,
650 "content-type": "text/html"},
652 "content-type": "text/plain",
653 "content": "This is an embedded message,
654 with a multipart/alternative part.\n"}]}]}]},
656 "content-type": "text/plain",
658 "content": "This is a text attachment.\n"},
660 "content-type": "text/plain",
661 "content": "And this message is signed.\n\n-Carl\n"}]},
663 "content-type": "application/pgp-signature"}]}]}}
665 test_expect_equal_file OUTPUT EXPECTED
667 test_begin_subtest "'notmuch show --part' does not corrupt a part with CRLF pair"
668 notmuch show --format=raw --part=3 id:base64-part-with-crlf > crlf.out
669 echo -n -e "\xEF\x0D\x0A" > crlf.expected
670 test_expect_equal_file crlf.out crlf.expected