2 #@ Usage: ./cc-test.sh [--check-only [s-nail-binary]]
5 ARGS
='-:/ -# -Sencoding=quoted-printable -Sstealthmua -Snosave -Sexpandaddr=restrict -Sdotlock-ignore-error'
10 #UTF8_LOCALE= autodetected unless set
12 if ( command -v command ) >/dev
/null
2>&1; then :; else
19 MAKE
="${MAKE:-`command -v make`}"
20 awk=${awk:-`command -v awk`}
21 cat=${cat:-`command -v cat`}
22 cksum=${cksum:-`command -v cksum`}
23 rm=${rm:-`command -v rm`}
24 sed=${sed:-`command -v sed`}
25 grep=${grep:-`command -v grep`}
29 export SNAIL ARGS CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
31 LC_ALL
=C LANG
=C ADDARG_UNI
=-Sttycharset=UTF-8
33 # Wed Oct 2 01:50:07 UTC 1996
34 SOURCE_DATE_EPOCH
=844221007
36 export LC_ALL LANG ADDARG_UNI TZ SOURCE_DATE_EPOCH
39 # Problem: force $SHELL to be a real shell. It seems some testing environments
40 # use nologin(?), but we need a real shell for command execution
41 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
42 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
47 if [ -z "${UTF8_LOCALE}" ]; then
49 if command -v locale
>/dev
/null
2>&1; then
50 UTF8_LOCALE
=`locale -a | { m=
52 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
54 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
68 echo >&2 "Usage: ./cc-test.sh [--check-only [s-nail-binary]]"
74 [ "${1}" = --check-only ] || usage
75 [ ${#} -gt 2 ] && usage
76 [ ${#} -eq 2 ] && SNAIL
="${2}"
77 [ -x "${SNAIL}" ] || usage
82 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
83 trap "exit 1" HUP INT TERM
86 # Test all configs TODO doesn't cover all *combinations*, stupid!
90 NOTME["OPT_AUTOCC"] = 1
91 NOTME["OPT_DEBUG"] = 1
92 NOTME["OPT_DEVEL"] = 1
93 NOTME["OPT_NOEXTMD5"] = 1
94 NOTME["OPT_NOMEMDBG"] = 1
99 sub(/^[[:space:]]*/, "")
100 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
101 # does not seem to be a compliant escape for =
103 $1 = substr($1, 1, index($1, "=") - 1)
109 # Doing this completely sequentially and not doing make distclean in
110 # between runs should effectively result in lesser compilations.
111 # It is completely dumb nonetheless... TODO
112 for (j = 1; j < i; ++j) {
113 for (k = 1; k < j; ++k)
115 for (k = j; k < i; ++k)
117 printf "OPT_AUTOCC=1\n"
119 for (j = 1; j < i; ++j) {
120 for (k = 1; k < j; ++k)
122 for (k = j; k < i; ++k)
124 printf "OPT_AUTOCC=1\n"
127 for (j = 1; j < i; ++j) {
128 for (k = 1; k < j; ++k)
130 for (k = j; k < i; ++k)
132 printf "OPT_AUTOCC=1\n"
133 printf "OPT_DEBUG=1\n"
135 for (j = 1; j < i; ++j) {
136 for (k = 1; k < j; ++k)
138 for (k = j; k < i; ++k)
140 printf "OPT_AUTOCC=1\n"
141 printf "OPT_DEBUG=1\n"
144 printf "CONFIG=NULL OPT_AUTOCC=0\n"
145 printf "CONFIG=NULL OPT_AUTOCC=1\n"
146 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
147 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
148 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
149 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
150 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
151 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
152 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
153 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
154 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
155 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
156 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
157 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
158 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
159 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
162 printf "\n\n##########\n$c\n"
163 printf "\n\n##########\n$c\n" >&2
171 # Read mailbox $2, strip non-constant headers and MIME boundaries, query the
172 # cksum(1) of the resulting data and compare against the checksum $3
174 tid
=${1} f=${2} s=${3}
176 csum
="`${sed} -e '/^From /d' \
177 -e '/^ boundary=/d' -e '/^--=-=/d' < \"${f}\" \
178 -e '/^\[-- Message/d' | ${cksum}`";
179 if [ "${csum}" = "${s}" ]; then
183 printf 'error: checksum mismatch (got %s)\n' "${csum}"
188 ( "${SNAIL}" ${ARGS} -X'echo $features' -Xx | ${grep} +${1} ) >/dev/null 2>&1
192 # Basic (easily testable) behaviour tests
194 __behave_x_opt_input_command_stack
196 __behave_input_inject_semicolon_seq
197 __behave_commandalias
200 __behave_macro_param_shift
205 # FIXME __behave_alias
207 # FIXME __behave_mlist
209 have_feat smime && __behave_smime
212 __behave_x_opt_input_command_stack() {
213 ${cat} <<- '__EOT' > "${BODY}"
221 echo "define mac1
{";\
222 echo " echo mac1-1 via1 \
$0";\
224 echo " echo mac1-2
";\
226 echo " echo mac1-3
";\
229 echo "define mac2
{";\
230 echo " echo mac2-1 via1 \
$0";\
232 echo " echo mac2-2
";\
238 echo echo 1-1-1 via1 \
$0;\
250 # The -X option supports multiline arguments, and those can internally use
251 # reverse solidus newline escaping. And all -X options are joined...
253 < "${BODY}" "${SNAIL}" ${ARGS} \
268 echo "define mac1 {";\
269 echo " echo mac1-1 via2 \$0";\
271 echo " echo mac1-2";\
273 echo " echo mac1-3";\
276 echo "define mac2 {";\
277 echo " echo mac2-1 via2 \$0";\
279 echo " echo mac2-2";\
285 echo echo 1-1-1 via2 \$0;\
297 ' > "${MBOX}" 2>/dev
/null
342 cksum_test behave
:x_opt_input_command_stack
"${MBOX}" '1391275936 378'
346 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
351 vput vexpr j '&' $i 7
357 echo ! The end for $1
369 cksum_test behave:xcall "${MBOX}" '1717228546 9555'
373 ${cat} <<- '__EOT' > "${BODY}"
392 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
393 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
394 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
396 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
397 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
420 echo a$
'b\U0000000'dt
421 echo a$
'b\U00000000'du
431 if [ -z "${UTF8_LOCALE}" ]; then
432 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
434 < "${BODY}" DIET
=CURD TIED
= \
435 LC_ALL
=${UTF8_LOCALE} "${SNAIL}" ${ARGS} 2>/dev/null > "${MBOX}"
451 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
452 #aCURDbc${DIET}d${TIED}e
453 #a${DIET}b${TIED}cCURDde
482 cksum_test behave
:wysh_unicode
"${MBOX}" '475805847 317'
485 < "${BODY}" DIET=CURD TIED= "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
501 #a${DIET}b${TIED}c\${DIET}d\${TIED}e
502 #aCURDbc${DIET}d${TIED}e
503 #a${DIET}b${TIED}cCURDde
532 cksum_test behave
:wysh_c
"${MBOX}" '1473887148 321'
535 __behave_input_inject_semicolon_seq
() {
536 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
541 echon this_is_mymac;call mydeepmac;echon ';';
543 echon one';';~mymac;echon two";";call mymac;echo three$';';
545 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
547 echon one';';~mymac;echon two";";call mymac;echo three$';';
549 #one;this_is_mymac(mydeepmac);two;this_is_mymac(mydeepmac);three;
550 #one;this_is_mymac(mydeepmac),TOO!;two;this_is_mymac(mydeepmac),TOO!;three;
551 cksum_test behave:input_inject_semicolon_seq "${MBOX}" '512117110 140'
554 __behave_commandalias() {
555 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
556 commandalias
echo echo hoho
560 commandalias XxX XxXx
561 commandalias XxXx XxXxX
562 commandalias XxXxX XxXxXx
563 commandalias XxXxXx
echo huhu
564 commandalias XxXxXxX
echo huhu
566 commandalias XxXxXx XxXxXxX
569 commandalias XxXxXx
echo huhu
576 cksum_test behave
:commandalias
"${MBOX}" '3694143612 31'
580 # Nestable conditions test
581 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
603 if $dietcurd == 'yoho'
608 if $dietcurd != 'yoho'
669 if $dietcurd == 'yohu'
671 elif $dietcurd == 'yoha'
673 elif $dietcurd == 'yohe'
675 elif $dietcurd == 'yoho'
677 if $dietcurd == 'yohu'
679 elif $dietcurd == 'yoha'
681 elif $dietcurd == 'yohe'
683 elif $dietcurd == 'yoho'
685 if $dietcurd == 'yohu'
687 elif $dietcurd == 'yoha'
689 elif $dietcurd == 'yohe'
691 elif $dietcurd == 'yoho'
702 # integer conversion, <..>..
805 set diet=abc curd=abc
811 set diet=abc curd=abcd
817 # 1. Shitty grouping capabilities as of today
818 unset diet curd ndefined
819 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
825 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
830 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
835 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
840 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
845 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
851 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
856 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
861 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
866 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
871 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
876 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
881 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
886 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
891 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
896 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
902 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
908 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
913 # 2. Shitty grouping capabilities as of today
914 unset diet curd ndefined
915 if [ false || false || true ] && [ false || true ] && yes
920 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
925 if [ 1 || 0 || 0 || 0 ]
930 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
935 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
940 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
945 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
950 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
955 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
960 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
965 if 1 || 0 || 0 || 0 && 0
970 if 1 || 0 || 0 || 0 && 1
975 if 0 || 0 || 0 || 1 && 0
980 if 0 || 0 || 0 || 1 && 1
985 if 0 || 0 || 0 || 1 && 0 || 1 && 0
990 if 0 || 0 || 0 || 1 && 0 || 1 && 1
996 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1001 if $diet == 'yo' && $curd == 'ho' && $ndefined
1007 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1012 if $diet == 'yo' && $curd == 'ho' && $ndefined
1017 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1022 # Some more en-braced variables
1024 if ${diet} == ${curd}
1029 if ${diet} != ${curd}
1045 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1050 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1055 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1060 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1065 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1070 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1075 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1080 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1085 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1091 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1096 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1101 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1106 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1111 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1116 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1121 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1126 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1131 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1137 cksum_test behave:if-normal "${MBOX}" '557629289 631'
1139 if have_feat regex; then
1140 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1142 if $dietcurd =~
'^yo.*'
1147 if $dietcurd =~
'^yoho.+'
1152 if $dietcurd !~
'.*ho$'
1157 if $dietcurd !~
'.+yoho$'
1162 if [ $dietcurd !~
'.+yoho$' ]
1167 if ! [ $dietcurd =~
'.+yoho$' ]
1172 if ! ! [ $dietcurd !~
'.+yoho$' ]
1177 if ! [ ! [ $dietcurd !~
'.+yoho$' ] ]
1182 if [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1187 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1192 if ! ! ! $dietcurd !~
'.+yoho$'
1197 if ! ! ! $dietcurd =~
'.+yoho$'
1202 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
1207 set diet
=abc curd
='^abc$'
1213 set diet
=abc curd
='^abcd$'
1220 cksum_test behave
:if-regex
"${MBOX}" '439960016 81'
1224 __behave_localopts
() {
1225 # Nestable conditions test
1226 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1241 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1246 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1247 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1256 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1258 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1264 #gv1 lv1 lv2 lv3 gv2, t2
1272 #gv1 lv1 lv2 lv3 gv2, t2
1275 #active trouble: gv1 gv2,
1277 cksum_test behave:localopts "${MBOX}" '1936527193 192'
1280 __behave_macro_param_shift() {
1281 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev
/null
1284 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1289 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1290 if [ $# > 1 ] ||
[ $ignerr == '' ]
1295 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1297 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1301 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1306 call t2
1 you get four args
1307 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1308 call t2
1 you get
'three args'
1309 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1310 call t2
1 you
'get two args'
1311 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1312 call t2
1 'you get one arg'
1313 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1314 ignerr call t2
'' 'you get one arg'
1315 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1321 #t2.0 has 5/5 parameters: 1,you,get (1 you get four args) [1 you get four args]
1322 #t2.1 has 4/4 parameters: you,get,four (you get four args) [you get four args]
1323 #t2.2:0 has 2/2 parameters: four,args, (four args) [four args]
1324 #t2.3:0 has 2/2 parameters: four,args, (four args) [four args]
1325 #t2.4:0 has 1/1 parameters: args,, (args) [args]
1326 #t1.1: 0; ignerr () should not exist
1328 #t2.0 has 4/4 parameters: 1,you,get (1 you get three args) [1 you get three args]
1329 #t2.1 has 3/3 parameters: you,get,three args (you get three args) [you get three args]
1330 #t2.2:0 has 1/1 parameters: three args,, (three args) [three args]
1331 #t2.3:0 has 1/1 parameters: three args,, (three args) [three args]
1332 #t2.4:0 has 0/0 parameters: ,, () []
1333 #t1.2: 0; ignerr () should not exist
1335 #t2.0 has 3/3 parameters: 1,you,get two args (1 you get two args) [1 you get two args]
1336 #t2.1 has 2/2 parameters: you,get two args, (you get two args) [you get two args]
1337 #t2.2:0 has 0/0 parameters: ,, () []
1338 #t2.3:0 has 0/0 parameters: ,, () []
1339 #t2.4:0 has 0/0 parameters: ,, () []
1340 #t1.3: 0; ignerr () should not exist
1342 #t2.0 has 2/2 parameters: 1,you get one arg, (1 you get one arg) [1 you get one arg]
1343 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1344 #t2.2:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1345 #t2.3:0 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1346 #t2.4:0 has 0/0 parameters: ,, () []
1347 #t1.4: 0; ignerr () should not exist
1349 #t2.0 has 2/2 parameters: ,you get one arg, ( you get one arg) [ you get one arg]
1350 #t2.1 has 1/1 parameters: you get one arg,, (you get one arg) [you get one arg]
1351 #t1.5: 1; ignerr () should not exist
1352 cksum_test behave
:macro_param_shift
"${MBOX}" '1402489146 1682'
1355 __behave_addrcodec
() {
1356 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}"
1357 vput addrcodec res e 1 <doog@def>
1359 eval vput addrcodec res d $res
1361 vput addrcodec res e 2 . <doog@def>
1363 eval vput addrcodec res d $res
1365 vput addrcodec res e 3 Sauer Dr. <doog@def>
1367 eval vput addrcodec res d $res
1369 vput addrcodec res e 4 Sauer (Ma) Dr. <doog@def>
1371 eval vput addrcodec res d $res
1373 vput addrcodec res e 5 Sauer (Ma) Braten Dr. <doog@def>
1375 eval vput addrcodec res d $res
1377 vput addrcodec res e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1379 eval vput addrcodec res d $res
1381 vput addrcodec res e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1383 eval vput addrcodec res d $res
1385 vput addrcodec res e 8 \
1386 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1388 eval vput addrcodec res d $res
1390 vput addrcodec res e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1392 eval vput addrcodec res d $res
1394 vput addrcodec res e 10 (Ma)Braten Dr. (Heu) <doog@def>
1396 eval vput addrcodec res d $res
1398 vput addrcodec res e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1400 eval vput addrcodec res d $res
1402 vput addrcodec res e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1404 eval vput addrcodec res d $res
1406 vput addrcodec res e 13(Ma)Braten Dr. (Heu) <doog@def>
1408 eval vput addrcodec res d $res
1410 vput addrcodec res e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1412 eval vput addrcodec res d $res
1414 vput addrcodec res e 15 \
1415 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1417 eval vput addrcodec res d $res
1419 vput addrcodec res e 16 \
1420 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1422 eval vput addrcodec res d $res
1424 vput addrcodec res e 17 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1426 eval vput addrcodec res d $res
1428 vput addrcodec res e 18 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1430 eval vput addrcodec res d $res
1432 vput addrcodec res e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1434 eval vput addrcodec res d $res
1436 vput addrcodec res +e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1438 vput addrcodec res +e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1440 eval vput addrcodec res d
$res
1442 vput addrcodec res
++e
22 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1444 eval vput addrcodec res d
$res
1451 #0 "3 Sauer Dr." <doog@def>
1452 #0 3 Sauer Dr. <doog@def>
1453 #0 4 Sauer (Ma) "Dr." <doog@def>
1454 #0 4 Sauer (Ma) Dr. <doog@def>
1455 #0 5 Sauer (Ma) "Braten Dr." <doog@def>
1456 #0 5 Sauer (Ma) Braten Dr. <doog@def>
1457 #0 6 Sauer (Ma) "Braten Dr." (Heu) <doog@def>
1458 #0 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1459 #0 7 Sauer (Ma) "Braten Dr." (Heu bu) <doog@def>
1460 #0 7 Sauer (Ma) Braten Dr. (Heu bu) <doog@def>
1461 #0 "8 Dr. Sauer" (Ma) "Braten Dr." (Heu bu) "Boom. Boom" <doog@def>
1462 #0 8 Dr. Sauer (Ma) Braten Dr. (Heu bu) Boom. Boom <doog@def>
1463 #0 "9 Dr.Sauer" (Ma) "Braten Dr." (Heu) <doog@def>
1464 #0 9 Dr.Sauer (Ma) Braten Dr. (Heu) <doog@def>
1465 #0 10 (Ma) "Braten Dr." (Heu) <doog@def>
1466 #0 10 (Ma) Braten Dr. (Heu) <doog@def>
1467 #0 11 (Ma) "Braten Dr\".\"" (Heu) <doog@def>
1468 #0 11 (Ma) Braten Dr"." (Heu) <doog@def>
1469 #0 "12 Dr. Sauer" (Ma) "Braten Dr." (u) <doog@def>
1470 #0 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1471 #0 13 (Ma) "Braten Dr." (Heu) <doog@def>
1472 #0 13 (Ma) Braten Dr. (Heu) <doog@def>
1473 #0 "14 Hey, Du Wie" () "findet Dr. das?" () <doog@def>
1474 #0 14 Hey, Du Wie () findet Dr. das? () <doog@def>
1475 #0 "15 Hey, Du Wie" () "findet \"\" Dr. \"\" das?" () <doog@def>
1476 #0 15 Hey, Du Wie () findet "" Dr. "" das? () <doog@def>
1477 #0 "16 \"Hey,\" \"Du\" \"Wie" () "\" findet \"\" Dr. \"\" das?" () <doog@def>
1478 #0 16 "Hey," "Du" "Wie () " findet "" Dr. "" das? () <doog@def>
1479 #0 "17 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1480 #0 17 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1481 #0 "18 \"Hey\" Du \"Wie" () "findet \" \" Dr. \"\"\" das?" () <doog@def>
1482 #0 18 "Hey" Du "Wie () findet " " Dr. """ das? () <doog@def>
1483 #0 "19 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1484 #0 19 Hey\,\" "Wie () " findet \" Dr. \" das? <doog@def>
1485 #1 20 Hey\\,\\" <doog@def> "Wie()" findet \\" Dr. \\" das?
1486 #0 "21 Hey\\,\\ Wie() findet \\ Dr. \\ das?" <doog@def>
1487 #0 21 Hey\,\ Wie() findet \ Dr. \ das? <doog@def>
1488 #0 "22 Hey\,\" Wie() findet \" Dr. \" das?" <doog@def>
1489 #0 22 Hey," Wie() findet " Dr. " das? <doog@def>
1490 cksum_test behave
:addrcodec
"${MBOX}" '2804134200 2018'
1494 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" 2>/dev/null
1495 vput vexpr res = 9223372036854775807
1496 echo $?/$^ERRNAME $res
1497 vput vexpr res = 9223372036854775808
1498 echo $?/$^ERRNAME $res
1499 vput vexpr res =@ 9223372036854775808
1500 echo $?/$^ERRNAME $res
1501 vput vexpr res = -9223372036854775808
1502 echo $?/$^ERRNAME $res
1503 vput vexpr res = -9223372036854775809
1504 echo $?/$^ERRNAME $res
1505 vput vexpr res =@ -9223372036854775809
1506 echo $?/$^ERRNAME $res
1509 echo $?/$^ERRNAME $res
1511 echo $?/$^ERRNAME $res
1513 echo $?/$^ERRNAME $res
1515 vput vexpr res + 0 0
1516 echo $?/$^ERRNAME $res
1517 vput vexpr res + 0 1
1518 echo $?/$^ERRNAME $res
1519 vput vexpr res + 1 1
1520 echo $?/$^ERRNAME $res
1522 vput vexpr res + 9223372036854775807 0
1523 echo $?/$^ERRNAME $res
1524 vput vexpr res + 9223372036854775807 1
1525 echo $?/$^ERRNAME $res
1526 vput vexpr res +@ 9223372036854775807 1
1527 echo $?/$^ERRNAME $res
1528 vput vexpr res + 0 9223372036854775807
1529 echo $?/$^ERRNAME $res
1530 vput vexpr res + 1 9223372036854775807
1531 echo $?/$^ERRNAME $res
1532 vput vexpr res +@ 1 9223372036854775807
1533 echo $?/$^ERRNAME $res
1535 vput vexpr res + -9223372036854775808 0
1536 echo $?/$^ERRNAME $res
1537 vput vexpr res + -9223372036854775808 -1
1538 echo $?/$^ERRNAME $res
1539 vput vexpr res +@ -9223372036854775808 -1
1540 echo $?/$^ERRNAME $res
1541 vput vexpr res + 0 -9223372036854775808
1542 echo $?/$^ERRNAME $res
1543 vput vexpr res + -1 -9223372036854775808
1544 echo $?/$^ERRNAME $res
1545 vput vexpr res +@ -1 -9223372036854775808
1546 echo $?/$^ERRNAME $res
1548 vput vexpr res - 0 0
1549 echo $?/$^ERRNAME $res
1550 vput vexpr res - 0 1
1551 echo $?/$^ERRNAME $res
1552 vput vexpr res - 1 1
1553 echo $?/$^ERRNAME $res
1555 vput vexpr res - 9223372036854775807 0
1556 echo $?/$^ERRNAME $res
1557 vput vexpr res - 9223372036854775807 -1
1558 echo $?/$^ERRNAME $res
1559 vput vexpr res -@ 9223372036854775807 -1
1560 echo $?/$^ERRNAME $res
1561 vput vexpr res - 0 9223372036854775807
1562 echo $?/$^ERRNAME $res
1563 vput vexpr res - -1 9223372036854775807
1564 echo $?/$^ERRNAME $res
1565 vput vexpr res - -2 9223372036854775807
1566 echo $?/$^ERRNAME $res
1567 vput vexpr res -@ -2 9223372036854775807
1568 echo $?/$^ERRNAME $res
1570 vput vexpr res - -9223372036854775808 +0
1571 echo $?/$^ERRNAME $res
1572 vput vexpr res - -9223372036854775808 +1
1573 echo $?/$^ERRNAME $res
1574 vput vexpr res -@ -9223372036854775808 +1
1575 echo $?/$^ERRNAME $res
1576 vput vexpr res - 0 -9223372036854775808
1577 echo $?/$^ERRNAME $res
1578 vput vexpr res - +1 -9223372036854775808
1579 echo $?/$^ERRNAME $res
1580 vput vexpr res -@ +1 -9223372036854775808
1581 echo $?/$^ERRNAME $res
1583 vput vexpr res + -13 -2
1584 echo $?/$^ERRNAME $res
1585 vput vexpr res - 0 0
1586 echo $?/$^ERRNAME $res
1587 vput vexpr res - 0 1
1588 echo $?/$^ERRNAME $res
1589 vput vexpr res - 1 1
1590 echo $?/$^ERRNAME $res
1591 vput vexpr res - -13 -2
1592 echo $?/$^ERRNAME $res
1594 vput vexpr res * 0 0
1595 echo $?/$^ERRNAME $res
1596 vput vexpr res * 0 1
1597 echo $?/$^ERRNAME $res
1598 vput vexpr res * 1 1
1599 echo $?/$^ERRNAME $res
1600 vput vexpr res * -13 -2
1601 echo $?/$^ERRNAME $res
1603 vput vexpr res / 0 0
1604 echo $?/$^ERRNAME $res
1605 vput vexpr res / 0 1
1606 echo $?/$^ERRNAME $res
1607 vput vexpr res / 1 1
1608 echo $?/$^ERRNAME $res
1609 vput vexpr res / -13 -2
1610 echo $?/$^ERRNAME $res
1612 vput vexpr res % 0 0
1613 echo $?/$^ERRNAME $res
1614 vput vexpr res % 0 1
1615 echo $?/$^ERRNAME $res
1616 vput vexpr res % 1 1
1617 echo $?/$^ERRNAME $res
1618 vput vexpr res % -13 -2
1619 echo $?/$^ERRNAME $res
1621 #0/NONE 9223372036854775807
1623 #0/OVERFLOW 9223372036854775807
1624 #0/NONE -9223372036854775808
1626 #0/OVERFLOW -9223372036854775808
1636 #0/NONE 9223372036854775807
1638 #0/OVERFLOW 9223372036854775807
1639 #0/NONE 9223372036854775807
1641 #0/OVERFLOW 9223372036854775807
1643 #0/NONE -9223372036854775808
1645 #0/OVERFLOW -9223372036854775808
1646 #0/NONE -9223372036854775808
1648 #0/OVERFLOW -9223372036854775808
1654 #0/NONE 9223372036854775807
1656 #0/OVERFLOW 9223372036854775807
1657 #0/NONE -9223372036854775807
1658 #0/NONE -9223372036854775808
1660 #0/OVERFLOW -9223372036854775808
1662 #0/NONE -9223372036854775808
1664 #0/OVERFLOW -9223372036854775808
1665 #0/NONE -9223372036854775808
1667 #0/OVERFLOW -9223372036854775808
1689 cksum_test behave:vexpr-numeric "${MBOX}" '1723609217 1048'
1691 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1692 vput vexpr res
find 'bananarama' 'nana'
1693 echo $?
/$^ERRNAME
:$res:
1694 vput vexpr res
find 'bananarama' 'bana'
1695 echo $?
/$^ERRNAME
:$res:
1696 vput vexpr res
find 'bananarama' 'Bana'
1697 echo $?
/$^ERRNAME
:$res:
1698 vput vexpr res
find 'bananarama' 'rama'
1699 echo $?
/$^ERRNAME
:$res:
1701 vput vexpr res ifind
'bananarama' 'nana'
1702 echo $?
/$^ERRNAME
:$res:
1703 vput vexpr res ifind
'bananarama' 'bana'
1704 echo $?
/$^ERRNAME
:$res:
1705 vput vexpr res ifind
'bananarama' 'Bana'
1706 echo $?
/$^ERRNAME
:$res:
1707 vput vexpr res ifind
'bananarama' 'rama'
1708 echo $?
/$^ERRNAME
:$res:
1710 vput vexpr res substring
'bananarama' 1
1711 echo $?
/$^ERRNAME
:$res:
1712 vput vexpr res substring
'bananarama' 3
1713 echo $?
/$^ERRNAME
:$res:
1714 vput vexpr res substring
'bananarama' 5
1715 echo $?
/$^ERRNAME
:$res:
1716 vput vexpr res substring
'bananarama' 7
1717 echo $?
/$^ERRNAME
:$res:
1718 vput vexpr res substring
'bananarama' 9
1719 echo $?
/$^ERRNAME
:$res:
1720 vput vexpr res substring
'bananarama' 10
1721 echo $?
/$^ERRNAME
:$res:
1722 vput vexpr res substring
'bananarama' 1 3
1723 echo $?
/$^ERRNAME
:$res:
1724 vput vexpr res substring
'bananarama' 3 3
1725 echo $?
/$^ERRNAME
:$res:
1726 vput vexpr res substring
'bananarama' 5 3
1727 echo $?
/$^ERRNAME
:$res:
1728 vput vexpr res substring
'bananarama' 7 3
1729 echo $?
/$^ERRNAME
:$res:
1730 vput vexpr res substring
'bananarama' 9 3
1731 echo $?
/$^ERRNAME
:$res:
1732 vput vexpr res substring
'bananarama' 10 3
1733 echo $?
/$^ERRNAME
:$res:
1759 cksum_test behave
:vexpr-string
"${MBOX}" '265398700 267'
1761 if have_feat regex
; then
1762 ${cat} <<- '__EOT' | "${SNAIL}" ${ARGS} > "${MBOX}" #2>/dev/null
1763 vput vexpr res regex 'bananarama' 'nana'
1764 echo $?/$^ERRNAME :$res:
1765 vput vexpr res regex 'bananarama' 'bana'
1766 echo $?/$^ERRNAME :$res:
1767 vput vexpr res regex 'bananarama' 'Bana'
1768 echo $?/$^ERRNAME :$res:
1769 vput vexpr res regex 'bananarama' 'rama'
1770 echo $?/$^ERRNAME :$res:
1772 vput vexpr res iregex 'bananarama' 'nana'
1773 echo $?/$^ERRNAME :$res:
1774 vput vexpr res iregex 'bananarama' 'bana'
1775 echo $?/$^ERRNAME :$res:
1776 vput vexpr res iregex 'bananarama' 'Bana'
1777 echo $?/$^ERRNAME :$res:
1778 vput vexpr res iregex 'bananarama' 'rama'
1779 echo $?/$^ERRNAME :$res:
1781 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1782 echo $?/$^ERRNAME :$res:
1783 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1784 echo $?/$^ERRNAME :$res:
1785 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
1786 echo $?/$^ERRNAME :$res:
1787 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
1788 echo $?/$^ERRNAME :$res:
1790 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1791 echo $?/$^ERRNAME :$res:
1792 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1793 echo $?/$^ERRNAME :$res:
1794 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
1795 echo $?/$^ERRNAME :$res:
1796 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
1797 echo $?/$^ERRNAME :$res:
1810 #0/NONE :baabananaramau{rama}:
1811 #0/NONE :abananaramaunarama:
1813 #0/NONE :bananabananarama:
1815 #0/NONE :baabananaramau{rama}:
1816 #0/NONE :abananaramaunarama:
1817 #0/NONE :naramabananarama:
1818 #0/NONE :bananabananarama:
1820 cksum_test behave:vexpr-regex "${MBOX}" '3270360157 311'
1824 __behave_smime() { # FIXME add test/ dir, unroll tests therein
1825 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
1826 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
1827 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
1829 printf 'behave:s/mime: .. generating test key and certificate ..\n'
1830 ${cat} <<-_EOT > ./.t.conf
1833 default_keyfile = keyfile.pem
1834 distinguished_name = req_distinguished_name
1835 attributes = req_attributes
1839 [ req_distinguished_name ]
1846 emailAddress = test@localhost
1851 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
1852 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
1853 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
1855 printf "behave
:s
/mime
:sign
/verify
: "
1856 echo bla | "${SNAIL}" ${ARGS} \
1857 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1858 -Ssmime-sign -Sfrom=test@localhost \
1859 -s 'S/MIME test' ./.VERIFY
1860 printf 'verify\nx\n' |
1861 "${SNAIL}" ${ARGS} \
1862 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1863 -Ssmime-sign -Sfrom=test@localhost \
1865 -f ./.VERIFY >/dev/null 2>&1
1866 if [ $? -eq 0 ]; then
1869 printf 'error: verification failed\n'
1871 ${rm} -f ${TRAP_EXIT_ADDONS}
1875 printf ' .. disproof via openssl smime(1): '
1876 if openssl smime -verify -CAfile ./.tcert.pem \
1877 -in ./.VERIFY >/dev/null 2>&1; then
1882 ${rm} -f ${TRAP_EXIT_ADDONS}
1887 # (signing +) encryption / decryption
1888 ${cat} <<-_EOT > ./.tsendmail.sh
1891 (echo 'From S-Postman Thu May 10 20:40:54 2012' && ${cat}) > ./.ENCRYPT
1893 chmod 0755 ./.tsendmail.sh
1895 printf "behave
:s
/mime
:encrypt
+sign
/decrypt
+verify
: "
1897 "${SNAIL}" ${ARGS} \
1898 -Ssmime-force-encryption \
1899 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
1900 -Smta=./.tsendmail.sh \
1901 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1902 -Ssmime-sign -Sfrom=test@localhost \
1903 -s 'S/MIME test' recei@ver.com
1905 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
1906 "${SNAIL}" ${ARGS} \
1907 -Ssmime-force-encryption \
1908 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
1909 -Smta=./.tsendmail.sh \
1910 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1911 -Ssmime-sign -Sfrom=test@localhost \
1913 -f ./.ENCRYPT >/dev/null 2>&1
1914 if [ $? -eq 0 ]; then
1918 printf 'error: decryption+verification failed\n'
1920 printf ' ..disproof via openssl smime(1): '
1921 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
1922 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
1928 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1930 '/^Content-Disposition: attachment; filename="smime.p7s
"/,/^-- /d' \
1931 < ./.DECRYPT > ./.ENCRYPT
1932 cksum_test ".. checksum of decrypted content
" ".
/.ENCRYPT
" '3090916509 510'
1934 printf "behave
:s
/mime
:encrypt
/decrypt
: "
1936 echo bla | "${SNAIL}" ${ARGS} \
1937 -Ssmime-force-encryption \
1938 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
1939 -Smta=./.tsendmail.sh \
1940 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1941 -Sfrom=test@localhost \
1942 -s 'S/MIME test' recei@ver.com
1943 printf 'decrypt ./.DECRYPT\nx\n' | "${SNAIL}" ${ARGS} \
1944 -Ssmime-force-encryption \
1945 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
1946 -Smta=./.tsendmail.sh \
1947 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
1948 -Sfrom=test@localhost \
1950 -f ./.ENCRYPT >/dev/null 2>&1
1951 if [ $? -eq 0 ]; then
1955 printf 'error: decryption failed\n'
1957 printf '.. disproof via openssl smime(1): '
1958 if openssl smime -decrypt -inkey ./.tkey.pem \
1959 -in ./.ENCRYPT >/dev/null 2>&1; then
1965 ${sed} -e '/^Date:/d' -e '/^X-Decoding-Date/d' \
1966 < ./.DECRYPT > ./.ENCRYPT
1967 cksum_test ".. checksum of decrypted content
" ./.ENCRYPT '999887248 295'
1969 ${rm} -f ${TRAP_EXIT_ADDONS}
1974 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
1975 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
1976 # Note we unfortunately need to place some statements without proper
1977 # indentation because of continuation problems
1979 # MIME encoding (QP) stress message body
1981 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
1982 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
1983 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
1984 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
1985 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
1986 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
1987 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
1988 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
1989 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
1990 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
1991 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
1992 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
1993 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
1994 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
1995 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
1996 "auf den zeilen vorher.
\r\n"\
1997 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
1999 "Die letzte Zeile war nur ein Punkt.
\r\n"\
2001 "Das waren deren zwei.
\r\n"\
2003 "Die letzte Zeile war ein Leerschritt.
\n"\
2004 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
2007 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
2009 "Das waren deren zwei. ditto.
\n"\
2011 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
2012 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
2013 "auf den zeilen vorher.
\n"\
2015 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
2016 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
2018 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2020 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2022 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2024 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2026 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
2028 "QP am Zeilenende über soft-nl hinweg
\n"\
2029 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2031 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2033 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2035 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
2037 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
2039 "Die letzte Zeile war ein Leerschritt.
\n"\
2043 # MIME encoding (QP) stress message subject
2044 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
2045 adadaddsssssssddddddddddddddddddddd\
2046 ddddddddddddddddddddddddddddddddddd\
2047 ddddddddddddddddddddddddddddddddddd\
2048 dddddddddddddddddddd Hallelulja? Od\
2049 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2050 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
2051 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
2052 fffffffffffffffffffffffffffffffffff\
2053 fffffffffffffffffffff ggggggggggggg\
2054 ggggggggggggggggggggggggggggggggggg\
2055 ggggggggggggggggggggggggggggggggggg\
2056 ggggggggggggggggggggggggggggggggggg\
2059 # Three tests for MIME encodign and (a bit) content classification.
2060 # At the same time testing -q FILE, < FILE and -t FILE
2063 < "${BODY}" "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2064 -a "${BODY}" -s "${SUB}" "${MBOX}"
2065 cksum_test content
:001 "${MBOX}" '2356108758 6413'
2068 < /dev
/null
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2069 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
2070 cksum_test content:002 "${MBOX}" '2356108758 6413'
2073 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
2075 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
2076 cksum_test content:003 "${MBOX}" '2356108758 6413'
2078 # Test for [260e19d] (Juergen Daubert)
2080 echo body | "${SNAIL}" ${ARGS} "${MBOX}"
2081 cksum_test content:004 "${MBOX}" '4004005686 49'
2083 # Sending of multiple mails in a single invocation
2085 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n~.
\n" &&
2086 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n~.
\n" &&
2088 ) | "${SNAIL}" ${ARGS} ${ADDARG_UNI}
2089 cksum_test content
:005 "${MBOX}" '2157252578 260'
2093 # "Test for" [d6f316a] (Gavin Troy)
2095 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
2096 "${SNAIL}" ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="${cat}" > "${BODY}"
2097 ${sed} -e 1d < "${BODY}" > "${MBOX}"
2098 cksum_test content:006 "${MBOX}" '2273863401 83'
2100 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
2103 for(i = 0; i < 10000; ++i)
2105 #printf "\xF0\x90\x87\x90"
2106 }' | "${SNAIL}" ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
2107 cksum_test content:007 "${MBOX}" '1754234717 61767'
2109 ## Test some more corner cases for header bodies (as good as we can today) ##
2113 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2114 -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̲' \
2116 cksum_test content
:008 "${MBOX}" '1563381297 326'
2118 # Single word (overlong line split -- bad standard! Requires injection of
2119 # artificial data!! Bad can be prevented by using RFC 2047 encoding)
2121 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2122 echo |
"${SNAIL}" ${ARGS} -s "${i}" "${MBOX}"
2123 cksum_test content
:009 "${MBOX}" '1996714851 1669'
2125 # Combination of encoded words, space and tabs of varying sort
2127 echo |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2128 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2129 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2130 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2131 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2132 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2134 cksum_test content:010 "${MBOX}" '2956039469 542'
2136 # Overlong multibyte sequence that must be forcefully split
2137 # todo This works even before v15.0, but only by accident
2139 echo | "${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2140 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2141 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2142 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
2144 cksum_test content
:011 "${MBOX}" '454973928 610'
2148 echo |
"${SNAIL}" ${ARGS} \
2149 -s "1-1 B2 B3 B4 B5 B6 B\
2150 1-2 B2 B3 B4 B5 B6 B\
2151 1-3 B2 B3 B4 B5 B6 B\
2152 1-4 B2 B3 B4 B5 B6 B\
2153 1-5 B2 B3 B4 B5 B6 B\
2154 1-6 B2 B3 B4 B5 B6 " \
2156 cksum_test content
:012 "${MBOX}" '1014122962 248'
2158 # Leading and trailing WS
2160 echo |
"${SNAIL}" ${ARGS} \
2161 -s " 2-1 B2 B3 B4 B5 B6 B\
2162 1-2 B2 B3 B4 B5 B6 B\
2163 1-3 B2 B3 B4 B5 B6 B\
2164 1-4 B2 B3 B4 B5 B6 " \
2166 cksum_test content
:013 "${MBOX}" '3212167908 187'
2168 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
2169 # have a (better) test framework materialize a quick shot
2171 TRAP_EXIT_ADDONS
=.
/.ttt
2173 mkdir .
/.ttt ||
exit 1
2177 : > 'diet\ is \curd.txt'
2178 : > 'diet "is" curd.txt'
2180 : > 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
2181 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
2182 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
2183 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
2185 echo bla |
"${SNAIL}" ${ARGS} ${ADDARG_UNI} \
2186 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
2187 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
2188 -a ./.ttt/höde-tröge.txt \
2189 -a ./.ttt/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 \
2190 -a ./.ttt/höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt \
2191 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
2192 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
2195 cksum_test content:14 "${MBOX}" '589846634 2491'
2197 printf "Resend
${BODY}\nx\n" | "${SNAIL}" ${ARGS} -f "${MBOX}"
2198 cksum_test content:14-2 "${MBOX}" '589846634 2491'
2202 if have_feat devel; then
2203 ARGS="${ARGS} -Smemdebug"
2210 if [ -z "${CHECK_ONLY}" ]; then
2216 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'