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