2 ######################################################
6 ######################################################
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir
=`dirname $0`/..
/..
12 MH_OBJ_DIR
=`cd $srcdir && pwd`; export MH_OBJ_DIR
15 .
"${srcdir}/test/post/test-post-common.sh"
18 expected
="$MH_TEST_DIR/test-mhfixmsg$$.expected"
19 expected_err
="$MH_TEST_DIR/test-mhfixmsg$$.expected_err"
20 actual
="$MH_TEST_DIR/test-mhfixmsg$$.actual"
21 actual_err
="$MH_TEST_DIR/test-mhfixmsg$$.actual_err"
24 if grep mhfixmsg
-format-text/html
"${MH_TEST_DIR}/Mail/mhn.defaults" \
26 can_reformat_texthtml
=1
28 echo "$0: skipping -reformat check because
29 mhfixmsg-format-text/html is not available"
30 can_reformat_texthtml
=0
36 # Verified behavior consistent with compiled sendmail.
37 cat >"$expected" <<EOF
38 Usage: mhfixmsg [+folder] [msgs] [switches]
53 mhfixmsg
-help >"$actual" 2>&1
54 check
"$expected" "$actual"
58 # Verified same behavior as compiled mhfixmsg.
59 case `mhfixmsg -version` in
61 *) printf '%s: mhfixmsg -version generated unexpected output\n' "$0" >&2
62 failed
=`expr ${failed:-0} + 1`;;
66 # check that non-MIME messages aren't modified
68 run_test
'mhfixmsg first -outfile '"$actual" ''
69 check
"`mhpath first`" "$actual" 'keep first'
72 # check that non-MIME messages with no bodies aren't modified
74 cat >`mhpath new` <<EOF
75 From: Test <test@example.com>
76 To: Some User <user@example.com>
77 Date: Fri, 29 Sep 2006 00:00:00
79 Subject: message with no body
82 run_test
'mhfixmsg last -outfile '"$actual" ''
83 check
"`mhpath last`" "$actual"
87 cat >"$MH_TEST_DIR"/Mail
/inbox
/11 <<EOF
90 Subject: =?ISO-8859-15?Q?Re=3A_H=E5lla_linuxsystem_uppdaterade?=
91 User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
93 Content-Type: MULTIPART/MIXED;
94 BOUNDARY="----=_NextPart_000_0000_00000000.00000000"
95 Content-Transfer-Encoding: QUOTED-PRINTABLE
97 This message is in MIME format. The first part should be readable
99 while the remaining parts are likely unreadable without MIME-aware
102 ------=_NextPart_000_0000_00000000.00000000
103 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15
104 Content-Transfer-Encoding: 8BIT
106 Some text in swedish.
108 Varf=C3=B6r inte anv=C3=A4nda...
110 ------=_NextPart_000_0000_00000000.00000000--
112 And some text after the last part.
115 cp -p "$MH_TEST_DIR"/Mail
/inbox
/11 "$MH_TEST_DIR"/Mail
/inbox
/12
117 run_test
'mhfixmsg last -nofixcte' ''
118 check
"$MH_TEST_DIR"/Mail
/inbox
/11 "$MH_TEST_DIR"/Mail
/inbox
/12 'keep first'
121 # check -fixcte (enabled by default): fixup of erroneous C-T-E in multipart
123 cat >"$expected" <<EOF
126 Subject: =?ISO-8859-15?Q?Re=3A_H=E5lla_linuxsystem_uppdaterade?=
127 User-Agent: Alpine 2.00 (DEB 1167 2008-08-23)
129 Content-Type: MULTIPART/MIXED;
130 BOUNDARY="----=_NextPart_000_0000_00000000.00000000"
131 Nmh-REPLACED-INVALID-Content-Transfer-Encoding: QUOTED-PRINTABLE
132 Content-Transfer-Encoding: 8bit
134 This message is in MIME format. The first part should be readable
136 while the remaining parts are likely unreadable without MIME-aware
139 ------=_NextPart_000_0000_00000000.00000000
140 Content-Type: TEXT/PLAIN; CHARSET=ISO-8859-15
141 Content-Transfer-Encoding: 8BIT
143 Some text in swedish.
145 Varf=C3=B6r inte anv=C3=A4nda...
147 ------=_NextPart_000_0000_00000000.00000000--
149 And some text after the last part.
152 run_test
'mhfixmsg last -outfile '"$actual"' -verbose' \
153 "mhfixmsg: 11, replace Content-Transfer-Encoding of \
154 QUOTED-PRINTABLE with 8 bit"
155 check
"$expected" "$actual" 'keep first'
158 # check with no options: checks backup
159 cp "$MH_TEST_DIR"/Mail
/inbox
/11 "$MH_TEST_DIR"/Mail
/inbox
/11.original
160 folder last
>/dev
/null
161 run_test
'mhfixmsg' ''
162 check
"$expected" "$MH_TEST_DIR"/Mail
/inbox
/11 'keep first'
163 cp "$MH_TEST_DIR"/Mail
/inbox
/11.original
"$MH_TEST_DIR"/Mail
/inbox
/11
164 check
"$MH_TEST_DIR"/Mail
/inbox
/,11 "$MH_TEST_DIR"/Mail
/inbox
/11.original
167 # check backup with -file
168 cp "$MH_TEST_DIR"/Mail
/inbox
/11 "$MH_TEST_DIR"/Mail
/inbox
/11.original
169 folder last
>/dev
/null
170 run_test
'mhfixmsg -file '"$MH_TEST_DIR"/Mail
/inbox
/11 ''
171 check
"$MH_TEST_DIR"/Mail
/inbox
/11 "$expected" 'keep first'
172 check
"$MH_TEST_DIR"/Mail
/inbox
/,11 "$MH_TEST_DIR"/Mail
/inbox
/11.original
175 # check -reformat (enabled by default): addition of text/plain part
176 # to solitary text/html part
178 cat >"$expected" <<EOF
180 From: sender@example.com
181 To: bonquiqui@example.com
183 Date: Sat, 26 Jan 2013 17:37:53 -0500
184 Content-Type: multipart/alternative; boundary="----=_nmh-multipart"
186 ------=_nmh-multipart
187 Content-Type: text/plain; charset="Windows-1252"
188 Content-Transfer-Encoding: 8bit
190 Need to go! Need ... to ... go!
192 ------=_nmh-multipart
193 Content-Type: text/html; charset="Windows-1252"
194 Content-Transfer-Encoding: 8bit
198 <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
199 <meta name="Generator" content="Microsoft Exchange Server">
200 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
204 <div>Need to go! Need ... to ... go!</div>
208 ------=_nmh-multipart--
211 cat >"$MH_TEST_DIR"/Mail
/inbox
/12 <<EOF
213 From: sender@example.com
214 To: bonquiqui@example.com
216 Date: Sat, 26 Jan 2013 17:37:53 -0500
217 Content-Type: text/html; charset="Windows-1252"
218 Content-Transfer-Encoding: quoted-printable
222 <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
224 <meta name=3D"Generator" content=3D"Microsoft Exchange Server">
225 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; pad=
226 ding-left: 4pt; border-left: #800000 2px solid; } --></style>
230 <div>Need to go! Need ... to ... go!</div>
235 if [ $can_reformat_texthtml -eq 1 ]; then
236 printf '%s\n' "mhfixmsg: 12, insert text/plain part
237 mhfixmsg: 12 part 1, decode text/html; charset=\"Windows-1252\"" \
240 #### lynx inserts multiple blank lines, so use uniq to squeeze them.
241 mhfixmsg last
-outfile - -verbose 2>"$actual.err" | uniq >"$actual"
242 check
"$expected" "$actual"
243 check
"$expected.err" "$actual.err"
247 # check handling of boundary string that appears in message body
249 cat >"$expected" <<EOF
251 From: sender@example.com
252 To: bonquiqui@example.com
254 Date: Sat, 26 Jan 2013 17:37:53 -0500
255 Content-Type: multipart/alternative; boundary="----=_nmh-multipart-3"
257 ------=_nmh-multipart-3
258 Content-Type: text/plain; charset="Windows-1252"
259 Content-Transfer-Encoding: 8bit
261 ------=_nmh-multipart
262 ------=_nmh-multipart-1
263 ------=_nmh-multipart-2
265 ------=_nmh-multipart-3
266 Content-Type: text/html; charset="Windows-1252"
267 Content-Transfer-Encoding: 8bit
271 <meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
272 <meta name="Generator" content="Microsoft Exchange Server">
273 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
276 ------=_nmh-multipart<br>
277 ------=_nmh-multipart-1<br>
278 ------=_nmh-multipart-2<br>
282 ------=_nmh-multipart-3--
285 cat >"$MH_TEST_DIR"/Mail
/inbox
/12 <<EOF
287 From: sender@example.com
288 To: bonquiqui@example.com
290 Date: Sat, 26 Jan 2013 17:37:53 -0500
291 Content-Type: text/html; charset="Windows-1252"
292 Content-Transfer-Encoding: quoted-printable
296 <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
298 <meta name=3D"Generator" content=3D"Microsoft Exchange Server">
299 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; pad=
300 ding-left: 4pt; border-left: #800000 2px solid; } --></style>
303 ------=3D_nmh-multipart<br>
304 ------=3D_nmh-multipart-1<br>
305 ------=3D_nmh-multipart-2<br>
310 if [ $can_reformat_texthtml -eq 1 ]; then
311 printf '%s\n' "mhfixmsg: 12, insert text/plain part
312 mhfixmsg: 12 part 1, decode text/html; charset=\"Windows-1252\"" \
315 #### lynx inserts multiple blank lines, so use uniq to squeeze them.
316 mhfixmsg last
-outfile - -verbose 2>"$actual.err" | uniq >"$actual"
317 check
"$expected" "$actual"
318 check
"$expected.err" "$actual.err"
323 cat >"$expected" <<EOF
325 From: sender@example.com
326 To: bonquiqui@example.com
328 Date: Sat, 26 Jan 2013 17:37:53 -0500
329 Content-Type: multipart/alternative; boundary="----=_nmh-multipart"
331 ------=_nmh-multipart
332 Content-Type: text/plain; charset="Windows-1252"
333 Content-Transfer-Encoding: 8bit
335 Need to go! Need ... to ... go!
337 ------=_nmh-multipart
338 Content-Type: text/html; charset="Windows-1252"
339 Content-Transfer-Encoding: quoted-printable
343 <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-=
345 <meta name=3D"Generator" content=3D"Microsoft Exchange Server">
346 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; pa=
347 dding-left: 4pt; border-left: #800000 2px solid; } --></style>
351 <div>Need to go! Need ... to ... go!</div>
355 ------=_nmh-multipart--
358 cat >"$MH_TEST_DIR"/Mail
/inbox
/12 <<EOF
360 From: sender@example.com
361 To: bonquiqui@example.com
363 Date: Sat, 26 Jan 2013 17:37:53 -0500
364 Content-Type: text/html; charset="Windows-1252"
365 Content-Transfer-Encoding: quoted-printable
369 <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
371 <meta name=3D"Generator" content=3D"Microsoft Exchange Server">
372 <!-- converted from text --><style><!-- .EmailQuote { margin-left: 1pt; pad=
373 ding-left: 4pt; border-left: #800000 2px solid; } --></style>
377 <div>Need to go! Need ... to ... go!</div>
382 if [ $can_reformat_texthtml -eq 1 ]; then
383 printf '%s\n' 'mhfixmsg: 12, insert text/plain part' >"$expected.err"
385 #### lynx inserts multiple blank lines, so use uniq to squeeze them.
386 mhfixmsg last
-nodecode -outfile - -verbose 2>"$actual.err" | uniq >"$actual"
387 check
"$expected" "$actual"
388 check
"$expected.err" "$actual.err"
392 # check -decode (enabled by default)
393 cat >"$expected" <<EOF
394 To: recipient@example.com
395 From: sender@example.com
396 Subject: mhfixmsg decode test
398 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
400 ------- =_aaaaaaaaaa0
401 Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
402 Content-Disposition: attachment; filename="test4.txt"
403 Content-Transfer-Encoding: 8bit
405 This is a text/plain part.
407 ------- =_aaaaaaaaaa0--
412 To: recipient@example.com
413 From: sender@example.com
414 Subject: mhfixmsg decode test
416 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
418 ------- =_aaaaaaaaaa0
419 Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
420 Content-Disposition: attachment; filename="test4.txt"
421 Content-Transfer-Encoding: base64
423 VGhpcyBpcyBhIHRleHQvcGxhaW4gcGFydC4K
425 ------- =_aaaaaaaaaa0--
428 mhfixmsg last
-outfile "$actual"
429 check
"$expected" "$actual"
432 # check -decode with more complicated content structure
434 To: recipient@example.com
435 From: sender@example.com
436 Subject: mhfixmsg decode test 2
438 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
440 This is additional content before the first subpart of the multipart.
442 ------- =_aaaaaaaaaa0
443 Content-Type: multipart/related;
444 type="multipart/alternative";
445 boundary="subpart__1.1"
448 Content-Type: text/plain; charset="iso-8859-1"
449 Content-Disposition: attachment; filename="test1.txt"
451 This is the first text/plain part, in a subpart.
455 This is additional content after the last subpart of the multipart.
457 ------- =_aaaaaaaaaa0
458 Content-Type: text/plain; charset="iso-8859-1"
459 Content-Disposition: attachment; filename="test2.txt"
460 Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
461 Content-Transfer-Encoding: 8bit
463 This is the second text/plain part.
465 ------- =_aaaaaaaaaa0
466 Content-Type: text/plain; charset="iso-8859-1"
467 Content-Disposition: attachment; filename="test3.txt"
469 This is the third text/plain part.
471 ------- =_aaaaaaaaaa0
472 Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
473 Content-Disposition: attachment; filename="test4.txt"
474 Content-Transfer-Encoding: 8bit
476 This is the fourth text/plain part.
478 ------- =_aaaaaaaaaa0--
480 This is additional content after the last subpart of the multipart.
485 To: recipient@example.com
486 From: sender@example.com
487 Subject: mhfixmsg decode test 2
489 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
491 This is additional content before the first subpart of the multipart.
493 ------- =_aaaaaaaaaa0
494 Content-Type: multipart/related;
495 type="multipart/alternative";
496 boundary="subpart__1.1"
499 Content-Type: text/plain; charset="iso-8859-1"
500 Content-Disposition: attachment; filename="test1.txt"
502 This is the first text/plain part, in a subpart.
506 This is additional content after the last subpart of the multipart.
508 ------- =_aaaaaaaaaa0
509 Content-Type: text/plain; charset="iso-8859-1"
510 Content-Disposition: attachment; filename="test2.txt"
511 Content-MD5: kq+Hnc2SD/eKwAnkFBDuEA==
512 Content-Transfer-Encoding: quoted-printable
514 This is the second text/plain part.
516 ------- =_aaaaaaaaaa0
517 Content-Type: text/plain; charset="iso-8859-1"
518 Content-Disposition: attachment; filename="test3.txt"
520 This is the third text/plain part.
522 ------- =_aaaaaaaaaa0
523 Content-Type: text/plain; charset="iso-8859-1"; name="test4.txt"
524 Content-Disposition: attachment; filename="test4.txt"
525 Content-Transfer-Encoding: base64
527 VGhpcyBpcyB0aGUgZm91cnRoIHRleHQvcGxhaW4gcGFydC4K
529 ------- =_aaaaaaaaaa0--
531 This is additional content after the last subpart of the multipart.
533 mhfixmsg last
-outfile "$actual"
534 check
"$expected" "$actual"
537 # check attempted -decode of binary text
538 #### Generated the encoded text below with:
539 #### $ printf '\x0d\xbd\xb2=\xbc\n' | base64
542 To: recipient@example.com
543 From: sender@example.com
544 Subject: mhfixmsg attempted binary decode test
546 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
548 ------- =_aaaaaaaaaa0
549 Content-Type: text/plain; charset="iso-8859-1"; name="square.txt"
550 Content-Transfer-Encoding: base64
554 ------- =_aaaaaaaaaa0--
557 cp -p `mhpath last` "$expected"
559 check
`mhpath last` "$expected" 'keep first'
562 # check -decode of binary text
563 printf "%s\x0d\xbd\xb2=\xbc%s" "To: recipient@example.com
564 From: sender@example.com
565 Subject: mhfixmsg binary decode test
567 Content-Type: multipart/mixed; boundary=\"----- =_aaaaaaaaaa0\"
569 ------- =_aaaaaaaaaa0
570 Content-Type: text/plain; charset=\"iso-8859-1\"; name=\"square.txt\"
571 Content-Transfer-Encoding: binary
575 ------- =_aaaaaaaaaa0--
577 ## output_content() in mhoutsbr.c can't handle binary content.
578 ## mhfixmsg last -decodetext binary -outfile "$actual"
579 ## check "$expected" "$actual"
585 # Also checks preservation of attributes after one (charset) that is
587 cat >"$expected" <<EOF
588 To: recipient@example.com
589 From: sender@example.com
590 Subject: mhfixmsg textcodeset test
592 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
594 ------- =_aaaaaaaaaa0
595 Content-Type: text/plain; charset="utf-8"; name="square.txt"
596 Content-Disposition: attachment; filename="square.txt"
597 Content-Transfer-Encoding: 8bit
601 ------- =_aaaaaaaaaa0--
604 #### Generated the encoded text below with:
605 #### $ printf '\xbd\xb2=\xbc\n' | base64
608 To: recipient@example.com
609 From: sender@example.com
610 Subject: mhfixmsg textcodeset test
612 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
614 ------- =_aaaaaaaaaa0
615 Content-Type: text/plain; charset="iso-8859-1"; name="square.txt"
616 Content-Disposition: attachment; filename="square.txt"
617 Content-Transfer-Encoding: base64
621 ------- =_aaaaaaaaaa0--
625 mhfixmsg last
-textcodeset utf
-8 -outfile "$actual" 2>"$actual.err"
626 if grep "mhfixmsg: Can't convert .* to .* without iconv" "$actual.err" \
628 echo skipping
-textcodeset check because nmh was built without
iconv
630 rm -f "$expected" "$actual" "$actual.err"
633 check
"$expected" "$actual"
638 # check -nofixboundary
639 cat >"$expected" <<EOF
642 cat >`mhpath new` <<EOF
643 Date: Fri, 13 May 2011 08:21:12 -0500
644 Content-Type: multipart/alternative;
645 boundary="----=_NextPart_000_1781A17_01CC1147.81E9467A"
646 Content-Transfer-Encoding: 8bit
648 From: <sender@example.com>
649 To: <recipient@example.com>
650 Subject: mhfixmsg bad boundary test
652 This is a multi-part message in MIME format.
654 ------=_NextPart_000_1781A1A_01CC1147.81EBA8D4
655 Content-Type: text/plain
657 The boundaries of this part don't match the header boundary.
659 ------=_NextPart_000_1781A1A_01CC1147.81EBA8D4--
662 cp -p `mhpath last` `mhpath new`
664 run_test
'mhfixmsg last -nofixboundary' ''
665 check
"$MH_TEST_DIR"/Mail
/inbox
/16 "$MH_TEST_DIR"/Mail
/inbox
/17 'keep first'
668 # check that message is not output when fed through stdin
669 mhfixmsg
-file - -verbose <`mhpath last` >"$actual" 2>"$actual.err"
670 check
"$expected" "$actual"
671 if grep "mhfixmsg: $MH_TEST_DIR/Mail/.*, fix multipart boundary" \
672 "$actual.err" >/dev
/null
; then
675 echo "$0: test failed, output is in $actual.err."
676 failed
=`expr ${failed:-0} + 1`
680 # check fixup of erroneous boundary in multipart (-fixboundary,
681 # enabled by default)
683 cat >"$expected" <<EOF
684 Date: Fri, 13 May 2011 08:21:12 -0500
685 Content-Type: multipart/alternative;
686 boundary="----=_NextPart_000_1781A1A_01CC1147.81EBA8D4"
687 Content-Transfer-Encoding: 8bit
689 From: <sender@example.com>
690 To: <recipient@example.com>
691 Subject: mhfixmsg bad boundary test
693 This is a multi-part message in MIME format.
695 ------=_NextPart_000_1781A1A_01CC1147.81EBA8D4
696 Content-Type: text/plain
698 The boundaries of this part don't match the header boundary.
700 ------=_NextPart_000_1781A1A_01CC1147.81EBA8D4--
703 run_test
'mhfixmsg last -outfile '"$actual"' -verbose' \
704 "mhfixmsg: 16, fix multipart boundary"
705 check
"$expected" "$actual"
708 # check that text/plain part is added to lone text/html in multipart/related
709 cat >"$expected" <<EOF
711 Date: Tue, 26 Feb 2013 18:07:20 -0600
712 Subject: multipart/related, not /alternative
713 Content-Type: multipart/related;
714 boundary="----=_Part_90310_101292502.1"
716 ------=_Part_90310_101292502.1
717 Content-Type: multipart/alternative; boundary="----=_nmh-multipart1"
719 ------=_nmh-multipart1
720 Content-Type: text/plain; charset="us-ascii"
721 Content-Transfer-Encoding: 7bit
723 This is the real content.
725 ------=_nmh-multipart1
726 Content-Type: text/html; charset="us-ascii"
727 Content-Transfer-Encoding: 7bit
730 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
731 <title>HTML Content</title>
734 This is the real content.
738 ------=_nmh-multipart1--
740 ------=_Part_90310_101292502.1
741 Content-Type: text/plain; charset="us-ascii"
742 Content-Transfer-Encoding: 7bit
744 Your email client does not support HTML messages
746 ------=_Part_90310_101292502.1--
749 cat >`mhpath new` <<EOF
751 Date: Tue, 26 Feb 2013 18:07:20 -0600
752 Subject: multipart/related, not /alternative
753 Content-Type: multipart/related;
754 boundary="----=_Part_90310_101292502.1"
756 ------=_Part_90310_101292502.1
757 Content-Type: text/html; charset="us-ascii"
758 Content-Transfer-Encoding: 7bit
761 <meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
762 <title>HTML Content</title>
765 This is the real content.
768 ------=_Part_90310_101292502.1
769 Content-Type: text/plain; charset="us-ascii"
770 Content-Transfer-Encoding: 7bit
772 Your email client does not support HTML messages
773 ------=_Part_90310_101292502.1--
776 if [ $can_reformat_texthtml -eq 1 ]; then
777 #### lynx inserts multiple blank lines, so use uniq to squeeze them.
778 mhfixmsg last
-outfile - | uniq >"$actual"
779 check
"$expected" "$actual"
784 # check handling of rfc822 message type
785 cat >"$expected" <<EOF
786 From: Test <test@example.com>
787 To: Some User <user@example.com>
788 Date: Fri, 29 Sep 2006 00:00:00
789 Message-Id: @test.nmh
790 Subject: message with message/rfc822 attachment
792 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
794 and some garbage before the attachment
796 ------- =_aaaaaaaaaa0
797 Content-Type: message/rfc822; name="1552"; charset="us-ascii"
798 Content-Description: 1552
799 Content-Disposition: attachment; filename="1552"
801 From: Test <test@example.com>
802 To: <another_user@example.com>
803 Date: Thu, 28 Sep 2006 00:00:00
804 Message-Id: @test.nmh
805 Subject: message/rfc822 attachment
807 This is an RFC-822 message.
809 ------- =_aaaaaaaaaa0--
811 and some garbage at the end
814 cat >`mhpath new` <<EOF
815 From: Test <test@example.com>
816 To: Some User <user@example.com>
817 Date: Fri, 29 Sep 2006 00:00:00
818 Message-Id: @test.nmh
819 Subject: message with message/rfc822 attachment
821 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaa0"
823 and some garbage before the attachment
825 ------- =_aaaaaaaaaa0
826 Content-Type: message/rfc822; name="1552"; charset="us-ascii"
827 Content-Description: 1552
828 Content-Disposition: attachment; filename="1552"
830 From: Test <test@example.com>
831 To: <another_user@example.com>
832 Date: Thu, 28 Sep 2006 00:00:00
833 Message-Id: @test.nmh
834 Subject: message/rfc822 attachment
836 This is an RFC-822 message.
838 ------- =_aaaaaaaaaa0--
840 and some garbage at the end
843 run_test
'mhfixmsg last -outfile '"$actual" ''
844 check
"$expected" "$actual"
848 cat >"$MH_TEST_DIR/Mail/rmmproc" <<'EOF'
851 chmod a
+x
"${MH_TEST_DIR}/Mail/rmmproc"
852 echo "rmmproc: ${MH_TEST_DIR}/Mail/rmmproc" >>"$MH"
853 cp "${MH_TEST_DIR}/Mail/inbox/14" "${MH_TEST_DIR}/Mail/inbox/14.original"
855 run_test
'mhfixmsg 14' ''
856 check
"${MH_TEST_DIR}/Mail/inbox/14.backup" \
857 "${MH_TEST_DIR}/Mail/inbox/14.original"
860 # make sure there are no tmp files left over
861 find "$MH_TEST_DIR/Mail" \
( -name 'mhfix*' -o -name ',mhfix*' \
) -print \
863 cat >"$expected" <<EOF
866 check
"$expected" "$actual"