2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
5 ARGS
='-n# -Sstealthmua -Sexpandaddr=restrict -Sdotlock-ignore-error'
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"
77 printf "CONFIG=MINIMAL WANT_AUTOCC=0\n"
78 printf "CONFIG=MINIMAL WANT_AUTOCC=1\n"
79 printf "CONFIG=MEDIUM WANT_AUTOCC=0\n"
80 printf "CONFIG=MEDIUM WANT_AUTOCC=1\n"
81 printf "CONFIG=NETSEND WANT_AUTOCC=0\n"
82 printf "CONFIG=NETSEND WANT_AUTOCC=1\n"
83 printf "CONFIG=MAXIMAL WANT_AUTOCC=0\n"
84 printf "CONFIG=MAXIMAL WANT_AUTOCC=1\n"
87 printf "\n\n##########\n$c\n"
88 printf "\n\n##########\n$c\n" >&2
96 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
97 # cksum(1) of the resulting data and compare against the checksum $3
99 tid
=${1} f=${2} s=${3}
101 csum
="`${sed} -e '/^From /d' -e '/^Date: /d' \
102 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
103 -e '/^\[-- Message/d' | ${cksum}`";
104 if [ "${csum}" = "${s}" ]; then
108 printf 'error: checksum mismatch (got %s)\n' "${csum}"
115 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} |
121 # Basic (easily testable) behaviour tests
125 printf 'echo +nix\nset folder=/\necho +nix\nset nofolder\necho +nix\nx' |
126 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} > "${MBOX}"
127 cksum_test behave
:001 "${MBOX}" '4214021069 15'
129 # POSIX: setting *noprompt*/prompt='' shall prevent prompting TODO
130 # TODO for this to be testable we need a way to echo a variable
131 # TODO or to force echo of the prompt
135 # FIXME __behave_alias
137 # FIXME __behave_mlist
139 have_feat SSL
/TLS
&& have_feat S
/MIME
&& __behave_smime
143 # Nestable conditions test
145 ${cat} <<- '__EOT' | MAILRC=/dev/null "${SNAIL}" ${ARGS} > "${MBOX}"
167 if $dietcurd == 'yoho'
172 if $dietcurd != 'yoho'
233 if $dietcurd == 'yohu'
235 elif $dietcurd == 'yoha'
237 elif $dietcurd == 'yohe'
239 elif $dietcurd == 'yoho'
241 if $dietcurd == 'yohu'
243 elif $dietcurd == 'yoha'
245 elif $dietcurd == 'yohe'
247 elif $dietcurd == 'yoho'
249 if $dietcurd == 'yohu'
251 elif $dietcurd == 'yoha'
253 elif $dietcurd == 'yohe'
255 elif $dietcurd == 'yoho'
266 # integer conversion, <..>..
369 set diet=abc curd=abc
375 set diet=abc curd=abcd
381 # 1. Shitty grouping capabilities as of today
382 unset diet curd ndefined
383 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
389 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
394 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
399 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
404 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
409 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
415 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
420 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
425 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
430 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
435 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
440 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
445 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
450 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
455 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
460 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
466 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
472 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
477 # 2. Shitty grouping capabilities as of today
478 unset diet curd ndefined
479 if [ false || false || true ] && [ false || true ] && yes
484 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
489 if [ 1 || 0 || 0 || 0 ]
494 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
499 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
504 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
509 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
514 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
519 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
524 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
529 if 1 || 0 || 0 || 0 && 0
534 if 1 || 0 || 0 || 0 && 1
539 if 0 || 0 || 0 || 1 && 0
544 if 0 || 0 || 0 || 1 && 1
549 if 0 || 0 || 0 || 1 && 0 || 1 && 0
554 if 0 || 0 || 0 || 1 && 0 || 1 && 1
560 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
565 if $diet == 'yo' && $curd == 'ho' && $ndefined
571 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
576 if $diet == 'yo' && $curd == 'ho' && $ndefined
581 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
587 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
592 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
597 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
602 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
607 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
612 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
617 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
622 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
627 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
633 if ! 0 && ! ! 1 && ! ! ! 0 && 3
638 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
643 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
648 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
653 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
658 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
663 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
668 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
673 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
679 cksum_test behave:if-normal "${MBOX}" '3542193361 607'
681 if have_feat REGEX; then
683 ${cat} <<- '__EOT' | MAILRC=/dev/null "${SNAIL}" ${ARGS} > "${MBOX}"
685 if $dietcurd =~
'^yo.*'
690 if $dietcurd =~
'^yoho.+'
695 if $dietcurd !~
'.*ho$'
700 if $dietcurd !~
'.+yoho$'
705 if [ $dietcurd !~
'.+yoho$' ]
710 if ! [ $dietcurd =~
'.+yoho$' ]
715 if ! ! [ $dietcurd !~
'.+yoho$' ]
720 if ! [ ! [ $dietcurd !~
'.+yoho$' ] ]
725 if [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
730 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
735 if ! ! ! $dietcurd !~
'.+yoho$'
740 if ! ! ! $dietcurd =~
'.+yoho$'
745 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
750 set diet
=abc curd
='^abc$'
756 set diet
=abc curd
='^abcd$'
763 cksum_test behave
:if-regex
"${MBOX}" '439960016 81'
767 __behave_smime
() { # FIXME add test/ dir, unroll tests therein, regular enable!
768 printf 'behave:s/mime: .. generating test key and certificate ..\n'
769 ${cat} <<-_EOT > ./t.conf
772 default_keyfile = keyfile.pem
773 distinguished_name = req_distinguished_name
774 attributes = req_attributes
778 [ req_distinguished_name ]
785 emailAddress = test@localhost
790 openssl req
-x509 -nodes -days 3650 -config .
/t.conf \
791 -newkey rsa
:1024 -keyout .
/tkey.pem
-out .
/tcert.pem
>/dev
/null
2>&1
793 ${cat} .
/tkey.pem .
/tcert.pem
> .
/tpair.pem
795 printf "behave:s/mime:sign/verify: "
797 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
798 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
799 -Ssmime-sign -Sfrom=test@localhost \
800 -s 'S/MIME test' .
/VERIFY
802 printf 'verify\nx\n' |
803 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
804 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
805 -Ssmime-sign -Sfrom=test@localhost \
806 -Sbatch-exit-on-error -R \
807 -f .
/VERIFY
>/dev
/null
2>&1
808 if [ $?
-eq 0 ]; then
812 printf 'error: verification failed\n'
813 ${rm} -f .
/VERIFY .
/tkey.pem .
/tcert.pem .
/tpair.pem
818 printf "behave:s/mime:encrypt/decrypt: "
819 ${cat} <<-_EOT > ./tsendmail.sh
821 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./ENCRYPT
823 chmod 0755 .
/tsendmail.sh
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 -s 'S/MIME test' recei@ver.com
834 printf 'decrypt ./DECRYPT\nfi ./DECRYPT\nverify\nx\n' |
835 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
836 -Ssmime-force-encryption \
837 -Ssmime-encrypt-recei@ver.com
=.
/tpair.pem \
838 -Ssendmail=.
/tsendmail.sh \
839 -Ssmime-ca-file=.
/tcert.pem
-Ssmime-sign-cert=.
/tpair.pem \
840 -Ssmime-sign -Sfrom=test@localhost \
841 -Sbatch-exit-on-error -R \
842 -f .
/ENCRYPT
>/dev
/null
2>&1
843 if [ $?
-eq 0 ]; then
847 printf 'error: decryption+verification failed\n'
849 ${rm} -f .
/tsendmail.sh .
/ENCRYPT .
/DECRYPT \
850 .
/tkey.pem .
/tcert.pem .
/tpair.pem
854 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
855 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
856 # Note we unfortunately need to place some statements without proper
857 # indentation because of continuation problems
859 ${rm} -f "${BODY}" "${MBOX}"
861 # MIME encoding (QP) stress message body
863 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
864 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
865 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
866 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
867 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
868 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
869 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
870 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
871 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
872 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
873 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
874 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
875 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
876 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
877 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
878 "auf den zeilen vorher.
\r\n"\
879 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
881 "Die letzte Zeile war nur ein Punkt.
\r\n"\
883 "Das waren deren zwei.
\r\n"\
885 "Die letzte Zeile war ein Leerschritt.
\n"\
886 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
889 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
891 "Das waren deren zwei. ditto.
\n"\
893 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
894 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
895 "auf den zeilen vorher.
\n"\
897 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
898 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
900 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
902 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
904 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
906 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
908 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
910 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
912 "Die letzte Zeile war ein Leerschritt.
\n"\
916 # MIME encoding (QP) stress message subject
917 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
918 adadaddsssssssddddddddddddddddddddd\
919 ddddddddddddddddddddddddddddddddddd\
920 ddddddddddddddddddddddddddddddddddd\
921 dddddddddddddddddddd Hallelulja? Od\
922 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
923 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
924 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
925 fffffffffffffffffffffffffffffffffff\
926 fffffffffffffffffffff ggggggggggggg\
927 ggggggggggggggggggggggggggggggggggg\
928 ggggggggggggggggggggggggggggggggggg\
929 ggggggggggggggggggggggggggggggggggg\
932 # Three tests for MIME encodign and (a bit) content classification.
933 # At the same time testing -q FILE, < FILE and -t FILE
935 # TODO Note: because of our weird putline() handling in <-> collect.c
937 < "${BODY}" MAILRC=/dev/null \
938 "${SNAIL}" -nSstealthmua -Sexpandaddr -a "${BODY}" -s "${SUB}" "${MBOX}"
939 cksum_test content:001-0 "${MBOX}" '3498258986 5631'
942 < "${BODY}" MAILRC=/dev/null \
943 "${SNAIL}" ${ARGS} -Snodot -a "${BODY}" -s "${SUB}" "${MBOX}"
944 cksum_test content:001 "${MBOX}" '3916146590 5630'
947 < /dev/null MAILRC=/dev/null \
948 "${SNAIL}" ${ARGS} -a "${BODY}" -s "${SUB}" \
949 -q "${BODY}" "${MBOX}"
950 cksum_test content:002 "${MBOX}" '3498258986 5631'
953 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
955 ) | MAILRC=/dev/null "${SNAIL}" ${ARGS} -Snodot -a "${BODY}" -t
956 cksum_test content:003 "${MBOX}" '3916146590 5630'
958 # Test for [260e19d] (Juergen Daubert)
960 echo body | MAILRC=/dev/null "${SNAIL}" ${ARGS} "${MBOX}"
961 cksum_test content:004 "${MBOX}" '4140682175 72'
963 # Sending of multiple mails in a single invocation
965 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n.
\n" &&
966 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n.
\n" &&
968 ) | MAILRC=/dev/null "${SNAIL}" ${ARGS}
969 cksum_test content:005 "${MBOX}" '3503215815 245'
973 # "Test
for" [d6f316a] (Gavin Troy)
975 printf "m
${MBOX}\n~s subject1
\nEmail body
\n.
\nfi
${MBOX}\np
\nx
\n" |
976 MAILRC=/dev/null "${SNAIL}" ${ARGS} \
977 -Spipe-text/plain="${cat}" > "${BODY}"
978 ${sed} -e 1d < "${BODY}" > "${MBOX}"
979 cksum_test content
:006 "${MBOX}" '11112309 106'
981 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
982 # TODO Note: because of our weird putline() handling in <-> collect.c
984 LC_ALL
=C
${awk} 'BEGIN{
985 for(i = 0; i < 10000; ++i)
987 #printf "\xF0\x90\x87\x90"
989 MAILRC
=/dev
/null
"${SNAIL}" -nSstealthmua -Sexpandaddr \
990 -s TestSubject
"${MBOX}"
991 cksum_test content
:007-0 "${MBOX}" '2747333583 61729'
994 LC_ALL
=C
${awk} 'BEGIN{
995 for(i = 0; i < 10000; ++i)
997 #printf "\xF0\x90\x87\x90"
999 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -s TestSubject "${MBOX}"
1000 cksum_test content
:007 "${MBOX}" '3343002941 61728'
1002 ## Test some more corner cases for header bodies (as good as we can today) ##
1007 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1008 -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̲' \
1010 cksum_test content
:008 "${MBOX}" '3872015771 288'
1012 # Single word (overlong line split -- bad standard! Requires injection of
1013 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
1015 i
=`LC_ALL=C ${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
1016 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
1017 cksum_test content
:009 "${MBOX}" '2048460448 1631'
1019 # Combination of encoded words, space and tabs of varying sort
1021 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1022 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
1023 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
1024 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
1025 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
1026 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
1028 cksum_test content
:010 "${MBOX}" '1272213842 504'
1030 # Overlong multibyte sequence that must be forcefully split
1031 # todo This works even before v15.0, but only by accident
1033 echo | MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1034 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
1035 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
1036 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
1038 cksum_test content
:011 "${MBOX}" '2972351879 572'
1043 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1044 -s "1-1 B2 B3 B4 B5 B6 B\
1045 1-2 B2 B3 B4 B5 B6 B\
1046 1-3 B2 B3 B4 B5 B6 B\
1047 1-4 B2 B3 B4 B5 B6 B\
1048 1-5 B2 B3 B4 B5 B6 B\
1049 1-6 B2 B3 B4 B5 B6 " \
1051 cksum_test content
:012 "${MBOX}" '1276108207 271'
1053 # Leading and trailing WS
1056 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} \
1057 -s " 2-1 B2 B3 B4 B5 B6 B\
1058 1-2 B2 B3 B4 B5 B6 B\
1059 1-3 B2 B3 B4 B5 B6 B\
1060 1-4 B2 B3 B4 B5 B6 " \
1062 cksum_test content
:013 "${MBOX}" '3677630181 210'
1064 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
1065 # have a (better) test framework materialize a quick shot
1069 : > 'diet\ is \curd.txt'
1070 : > diet
\"is
\" curd.txt
1072 : > 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 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
1074 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
1075 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
1077 MAILRC
=/dev
/null
"${SNAIL}" ${ARGS} -Snodot \
1078 -a "ma'ger.txt" -a "mä'ger.txt" \
1079 -a 'diet\\\ is\ \\curd.txt' -a diet
\"is
\" curd.txt \
1081 -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 \
1082 -a höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
1083 -a hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
1084 -a ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
1086 ${rm} -f "ma'ger.txt" "mä'ger.txt" 'diet\ is \curd.txt' \
1087 diet
\"is
\" curd.txt höde-tröge.txt \
1088 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 \
1089 höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
1090 hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
1091 ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
1092 cksum_test content
:14 "${MBOX}" '1106643854 2453'
1094 ${rm} -f "${BODY}" "${MBOX}"
1098 if have_feat DEVEL; then
1099 ARGS="${ARGS} -Smemdebug"
1106 if [ -z "${CHECK_ONLY}" ]; then
1112 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'