2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
5 ARGS
='-n# -Sstealthmua -Sexpandaddr=restrict'
10 MAKE
="${MAKE:-`command -v make`}"
11 awk=${awk:-`command -v awk`}
12 cat=${cat:-`command -v cat`}
13 cksum=${cksum:-`command -v cksum`}
14 rm=${rm:-`command -v rm`}
15 sed=${sed:-`command -v sed`}
16 grep=${grep:-`command -v grep`}
20 export SNAIL ARGS CONF BODY MBOX MAKE
awk cat cksum rm sed grep
22 # NOTE! UnixWare 7.1.4 gives ISO-10646-Minimum-European-Subset for
23 # nl_langinfo(CODESET), then, so also overwrite ttycharset.
24 # (In addition this setup allows us to succeed on TinyCore 4.4 that has no
25 # other locales than C/POSIX installed by default!)
27 LC_ALL
=${LC} LANG
=${LC}
29 export LC_ALL LANG ttycharset
34 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
40 [ "${1}" = --check-only ] || usage
41 [ ${#} -gt 2 ] && usage
42 [ ${#} -eq 2 ] && SNAIL
="${2}"
43 [ -x "${SNAIL}" ] || usage
48 # Test all configs TODO doesn't cover all *combinations*, stupid!
52 /^[[:space:]]*WANT_/ {
53 sub(/^[[:space:]]*/, "")
54 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
55 # does not seem to be a compliant escape for =
57 $1 = substr($1, 1, index($1, "=") - 1)
58 if ($1 == "WANT_AUTOCC")
63 for (j = 1; j < i; ++j) {
64 for (k = 1; k < j; ++k)
66 for (k = j; k < i; ++k)
68 printf "WANT_AUTOCC=1\n"
70 for (k = 1; k < j; ++k)
72 for (k = j; k < i; ++k)
74 printf "WANT_AUTOCC=1\n"
78 printf "\n\n##########\n$c\n"
79 printf "\n\n##########\n$c\n" >&2
87 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
88 # cksum(1) of the resulting data and compare against the checksum $3
90 tid
=${1} f=${2} s=${3}
92 csum
="`${sed} -e '/^From /d' -e '/^Date: /d' \
93 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
94 -e '/^\[-- Message/d' | ${cksum}`";
95 if [ "${csum}" = "${s}" ]; then
99 printf 'error: checksum mismatch (got %s)\n' "${csum}"
106 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} |
112 # Basic (easily testable) behaviour tests
116 printf 'echo +nix\nset folder=/\necho +nix\nset nofolder\necho +nix\nx' |
117 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} > "${MBOX}"
118 cksum_test behave
:001 "${MBOX}" '4214021069 15'
120 # POSIX: setting *noprompt*/prompt='' shall prevent prompting TODO
121 # TODO for this to be testable we need a way to echo a variable
122 # TODO or to force echo of the prompt
126 # FIXME __behave_alias
128 # FIXME __behave_mlist
130 have_feat SSL
/TLS
&& have_feat S
/MIME
&& __behave_smime
134 # Nestable conditions test
136 ${cat} <<- '__EOT' | MAILRC=/dev/null "${SNAIL}" ${ARGS} > "${MBOX}"
158 if $dietcurd == 'yoho'
163 if $dietcurd != 'yoho'
224 if $dietcurd == 'yohu'
226 elif $dietcurd == 'yoha'
228 elif $dietcurd == 'yohe'
230 elif $dietcurd == 'yoho'
232 if $dietcurd == 'yohu'
234 elif $dietcurd == 'yoha'
236 elif $dietcurd == 'yohe'
238 elif $dietcurd == 'yoho'
240 if $dietcurd == 'yohu'
242 elif $dietcurd == 'yoha'
244 elif $dietcurd == 'yohe'
246 elif $dietcurd == 'yoho'
257 # integer conversion, <..>..
360 set diet=abc curd=abc
366 set diet=abc curd=abcd
372 # 1. Shitty grouping capabilities as of today
373 unset diet curd ndefined
374 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
380 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
385 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
390 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
395 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
400 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
406 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
411 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
416 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
421 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
426 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
431 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
436 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
441 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
446 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
451 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
457 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
463 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
468 # 2. Shitty grouping capabilities as of today
469 unset diet curd ndefined
470 if [ false || false || true ] && [ false || true ] && yes
475 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
480 if [ 1 || 0 || 0 || 0 ]
485 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
490 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
495 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
500 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
505 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
510 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
515 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
520 if 1 || 0 || 0 || 0 && 0
525 if 1 || 0 || 0 || 0 && 1
530 if 0 || 0 || 0 || 1 && 0
535 if 0 || 0 || 0 || 1 && 1
540 if 0 || 0 || 0 || 1 && 0 || 1 && 0
545 if 0 || 0 || 0 || 1 && 0 || 1 && 1
551 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
556 if $diet == 'yo' && $curd == 'ho' && $ndefined
562 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
567 if $diet == 'yo' && $curd == 'ho' && $ndefined
572 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
578 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
583 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
588 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
593 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
598 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
603 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
608 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
613 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
618 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
624 if ! 0 && ! ! 1 && ! ! ! 0 && 3
629 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
634 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
639 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
644 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
649 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
654 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
659 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
664 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
670 cksum_test behave:if-normal "${MBOX}" '3542193361 607'
672 if have_feat REGEX; then
674 ${cat} <<- '__EOT' | MAILRC=/dev/null "${SNAIL}" ${ARGS} > "${MBOX}"
676 if $dietcurd =~
'^yo.*'
681 if $dietcurd =~
'^yoho.+'
686 if $dietcurd !~
'.*ho$'
691 if $dietcurd !~
'.+yoho$'
696 if [ $dietcurd !~
'.+yoho$' ]
701 if ! [ $dietcurd =~
'.+yoho$' ]
706 if ! ! [ $dietcurd !~
'.+yoho$' ]
711 if ! [ ! [ $dietcurd !~
'.+yoho$' ] ]
716 if [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
721 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
726 if ! ! ! $dietcurd !~
'.+yoho$'
731 if ! ! ! $dietcurd =~
'.+yoho$'
736 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
741 set diet
=abc curd
='^abc$'
747 set diet
=abc curd
='^abcd$'
754 cksum_test behave
:if-regex
"${MBOX}" '439960016 81'
758 __behave_smime
() { # FIXME add test/ dir, unroll tests therein, regular enable!
759 printf 'behave:s/mime: .. generating test key and certificate ..\n'
760 ${cat} <<-_EOT > ./t.conf
763 default_keyfile = keyfile.pem
764 distinguished_name = req_distinguished_name
765 attributes = req_attributes
769 [ req_distinguished_name ]
776 emailAddress = test@localhost
781 openssl req
-x509 -nodes -days 3650 -config .
/t.conf \
782 -newkey rsa
:1024 -keyout .
/tkey.pem
-out .
/tcert.pem
>/dev
/null
2>&1
784 ${cat} .
/tkey.pem .
/tcert.pem
> .
/tpair.pem
786 printf "behave:s/mime:sign/verify: "
788 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
789 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
790 -Ssmime-sign -Sfrom=test@localhost \
791 -s 'S/MIME test' .
/VERIFY
793 printf 'verify\nx\n' |
794 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
795 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
796 -Ssmime-sign -Sfrom=test@localhost \
797 -Sbatch-exit-on-error -R \
798 -f .
/VERIFY
>/dev
/null
2>&1
799 if [ $?
-eq 0 ]; then
803 printf 'error: verification failed\n'
804 ${rm} -f .
/VERIFY .
/tkey.pem .
/tcert.pem .
/tpair.pem
809 printf "behave:s/mime:encrypt/decrypt: "
810 ${cat} <<-_EOT > ./tsendmail.sh
812 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./ENCRYPT
814 chmod 0755 .
/tsendmail.sh
817 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
818 -Ssmime-force-encryption \
819 -Ssmime-encrypt-recei@ver.com
=.
/tpair.pem \
820 -Ssendmail=.
/tsendmail.sh \
821 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
822 -Ssmime-sign -Sfrom=test@localhost \
823 -s 'S/MIME test' recei@ver.com
825 printf 'decrypt ./DECRYPT\nfi ./DECRYPT\nverify\nx\n' |
826 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
827 -Ssmime-force-encryption \
828 -Ssmime-encrypt-recei@ver.com
=.
/tpair.pem \
829 -Ssendmail=.
/tsendmail.sh \
830 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
831 -Ssmime-sign -Sfrom=test@localhost \
832 -Sbatch-exit-on-error -R \
833 -f .
/ENCRYPT
>/dev
/null
2>&1
834 if [ $?
-eq 0 ]; then
838 printf 'error: decryption+verification failed\n'
840 ${rm} -f .
/tsendmail.sh .
/ENCRYPT .
/DECRYPT \
841 .
/tkey.pem .
/tcert.pem .
/tpair.pem
845 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
846 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
847 # Note we unfortunately need to place some statements without proper
848 # indentation because of continuation problems
850 ${rm} -f "${BODY}" "${MBOX}"
852 # MIME encoding (QP) stress message body
854 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
855 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
856 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
857 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
858 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
859 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
860 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
861 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
862 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
863 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
864 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
865 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
866 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
867 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
868 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
869 "auf den zeilen vorher.
\r\n"\
870 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
872 "Die letzte Zeile war nur ein Punkt.
\r\n"\
874 "Das waren deren zwei.
\r\n"\
876 "Die letzte Zeile war ein Leerschritt.
\n"\
877 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
880 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
882 "Das waren deren zwei. ditto.
\n"\
884 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
885 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
886 "auf den zeilen vorher.
\n"\
888 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
889 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
891 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
893 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
895 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
897 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
899 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
901 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
903 "Die letzte Zeile war ein Leerschritt.
\n"\
907 # MIME encoding (QP) stress message subject
908 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
909 adadaddsssssssddddddddddddddddddddd\
910 ddddddddddddddddddddddddddddddddddd\
911 ddddddddddddddddddddddddddddddddddd\
912 dddddddddddddddddddd Hallelulja? Od\
913 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
914 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
915 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
916 fffffffffffffffffffffffffffffffffff\
917 fffffffffffffffffffff ggggggggggggg\
918 ggggggggggggggggggggggggggggggggggg\
919 ggggggggggggggggggggggggggggggggggg\
920 ggggggggggggggggggggggggggggggggggg\
923 # Three tests for MIME encodign and (a bit) content classification.
924 # At the same time testing -q FILE, < FILE and -t FILE
926 # TODO Note: because of our weird putline() handling in <-> collect.c
928 < "${BODY}" MAILRC=/dev/null \
929 "${SNAIL}" -nSstealthmua -Sexpandaddr -a "${BODY}" -s "${SUB}" "${MBOX}"
930 cksum_test content:001-0 "${MBOX}" '3498258986 5631'
933 < "${BODY}" MAILRC=/dev/null \
934 "${SNAIL}" ${ARGS} -Snodot -a "${BODY}" -s "${SUB}" "${MBOX}"
935 cksum_test content:001 "${MBOX}" '3916146590 5630'
938 < /dev/null MAILRC=/dev/null \
939 "${SNAIL}" ${ARGS} -a "${BODY}" -s "${SUB}" \
940 -q "${BODY}" "${MBOX}"
941 cksum_test content:002 "${MBOX}" '3498258986 5631'
944 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
946 ) | MAILRC=/dev/null "${SNAIL}" ${ARGS} -Snodot -a "${BODY}" -t
947 cksum_test content:003 "${MBOX}" '3916146590 5630'
949 # Test for [260e19d] (Juergen Daubert)
951 echo body | MAILRC=/dev/null "${SNAIL}" ${ARGS} "${MBOX}"
952 cksum_test content:004 "${MBOX}" '4140682175 72'
954 # Sending of multiple mails in a single invocation
956 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n.
\n" &&
957 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n.
\n" &&
959 ) | MAILRC=/dev/null "${SNAIL}" ${ARGS}
960 cksum_test content:005 "${MBOX}" '3503215815 245'
964 # "Test
for" [d6f316a] (Gavin Troy)
966 printf "m
${MBOX}\n~s subject1
\nEmail body
\n.
\nfi
${MBOX}\np
\nx
\n" |
967 MAILRC=/dev/null "${SNAIL}" ${ARGS} \
968 -Spipe-text/plain="${cat}" > "${BODY}"
969 ${sed} -e 1d < "${BODY}" > "${MBOX}"
970 cksum_test content
:006 "${MBOX}" '11112309 106'
972 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
973 # TODO Note: because of our weird putline() handling in <-> collect.c
975 LC_ALL
=C
${awk} 'BEGIN{
976 for(i = 0; i < 10000; ++i)
978 #printf "\xF0\x90\x87\x90"
980 MAILRC
=/dev
/null
"${SNAIL}" -nSstealthmua -Sexpandaddr \
981 -s TestSubject
"${MBOX}"
982 cksum_test content
:007-0 "${MBOX}" '2747333583 61729'
985 LC_ALL
=C
${awk} 'BEGIN{
986 for(i = 0; i < 10000; ++i)
988 #printf "\xF0\x90\x87\x90"
990 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -s TestSubject "${MBOX}"
991 cksum_test content
:007 "${MBOX}" '3343002941 61728'
993 ## Test some more corner cases for header bodies (as good as we can today) ##
998 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
999 -s 'a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲a̲b̲c̲d̲e̲f̲h̲i̲k̲l̲m̲n̲o̲r̲s̲t̲u̲v̲w̲x̲z̲' \
1001 cksum_test content
:008 "${MBOX}" '3872015771 288'
1003 # Single word (overlong line split -- bad standard! Requires injection of
1004 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
1006 i
=`LC_ALL=C ${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
1007 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
1008 cksum_test content
:009 "${MBOX}" '2048460448 1631'
1010 # Combination of encoded words, space and tabs of varying sort
1012 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1013 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
1014 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
1015 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
1016 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
1017 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
1019 cksum_test content
:010 "${MBOX}" '1272213842 504'
1021 # Overlong multibyte sequence that must be forcefully split
1022 # todo This works even before v15.0, but only by accident
1024 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1025 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
1026 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
1027 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
1029 cksum_test content
:011 "${MBOX}" '2972351879 572'
1034 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1035 -s "1-1 B2 B3 B4 B5 B6 B\
1036 1-2 B2 B3 B4 B5 B6 B\
1037 1-3 B2 B3 B4 B5 B6 B\
1038 1-4 B2 B3 B4 B5 B6 B\
1039 1-5 B2 B3 B4 B5 B6 B\
1040 1-6 B2 B3 B4 B5 B6 " \
1042 cksum_test content
:012 "${MBOX}" '1276108207 271'
1044 # Leading and trailing WS
1047 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1048 -s " 2-1 B2 B3 B4 B5 B6 B\
1049 1-2 B2 B3 B4 B5 B6 B\
1050 1-3 B2 B3 B4 B5 B6 B\
1051 1-4 B2 B3 B4 B5 B6 " \
1053 cksum_test content
:013 "${MBOX}" '3677630181 210'
1055 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
1056 # have a (better) test framework materialize a quick shot
1060 : > 'diet\ is \curd.txt'
1061 : > diet
\"is
\" curd.txt
1063 : > höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt
1064 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
1065 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
1066 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
1068 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -Snodot \
1069 -a "ma'ger.txt" -a "mä'ger.txt" \
1070 -a 'diet\\\ is\ \\curd.txt' -a diet
\"is
\" curd.txt \
1072 -a höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt \
1073 -a höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
1074 -a hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
1075 -a ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
1077 ${rm} -f "ma'ger.txt" "mä'ger.txt" 'diet\ is \curd.txt' \
1078 diet
\"is
\" curd.txt höde-tröge.txt \
1079 höde__tröge__müde__dätte__hätte__vülle__gülle__äse__äße__säuerliche__kräuter__österliche__grüße__mäh.txt \
1080 höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
1081 hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
1082 ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
1083 cksum_test content
:14 "${MBOX}" '1106643854 2453'
1085 ${rm} -f "${BODY}" "${MBOX}"
1089 if have_feat DEVEL; then
1090 ARGS="${ARGS} -Smemdebug"
1097 if [ -z "${CHECK_ONLY}" ]; then
1103 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'