2 #@ Usage: ./cc-test.sh [--check-only] s-mailx-binary
3 #@ TODO _All_ the tests should happen in a temporary subdir.
6 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
7 # such is a compile-time variable
8 ARGS
='-:/ -# -Sdotlock-ignore-error -Sencoding=quoted-printable -Sstealthmua'
9 ARGS
="${ARGS}"' -Snosave -Sexpandaddr=restrict'
10 ADDARG_UNI
=-Sttycharset=UTF-8
15 #UTF8_LOCALE= autodetected unless set
18 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
20 if ( command -v command ) >/dev
/null
2>&1; then :; else
27 MAKE
="${MAKE:-`command -v make`}"
28 awk=${awk:-`command -v awk`}
29 cat=${cat:-`command -v cat`}
30 cksum=${cksum:-`command -v cksum`}
31 rm=${rm:-`command -v rm`}
32 sed=${sed:-`command -v sed`}
33 grep=${grep:-`command -v grep`}
35 # Problem: force $SHELL to be a real shell. It seems some testing environments
36 # use nologin(?), but we need a real shell for command execution
37 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
38 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
43 # We sometimes "fake" sendmail(1) a.k.a. *mta* with a shell wrapper, and it
44 # happens that /bin/sh is often terribly slow
45 if command -v dash
>/dev
/null
2>&1; then
46 MYSHELL
="`command -v dash`"
47 elif command -v mksh
>/dev
/null
2>&1; then
48 MYSHELL
="`command -v mksh`"
55 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
59 # Wed Oct 2 01:50:07 UTC 1996
60 SOURCE_DATE_EPOCH
=844221007
62 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
66 echo >&2 "Usage: ./cc-test.sh [--check-only] s-mailx-binary"
71 while [ $# -gt 0 ]; do
72 if [ "${1}" = --check-only ]; then
79 [ -x "${MAILX}" ] || usage
81 MAILX
="${MEMTESTER}${MAILX}"
84 if [ -z "${UTF8_LOCALE}" ]; then
85 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
86 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
88 \if [ "${ttycharset}" @i=% utf ]
93 \wysh set LC_ALL="${1}.utf8"
95 \eval xcall cset_test "${@}"
99 \call cset_test POSIX en_EN en_US
101 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
103 if [ -z "${UTF8_LOCALE}" ] && command -v locale
>/dev
/null
2>&1; then
104 UTF8_LOCALE
=`locale -a | { m=
106 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
108 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
122 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
123 trap "exit 1" HUP INT TERM
126 # Test all configs TODO doesn't cover all *combinations*, stupid!
130 NOTME["OPT_AUTOCC"] = 1
131 NOTME["OPT_DEBUG"] = 1
132 NOTME["OPT_DEVEL"] = 1
133 NOTME["OPT_NOEXTMD5"] = 1
134 NOTME["OPT_NOMEMDBG"] = 1
135 NOTME["OPT_NYD2"] = 1
138 /^[[:space:]]*OPT_/ {
139 sub(/^[[:space:]]*/, "")
140 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
141 # does not seem to be a compliant escape for =
143 $1 = substr($1, 1, index($1, "=") - 1)
149 # Doing this completely sequentially and not doing make distclean in
150 # between runs should effectively result in lesser compilations.
151 # It is completely dumb nonetheless... TODO
152 for (j = 1; j < i; ++j) {
153 for (k = 1; k < j; ++k)
155 for (k = j; k < i; ++k)
157 printf "OPT_AUTOCC=1\n"
159 for (j = 1; j < i; ++j) {
160 for (k = 1; k < j; ++k)
162 for (k = j; k < i; ++k)
164 printf "OPT_AUTOCC=1\n"
167 for (j = 1; j < i; ++j) {
168 for (k = 1; k < j; ++k)
170 for (k = j; k < i; ++k)
172 printf "OPT_AUTOCC=1\n"
173 printf "OPT_DEBUG=1\n"
175 for (j = 1; j < i; ++j) {
176 for (k = 1; k < j; ++k)
178 for (k = j; k < i; ++k)
180 printf "OPT_AUTOCC=1\n"
181 printf "OPT_DEBUG=1\n"
184 printf "CONFIG=NULL OPT_AUTOCC=0\n"
185 printf "CONFIG=NULL OPT_AUTOCC=1\n"
186 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
187 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
188 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
189 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
190 printf "CONFIG=MEDIUM OPT_AUTOCC=0\n"
191 printf "CONFIG=MEDIUM OPT_AUTOCC=1\n"
192 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
193 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
194 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
195 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
196 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
197 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
198 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
199 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
202 printf "\n\n##########\n$c\n"
203 printf "\n\n##########\n$c\n" >&2
211 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
212 ${grep} +${1} ) >/dev
/null
2>&1
216 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
224 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
225 #x=`echo ${tid} | tr "/:=" "__-"`
226 #cp -f "${f}" "${TMPDIR}/${x}"
227 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
228 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
229 csum
="`${cksum} < ${f}`"
230 if [ "${csum}" = "${s}" ]; then
231 printf '%s: ok\n' "${tid}"
234 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
240 printf '%s: error: %s\n' ${1} "${2}"
244 [ $?
-ne 0 ] && err
$1 'unexpected non-0 exit status'
248 [ $?
-eq 0 ] && err
$1 'unexpected 0 exit status'
251 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
253 echo "$((${1} + ${2}))"
255 elif command -v expr >/dev
/null
2>&1; then
257 echo `expr ${1} + ${2}`
261 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
265 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
267 echo "$((${1} % ${2}))"
269 elif command -v expr >/dev
/null
2>&1; then
271 echo `expr ${1} % ${2}`
275 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
280 # Basic (easily testable) behaviour tests
282 t_behave_X_opt_input_command_stack
285 t_behave_input_inject_semicolon_seq
286 t_behave_commandalias
289 t_behave_macro_param_shift
300 # FIXME t_behave_mlist
303 t_behave_record_a_resend
306 t_behave_compose_hooks
307 t_behave_message_injections
308 t_behave_mime_types_load_control
313 t_behave_mass_recipients
316 t_behave_X_opt_input_command_stack
() {
319 ${cat} <<- '__EOT' > "${BODY}"
327 echo "define mac1 {";\
328 echo " echo mac1-1 via1 \$0";\
330 echo " echo mac1-2";\
332 echo " echo mac1-3";\
335 echo "define mac2 {";\
336 echo " echo mac2-1 via1 \$0";\
338 echo " echo mac2-2";\
344 echo echo 1-1-1 via1 \$0;\
356 # The -X option supports multiline arguments, and those can internally use
357 # reverse solidus newline escaping. And all -X options are joined...
359 < "${BODY}" ${MAILX} ${ARGS} \
374 echo "define mac1 {";\
375 echo " echo mac1-1 via2 \$0";\
377 echo " echo mac1-2";\
379 echo " echo mac1-3";\
382 echo "define mac2 {";\
383 echo " echo mac2-1 via2 \$0";\
385 echo " echo mac2-2";\
391 echo echo 1-1-1 via2 \$0;\
405 check behave:x_opt_input_command_stack 0 "${MBOX}" '1786542668 416'
410 t_behave_X_errexit() {
413 ${cat} <<- '__EOT' > "${BODY}"
419 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
420 -X'echo one' -X' echos nono ' -X'echo two' \
422 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
424 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
426 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
428 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
430 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
434 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
435 -X'echo one' -X' echos nono ' -X'echo two' \
437 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
439 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
441 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
443 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
445 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
447 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
449 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
451 ## Repeat 4-7 with ignerr set
453 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
455 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
456 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
458 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
460 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
462 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
464 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
466 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
468 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
470 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
478 ${cat} <<- '__EOT' > "${BODY}"
497 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
498 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
499 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
501 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
502 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
525 echo a$
'b\U0000000'dt
526 echo a$
'b\U00000000'du
536 if [ -z "${UTF8_LOCALE}" ]; then
537 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
539 < "${BODY}" DIET
=CURD TIED
= \
540 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
541 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
544 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
545 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
550 t_behave_input_inject_semicolon_seq() {
553 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
558 echon this_is_mymac
;call mydeepmac
;echon
';';
560 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
562 echon this_is_mymac
;call mydeepmac
;echon
,TOO
'!;';
564 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
567 check behave
:input_inject_semicolon_seq
0 "${MBOX}" '512117110 140'
572 t_behave_commandalias
() {
575 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
576 commandalias echo echo hoho
580 commandalias XxX XxXx
581 commandalias XxXx XxXxX
582 commandalias XxXxX XxXxXx
583 commandalias XxXxXx echo huhu
584 commandalias XxXxXxX echo huhu
586 commandalias XxXxXx XxXxXxX
589 commandalias XxXxXx echo huhu
593 check behave:commandalias 0 "${MBOX}" '3694143612 31'
601 # Nestable conditions test
602 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
624 if $dietcurd == 'yoho'
629 if $dietcurd @
== 'Yoho'
634 if $dietcurd == 'Yoho'
639 if $dietcurd != 'yoho'
644 if $dietcurd @
!= 'Yoho'
649 if $dietcurd != 'Yoho'
710 if $dietcurd == 'yohu'
712 elif $dietcurd == 'yoha'
714 elif $dietcurd == 'yohe'
716 elif $dietcurd == 'yoho'
718 if $dietcurd == 'yohu'
720 elif $dietcurd == 'yoha'
722 elif $dietcurd == 'yohe'
724 elif $dietcurd == 'yoho'
726 if $dietcurd == 'yohu'
728 elif $dietcurd == 'yoha'
730 elif $dietcurd == 'yohe'
732 elif $dietcurd == 'yoho'
881 set diet
=abc curd
=abc
887 set diet
=abc curd
=abcd
893 # 1. Shitty grouping capabilities as of today
894 unset diet curd ndefined
895 if [ [ false
] ||
[ false
] ||
[ true
] ] && [ [ false
] ||
[ true
] ] && \
901 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
906 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
911 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
916 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
921 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
927 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
932 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
937 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
942 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
947 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
952 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
957 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
962 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
967 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
972 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
978 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
984 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
989 # 2. Shitty grouping capabilities as of today
990 unset diet curd ndefined
991 if [ false || false || true
] && [ false || true
] && yes
996 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
1001 if [ 1 ||
0 ||
0 ||
0 ]
1006 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
1011 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
1016 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
1021 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1026 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1031 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1036 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1041 if 1 ||
0 ||
0 ||
0 && 0
1046 if 1 ||
0 ||
0 ||
0 && 1
1051 if 0 ||
0 ||
0 ||
1 && 0
1056 if 0 ||
0 ||
0 ||
1 && 1
1061 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
1066 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
1072 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1077 if $diet == 'yo' && $curd == 'ho' && $ndefined
1083 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1088 if $diet == 'yo' && $curd == 'ho' && $ndefined
1093 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1098 # Some more en-braced variables
1100 if ${diet} == ${curd}
1105 if ${diet} != ${curd}
1121 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1126 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1131 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1136 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1141 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1146 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1151 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1156 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
1161 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1167 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1172 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1177 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1182 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1187 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1192 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1197 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1202 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
1207 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1214 check behave
:if-normal
0 "${MBOX}" '1688759742 719'
1216 if have_feat regex
; then
1217 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1219 if $dietcurd =~ '^yo.*'
1224 if $dietcurd =~ '^Yo.*'
1229 if $dietcurd @=~ '^Yo.*'
1234 if $dietcurd =~ '^yOho.+'
1239 if $dietcurd @!~ '.*Ho$'
1244 if $dietcurd !~ '.+yohO$'
1249 if [ $dietcurd @i!~ '.+yoho$' ]
1254 if ! [ $dietcurd @i=~ '.+yoho$' ]
1259 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1264 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1269 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1274 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1279 if ! ! ! $dietcurd !~ '.+yoho$'
1284 if ! ! ! $dietcurd =~ '.+yoho$'
1289 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1294 set diet=abc curd='^abc$'
1300 set diet=abc curd='^abcd$'
1308 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1310 printf 'behave:if-regex: unsupported, skipped\n'
1316 t_behave_localopts() {
1319 # Nestable conditions test
1320 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1335 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1340 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1341 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1350 echo active trouble
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1352 echo active null
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1355 check behave
:localopts
0 "${MBOX}" '1936527193 192'
1360 t_behave_macro_param_shift
() {
1363 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1366 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1371 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1372 if [ $# > 1 ] || [ $ignerr == '' ]
1377 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1379 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1383 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1388 call t2 1 you get four args
1389 echo t1.1: $?';' ignerr ($ignerr) should not exist
1390 call t2 1 you get 'three args'
1391 echo t1.2: $?';' ignerr ($ignerr) should not exist
1392 call t2 1 you 'get two args'
1393 echo t1.3: $?';' ignerr ($ignerr) should not exist
1394 call t2 1 'you get one arg'
1395 echo t1.4: $?';' ignerr ($ignerr) should not exist
1396 ignerr call t2 '' 'you get one arg'
1397 echo t1.5: $?';' ignerr ($ignerr) should not exist
1402 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1407 t_behave_addrcodec() {
1410 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1411 vput addrcodec res e
1 <doog@def
>
1412 echo $?
/$^ERRNAME
$res
1413 eval vput addrcodec res d
$res
1414 echo $?
/$^ERRNAME
$res
1415 vput addrcodec res e
2 .
<doog@def
>
1416 echo $?
/$^ERRNAME
$res
1417 eval vput addrcodec res d
$res
1418 echo $?
/$^ERRNAME
$res
1419 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1420 echo $?
/$^ERRNAME
$res
1421 eval vput addrcodec res d
$res
1422 echo $?
/$^ERRNAME
$res
1423 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1424 echo $?
/$^ERRNAME
$res
1425 eval vput addrcodec res d
$res
1426 echo $?
/$^ERRNAME
$res
1427 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1428 echo $?
/$^ERRNAME
$res
1429 eval vput addrcodec res d
$res
1430 echo $?
/$^ERRNAME
$res
1432 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1433 echo $?
/$^ERRNAME
$res
1434 eval vput addrcodec res d
$res
1435 echo $?
/$^ERRNAME
$res
1436 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1437 echo $?
/$^ERRNAME
$res
1438 eval vput addrcodec res d
$res
1439 echo $?
/$^ERRNAME
$res
1440 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1441 echo $?
/$^ERRNAME
$res
1442 eval vput addrcodec res d
$res
1443 echo $?
/$^ERRNAME
$res
1444 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1445 echo $?
/$^ERRNAME
$res
1446 eval vput addrcodec res d
$res
1447 echo $?
/$^ERRNAME
$res
1448 vput addrcodec res
+e
8 \
1449 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1450 echo $?
/$^ERRNAME
$res
1451 eval vput addrcodec res d
$res
1452 echo $?
/$^ERRNAME
$res
1453 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1454 echo $?
/$^ERRNAME
$res
1455 eval vput addrcodec res d
$res
1456 echo $?
/$^ERRNAME
$res
1457 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1458 echo $?
/$^ERRNAME
$res
1459 eval vput addrcodec res d
$res
1460 echo $?
/$^ERRNAME
$res
1461 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1462 echo $?
/$^ERRNAME
$res
1463 eval vput addrcodec res d
$res
1464 echo $?
/$^ERRNAME
$res
1465 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1466 echo $?
/$^ERRNAME
$res
1467 eval vput addrcodec res d
$res
1468 echo $?
/$^ERRNAME
$res
1469 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1470 echo $?
/$^ERRNAME
$res
1471 eval vput addrcodec res d
$res
1472 echo $?
/$^ERRNAME
$res
1473 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1474 echo $?
/$^ERRNAME
$res
1475 eval vput addrcodec res d
$res
1476 echo $?
/$^ERRNAME
$res
1477 vput addrcodec res
+e
15 \
1478 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1479 echo $?
/$^ERRNAME
$res
1480 eval vput addrcodec res d
$res
1481 echo $?
/$^ERRNAME
$res
1482 vput addrcodec res
+e
16 \
1483 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1484 echo $?
/$^ERRNAME
$res
1485 eval vput addrcodec res d
$res
1486 echo $?
/$^ERRNAME
$res
1487 vput addrcodec res
+e
17 \
1488 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1489 echo $?
/$^ERRNAME
$res
1490 eval vput addrcodec res d
$res
1491 echo $?
/$^ERRNAME
$res
1492 vput addrcodec res
+e
18 \
1493 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1494 echo $?
/$^ERRNAME
$res
1495 eval vput addrcodec res d
$res
1496 echo $?
/$^ERRNAME
$res
1497 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1498 echo $?
/$^ERRNAME
$res
1499 eval vput addrcodec res d
$res
1500 echo $?
/$^ERRNAME
$res
1502 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1503 echo $?
/$^ERRNAME
$res
1504 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1505 echo $?/$^ERRNAME $res
1506 eval vput addrcodec res d $res
1507 echo $?/$^ERRNAME $res
1509 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1510 echo $?/$^ERRNAME $res
1511 eval vput addrcodec res d $res
1512 echo $?/$^ERRNAME $res
1514 vput addrcodec res s \
1515 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1516 echo $?/$^ERRNAME $res
1519 check behave:addrcodec 0 "${MBOX}" '429099645 2414'
1527 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1528 vput vexpr res
= 9223372036854775807
1529 echo $?
/$^ERRNAME
$res
1530 vput vexpr res
= 9223372036854775808
1531 echo $?
/$^ERRNAME
$res
1532 vput vexpr res
=@
9223372036854775808
1533 echo $?
/$^ERRNAME
$res
1534 vput vexpr res
= -9223372036854775808
1535 echo $?
/$^ERRNAME
$res
1536 vput vexpr res
= -9223372036854775809
1537 echo $?
/$^ERRNAME
$res
1538 vput vexpr res
=@
-9223372036854775809
1539 echo $?
/$^ERRNAME
$res
1542 echo $?
/$^ERRNAME
$res
1544 echo $?
/$^ERRNAME
$res
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
+@
1 9223372036854775807
1566 echo $?
/$^ERRNAME
$res
1568 vput vexpr res
+ -9223372036854775808 0
1569 echo $?
/$^ERRNAME
$res
1570 vput vexpr res
+ -9223372036854775808 -1
1571 echo $?
/$^ERRNAME
$res
1572 vput vexpr res
+@
-9223372036854775808 -1
1573 echo $?
/$^ERRNAME
$res
1574 vput vexpr res
+ 0 -9223372036854775808
1575 echo $?
/$^ERRNAME
$res
1576 vput vexpr res
+ -1 -9223372036854775808
1577 echo $?
/$^ERRNAME
$res
1578 vput vexpr res
+@
-1 -9223372036854775808
1579 echo $?
/$^ERRNAME
$res
1581 vput vexpr res
- 0 0
1582 echo $?
/$^ERRNAME
$res
1583 vput vexpr res
- 0 1
1584 echo $?
/$^ERRNAME
$res
1585 vput vexpr res
- 1 1
1586 echo $?
/$^ERRNAME
$res
1588 vput vexpr res
- 9223372036854775807 0
1589 echo $?
/$^ERRNAME
$res
1590 vput vexpr res
- 9223372036854775807 -1
1591 echo $?
/$^ERRNAME
$res
1592 vput vexpr res
-@
9223372036854775807 -1
1593 echo $?
/$^ERRNAME
$res
1594 vput vexpr res
- 0 9223372036854775807
1595 echo $?
/$^ERRNAME
$res
1596 vput vexpr res
- -1 9223372036854775807
1597 echo $?
/$^ERRNAME
$res
1598 vput vexpr res
- -2 9223372036854775807
1599 echo $?
/$^ERRNAME
$res
1600 vput vexpr res
-@
-2 9223372036854775807
1601 echo $?
/$^ERRNAME
$res
1603 vput vexpr res
- -9223372036854775808 +0
1604 echo $?
/$^ERRNAME
$res
1605 vput vexpr res
- -9223372036854775808 +1
1606 echo $?
/$^ERRNAME
$res
1607 vput vexpr res
-@
-9223372036854775808 +1
1608 echo $?
/$^ERRNAME
$res
1609 vput vexpr res
- 0 -9223372036854775808
1610 echo $?
/$^ERRNAME
$res
1611 vput vexpr res
- +1 -9223372036854775808
1612 echo $?
/$^ERRNAME
$res
1613 vput vexpr res
-@
+1 -9223372036854775808
1614 echo $?
/$^ERRNAME
$res
1616 vput vexpr res
+ -13 -2
1617 echo $?
/$^ERRNAME
$res
1618 vput vexpr res
- 0 0
1619 echo $?
/$^ERRNAME
$res
1620 vput vexpr res
- 0 1
1621 echo $?
/$^ERRNAME
$res
1622 vput vexpr res
- 1 1
1623 echo $?
/$^ERRNAME
$res
1624 vput vexpr res
- -13 -2
1625 echo $?
/$^ERRNAME
$res
1627 vput vexpr res
* 0 0
1628 echo $?
/$^ERRNAME
$res
1629 vput vexpr res
* 0 1
1630 echo $?
/$^ERRNAME
$res
1631 vput vexpr res
* 1 1
1632 echo $?
/$^ERRNAME
$res
1633 vput vexpr res
* -13 -2
1634 echo $?
/$^ERRNAME
$res
1636 vput vexpr res
/ 0 0
1637 echo $?
/$^ERRNAME
$res
1638 vput vexpr res
/ 0 1
1639 echo $?
/$^ERRNAME
$res
1640 vput vexpr res
/ 1 1
1641 echo $?
/$^ERRNAME
$res
1642 vput vexpr res
/ -13 -2
1643 echo $?
/$^ERRNAME
$res
1645 vput vexpr res
% 0 0
1646 echo $?
/$^ERRNAME
$res
1647 vput vexpr res
% 0 1
1648 echo $?
/$^ERRNAME
$res
1649 vput vexpr res
% 1 1
1650 echo $?
/$^ERRNAME
$res
1651 vput vexpr res
% -13 -2
1652 echo $?
/$^ERRNAME
$res
1655 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1657 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1658 vput vexpr res find 'bananarama' 'nana'
1659 echo $?/$^ERRNAME :$res:
1660 vput vexpr res find 'bananarama' 'bana'
1661 echo $?/$^ERRNAME :$res:
1662 vput vexpr res find 'bananarama' 'Bana'
1663 echo $?/$^ERRNAME :$res:
1664 vput vexpr res find 'bananarama' 'rama'
1665 echo $?/$^ERRNAME :$res:
1667 vput vexpr res ifind 'bananarama' 'nana'
1668 echo $?/$^ERRNAME :$res:
1669 vput vexpr res ifind 'bananarama' 'bana'
1670 echo $?/$^ERRNAME :$res:
1671 vput vexpr res ifind 'bananarama' 'Bana'
1672 echo $?/$^ERRNAME :$res:
1673 vput vexpr res ifind 'bananarama' 'rama'
1674 echo $?/$^ERRNAME :$res:
1676 vput vexpr res substring 'bananarama' 1
1677 echo $?/$^ERRNAME :$res:
1678 vput vexpr res substring 'bananarama' 3
1679 echo $?/$^ERRNAME :$res:
1680 vput vexpr res substring 'bananarama' 5
1681 echo $?/$^ERRNAME :$res:
1682 vput vexpr res substring 'bananarama' 7
1683 echo $?/$^ERRNAME :$res:
1684 vput vexpr res substring 'bananarama' 9
1685 echo $?/$^ERRNAME :$res:
1686 vput vexpr res substring 'bananarama' 10
1687 echo $?/$^ERRNAME :$res:
1688 vput vexpr res substring 'bananarama' 1 3
1689 echo $?/$^ERRNAME :$res:
1690 vput vexpr res substring 'bananarama' 3 3
1691 echo $?/$^ERRNAME :$res:
1692 vput vexpr res substring 'bananarama' 5 3
1693 echo $?/$^ERRNAME :$res:
1694 vput vexpr res substring 'bananarama' 7 3
1695 echo $?/$^ERRNAME :$res:
1696 vput vexpr res substring 'bananarama' 9 3
1697 echo $?/$^ERRNAME :$res:
1698 vput vexpr res substring 'bananarama' 10 3
1699 echo $?/$^ERRNAME :$res:
1703 check behave:vexpr-string 0 "${MBOX}" '265398700 267'
1705 if have_feat regex; then
1706 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1707 vput vexpr res regex
'bananarama' 'nana'
1708 echo $?
/$^ERRNAME
:$res:
1709 vput vexpr res regex
'bananarama' 'bana'
1710 echo $?
/$^ERRNAME
:$res:
1711 vput vexpr res regex
'bananarama' 'Bana'
1712 echo $?
/$^ERRNAME
:$res:
1713 vput vexpr res regex
'bananarama' 'rama'
1714 echo $?
/$^ERRNAME
:$res:
1716 vput vexpr res iregex
'bananarama' 'nana'
1717 echo $?
/$^ERRNAME
:$res:
1718 vput vexpr res iregex
'bananarama' 'bana'
1719 echo $?
/$^ERRNAME
:$res:
1720 vput vexpr res iregex
'bananarama' 'Bana'
1721 echo $?
/$^ERRNAME
:$res:
1722 vput vexpr res iregex
'bananarama' 'rama'
1723 echo $?
/$^ERRNAME
:$res:
1725 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1726 echo $?
/$^ERRNAME
:$res:
1727 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1728 echo $?
/$^ERRNAME
:$res:
1729 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1730 echo $?
/$^ERRNAME
:$res:
1731 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1732 echo $?
/$^ERRNAME
:$res:
1734 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1735 echo $?
/$^ERRNAME
:$res:
1736 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1737 echo $?
/$^ERRNAME
:$res:
1738 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1739 echo $?
/$^ERRNAME
:$res:
1740 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1741 echo $?
/$^ERRNAME
:$res:
1745 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
1747 printf 'behave:vexpr-regex: unsupported, skipped\n'
1753 t_behave_call_ret
() {
1756 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1761 vput vexpr j '&' $i 7
1767 vput vexpr j '&' $i 7
1773 echo ! The end for $1
1777 # Transport $?/$! up the call chain
1783 wysh set i=$? j=$! k=$^ERRNAME
1787 echo ! The end for $1
1788 return $i $^ERR-BUSY
1792 # Up and down it goes
1799 vput vexpr k - $1 $2
1803 echo "# <$i/$j> .. "
1807 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
1810 echo ! The end
for $1=$i/$2
1814 return $i $^ERR-BUSY
1820 call w1
0; echo ?
=$?
!=$
!; echo -----;
1821 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
1822 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
1825 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
1833 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1838 vput vexpr j '&' $i 7
1844 echo ! The end for $1/$2
1846 return $i $^ERR-BUSY
1857 echo ?=$? !=$^ERRNAME
1860 echo ?=$? !=$^ERRNAME
1862 echo ?=$? !=$^ERRNAME
1865 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
1869 ${cat} <<- '__EOT' > "${BODY}"
1874 vput vexpr j '&' $i 7
1880 echo ! The end for $1
1883 echo would be err with errexit
1892 echo zwei, ?=$? !=$!
1893 localopts yes; set errexit
1895 echo drei, ?=$? !=$^ERRNAME
1897 echo vier, ?=$? !=$^ERRNAME, this is an error
1900 echo outer 1, ?=$? !=$^ERRNAME
1902 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
1904 echo outer 3, ?=$? !=$^ERRNAME
1905 echo this is definitely an error
1908 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
1910 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
1912 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
1914 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
1919 t_behave_vpospar() {
1922 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1923 vpospar
set hey
, "'you ", world
!
1924 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1925 vput vpospar x quote
; echo x
<$x>
1926 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1927 vput vpospar y quote
;echo y
<$y>
1928 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1929 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1930 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1933 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1934 vput vpospar z quote
;echo infun2
:z
<$z>
1938 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1939 vput vpospar y quote
;echo infun
:y
<$y>
1940 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1941 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1943 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1944 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1947 call infun This
"in a" fun
1948 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1949 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1951 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
1954 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1956 echo ifs<$ifs> ifs-ws<$ifs-ws>
1957 vpospar set hey, "'you ", world!
1958 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1959 vput vpospar x quote; echo x<$x>
1960 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1961 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1964 echo ifs<$ifs> ifs-ws<$ifs-ws>
1965 vpospar set hey, "'you
", world!
1966 echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1967 vput vpospar x quote; echo x<$x>
1968 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1969 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1972 echo ifs<$ifs> ifs-ws<$ifs-ws>
1973 vpospar set hey, "'you ", world!
1974 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1975 vput vpospar x quote; echo x<$x>
1976 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1977 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1979 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
1986 TRAP_EXIT_ADDONS="./.t*"
1988 ${cat} <<- '__EOT
' > .tin
1989 hey1, "'you
", world!
1990 hey2, "'you ", bugs bunny!
1995 ${cat} <<- '__EOT
' |\
1996 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
1998 echo $?/$^ERRNAME / <$a><$b><$c>
2000 echo $?/$^ERRNAME / <$a><$b><$c>
2002 echo $?/$^ERRNAME / <$a><$b><$c>
2004 echo $?/$^ERRNAME / <$a><$b><$c>
2006 echo $?/$^ERRNAME / <$a><$b><$c>
2007 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2009 check behave:read-1 0 "${MBOX}" '1527910147 173'
2011 ${cat} <<- '__EOT
' > .tin2
2012 hey2.0,:"'you
",:world!:mars.:
2013 hey2.1,:"'you ",:world!
2014 hey2.2,:"'you
",:bugs bunny!
2020 ${cat} <<- '__EOT' |\
2021 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2024 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2026 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2028 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2030 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2032 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2034 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2036 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2038 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2039 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2041 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2048 TRAP_EXIT_ADDONS
="./.t*"
2052 while [ ${i} -lt 112 ]; do
2053 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2054 "${MBOX}" "${i}" "${i}"
2057 ) |
${MAILX} ${ARGS}
2058 check behave
:mbox-1
0 "${MBOX}" '1140119864 13780'
2064 ' "${MBOX}" .tmbox1 .tmbox1 |
2065 ${MAILX} ${ARGS} > .tlst
2066 check behave
:mbox-2
0 .tlst
'2739893312 9103'
2072 ' "${MBOX}" .tmbox2 .tmbox2 |
2073 ${MAILX} ${ARGS} > .tlst
2074 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2076 # only the odd (even)
2078 printf 'File "file://%s"
2081 while [ ${i} -lt 112 ]; do
2083 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2090 ) |
${MAILX} ${ARGS} > .tlst
2091 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2092 check behave
:mbox-5
- .tlst
'2960975049 4573'
2095 printf 'file "file://%s"
2098 while [ ${i} -lt 112 ]; do
2100 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2108 ' .tmbox3 .tmbox3 .tmbox2
2109 ) | ${MAILX} ${ARGS} > .tlst
2110 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2111 ${sed} 2d < .tlst > .tlstx
2112 check behave:mbox-7 - .tlstx '2729940494 13645'
2117 t_behave_alternates() {
2119 TRAP_EXIT_ADDONS=".
/.t
*"
2121 ${cat} <<-_EOT > ./.tsendmail.sh
2123 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2126 chmod 0755 ./.tsendmail.sh
2128 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2132 alternates a1@b1 a2@b2 a3@b3
2137 echo $?/$^ERRNAME <$rv>
2142 echo $?/$^ERRNAME <$rv>
2145 echo $?/$^ERRNAME <$rv>
2148 echo $?/$^ERRNAME <$rv>
2152 alternates a1@b1 a2@b2 a3@b3
2155 echo $?/$^ERRNAME <$rv>
2158 echo $?/$^ERRNAME <$rv>
2161 echo $?/$^ERRNAME <$rv>
2164 alternates a1@b1 a2@b2 a3@b3
2167 echo $?/$^ERRNAME <$rv>
2170 echo $?/$^ERRNAME <$rv>
2173 echo $?/$^ERRNAME <$rv>
2177 alternates a1@b1 a2@b2 a3@b3
2180 echo $?/$^ERRNAME <$rv>
2184 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2186 ~s all alternates, only a1@b1 remains
2188 ~b a3@b3 a3@c3 a3@d3
2197 alternates a1@b1 a1@c1 a2@b2 a3@b3
2199 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2201 ~b a3@b3 a3@c3 a3@d3
2208 alternates a1@b1 a2@b2 a3; set allnet
2210 ~s all alternates via allnet, only a1@b1 remains
2212 ~b a3@b3 a3@c3 a3@d3
2223 echo $?/$^ERRNAME <$rv>
2227 echo $?/$^ERRNAME <$rv>
2231 echo $?/$^ERRNAME <$rv>
2235 echo $?/$^ERRNAME <$rv>
2239 echo $?/$^ERRNAME <$rv>
2243 alternates a1@b1 a2@b2
2246 echo $?/$^ERRNAME <$rv>
2247 alternates a3@b3 a4@b4
2250 echo $?/$^ERRNAME <$rv>
2252 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2253 check behave:alternates-2 - .tall '1878598364 505'
2260 TRAP_EXIT_ADDONS=".
/.t
*"
2262 ${cat} <<-_EOT > ./.tsendmail.sh
2264 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2267 chmod 0755 ./.tsendmail.sh
2269 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2271 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2273 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2275 alias a4 a5 ex1@a4.ple
2277 alias a6 a7 ex1@a6.ple
2291 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2292 check behave:alias-2 - .tall '3548953204 152'
2294 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2295 # TODO need to somehow provide its contents to the test, then test
2300 t_behave_filetype() {
2302 TRAP_EXIT_ADDONS=".
/.t
*"
2304 ${cat} <<-_EOT > ./.tsendmail.sh
2306 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2309 chmod 0755 ./.tsendmail.sh
2311 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ ./snailmail.jpg\n~.\n' |
2312 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2313 check behave:filetype-1 0 "${MBOX}" '1645747150 13536'
2315 if command -v gzip >/dev/null 2>&1; then
2318 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2319 copy 2 ./.t.mbox.gz' "${MBOX}" |
2321 -X'filetype gz gzip\ -dc gzip\ -c'
2322 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2324 -X'filetype gz gzip\ -dc gzip\ -c'
2326 check behave:filetype-2 0 ".
/.t.mbox
" '1645747150 13536'
2328 echo 'behave:filetype-2: unsupported, skipped'
2333 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2339 -X'filetype gz gzip\ -dc gzip\ -c' \
2340 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2341 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2342 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2344 -X'filetype gz gzip\ -dc gzip\ -c' \
2345 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2348 check behave:filetype-3 - ".
/.t.mbox
" '238021003 27092'
2353 t_behave_record_a_resend() {
2355 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
2359 m %s\n~s Subject 1.\nHello.\n~.
2360 set record-files add-file-recipients
2361 m %s\n~s Subject 2.\nHello.\n~.
2363 resend 2 ./.t.resent
2364 Resend 1 ./.t.resent
2366 resend 2 ./.t.resent
2367 Resend 1 ./.t.resent
2368 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
2371 check behave:record_a_resend-1 0 "${MBOX}" '3057873538 256'
2372 check behave:record_a_resend-2 - .t.record '391356429 460'
2373 check behave:record_a_resend-3 - .t.resent '2685231691 648'
2378 t_behave_e_H_L_opts() {
2380 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2383 ${MAILX} ${ARGS} -ef ./.t.mbox
2384 echo ${?} > "${MBOX}"
2386 ${cat} <<-_EOT > ./.tsendmail.sh
2388 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2391 chmod 0755 ./.tsendmail.sh
2392 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2393 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2394 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2395 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2397 ${MAILX} ${ARGS} -ef ./.t.mbox
2398 echo ${?} >> "${MBOX}"
2399 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
2400 echo ${?} >> "${MBOX}"
2401 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
2402 echo ${?} >> "${MBOX}"
2403 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
2404 echo ${?} >> "${MBOX}"
2405 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
2406 echo ${?} >> "${MBOX}"
2407 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
2408 echo ${?} >> "${MBOX}"
2409 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2410 echo ${?} >> "${MBOX}"
2412 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2413 echo ${?} >> "${MBOX}"
2414 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2415 echo ${?} >> "${MBOX}"
2416 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2417 echo ${?} >> "${MBOX}"
2418 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2419 echo ${?} >> "${MBOX}"
2420 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2421 echo ${?} >> "${MBOX}"
2422 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2423 echo ${?} >> "${MBOX}"
2424 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev
/null
2425 echo ${?} >> "${MBOX}"
2427 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2432 t_behave_compose_hooks
() { # TODO monster
2434 TRAP_EXIT_ADDONS
="./.t*"
2436 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
2437 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
2439 ${cat} <<-_EOT > ./.tsendmail.sh
2441 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2444 chmod 0755 .
/.tsendmail.sh
2446 ${cat} <<'__EOT__' > ./.trc
2448 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
2451 vput vexpr es substr "$1" 0 1
2456 define read_mline_res {
2457 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2458 echo $len/$es/$^ERRNAME: $hl
2459 if [ $es -ne $^ERR-NONE ]
2460 xcall bail read_mline_res
2462 \xcall read_mline_res
2467 echo "~^header list"; read hl; echo $hl;\
2468 call xerr "$hl" "in_addr ($xh) 0-1"
2470 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2471 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
2472 echo "~^header insert $xh <${xh}2@exam.ple>";\
2473 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
2474 echo "~^header insert $xh ${xh}3@exam.ple";\
2475 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
2476 echo "~^header list $xh"; read hl; echo $hl;\
2477 call xerr "$hl" "ins_addr $xh 1-4"
2478 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
2481 if [ "$t_remove" == "" ]
2485 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
2486 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
2488 xcall bail "ins_addr $xh 2-2"
2490 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
2492 xcall bail "ins_addr $xh 2-3"
2494 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
2496 xcall bail "ins_addr $xh 2-4"
2500 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2501 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
2502 echo "~^header insert $xh <${xh}2@exam.ple>";\
2503 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
2504 echo "~^header insert $xh ${xh}3@exam.ple";\
2505 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
2506 echo "~^header list $xh"; read hl; echo $hl;\
2507 call xerr "$hl" "ins_addr $xh 3-4"
2508 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
2511 echo "~^header remove-at $xh 1"; read es;\
2512 call xerr $es "ins_addr $xh 3-6"
2513 echo "~^header remove-at $xh 1"; read es;\
2514 call xerr $es "ins_addr $xh 3-7"
2515 echo "~^header remove-at $xh 1"; read es;\
2516 call xerr $es "ins_addr $xh 3-8"
2517 echo "~^header remove-at $xh 1"; read es;\
2518 vput vexpr es substr $es 0 3
2520 xcall bail "ins_addr $xh 3-9"
2522 echo "~^header remove-at $xh T"; read es;\
2523 vput vexpr es substr $es 0 3
2525 xcall bail "ins_addr $xh 3-10"
2527 echo "~^header list $xh"; read es;\
2528 vput vexpr es substr $es 0 3
2530 xcall bail "ins_addr $xh 3-11"
2532 echo "~^header show $xh"; read es;\
2533 vput vexpr es substr $es 0 3
2535 xcall bail "ins_addr $xh 3-12"
2539 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2540 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
2541 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
2542 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
2543 echo "~^header insert $xh ${xh}3@exam.ple";\
2544 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
2545 echo "~^header list $xh"; read hl; echo $hl;\
2546 call xerr "$hl" "header list $xh 3-4"
2547 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
2550 echo "~^header remove-at $xh 3"; read es;\
2551 call xerr $es "ins_addr $xh 4-6"
2552 echo "~^header remove-at $xh 2"; read es;\
2553 call xerr $es "ins_addr $xh 4-7"
2554 echo "~^header remove-at $xh 1"; read es;\
2555 call xerr $es "ins_addr $xh 4-8"
2556 echo "~^header remove-at $xh 1"; read es;\
2557 vput vexpr es substr $es 0 3
2559 xcall bail "ins_addr $xh 4-9"
2561 echo "~^header remove-at $xh T"; read es;\
2562 vput vexpr es substr $es 0 3
2564 xcall bail "ins_addr $xh 4-10"
2566 echo "~^header list $xh"; read es;\
2567 vput vexpr es substr $es 0 3
2569 xcall bail "ins_addr $xh 4-11"
2571 echo "~^header show $xh"; read es;\
2572 vput vexpr es substr $es 0 3
2574 xcall bail "ins_addr $xh 4-12"
2578 wysh set xh=$1 mult=$2
2579 echo "~^header list"; read hl; echo $hl;\
2580 call xerr "$hl" "ins_ref ($xh) 0-1"
2582 echo "~^header insert $xh <$xh@exam.ple>";\
2583 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
2585 echo "~^header insert $xh <${xh}2@exam.ple>";\
2586 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
2587 echo "~^header insert $xh ${xh}3@exam.ple";\
2588 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
2590 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
2591 vput vexpr es substr $es 0 3
2593 xcall bail "ins_ref $xh 1-4"
2597 echo "~^header list $xh"; read hl; echo $hl;\
2598 call xerr "$hl" "ins_ref $xh 1-5"
2599 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
2602 if [ "$t_remove" == "" ]
2606 echo "~^header remove $xh"; read es;\
2607 call xerr $es "ins_ref $xh 2-1"
2608 echo "~^header remove $xh"; read es;\
2609 vput vexpr es substr $es 0 3
2611 xcall bail "ins_ref $xh 2-2"
2613 echo "~^header list $xh"; read es;\
2614 vput vexpr es substr $es 0 3
2616 xcall bail "$es ins_ref $xh 2-3"
2618 echo "~^header show $xh"; read es;\
2619 vput vexpr es substr $es 0 3
2621 xcall bail "ins_ref $xh 2-4"
2625 echo "~^header insert $xh <$xh@exam.ple>";\
2626 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
2628 echo "~^header insert $xh <${xh}2@exam.ple>";\
2629 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
2630 echo "~^header insert $xh ${xh}3@exam.ple";\
2631 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
2633 echo "~^header list $xh";\
2634 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
2635 echo "~^header show $xh";\
2636 read es; call xerr $es "ins_ref $xh 3-5"
2639 echo "~^header remove-at $xh 1"; read es;\
2640 call xerr $es "ins_ref $xh 3-6"
2641 if [ $mult -ne 0 ] && [ $xh != subject ]
2642 echo "~^header remove-at $xh 1"; read es;\
2643 call xerr $es "ins_ref $xh 3-7"
2644 echo "~^header remove-at $xh 1"; read es;\
2645 call xerr $es "ins_ref $xh 3-8"
2647 echo "~^header remove-at $xh 1"; read es;\
2648 vput vexpr es substr $es 0 3
2650 xcall bail "ins_ref $xh 3-9"
2652 echo "~^header remove-at $xh T"; read es;\
2653 vput vexpr es substr $es 0 3
2655 xcall bail "ins_ref $xh 3-10"
2657 echo "~^header show $xh"; read es;\
2658 vput vexpr es substr $es 0 3
2660 xcall bail "ins_ref $xh 3-11"
2664 echo "~^header insert $xh <$xh@exam.ple> ";\
2665 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
2667 echo "~^header insert $xh <${xh}2@exam.ple> ";\
2668 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
2669 echo "~^header insert $xh ${xh}3@exam.ple";\
2670 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
2672 echo "~^header list $xh"; read hl; echo $hl;\
2673 call xerr "$hl" "ins_ref $xh 4-4"
2674 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
2677 if [ $mult -ne 0 ] && [ $xh != subject ]
2678 echo "~^header remove-at $xh 3"; read es;\
2679 call xerr $es "ins_ref $xh 4-6"
2680 echo "~^header remove-at $xh 2"; read es;\
2681 call xerr $es "ins_ref $xh 4-7"
2683 echo "~^header remove-at $xh 1"; read es;\
2684 call xerr $es "ins_ref $xh 4-8"
2685 echo "~^header remove-at $xh 1"; read es;\
2686 vput vexpr es substr $es 0 3
2688 xcall bail "ins_ref $xh 4-9"
2690 echo "~^header remove-at $xh T"; read es;\
2691 vput vexpr es substr $es 0 3
2693 xcall bail "ins_ref $xh 4-10"
2695 echo "~^header show $xh"; read es;\
2696 vput vexpr es substr $es 0 3
2698 xcall bail "ins_ref $xh 4-11"
2703 # In collect.c order
2705 call ins_ref sender 0 # Not a "ref", but works
2709 call ins_addr reply-To
2710 call ins_addr mail-Followup-to
2711 call ins_ref messAge-id 0
2712 call ins_ref rEfErEncEs 1
2713 call ins_ref in-Reply-to 1
2714 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
2715 call ins_addr freeForm1
2716 call ins_addr freeform2
2718 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
2720 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
2728 echo "~^attachment";\
2729 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2731 xcall bail "attach 0-1"
2734 echo "~^attach attribute ./.treadctl";\
2735 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2737 xcall bail "attach 0-2"
2739 echo "~^attachment attribute-at 1";\
2740 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2742 xcall bail "attach 0-3"
2745 echo "~^attachment insert ./.treadctl=ascii";\
2746 read hl; echo $hl; call xerr "$hl" "attach 1-1"
2747 echo "~^attachment list";\
2748 read es; echo $es;call xerr "$es" "attach 1-2"
2750 echo "~^attachment attribute ./.treadctl";\
2751 read es; echo $es;call xerr "$es" "attach 1-3"
2753 echo "~^attachment attribute .treadctl";\
2754 read es; echo $es;call xerr "$es" "attach 1-4"
2756 echo "~^attachment attribute-at 1";\
2757 read es; echo $es;call xerr "$es" "attach 1-5"
2760 echo "~^attachment attribute-set ./.treadctl filename rctl";\
2761 read es; echo $es;call xerr "$es" "attach 1-6"
2762 echo "~^attachment attribute-set .treadctl content-description Au";\
2763 read es; echo $es;call xerr "$es" "attach 1-7"
2764 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
2765 read es; echo $es;call xerr "$es" "attach 1-8"
2767 echo "~^attachment attribute ./.treadctl";\
2768 read es; echo $es;call xerr "$es" "attach 1-9"
2770 echo "~^attachment attribute .treadctl";\
2771 read es; echo $es;call xerr "$es" "attach 1-10"
2773 echo "~^attachment attribute rctl";\
2774 read es; echo $es;call xerr "$es" "attach 1-11"
2776 echo "~^attachment attribute-at 1";\
2777 read es; echo $es;call xerr "$es" "attach 1-12"
2781 echo "~^attachment insert ./.tattach=latin1";\
2782 read hl; echo $hl; call xerr "$hl" "attach 2-1"
2783 echo "~^attachment list";\
2784 read es; echo $es;call xerr "$es" "attach 2-2"
2786 echo "~^attachment attribute ./.tattach";\
2787 read es; echo $es;call xerr "$es" "attach 2-3"
2789 echo "~^attachment attribute .tattach";\
2790 read es; echo $es;call xerr "$es" "attach 2-4"
2792 echo "~^attachment attribute-at 2";\
2793 read es; echo $es;call xerr "$es" "attach 2-5"
2796 echo "~^attachment attribute-set ./.tattach filename tat";\
2797 read es; echo $es;call xerr "$es" "attach 2-6"
2799 "~^attachment attribute-set .tattach content-description Au2";\
2800 read es; echo $es;call xerr "$es" "attach 2-7"
2801 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
2802 read es; echo $es;call xerr "$es" "attach 2-8"
2804 "~^attachment attribute-set-at 2 content-type application/x-sh";\
2805 read es; echo $es;call xerr "$es" "attach 2-9"
2807 echo "~^attachment attribute ./.tattach";\
2808 read es; echo $es;call xerr "$es" "attach 2-10"
2810 echo "~^attachment attribute .tattach";\
2811 read es; echo $es;call xerr "$es" "attach 2-11"
2813 echo "~^attachment attribute tat";\
2814 read es; echo $es;call xerr "$es" "attach 2-12"
2816 echo "~^attachment attribute-at 2";\
2817 read es; echo $es;call xerr "$es" "attach 2-13"
2821 if [ "$t_remove" == "" ]
2825 echo "~^attachment remove ./.treadctl"; read es;\
2826 call xerr $es "attach 3-1"
2827 echo "~^attachment remove ./.tattach"; read es;\
2828 call xerr $es "attach 3-2"
2829 echo "~^ attachment remove ./.treadctl"; read es;\
2830 vput vexpr es substr $es 0 3
2832 xcall bail "attach 3-3"
2834 echo "~^ attachment remove ./.tattach"; read es;\
2835 vput vexpr es substr $es 0 3
2837 xcall bail "attach 3-4"
2839 echo "~^attachment list"; read es;\
2840 vput vexpr es substr $es 0 3
2842 xcall bail "attach 3-5"
2846 echo "~^attachment insert ./.tattach=latin1";\
2847 read hl; echo $hl; call xerr "$hl" "attach 4-1"
2848 echo "~^attachment insert ./.tattach=latin1";\
2849 read hl; echo $hl; call xerr "$hl" "attach 4-2"
2850 echo "~^attachment list";\
2851 read es; echo $es;call xerr "$es" "attach 4-3"
2853 echo "~^ attachment remove .tattach"; read es;\
2854 vput vexpr es substr $es 0 3
2856 xcall bail "attach 4-4 $es"
2858 echo "~^attachment remove-at T"; read es;\
2859 vput vexpr es substr $es 0 3
2861 xcall bail "attach 4-5"
2863 echo "~^attachment remove ./.tattach"; read es;\
2864 call xerr $es "attach 4-6"
2865 echo "~^attachment remove ./.tattach"; read es;\
2866 call xerr $es "attach 4-7"
2867 echo "~^ attachment remove ./.tattach"; read es;\
2868 vput vexpr es substr $es 0 3
2870 xcall bail "attach 4-8 $es"
2872 echo "~^attachment list"; read es;\
2873 vput vexpr es substr $es 0 3
2875 xcall bail "attach 4-9"
2879 echo "~^attachment insert ./.tattach=latin1";\
2880 read hl; echo $hl; call xerr "$hl" "attach 5-1"
2881 echo "~^attachment insert ./.tattach=latin1";\
2882 read hl; echo $hl; call xerr "$hl" "attach 5-2"
2883 echo "~^attachment insert ./.tattach=latin1";\
2884 read hl; echo $hl; call xerr "$hl" "attach 5-3"
2885 echo "~^attachment list";\
2886 read es; echo $es;call xerr "$es" "attach 5-4"
2889 echo "~^attachment remove-at 3"; read es;\
2890 call xerr $es "attach 5-5"
2891 echo "~^attachment remove-at 3"; read es;\
2892 vput vexpr es substr $es 0 3
2894 xcall bail "attach 5-6"
2896 echo "~^attachment remove-at 2"; read es;\
2897 call xerr $es "attach 5-7"
2898 echo "~^attachment remove-at 2"; read es;\
2899 vput vexpr es substr $es 0 3
2901 xcall bail "attach 5-8"
2903 echo "~^attachment remove-at 1"; read es;\
2904 call xerr $es "attach 5-9"
2905 echo "~^attachment remove-at 1"; read es;\
2906 vput vexpr es substr $es 0 3
2908 xcall bail "attach 5-10"
2911 echo "~^attachment list"; read es;\
2912 vput vexpr es substr $es 0 3
2914 xcall bail "attach 5-11"
2918 echo "~^attachment insert ./.tattach=latin1";\
2919 read hl; echo $hl; call xerr "$hl" "attach 6-1"
2920 echo "~^attachment insert ./.tattach=latin1";\
2921 read hl; echo $hl; call xerr "$hl" "attach 6-2"
2922 echo "~^attachment insert ./.tattach=latin1";\
2923 read hl; echo $hl; call xerr "$hl" "attach 6-3"
2924 echo "~^attachment list";\
2925 read es; echo $es;call xerr "$es" "attach 6-4"
2928 echo "~^attachment remove-at 1"; read es;\
2929 call xerr $es "attach 6-5"
2930 echo "~^attachment remove-at 1"; read es;\
2931 call xerr $es "attach 6-6"
2932 echo "~^attachment remove-at 1"; read es;\
2933 call xerr $es "attach 6-7"
2934 echo "~^attachment remove-at 1"; read es;\
2935 vput vexpr es substr $es 0 3
2937 xcall bail "attach 6-8"
2940 echo "~^attachment list"; read es;\
2941 vput vexpr es substr $es 0 3
2943 xcall bail "attach 6-9"
2955 echo on-compose-enter, mailx-command<$mailx-command>
2956 alternates alter1@exam.ple alter2@exam.ple
2958 set autocc='alter1@exam.ple alter2@exam.ple'
2959 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2960 echo mailx-subject<$mailx-subject>
2961 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2962 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2963 mailx-raw-bcc<$mailx-raw-bcc>
2964 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2965 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2968 echo on-compose-leave, mailx-command<$mailx-command>
2970 eval alternates $al alter3@exam.ple alter4@exam.ple
2972 set autobcc='alter3@exam.ple alter4@exam.ple'
2973 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2974 echo mailx-subject<$mailx-subject>
2975 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2976 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2977 mailx-raw-bcc<$mailx-raw-bcc>
2978 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2979 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2982 echo on-compose-cleanup, mailx-command<$mailx-command>
2985 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2986 echo mailx-subject<$mailx-subject>
2987 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2988 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2989 mailx-raw-bcc<$mailx-raw-bcc>
2990 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2991 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2993 wysh set on-compose-splice=t_ocs \
2994 on-compose-enter=t_oce on-compose-leave=t_ocl \
2995 on-compose-cleanup=t_occ
3001 printf 'm this-goes@nowhere\nbody\n!.\n' |
3002 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3003 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3005 ${cat} .
/.tall
>> "${MBOX}"
3006 check behave
:compose_hooks-1
0 "${MBOX}" '3667291468 10101'
3009 printf 'm this-goes@nowhere\nbody\n!.\n' |
3010 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3011 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3013 ${cat} .
/.tall
>> "${MBOX}"
3014 check behave
:compose_hooks-2
0 "${MBOX}" '1746765053 12535'
3016 # Some state machine stress, shell compose hook, localopts for hook, etc.
3017 # readctl in child. ~r as HERE document
3019 printf 'm ex@am.ple\nbody\n!.\nvar t_oce t_ocs t_ocs_sh t_ocl t_occ autocc' |
3020 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3021 -Smta=.
/.tsendmail.sh \
3024 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3027 vput vexpr es substr "$1" 0 1
3032 define read_mline_res {
3033 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3034 echo $len/$es/$^ERRNAME: $hl
3035 if [ $es -ne $^ERR-NONE ]
3036 xcall bail read_mline_res
3038 \xcall read_mline_res
3042 vput vexpr i + 1 "$2"
3044 vput vexpr j % $i 10
3051 eval \\$j _work $1 $i
3054 vput vexpr i + $i "$1"
3058 read line;wysh set es=$? en=$^ERRNAME ; echo read:$es/$en: $line
3059 if [ "${es}" -ne -1 ]
3062 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3067 echo "~^header list"; read hl; echo $hl;\
3068 vput vexpr es substr "$hl" 0 1
3070 xcall bail "header list"
3073 call _work 1; echo $?
3074 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3075 read es; echo $es; vput vexpr es substr "$es" 0 1
3077 xcall bail "be diet"
3079 echo "~^header insert cc <splice2@exam.ple>";\
3080 read es; echo $es; vput vexpr es substr "$es" 0 1
3082 xcall bail "be diet2"
3085 call _work 2; echo $?
3086 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3087 read es; echo $es;vput vexpr es substr "$es" 0 1
3089 xcall bail "be juicy"
3091 echo "~^header insert bcc juice2@exam.ple";\
3092 read es; echo $es;vput vexpr es substr "$es" 0 1
3094 xcall bail "be juicy2"
3096 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3097 read es; echo $es;vput vexpr es substr "$es" 0 1
3099 xcall bail "be juicy3"
3101 echo "~^header insert bcc juice4@exam.ple";\
3102 read es; echo $es;vput vexpr es substr "$es" 0 1
3104 xcall bail "be juicy4"
3107 echo "~^header remove-at bcc 3";\
3108 read es; echo $es;vput vexpr es substr "$es" 0 1
3110 xcall bail "remove juicy5"
3112 echo "~^header remove-at bcc 2";\
3113 read es; echo $es;vput vexpr es substr "$es" 0 1
3115 xcall bail "remove juicy6"
3117 echo "~^header remove-at bcc 3";\
3118 read es; echo $es;vput vexpr es substr "$es" 0 3
3120 xcall bail "failed to remove-at"
3122 # Add duplicates which ought to be removed!
3123 echo "~^header insert bcc juice4@exam.ple";\
3124 read es; echo $es;vput vexpr es substr "$es" 0 1
3126 xcall bail "be juicy4-1"
3128 echo "~^header insert bcc juice4@exam.ple";\
3129 read es; echo $es;vput vexpr es substr "$es" 0 1
3131 xcall bail "be juicy4-2"
3133 echo "~^header insert bcc juice4@exam.ple";\
3134 read es; echo $es;vput vexpr es substr "$es" 0 1
3136 xcall bail "be juicy4-3"
3141 call _work 3; echo $?
3143 vput ! i echo just knock if you can hear me;\
3145 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3147 echon shell-cmd says $?/$^ERRNAME: $i
3148 echo "~x will not become interpreted, we are reading until __EOT"
3150 read r_status; echo "~~r status output: $r_status"
3151 echo "~:echo $? $! $^ERRNAME"
3153 echo "~~r status from parent: $r_status"
3156 call _work 4; echo $?
3157 vput cwd cwd;echo cwd:$?
3158 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3162 call _work 5; echo $?
3163 echo "~^header show MAILX-Command"; read es;\
3164 call xerr $es "t_header 1000"; call read_mline_res
3165 echo "~^header show MAILX-raw-TO"; read es;\
3166 call xerr $es "t_header 1001"; xcall read_mline_res
3168 echoerr IT IS WRONG IF YOU SEE THIS
3171 echo on-compose-enter, mailx-command<$mailx-command>
3172 set t_oce autobcc=oce@exam.ple
3173 alternates alter1@exam.ple alter2@exam.ple
3175 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3176 echo mailx-subject<$mailx-subject>
3177 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3178 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3179 mailx-raw-bcc<$mailx-raw-bcc>
3180 echo mailx-orig-from<$mailx-orig-from> \
3181 mailx-orig-to<$mailx-orig-to> \
3182 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3185 echo on-compose-leave, mailx-command<$mailx-command>
3186 set t_ocl autocc=ocl@exam.ple
3188 alternates alter3@exam.ple alter4@exam.ple
3190 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3191 echo mailx-subject<$mailx-subject>
3192 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3193 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3194 mailx-raw-bcc<$mailx-raw-bcc>
3195 echo mailx-orig-from<$mailx-orig-from> \
3196 mailx-orig-to<$mailx-orig-to> \
3197 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3200 echo on-compose-cleanup, mailx-command<$mailx-command>
3201 set t_occ autocc=occ@exam.ple
3204 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3205 echo mailx-subject<$mailx-subject>
3206 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3207 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3208 mailx-raw-bcc<$mailx-raw-bcc>
3209 echo mailx-orig-from<$mailx-orig-from> \
3210 mailx-orig-to<$mailx-orig-to> \
3211 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3213 wysh set on-compose-splice=t_ocs \
3214 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
3215 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3216 on-compose-enter=t_oce on-compose-leave=t_ocl \
3217 on-compose-cleanup=t_occ
3219 ex0_test behave
:compose_hooks-3
3220 ${cat} .
/.tnotes
>> "${MBOX}"
3222 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3224 # Reply, forward, resend, Resend
3227 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3228 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3229 -Smta=.
/.tsendmail.sh
3232 echo start: $? $! $^ERRNAME
3234 echo File: $? $! $^ERRNAME;echo;echo
3236 this is content of reply 1
3238 echo reply 1: $? $! $^ERRNAME;echo;echo
3240 this is content of Reply 1 2
3242 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3243 forward 1 fwdex@am.ple
3244 this is content of forward 1
3246 echo forward 1: $? $! $^ERRNAME;echo;echo
3247 resend 1 2 resendex@am.ple
3248 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3249 Resend 1 2 Resendex@am.ple
3250 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3252 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3253 -Smta=.
/.tsendmail.sh \
3256 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3259 vput vexpr es substr "$1" 0 1
3264 define read_mline_res {
3265 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3266 echo mline_res:$len/$es/$^ERRNAME: $hl
3267 if [ $es -ne $^ERR-NONE ]
3268 xcall bail read_mline_res
3270 \xcall read_mline_res
3274 echo "~^header show $1"; read es;\
3275 call xerr $es "work_hl $1"; echo $1; call read_mline_res
3283 echo t_ocs version $ver
3284 echo "~^header list"; read hl; echo $hl;\
3285 echoerr the header list is $hl;\
3286 call xerr "$hl" "header list"
3287 eval vpospar set $hl
3290 echoerr IT IS WRONG IF YOU SEE THIS
3293 echo on-XY-enter, mailx-command<$mailx-command>
3294 set t_oce autobcc=oce@exam.ple
3295 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3296 echo mailx-subject<$mailx-subject>
3297 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3298 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3299 mailx-raw-bcc<$mailx-raw-bcc>
3300 echo mailx-orig-from<$mailx-orig-from> \
3301 mailx-orig-to<$mailx-orig-to> \
3302 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3305 echo on-XY-leave, mailx-command<$mailx-command>
3306 set t_ocl autocc=ocl@exam.ple
3307 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3308 echo mailx-subject<$mailx-subject>
3309 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3310 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3311 mailx-raw-bcc<$mailx-raw-bcc>
3312 echo mailx-orig-from<$mailx-orig-from> \
3313 mailx-orig-to<$mailx-orig-to> \
3314 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3317 echo on-XY-cleanup, mailx-command<$mailx-command>
3318 set t_occ autocc=occ@exam.ple
3319 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3320 echo mailx-subject<$mailx-subject>
3321 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3322 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3323 mailx-raw-bcc<$mailx-raw-bcc>
3324 echo mailx-orig-from<$mailx-orig-from> \
3325 mailx-orig-to<$mailx-orig-to> \
3326 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3328 wysh set on-compose-splice=t_ocs \
3329 on-compose-enter=t_oce on-compose-leave=t_ocl \
3330 on-compose-cleanup=t_occ \
3331 on-resend-enter=t_oce on-resend-cleanup=t_occ
3333 ex0_test behave
:compose_hooks-4
3334 ${cat} .
/.tnotes
>> "${MBOX}"
3336 check behave
:compose_hooks-4
- "${MBOX}" '2711778338 7516'
3341 t_behave_message_injections
() {
3343 TRAP_EXIT_ADDONS
="./.t*"
3345 ${cat} <<-_EOT > ./.tsendmail.sh
3347 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3350 chmod 0755 .
/.tsendmail.sh
3352 echo mysig
> .
/.tmysig
3354 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3355 -Smessage-inject-head=head-inject \
3356 -Smessage-inject-tail=tail-inject \
3357 -Ssignature=.
/.tmysig \
3358 ex@am.ple
> .
/.tall
2>&1
3359 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3360 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3362 ${cat} <<-_EOT > ./.template
3366 Subject: This subject is
3368 Body, body, body me.
3370 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3371 -Smessage-inject-head=head-inject \
3372 -Smessage-inject-tail=tail-inject \
3373 -Ssignature=.
/.tmysig \
3375 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3376 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3381 t_behave_mime_types_load_control
() {
3383 TRAP_EXIT_ADDONS
="./.t*"
3385 ${cat} <<-_EOT > ./.tmts1
3386 @ application/mathml+xml mathml
3388 ${cat} <<-_EOT > ./.tmts2
3389 @ x-conference/x-cooltalk ice
3391 @ application/aga-aga aga
3394 ${cat} <<-_EOT > ./.tmts1.mathml
3395 <head>nonsense ML</head>
3397 ${cat} <<-_EOT > ./.tmts2.ice
3400 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3401 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3415 ' "${MBOX}" "${MBOX}" |
3417 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3419 ex0_test behave
:mime_types_load_control
3421 ${cat} "${MBOX}" >> .
/.tout
3422 check behave
:mime_types_load_control-1
- .
/.tout
'529577037 2474'
3424 echo type |
${MAILX} ${ARGS} -R \
3425 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3426 -f "${MBOX}" >> .
/.tout
2>&1
3427 check behave
:mime_types_load_control-2
0 .
/.tout
'2025926659 3558'
3433 have_feat smime ||
{
3434 echo 'behave:s/mime: unsupported, skipped'
3439 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
3440 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
3441 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
3443 printf 'behave:s/mime: .. generating test key and certificate ..\n'
3444 ${cat} <<-_EOT > ./.t.conf
3447 default_keyfile = keyfile.pem
3448 distinguished_name = req_distinguished_name
3449 attributes = req_attributes
3453 [ req_distinguished_name ]
3460 emailAddress = test@localhost
3465 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
3466 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
3467 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
3470 printf 'behave:s/mime:sign/verify: '
3471 echo bla |
${MAILX} ${ARGS} \
3472 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3473 -Ssmime-sign -Sfrom=test@localhost \
3474 -s 'S/MIME test' .
/.VERIFY
3475 if [ $?
-eq 0 ]; then
3486 /^Content-Description: /{ skip = 2; print; next }
3487 /^$/{ if(skip) --skip }
3490 < .
/.VERIFY
> "${MBOX}"
3491 check behave
:s
/mime
:sign
/verify
:checksum
- "${MBOX}" '2900817158 648'
3493 printf 'behave:s/mime:sign/verify:verify '
3494 printf 'verify\nx\n' |
3496 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3497 -Ssmime-sign -Sfrom=test@localhost \
3499 -f .
/.VERIFY
>/dev
/null
2>&1
3500 if [ $?
-eq 0 ]; then
3509 printf 'behave:s/mime:sign/verify:disproof-1 '
3510 if openssl smime
-verify -CAfile .
/.tcert.pem \
3511 -in .
/.VERIFY
>/dev
/null
2>&1; then
3520 # (signing +) encryption / decryption
3521 ${cat} <<-_EOT > ./.tsendmail.sh
3523 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
3525 chmod 0755 .
/.tsendmail.sh
3527 printf 'behave:s/mime:encrypt+sign: '
3530 -Ssmime-force-encryption \
3531 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3532 -Smta=.
/.tsendmail.sh \
3533 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3534 -Ssmime-sign -Sfrom=test@localhost \
3535 -s 'S/MIME test' recei@ver.com
3536 if [ $?
-eq 0 ]; then
3540 printf 'error: encrypt+sign failed\n'
3543 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3544 check behave
:s
/mime
:encrypt
+sign
:checksum
- "${MBOX}" '1937410597 327'
3546 printf 'behave:s/mime:decrypt+verify: '
3547 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
3549 -Ssmime-force-encryption \
3550 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3551 -Smta=.
/.tsendmail.sh \
3552 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3553 -Ssmime-sign -Sfrom=test@localhost \
3555 -f .
/.ENCRYPT
>/dev
/null
2>&1
3556 if [ $?
-eq 0 ]; then
3565 /^Content-Description: /{ skip = 2; print; next }
3566 /^$/{ if(skip) --skip }
3569 < .
/.DECRYPT
> "${MBOX}"
3570 check behave
:s
/mime
:decrypt
+verify
:checksum
- "${MBOX}" '1720739247 931'
3572 printf 'behave:s/mime:decrypt+verify:disproof-1: '
3573 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
3574 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
3581 printf "behave:s/mime:encrypt: "
3582 echo bla |
${MAILX} ${ARGS} \
3583 -Ssmime-force-encryption \
3584 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3585 -Smta=.
/.tsendmail.sh \
3586 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3587 -Sfrom=test@localhost \
3588 -s 'S/MIME test' recei@ver.com
3589 if [ $?
-eq 0 ]; then
3596 # Same as behave:s/mime:encrypt+sign:checksum above
3597 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3598 check behave
:s
/mime
:encrypt
:checksum
- "${MBOX}" '1937410597 327'
3601 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
3602 -Ssmime-force-encryption \
3603 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3604 -Smta=.
/.tsendmail.sh \
3605 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3606 -Sfrom=test@localhost \
3608 -f .
/.ENCRYPT
>/dev
/null
2>&1
3609 check behave
:s
/mime
:decrypt
0 "./.DECRYPT" '2624716890 422'
3611 printf 'behave:s/mime:decrypt:disproof-1: '
3612 if openssl smime
-decrypt -inkey .
/.tkey.pem \
3613 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
3623 t_behave_maildir
() {
3625 TRAP_EXIT_ADDONS
="./.t*"
3629 while [ ${i} -lt 112 ]; do
3630 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
3631 "${MBOX}" "${i}" "${i}"
3634 ) |
${MAILX} ${ARGS}
3635 check behave
:maildir-1
0 "${MBOX}" '1140119864 13780'
3641 ' "${MBOX}" .tmdir1 .tmdir1 |
3642 ${MAILX} ${ARGS} -Snewfolders=maildir
> .tlst
3643 check behave
:maildir-2
0 .tlst
'1797938753 9103'
3646 copy * "maildir://%s"
3649 ' "${MBOX}" .tmdir2 .tmdir2 |
3650 ${MAILX} ${ARGS} > .tlst
3651 check behave
:maildir-3
0 .tlst
'1155631089 9113'
3653 printf 'File "maildir://%s"
3657 ' .tmdir2 .tmbox1 .tmbox1 |
3658 ${MAILX} ${ARGS} > .tlst
3659 check behave
:maildir-4
0 .tmbox1
'2646131190 13220'
3660 check behave
:maildir-5
- .tlst
'3701297796 9110'
3662 # only the odd (even)
3664 printf 'File "maildir://%s"
3667 while [ ${i} -lt 112 ]; do
3669 [ ${j} -eq 1 ] && printf '%s ' "${i}"
3676 ) |
${MAILX} ${ARGS} > .tlst
3677 check behave
:maildir-6
0 .tmbox2
'142890131 6610'
3678 check behave
:maildir-7
- .tlst
'960096773 4573'
3681 printf 'file "maildir://%s"
3684 while [ ${i} -lt 112 ]; do
3686 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
3694 ' .tmbox2 .tmbox2 .tmdir2
3695 ) | ${MAILX} ${ARGS} > .tlst
3696 check behave:maildir-8 0 .tmbox2 '3806905791 13100'
3697 ${sed} 2d < .tlst > .tlstx
3698 check behave:maildir-9 - .tlstx '4216815295 13645'
3703 t_behave_mass_recipients() {
3705 TRAP_EXIT_ADDONS=".
/.t
*"
3707 ${cat} <<-_EOT > ./.tsendmail.sh
3709 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3712 chmod 0755 ./.tsendmail.sh
3714 ${cat} <<'__EOT__' > ./.trc
3716 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3719 wysh set nr=$1 hn=$2
3720 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
3722 xcall bail "ins_addr
$hn 1-$nr"
3724 vput vexpr nr + $nr 1
3725 if [ "$nr" -le "$maximum" ]
3726 xcall ins_addr $nr $hn
3730 wysh set nr=$1 hn=$2
3731 alternates $hn$nr@$hn
3732 vput vexpr nr + $nr 2
3733 if [ "$nr" -le "$maximum" ]
3734 xcall bld_alter $nr $hn
3744 if [ "$t_remove" != '' ]
3749 set on-compose-splice=t_ocs on-compose-leave=t_ocl
3753 printf 'm this-goes@nowhere\nbody\n!.\n' |
3754 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3755 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3757 ${cat} ./.tall >> "${MBOX}"
3758 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
3761 printf 'm this-goes@nowhere\nbody\n!.\n' |
3762 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3763 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3765 ${cat} ./.tall >> "${MBOX}"
3766 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
3772 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
3773 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
3774 # Note we unfortunately need to place some statements without proper
3775 # indentation because of continuation problems
3779 # MIME encoding (QP) stress message body
3781 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
3782 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
3783 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
3784 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
3785 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
3786 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
3787 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
3788 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
3789 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
3790 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
3791 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
3792 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
3793 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
3794 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
3795 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
3796 "auf den zeilen vorher.
\r\n"\
3797 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
3799 "Die letzte Zeile war nur ein Punkt.
\r\n"\
3801 "Das waren deren zwei.
\r\n"\
3803 "Die letzte Zeile war ein Leerschritt.
\n"\
3804 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
3807 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
3809 "Das waren deren zwei. ditto.
\n"\
3811 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
3812 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
3813 "auf den zeilen vorher.
\n"\
3815 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
3816 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
3818 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3820 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3822 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3824 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3826 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3828 "QP am Zeilenende über soft-nl hinweg
\n"\
3829 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3831 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3833 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3835 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3837 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
3839 "Die letzte Zeile war ein Leerschritt.
\n"\
3843 # MIME encoding (QP) stress message subject
3844 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
3845 adadaddsssssssddddddddddddddddddddd\
3846 ddddddddddddddddddddddddddddddddddd\
3847 ddddddddddddddddddddddddddddddddddd\
3848 dddddddddddddddddddd Hallelulja? Od\
3849 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
3850 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
3851 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
3852 fffffffffffffffffffffffffffffffffff\
3853 fffffffffffffffffffff ggggggggggggg\
3854 ggggggggggggggggggggggggggggggggggg\
3855 ggggggggggggggggggggggggggggggggggg\
3856 ggggggggggggggggggggggggggggggggggg\
3859 # Three tests for MIME encoding and (a bit) content classification.
3860 # At the same time testing -q FILE, < FILE and -t FILE
3863 < "${BODY}" ${MAILX} ${ARGS} ${ADDARG_UNI} \
3864 -a "${BODY}" -s "${SUB}" "${MBOX}"
3865 check content
:001 0 "${MBOX}" '1145066634 6654'
3868 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3869 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
3870 check content
:002 0 "${MBOX}" '1145066634 6654'
3873 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
3875 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
3876 check content:003 0 "${MBOX}" '1145066634 6654'
3878 # Test for [260e19d] (Juergen Daubert)
3880 echo body | ${MAILX} ${ARGS} "${MBOX}"
3881 check content
:004 0 "${MBOX}" '2917662811 98'
3883 # Sending of multiple mails in a single invocation
3885 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
3886 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
3888 ) |
${MAILX} ${ARGS} ${ADDARG_UNI}
3889 check content
:005 0 "${MBOX}" '2098659767 358'
3893 # "Test for" [d6f316a] (Gavin Troy)
3895 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
3896 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
3897 check content:006 0 "${MBOX}" '2099098650 122'
3898 check content:006-1 - "${BODY}" '794542938 174'
3900 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
3903 for(i = 0; i < 10000; ++i)
3905 #printf "\xF0\x90\x87\x90"
3906 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
3907 check content
:007 0 "${MBOX}" '534262374 61816'
3909 ## Test some more corner cases for header bodies (as good as we can today) ##
3913 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
3914 -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̲' \
3916 check content
:008 0 "${MBOX}" '3370931614 375'
3918 # Single word (overlong line split -- bad standard! Requires injection of
3919 # artificial data!! But can be prevented by using RFC 2047 encoding)
3921 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
3922 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
3923 check content:009 0 "${MBOX}" '489922370 1718'
3925 # Combination of encoded words, space and tabs of varying sort
3927 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3928 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
3929 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
3930 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
3931 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
3932 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
3934 check content:010 0 "${MBOX}" '1676887734 591'
3936 # Overlong multibyte sequence that must be forcefully split
3937 # todo This works even before v15.0, but only by accident
3939 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3940 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3941 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3942 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
3944 check content:011 0 "${MBOX}" '3029301775 659'
3948 echo | ${MAILX} ${ARGS} \
3949 -s "1-1 B2 B3 B4 B5 B6 B\
3950 1-2 B2 B3 B4 B5 B6 B\
3951 1-3 B2 B3 B4 B5 B6 B\
3952 1-4 B2 B3 B4 B5 B6 B\
3953 1-5 B2 B3 B4 B5 B6 B\
3954 1-6 B2 B3 B4 B5 B6
" \
3956 check content:012 0 "${MBOX}" '4126167195 297'
3958 # Leading and trailing WS
3960 echo | ${MAILX} ${ARGS} \
3961 -s " 2-1 B2 B3 B4 B5 B6 B\
3962 1-2 B2 B3 B4 B5 B6 B\
3963 1-3 B2 B3 B4 B5 B6 B\
3964 1-4 B2 B3 B4 B5 B6
" \
3966 check content:013 0 "${MBOX}" '3600624479 236'
3968 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
3969 # have a (better) test framework materialize a quick shot
3971 TRAP_EXIT_ADDONS=./.ttt
3973 mkdir ./.ttt || exit 1
3977 : > 'diet\ is \curd.txt'
3978 : > 'diet "is
" curd.txt'
3980 : > 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
3981 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3982 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3983 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3985 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3986 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
3987 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
3988 -a ./.ttt/höde-tröge.txt \
3989 -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 \
3990 -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 \
3991 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3992 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3994 check content:014-1 0 "${MBOX}" '684985954 3092'
3996 # `resend' test, reusing $MBOX
3998 printf "Resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3999 check content:014-2 0 "${BODY}" '684985954 3092'
4002 printf "resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4003 check content:014-3 0 "${BODY}" '3130352658 3148'
4009 # if have_feat devel; then
4010 # ARGS="${ARGS} -Smemdebug"
4017 if [ -z "${CHECK_ONLY}" ]; then
4023 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'