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