]> diplodocus.org Git - nmh/blob - test/mhmail/test-mhmail
Change test-mhmail so it can handle a MIMETYPEPROC that doesn't output
[nmh] / test / mhmail / test-mhmail
1 #!/bin/sh
2 ######################################################
3 #
4 # Test mhmail
5 #
6 ######################################################
7
8 set -e
9
10 if test -z "${MH_OBJ_DIR}"; then
11 srcdir=`dirname $0`/../..
12 MH_OBJ_DIR=`cd $srcdir && pwd`; export MH_OBJ_DIR
13 fi
14
15 . "${srcdir}/test/post/test-post-common.sh"
16
17 # Find MIME type string, using mimetypeproc if configured with it.
18 MIMETYPEPROC=`mhparam mimetypeproc`
19 content_type_string() {
20 if test -z "$MIMETYPEPROC"; then
21 echo "text/plain; name=\"`basename $1`\"; charset=\"us-ascii\""
22 else
23 # 1) Excise leading filename followed by : and any whitespace.
24 # 2) Wrap charset value in double quotes. Assume that it isn't already.
25 printf "%s%s" \
26 `$MIMETYPEPROC $1` "; name=\"`basename $1`\"; charset=\"us-ascii\""
27 fi
28 }
29
30 # Customize test_post () for use with mhmail.
31 # $1 is expected output file, provided by caller
32 # $2 is mhmail switches, except for -body
33 # $3 of -b signifies use -body switch, | signifies provide body on stdin
34 # $4 contains the message body.
35 test_mhmail ()
36 {
37 pid=`"${MH_OBJ_DIR}/test/fakesmtp" "$actual" $localport`
38
39 if [ $3 = '|' ]; then
40 printf '%s' "$4" | mhmail recipient@example.com $2 \
41 -server 127.0.0.1 -port $localport
42 else
43 mhmail recipient@example.com $2 -body "$4" \
44 -server 127.0.0.1 -port $localport
45 fi
46
47 #
48 # It's hard to calculate the exact Date: header post is going to
49 # use, so we'll just use sed to remove the actual date so we can easily
50 # compare it against our "correct" output. And same for
51 # Message-ID.
52 #
53
54 sed -e 's/^Date:.*/Date:/' \
55 -e 's/^Resent-Date:.*/Resent-Date:/' \
56 -e 's/^Message-ID:.*/Message-ID:/' "$actual" > "$actual".nodate
57 rm -f "$actual"
58
59 check "$actual".nodate "$1"
60 }
61
62 expected=$MH_TEST_DIR/test-mhmail$$.expected
63 expected_err=$MH_TEST_DIR/test-mhmail$$.expected_err
64 actual=$MH_TEST_DIR/test-mhmail$$.actual
65 actual_err=$MH_TEST_DIR/test-mhmail$$.actual_err
66
67
68 # check -help
69 # Verified behavior consistent with compiled sendmail.
70 cat >$expected <<EOF
71 Usage: mhmail [-t(o)] addrs ... [switches]
72 switches are:
73 -at(tach) file [-at(tach) file] ...
74 -b(ody) text
75 -c(c) addrs ...
76 -f(rom) addr
77 -hea(derfield) name:value [-hea(derfield) name:value] ...
78 -su(bject) text
79 -r(esent)
80 -pr(ofile)
81 -se(nd)
82 -nose(nd)
83 -v(ersion)
84 -hel(p)
85 and all post(8)/send(1) switches
86 mhmail with no arguments is equivalent to inc
87 EOF
88
89 mhmail -help >$actual 2>&1
90 check $expected $actual
91
92
93 # check -version
94 # Verified same behavior as compiled mhmail.
95 case `mhmail -v` in
96 mhmail\ --*) ;;
97 * ) printf '%s: mhmail -v generated unexpected output\n' "$0" >&2
98 failed=`expr ${failed:-0} + 1`;;
99 esac
100
101 # check for missing argument to switches that require them
102 for switch in attach body cc from headerfield subject to; do
103 run_test "mhmail recipient -$switch" \
104 "mhmail: missing argument to -$switch"
105 done
106 for switch in attach body cc from headerfield subject to; do
107 run_test "mhmail recipient -$switch -nosend" \
108 "mhmail: missing argument to -$switch"
109 done
110 for switch in attach body cc from headerfield subject to; do
111 run_test "mhmail recipient -$switch -server 127.0.0.1" \
112 "mhmail: missing argument to -$switch"
113 done
114
115
116 # check with no switches
117 # That will just run inc, which we don't want to do anything,
118 # so tell inc to just display its version.
119 # Verified same behavior as compiled mhmail.
120 printf 'inc: -version\n' >> $MH
121 case `mhmail` in
122 inc\ --*) ;;
123 * ) echo "$0: mhmail generated unexpected output" >&2
124 failed=`expr ${failed:-0} + 1`;;
125 esac
126
127
128 # check -nosend
129 # Not supported by compiled mhmail.
130 mhmail -nosend recipient@example.com -from sender1@localhost \
131 -server 127.0.0.1 -port $localport -body '' >"$actual" 2>"$actual_err"
132
133 cat > "$expected" <<EOF
134 To: recipient@example.com
135 From: sender1@localhost
136
137
138 EOF
139
140 cat > "$expected_err" <<EOF
141 EOF
142
143 check "$expected" "$actual"
144 check "$expected_err" "$actual_err"
145 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
146
147
148 # check -send
149 # Not supported by compiled mhmail.
150 cat > "$expected" <<EOF
151 EHLO nosuchhost.example.com
152 MAIL FROM:<sender2@localhost>
153 RCPT TO:<recipient@example.com>
154 DATA
155 To: recipient@example.com
156 From: sender2@localhost
157 Date:
158
159 message
160 .
161 QUIT
162 EOF
163
164 test_mhmail "$expected" "-from sender2@localhost -nosend -send" '|' message
165 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
166
167
168 # check -from
169 # Verified same behavior as compiled mhmail.
170 cat > "$expected" <<EOF
171 EHLO nosuchhost.example.com
172 MAIL FROM:<sender3@localhost>
173 RCPT TO:<recipient@example.com>
174 DATA
175 To: recipient@example.com
176 From: sender3@localhost
177 Date:
178
179 message
180 .
181 QUIT
182 EOF
183
184 test_mhmail "$expected" "-from sender3@localhost" '|' message
185 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
186
187
188 # check -from and -body
189 # Verified same behavior as compiled mhmail.
190 cat > "$expected" <<EOF
191 EHLO nosuchhost.example.com
192 MAIL FROM:<sender4@localhost>
193 RCPT TO:<recipient@example.com>
194 DATA
195 To: recipient@example.com
196 From: sender4@localhost
197 Date:
198
199 body
200 .
201 QUIT
202 EOF
203
204 test_mhmail "$expected" "-from sender4@localhost" -b body
205 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
206
207
208 # check -from and -cc
209 # Verified same behavior as compiled mhmail.
210 cat > "$expected" <<EOF
211 EHLO nosuchhost.example.com
212 MAIL FROM:<sender5@localhost>
213 RCPT TO:<recipient@example.com>
214 RCPT TO:<recipient2@example.com>
215 DATA
216 To: recipient@example.com
217 Cc: recipient2@example.com
218 From: sender5@localhost
219 Date:
220
221 message
222 .
223 QUIT
224 EOF
225
226 test_mhmail "$expected" \
227 "-from sender5@localhost -cc recipient2@example.com" '|' message
228 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
229
230
231 # check -from and multiple -cc addresses
232 # Verified same behavior as compiled mhmail.
233 cat > "$expected" <<EOF
234 EHLO nosuchhost.example.com
235 MAIL FROM:<sender6@localhost>
236 RCPT TO:<recipient@example.com>
237 RCPT TO:<recipient2@example.com>
238 RCPT TO:<recipient3@example.com>
239 RCPT TO:<recipient4@example.com>
240 DATA
241 To: recipient@example.com
242 Cc: recipient2@example.com, recipient3@example.com,
243 recipient4@example.com
244 From: sender6@localhost
245 Date:
246
247 message
248 .
249 QUIT
250 EOF
251
252 test_mhmail "$expected" \
253 '-from sender6@localhost -cc recipient2@example.com '\
254 'recipient3@example.com recipient4@example.com' '|' message
255 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
256
257
258 # check -from and -subject
259 # Verified same behavior as compiled mhmail.
260 cat > "$expected" <<EOF
261 EHLO nosuchhost.example.com
262 MAIL FROM:<sender7@localhost>
263 RCPT TO:<recipient@example.com>
264 DATA
265 To: recipient@example.com
266 Subject: Test
267 From: sender7@localhost
268 Date:
269
270 message
271 .
272 QUIT
273 EOF
274
275 test_mhmail "$expected" '-from sender7@localhost -subject Test' '|' message
276 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
277
278
279 # check -from and -profile
280 # Show that -profile causes mhmail to 1) read the profile and
281 # 2) use send(1) by added a send switch to the profile and
282 # verifying that it gets used.
283 # Not supported by compiled mhmail.
284 printf 'send: -msgid\n' >> $MH
285
286 cat > "$expected" <<EOF
287 EHLO nosuchhost.example.com
288 MAIL FROM:<sender8@localhost>
289 RCPT TO:<recipient@example.com>
290 DATA
291 To: recipient@example.com
292 From: sender8@localhost
293 Date:
294 Message-ID:
295
296 message
297 .
298 QUIT
299 EOF
300
301 test_mhmail "$expected" '-from sender8@localhost -profile' '|' message
302 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
303
304
305 # check repeated -from and -subject switches
306 # Verified same behavior as compiled mhmail.
307 cat > "$expected" <<EOF
308 EHLO nosuchhost.example.com
309 MAIL FROM:<sender9@localhost>
310 RCPT TO:<recipient@example.com>
311 DATA
312 To: recipient@example.com
313 Subject: Subject2
314 From: sender9@localhost
315 Date:
316
317 message
318 .
319 QUIT
320 EOF
321
322 test_mhmail "$expected" '-from sender9@localhost -from sender9@localhost '\
323 '-subject Subject1 -subject Subject2' -b message
324 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
325
326 # check repeated -body switches
327 # Verified same behavior as compiled mhmail.
328 cat > "$expected" <<EOF
329 EHLO nosuchhost.example.com
330 MAIL FROM:<sender10@localhost>
331 RCPT TO:<recipient@example.com>
332 DATA
333 To: recipient@example.com
334 From: sender10@localhost
335 Date:
336
337 body2
338 .
339 QUIT
340 EOF
341
342 test_mhmail "$expected" "-from sender10@localhost -body body1" -b body2
343 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
344
345
346 # check multiple -cc switches
347 # Verified same behavior as compiled mhmail.
348 cat > "$expected" <<EOF
349 EHLO nosuchhost.example.com
350 MAIL FROM:<sender11@localhost>
351 RCPT TO:<recipient@example.com>
352 RCPT TO:<cc1@example.com>
353 RCPT TO:<cc2@example.com>
354 DATA
355 To: recipient@example.com
356 Cc: cc1@example.com, cc2@example.com
357 From: sender11@localhost
358 Date:
359
360 message
361 .
362 QUIT
363 EOF
364
365 test_mhmail "$expected" \
366 '-from sender11@localhost -cc cc1@example.com -cc cc2@example.com' -b message
367 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
368
369
370 # check separated -cc arguments
371 # Verified same behavior as compiled mhmail.
372 cat > "$expected" <<EOF
373 EHLO nosuchhost.example.com
374 MAIL FROM:<sender12@localhost>
375 RCPT TO:<recipient@example.com>
376 RCPT TO:<cc1@example.com>
377 RCPT TO:<cc2@example.com>
378 DATA
379 To: recipient@example.com
380 Cc: cc1@example.com, cc2@example.com
381 Subject: Test
382 From: sender12@localhost
383 Date:
384
385 message
386 .
387 QUIT
388 EOF
389
390 test_mhmail "$expected" \
391 '-from sender12@localhost -cc cc1@example.com -subject '\
392 'Test cc2@example.com' -b message
393 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
394
395
396 # check -cc switch followed by -to switch
397 # Verified same behavior as compiled mhmail.
398 cat > "$expected" <<EOF
399 EHLO nosuchhost.example.com
400 MAIL FROM:<sender13@localhost>
401 RCPT TO:<recipient@example.com>
402 RCPT TO:<recipient2@example.com>
403 RCPT TO:<cc1@example.com>
404 DATA
405 To: recipient@example.com, recipient2@example.com
406 Cc: cc1@example.com
407 Subject: Test
408 From: sender13@localhost
409 Date:
410
411 message
412 .
413 QUIT
414 EOF
415
416 test_mhmail "$expected" \
417 "-from sender13@localhost -cc cc1@example.com -subject Test \
418 -to recipient2@example.com" \
419 -b message
420 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
421
422
423 # check with no newline on stdin
424 # Shows different behavior than compiled mhmail, which was silent in this case.
425 cat > "$expected" <<EOF
426 EOF
427
428 cat > "$expected_err" <<EOF
429 mhmail: empty message not sent, use -body '' to force.
430 EOF
431
432 set +e
433 printf '' | mhmail recipient@example.com -server 127.0.0.1 -port $localport \
434 >"$actual" 2>"$actual_err"
435 set -e
436
437 check "$expected" "$actual"
438 check "$expected_err" "$actual_err"
439 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
440
441
442 # check with one newline on stdin
443 # Verified same behavior as compiled mhmail.
444 cat > "$expected" <<EOF
445 EHLO nosuchhost.example.com
446 MAIL FROM:<sender14@localhost>
447 RCPT TO:<recipient@example.com>
448 DATA
449 To: recipient@example.com
450 From: sender14@localhost
451 Date:
452
453
454 .
455 QUIT
456 EOF
457
458 test_mhmail "$expected" '-from sender14@localhost' '|' '
459 '
460 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
461
462
463 # check with multiple newlines on stdin
464 # Verified same behavior as compiled mhmail.
465 cat > "$expected" <<EOF
466 EHLO nosuchhost.example.com
467 MAIL FROM:<sender15@localhost>
468 RCPT TO:<recipient@example.com>
469 DATA
470 To: recipient@example.com
471 From: sender15@localhost
472 Date:
473
474
475
476
477 .
478 QUIT
479 EOF
480
481 test_mhmail "$expected" '-from sender15@localhost' '|' '
482
483
484 '
485 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
486
487
488 # check with text and no trailing newline on stdin
489 # Verified same behavior as compiled mhmail.
490 cat > "$expected" <<EOF
491 EHLO nosuchhost.example.com
492 MAIL FROM:<sender16@localhost>
493 RCPT TO:<recipient@example.com>
494 DATA
495 To: recipient@example.com
496 From: sender16@localhost
497 Date:
498
499 no newline in input
500 .
501 QUIT
502 EOF
503
504 test_mhmail "$expected" '-from sender16@localhost' '|' 'no newline in input'
505 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
506
507
508 # check with text and multiple trailing blank lines on stdin
509 # Verified same behavior as compiled mhmail.
510 cat > "$expected" <<EOF
511 EHLO nosuchhost.example.com
512 MAIL FROM:<sender17@localhost>
513 RCPT TO:<recipient@example.com>
514 DATA
515 To: recipient@example.com
516 From: sender17@localhost
517 Date:
518
519 here's some text
520
521
522 .
523 QUIT
524 EOF
525
526 test_mhmail "$expected" '-from sender17@localhost' '|' "here's some text
527
528
529 "
530 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
531
532
533 # check with no newline to -body
534 # Verified same behavior as compiled mhmail.
535 cat > "$expected" <<EOF
536 EHLO nosuchhost.example.com
537 MAIL FROM:<sender18@localhost>
538 RCPT TO:<recipient@example.com>
539 DATA
540 To: recipient@example.com
541 From: sender18@localhost
542 Date:
543
544
545 .
546 QUIT
547 EOF
548
549 test_mhmail "$expected" '-from sender18@localhost' -b ''
550 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
551
552
553 # check with one newline to -body
554 # Shows different behavior than compiled mhmail, which suppressed the newline.
555 cat > "$expected" <<EOF
556 EHLO nosuchhost.example.com
557 MAIL FROM:<sender19@localhost>
558 RCPT TO:<recipient@example.com>
559 DATA
560 To: recipient@example.com
561 From: sender19@localhost
562 Date:
563
564
565
566 .
567 QUIT
568 EOF
569
570 test_mhmail "$expected" '-from sender19@localhost' -b '
571 '
572 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
573
574
575 # check with multiple newlines to -body
576 # Shows different behavior than compiled mhmail, which suppressed one
577 # of the newlines.
578 cat > "$expected" <<EOF
579 EHLO nosuchhost.example.com
580 MAIL FROM:<sender20@localhost>
581 RCPT TO:<recipient@example.com>
582 DATA
583 To: recipient@example.com
584 From: sender20@localhost
585 Date:
586
587
588
589
590
591 .
592 QUIT
593 EOF
594
595 test_mhmail "$expected" '-from sender20@localhost' -b '
596
597
598 '
599 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
600
601
602 # check with text and no trailing newline to -body
603 # Verified same behavior as compiled mhmail.
604 cat > "$expected" <<EOF
605 EHLO nosuchhost.example.com
606 MAIL FROM:<sender21@localhost>
607 RCPT TO:<recipient@example.com>
608 DATA
609 To: recipient@example.com
610 From: sender21@localhost
611 Date:
612
613 no newline in input
614 .
615 QUIT
616 EOF
617
618 test_mhmail "$expected" '-from sender21@localhost' -b 'no newline in input'
619 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
620
621
622 # check with text and multiple trailing blank lines to -body
623 # Shows different behavior than compiled mhmail, which suppressed one
624 # of the newlines.
625 cat > "$expected" <<EOF
626 EHLO nosuchhost.example.com
627 MAIL FROM:<sender22@localhost>
628 RCPT TO:<recipient@example.com>
629 DATA
630 To: recipient@example.com
631 From: sender22@localhost
632 Date:
633
634 here's some text
635
636
637 .
638 QUIT
639 EOF
640
641 test_mhmail "$expected" '-from sender22@localhost' -b "here's some text
642
643 "
644 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
645
646
647 # check -resent
648 # Verified same behavior as compiled mhmail.
649 cat > "$expected" <<EOF
650 EHLO nosuchhost.example.com
651 MAIL FROM:<orig_recipient@example.com>
652 RCPT TO:<recipient@example.com>
653 DATA
654 Resent-To: recipient@example.com
655 Resent-From: orig_recipient@example.com
656 To: recipient@example.com
657 From: sender23@localhost
658 Date:
659 Resent-Date:
660
661 please resend this message, 1
662 .
663 QUIT
664 EOF
665
666 test_mhmail "$expected" '-from orig_recipient@example.com -resent' \
667 -b 'To: recipient@example.com
668 From: sender23@localhost
669 Date: Sat Jun 16 18:35:15 -0500
670
671 please resend this message, 1'
672
673 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
674
675 # check -resent -profile, using stdin
676 # Not supported by compiled mhmail.
677 cat > "$expected" <<EOF
678 EHLO nosuchhost.example.com
679 MAIL FROM:<orig_recipient@example.com>
680 RCPT TO:<recipient@example.com>
681 DATA
682 To: recipient@example.com
683 From: sender24@localhost
684 Date:
685 Resent-To: recipient@example.com
686 Resent-From: orig_recipient@example.com
687 Resent-Date:
688
689 please resend this message, 2
690 .
691 QUIT
692 EOF
693
694 test_mhmail "$expected" \
695 '-from orig_recipient@example.com -resent -profile -nomsgid' \
696 '|' 'To: recipient@example.com
697 From: sender24@localhost
698 Date: Sat Jun 16 18:35:15 -0500
699
700 please resend this message, 2'
701
702 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
703
704
705 # check -resent -profile, using -b
706 # Not supported by compiled mhmail.
707 cat > "$expected" <<EOF
708 EHLO nosuchhost.example.com
709 MAIL FROM:<orig_recipient@example.com>
710 RCPT TO:<recipient@example.com>
711 DATA
712 To: recipient@example.com
713 From: sender25@localhost
714 Date:
715 Resent-To: recipient@example.com
716 Resent-From: orig_recipient@example.com
717 Resent-Date:
718
719 please resend this message, 3
720 .
721 QUIT
722 EOF
723
724 test_mhmail "$expected" \
725 '-from orig_recipient@example.com -resent -profile -nomsgid' \
726 -b 'To: recipient@example.com
727 From: sender25@localhost
728 Date: Sat Jun 16 18:35:15 -0500
729
730 please resend this message, 3'
731
732 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
733
734
735 # check -headerfield.
736 # Not supported by compiled mhmail.
737 cat > "$expected" <<EOF
738 EHLO nosuchhost.example.com
739 MAIL FROM:<sender26@example.com>
740 RCPT TO:<recipient@example.com>
741 DATA
742 To: recipient@example.com
743 From: sender26@example.com
744 User-Agent: nmh
745 Date:
746
747 with added header field
748 .
749 QUIT
750 EOF
751
752 test_mhmail "$expected" \
753 '-from sender26@example.com -headerfield User-Agent:nmh' \
754 -b 'with added header field'
755
756 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
757
758
759 # check multiple -headerfields.
760 # Not supported by compiled mhmail.
761 cat > "$expected" <<EOF
762 EHLO nosuchhost.example.com
763 MAIL FROM:<sender27@example.com>
764 RCPT TO:<recipient@example.com>
765 DATA
766 To: recipient@example.com
767 From: sender27@example.com
768 MIME-Version: 1.0
769 Content-Type: text/plain;charset=utf-8
770 Content-Transfer-Encoding: 8bit
771 Date:
772
773 with added header fields
774 .
775 QUIT
776 EOF
777
778 test_mhmail "$expected" \
779 "-from sender27@example.com -headerfield MIME-Version:1.0 \
780 -headerfield Content-Type:text/plain;charset=utf-8 \
781 -headerfield Content-Transfer-Encoding:8bit" \
782 -b 'with added header fields'
783
784 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
785
786
787 # check -attach
788 # Not supported by compiled mhmail.
789 cat > "$expected" <<EOF
790 EHLO nosuchhost.example.com
791 MAIL FROM:<sender28@example.com>
792 RCPT TO:<recipient@example.com>
793 DATA
794 To: recipient@example.com
795 From: sender28@example.com
796 MIME-Version: 1.0
797 Content-Type: multipart/mixed; boundary="----- =_aaaaaaaaaa0"
798 Date:
799 Message-ID:
800
801 ------- =_aaaaaaaaaa0
802 Content-Type: text/plain; charset="us-ascii"
803
804 See how easy it is to add an attachment!
805
806 ------- =_aaaaaaaaaa0
807 Content-Type: `content_type_string ${srcdir}/test/mhmail/attachment.txt`
808 Content-Description: attachment.txt
809 Content-Disposition: attachment; filename="attachment.txt"
810
811 The future disappears into memory, With only a moment between,
812 Forever dwells in that moment, hope is what remains to be seen
813 Forever dwells in that moment, hope is what remains to be seen.
814
815 ------- =_aaaaaaaaaa0--
816 .
817 QUIT
818 EOF
819
820 test_mhmail "$expected" \
821 "-from sender28@example.com -attach ${srcdir}/test/mhmail/attachment.txt" \
822 -b 'See how easy it is to add an attachment!'
823
824 [ ${failed:-0} -eq 0 ] || exit ${failed:-0}
825
826
827 exit ${failed:-0}