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 if [ "${1}" = --check-only ]; then
74 [ -x "${MAILX}" ] || usage
77 MAILX
="${MEMTESTER}${MAILX}"
80 if [ -n "${CHECK_ONLY}" ] && [ -z "${UTF8_LOCALE}" ]; then
81 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
82 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
84 \if [ "${ttycharset}" @i=% utf ]
91 \eval xcall cset_test "${@}"
95 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
96 en_US.utf8 en_US.UTF-8
98 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
100 if [ -z "${UTF8_LOCALE}" ] && command -v locale
>/dev
/null
2>&1; then
101 UTF8_LOCALE
=`locale -a | { m=
103 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
105 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
119 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
120 trap "exit 1" HUP INT TERM
123 # Test all configs TODO doesn't cover all *combinations*, stupid!
127 NOTME["OPT_AUTOCC"] = 1
128 NOTME["OPT_DEBUG"] = 1
129 NOTME["OPT_DEVEL"] = 1
130 NOTME["OPT_NOEXTMD5"] = 1
131 NOTME["OPT_ASAN_ADDRESS"] = 1
132 NOTME["OPT_ASAN_MEMORY"] = 1
133 NOTME["OPT_FORCED_STACKPROT"] = 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
204 sh
-c "${MAKE} ${c} all test"
210 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
211 ${grep} +${1} ) >/dev
/null
2>&1
215 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
223 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
224 #x=`echo ${tid} | tr "/:=" "__-"`
225 #cp -f "${f}" "${TMPDIR}/${x}"
226 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
227 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
228 csum
="`${cksum} < ${f}`"
229 if [ "${csum}" = "${s}" ]; then
230 printf '%s: ok\n' "${tid}"
233 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
239 printf '%s: error: %s\n' ${1} "${2}"
243 [ $?
-ne 0 ] && err
$1 'unexpected non-0 exit status'
247 [ $?
-eq 0 ] && err
$1 'unexpected 0 exit status'
250 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
252 echo "$((${1} + ${2}))"
254 elif command -v expr >/dev
/null
2>&1; then
256 echo `expr ${1} + ${2}`
260 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
264 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
266 echo "$((${1} % ${2}))"
268 elif command -v expr >/dev
/null
2>&1; then
270 echo `expr ${1} % ${2}`
274 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
279 # Basic (easily testable) behaviour tests
281 t_behave_X_opt_input_command_stack
284 t_behave_input_inject_semicolon_seq
285 t_behave_commandalias
288 t_behave_macro_param_shift
299 # FIXME t_behave_mlist
302 t_behave_record_a_resend
305 t_behave_compose_hooks
306 t_behave_message_injections
307 t_behave_mime_types_load_control
312 t_behave_mass_recipients
315 t_behave_X_opt_input_command_stack
() {
318 ${cat} <<- '__EOT' > "${BODY}"
326 echo "define mac1 {";\
327 echo " echo mac1-1 via1 \$0";\
329 echo " echo mac1-2";\
331 echo " echo mac1-3";\
334 echo "define mac2 {";\
335 echo " echo mac2-1 via1 \$0";\
337 echo " echo mac2-2";\
343 echo echo 1-1-1 via1 \$0;\
355 # The -X option supports multiline arguments, and those can internally use
356 # reverse solidus newline escaping. And all -X options are joined...
358 < "${BODY}" ${MAILX} ${ARGS} \
373 echo "define mac1 {";\
374 echo " echo mac1-1 via2 \$0";\
376 echo " echo mac1-2";\
378 echo " echo mac1-3";\
381 echo "define mac2 {";\
382 echo " echo mac2-1 via2 \$0";\
384 echo " echo mac2-2";\
390 echo echo 1-1-1 via2 \$0;\
404 check behave:x_opt_input_command_stack 0 "${MBOX}" '1786542668 416'
409 t_behave_X_errexit() {
412 ${cat} <<- '__EOT' > "${BODY}"
418 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
419 -X'echo one' -X' echos nono ' -X'echo two' \
421 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
423 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
425 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
427 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
429 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
433 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
434 -X'echo one' -X' echos nono ' -X'echo two' \
436 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
438 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
440 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
442 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
444 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
446 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
448 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
450 ## Repeat 4-7 with ignerr set
452 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
454 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
455 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
457 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
459 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
461 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
463 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
465 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
467 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
469 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
477 ${cat} <<- '__EOT' > "${BODY}"
496 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
497 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
498 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
500 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
501 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
524 echo a$
'b\U0000000'dt
525 echo a$
'b\U00000000'du
535 if [ -z "${UTF8_LOCALE}" ]; then
536 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
538 < "${BODY}" DIET
=CURD TIED
= \
539 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
540 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
543 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
544 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
549 t_behave_input_inject_semicolon_seq() {
552 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
557 echon this_is_mymac
;call mydeepmac
;echon
';';
559 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
561 echon this_is_mymac
;call mydeepmac
;echon
,TOO
'!;';
563 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
566 check behave
:input_inject_semicolon_seq
0 "${MBOX}" '512117110 140'
571 t_behave_commandalias
() {
574 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
575 commandalias echo echo hoho
579 commandalias XxX XxXx
580 commandalias XxXx XxXxX
581 commandalias XxXxX XxXxXx
582 commandalias XxXxXx echo huhu
583 commandalias XxXxXxX echo huhu
585 commandalias XxXxXx XxXxXxX
588 commandalias XxXxXx echo huhu
592 check behave:commandalias 0 "${MBOX}" '3694143612 31'
600 # Nestable conditions test
601 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
623 if $dietcurd == 'yoho'
628 if $dietcurd @
== 'Yoho'
633 if $dietcurd == 'Yoho'
638 if $dietcurd != 'yoho'
643 if $dietcurd @
!= 'Yoho'
648 if $dietcurd != 'Yoho'
709 if $dietcurd == 'yohu'
711 elif $dietcurd == 'yoha'
713 elif $dietcurd == 'yohe'
715 elif $dietcurd == 'yoho'
717 if $dietcurd == 'yohu'
719 elif $dietcurd == 'yoha'
721 elif $dietcurd == 'yohe'
723 elif $dietcurd == 'yoho'
725 if $dietcurd == 'yohu'
727 elif $dietcurd == 'yoha'
729 elif $dietcurd == 'yohe'
731 elif $dietcurd == 'yoho'
880 set diet
=abc curd
=abc
886 set diet
=abc curd
=abcd
892 # 1. Shitty grouping capabilities as of today
893 unset diet curd ndefined
894 if [ [ false
] ||
[ false
] ||
[ true
] ] && [ [ false
] ||
[ true
] ] && \
900 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
905 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
910 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
915 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
920 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
926 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
931 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
936 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
941 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
946 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
951 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
956 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
961 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
966 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
971 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
977 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
983 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
988 # 2. Shitty grouping capabilities as of today
989 unset diet curd ndefined
990 if [ false || false || true
] && [ false || true
] && yes
995 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
1000 if [ 1 ||
0 ||
0 ||
0 ]
1005 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
1010 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
1015 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
1020 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1025 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1030 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1035 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1040 if 1 ||
0 ||
0 ||
0 && 0
1045 if 1 ||
0 ||
0 ||
0 && 1
1050 if 0 ||
0 ||
0 ||
1 && 0
1055 if 0 ||
0 ||
0 ||
1 && 1
1060 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
1065 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
1071 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1076 if $diet == 'yo' && $curd == 'ho' && $ndefined
1082 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1087 if $diet == 'yo' && $curd == 'ho' && $ndefined
1092 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1097 # Some more en-braced variables
1099 if ${diet} == ${curd}
1104 if ${diet} != ${curd}
1120 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1125 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1130 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1135 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1140 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1145 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1150 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1155 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
1160 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1166 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1171 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1176 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1181 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1186 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1191 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1196 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1201 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
1206 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1213 check behave
:if-normal
0 "${MBOX}" '1688759742 719'
1215 if have_feat regex
; then
1216 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1218 if $dietcurd =~ '^yo.*'
1223 if $dietcurd =~ '^Yo.*'
1228 if $dietcurd @=~ '^Yo.*'
1233 if $dietcurd =~ '^yOho.+'
1238 if $dietcurd @!~ '.*Ho$'
1243 if $dietcurd !~ '.+yohO$'
1248 if [ $dietcurd @i!~ '.+yoho$' ]
1253 if ! [ $dietcurd @i=~ '.+yoho$' ]
1258 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1263 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1268 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1273 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1278 if ! ! ! $dietcurd !~ '.+yoho$'
1283 if ! ! ! $dietcurd =~ '.+yoho$'
1288 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1293 set diet=abc curd='^abc$'
1299 set diet=abc curd='^abcd$'
1307 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1309 printf 'behave:if-regex: unsupported, skipped\n'
1315 t_behave_localopts() {
1318 # Nestable conditions test
1319 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1334 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1339 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1340 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1349 echo active trouble
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1351 echo active null
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1354 check behave
:localopts
0 "${MBOX}" '1936527193 192'
1359 t_behave_macro_param_shift
() {
1362 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1365 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1370 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1371 if [ $# > 1 ] || [ $ignerr == '' ]
1376 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1378 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1382 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1387 call t2 1 you get four args
1388 echo t1.1: $?';' ignerr ($ignerr) should not exist
1389 call t2 1 you get 'three args'
1390 echo t1.2: $?';' ignerr ($ignerr) should not exist
1391 call t2 1 you 'get two args'
1392 echo t1.3: $?';' ignerr ($ignerr) should not exist
1393 call t2 1 'you get one arg'
1394 echo t1.4: $?';' ignerr ($ignerr) should not exist
1395 ignerr call t2 '' 'you get one arg'
1396 echo t1.5: $?';' ignerr ($ignerr) should not exist
1401 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1406 t_behave_addrcodec() {
1409 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1410 vput addrcodec res e
1 <doog@def
>
1411 echo $?
/$^ERRNAME
$res
1412 eval vput addrcodec res d
$res
1413 echo $?
/$^ERRNAME
$res
1414 vput addrcodec res e
2 .
<doog@def
>
1415 echo $?
/$^ERRNAME
$res
1416 eval vput addrcodec res d
$res
1417 echo $?
/$^ERRNAME
$res
1418 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1419 echo $?
/$^ERRNAME
$res
1420 eval vput addrcodec res d
$res
1421 echo $?
/$^ERRNAME
$res
1422 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1423 echo $?
/$^ERRNAME
$res
1424 eval vput addrcodec res d
$res
1425 echo $?
/$^ERRNAME
$res
1426 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1427 echo $?
/$^ERRNAME
$res
1428 eval vput addrcodec res d
$res
1429 echo $?
/$^ERRNAME
$res
1431 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1432 echo $?
/$^ERRNAME
$res
1433 eval vput addrcodec res d
$res
1434 echo $?
/$^ERRNAME
$res
1435 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1436 echo $?
/$^ERRNAME
$res
1437 eval vput addrcodec res d
$res
1438 echo $?
/$^ERRNAME
$res
1439 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1440 echo $?
/$^ERRNAME
$res
1441 eval vput addrcodec res d
$res
1442 echo $?
/$^ERRNAME
$res
1443 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1444 echo $?
/$^ERRNAME
$res
1445 eval vput addrcodec res d
$res
1446 echo $?
/$^ERRNAME
$res
1447 vput addrcodec res
+e
8 \
1448 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1449 echo $?
/$^ERRNAME
$res
1450 eval vput addrcodec res d
$res
1451 echo $?
/$^ERRNAME
$res
1452 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1453 echo $?
/$^ERRNAME
$res
1454 eval vput addrcodec res d
$res
1455 echo $?
/$^ERRNAME
$res
1456 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1457 echo $?
/$^ERRNAME
$res
1458 eval vput addrcodec res d
$res
1459 echo $?
/$^ERRNAME
$res
1460 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1461 echo $?
/$^ERRNAME
$res
1462 eval vput addrcodec res d
$res
1463 echo $?
/$^ERRNAME
$res
1464 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1465 echo $?
/$^ERRNAME
$res
1466 eval vput addrcodec res d
$res
1467 echo $?
/$^ERRNAME
$res
1468 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1469 echo $?
/$^ERRNAME
$res
1470 eval vput addrcodec res d
$res
1471 echo $?
/$^ERRNAME
$res
1472 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1473 echo $?
/$^ERRNAME
$res
1474 eval vput addrcodec res d
$res
1475 echo $?
/$^ERRNAME
$res
1476 vput addrcodec res
+e
15 \
1477 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1478 echo $?
/$^ERRNAME
$res
1479 eval vput addrcodec res d
$res
1480 echo $?
/$^ERRNAME
$res
1481 vput addrcodec res
+e
16 \
1482 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1483 echo $?
/$^ERRNAME
$res
1484 eval vput addrcodec res d
$res
1485 echo $?
/$^ERRNAME
$res
1486 vput addrcodec res
+e
17 \
1487 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1488 echo $?
/$^ERRNAME
$res
1489 eval vput addrcodec res d
$res
1490 echo $?
/$^ERRNAME
$res
1491 vput addrcodec res
+e
18 \
1492 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1493 echo $?
/$^ERRNAME
$res
1494 eval vput addrcodec res d
$res
1495 echo $?
/$^ERRNAME
$res
1496 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1497 echo $?
/$^ERRNAME
$res
1498 eval vput addrcodec res d
$res
1499 echo $?
/$^ERRNAME
$res
1501 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1502 echo $?
/$^ERRNAME
$res
1503 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1504 echo $?/$^ERRNAME $res
1505 eval vput addrcodec res d $res
1506 echo $?/$^ERRNAME $res
1508 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1509 echo $?/$^ERRNAME $res
1510 eval vput addrcodec res d $res
1511 echo $?/$^ERRNAME $res
1513 vput addrcodec res s \
1514 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1515 echo $?/$^ERRNAME $res
1518 check behave:addrcodec 0 "${MBOX}" '429099645 2414'
1526 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1527 vput vexpr res
= 9223372036854775807
1528 echo $?
/$^ERRNAME
$res
1529 vput vexpr res
= 9223372036854775808
1530 echo $?
/$^ERRNAME
$res
1531 vput vexpr res
=@
9223372036854775808
1532 echo $?
/$^ERRNAME
$res
1533 vput vexpr res
= -9223372036854775808
1534 echo $?
/$^ERRNAME
$res
1535 vput vexpr res
= -9223372036854775809
1536 echo $?
/$^ERRNAME
$res
1537 vput vexpr res
=@
-9223372036854775809
1538 echo $?
/$^ERRNAME
$res
1541 echo $?
/$^ERRNAME
$res
1543 echo $?
/$^ERRNAME
$res
1545 echo $?
/$^ERRNAME
$res
1547 vput vexpr res
+ 0 0
1548 echo $?
/$^ERRNAME
$res
1549 vput vexpr res
+ 0 1
1550 echo $?
/$^ERRNAME
$res
1551 vput vexpr res
+ 1 1
1552 echo $?
/$^ERRNAME
$res
1554 vput vexpr res
+ 9223372036854775807 0
1555 echo $?
/$^ERRNAME
$res
1556 vput vexpr res
+ 9223372036854775807 1
1557 echo $?
/$^ERRNAME
$res
1558 vput vexpr res
+@
9223372036854775807 1
1559 echo $?
/$^ERRNAME
$res
1560 vput vexpr res
+ 0 9223372036854775807
1561 echo $?
/$^ERRNAME
$res
1562 vput vexpr res
+ 1 9223372036854775807
1563 echo $?
/$^ERRNAME
$res
1564 vput vexpr res
+@
1 9223372036854775807
1565 echo $?
/$^ERRNAME
$res
1567 vput vexpr res
+ -9223372036854775808 0
1568 echo $?
/$^ERRNAME
$res
1569 vput vexpr res
+ -9223372036854775808 -1
1570 echo $?
/$^ERRNAME
$res
1571 vput vexpr res
+@
-9223372036854775808 -1
1572 echo $?
/$^ERRNAME
$res
1573 vput vexpr res
+ 0 -9223372036854775808
1574 echo $?
/$^ERRNAME
$res
1575 vput vexpr res
+ -1 -9223372036854775808
1576 echo $?
/$^ERRNAME
$res
1577 vput vexpr res
+@
-1 -9223372036854775808
1578 echo $?
/$^ERRNAME
$res
1580 vput vexpr res
- 0 0
1581 echo $?
/$^ERRNAME
$res
1582 vput vexpr res
- 0 1
1583 echo $?
/$^ERRNAME
$res
1584 vput vexpr res
- 1 1
1585 echo $?
/$^ERRNAME
$res
1587 vput vexpr res
- 9223372036854775807 0
1588 echo $?
/$^ERRNAME
$res
1589 vput vexpr res
- 9223372036854775807 -1
1590 echo $?
/$^ERRNAME
$res
1591 vput vexpr res
-@
9223372036854775807 -1
1592 echo $?
/$^ERRNAME
$res
1593 vput vexpr res
- 0 9223372036854775807
1594 echo $?
/$^ERRNAME
$res
1595 vput vexpr res
- -1 9223372036854775807
1596 echo $?
/$^ERRNAME
$res
1597 vput vexpr res
- -2 9223372036854775807
1598 echo $?
/$^ERRNAME
$res
1599 vput vexpr res
-@
-2 9223372036854775807
1600 echo $?
/$^ERRNAME
$res
1602 vput vexpr res
- -9223372036854775808 +0
1603 echo $?
/$^ERRNAME
$res
1604 vput vexpr res
- -9223372036854775808 +1
1605 echo $?
/$^ERRNAME
$res
1606 vput vexpr res
-@
-9223372036854775808 +1
1607 echo $?
/$^ERRNAME
$res
1608 vput vexpr res
- 0 -9223372036854775808
1609 echo $?
/$^ERRNAME
$res
1610 vput vexpr res
- +1 -9223372036854775808
1611 echo $?
/$^ERRNAME
$res
1612 vput vexpr res
-@
+1 -9223372036854775808
1613 echo $?
/$^ERRNAME
$res
1615 vput vexpr res
+ -13 -2
1616 echo $?
/$^ERRNAME
$res
1617 vput vexpr res
- 0 0
1618 echo $?
/$^ERRNAME
$res
1619 vput vexpr res
- 0 1
1620 echo $?
/$^ERRNAME
$res
1621 vput vexpr res
- 1 1
1622 echo $?
/$^ERRNAME
$res
1623 vput vexpr res
- -13 -2
1624 echo $?
/$^ERRNAME
$res
1626 vput vexpr res
* 0 0
1627 echo $?
/$^ERRNAME
$res
1628 vput vexpr res
* 0 1
1629 echo $?
/$^ERRNAME
$res
1630 vput vexpr res
* 1 1
1631 echo $?
/$^ERRNAME
$res
1632 vput vexpr res
* -13 -2
1633 echo $?
/$^ERRNAME
$res
1635 vput vexpr res
/ 0 0
1636 echo $?
/$^ERRNAME
$res
1637 vput vexpr res
/ 0 1
1638 echo $?
/$^ERRNAME
$res
1639 vput vexpr res
/ 1 1
1640 echo $?
/$^ERRNAME
$res
1641 vput vexpr res
/ -13 -2
1642 echo $?
/$^ERRNAME
$res
1644 vput vexpr res
% 0 0
1645 echo $?
/$^ERRNAME
$res
1646 vput vexpr res
% 0 1
1647 echo $?
/$^ERRNAME
$res
1648 vput vexpr res
% 1 1
1649 echo $?
/$^ERRNAME
$res
1650 vput vexpr res
% -13 -2
1651 echo $?
/$^ERRNAME
$res
1654 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1656 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1657 vput vexpr res find 'bananarama' 'nana'
1658 echo $?/$^ERRNAME :$res:
1659 vput vexpr res find 'bananarama' 'bana'
1660 echo $?/$^ERRNAME :$res:
1661 vput vexpr res find 'bananarama' 'Bana'
1662 echo $?/$^ERRNAME :$res:
1663 vput vexpr res find 'bananarama' 'rama'
1664 echo $?/$^ERRNAME :$res:
1666 vput vexpr res ifind 'bananarama' 'nana'
1667 echo $?/$^ERRNAME :$res:
1668 vput vexpr res ifind 'bananarama' 'bana'
1669 echo $?/$^ERRNAME :$res:
1670 vput vexpr res ifind 'bananarama' 'Bana'
1671 echo $?/$^ERRNAME :$res:
1672 vput vexpr res ifind 'bananarama' 'rama'
1673 echo $?/$^ERRNAME :$res:
1675 vput vexpr res substring 'bananarama' 1
1676 echo $?/$^ERRNAME :$res:
1677 vput vexpr res substring 'bananarama' 3
1678 echo $?/$^ERRNAME :$res:
1679 vput vexpr res substring 'bananarama' 5
1680 echo $?/$^ERRNAME :$res:
1681 vput vexpr res substring 'bananarama' 7
1682 echo $?/$^ERRNAME :$res:
1683 vput vexpr res substring 'bananarama' 9
1684 echo $?/$^ERRNAME :$res:
1685 vput vexpr res substring 'bananarama' 10
1686 echo $?/$^ERRNAME :$res:
1687 vput vexpr res substring 'bananarama' 1 3
1688 echo $?/$^ERRNAME :$res:
1689 vput vexpr res substring 'bananarama' 3 3
1690 echo $?/$^ERRNAME :$res:
1691 vput vexpr res substring 'bananarama' 5 3
1692 echo $?/$^ERRNAME :$res:
1693 vput vexpr res substring 'bananarama' 7 3
1694 echo $?/$^ERRNAME :$res:
1695 vput vexpr res substring 'bananarama' 9 3
1696 echo $?/$^ERRNAME :$res:
1697 vput vexpr res substring 'bananarama' 10 3
1698 echo $?/$^ERRNAME :$res:
1702 check behave:vexpr-string 0 "${MBOX}" '265398700 267'
1704 if have_feat regex; then
1705 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1706 vput vexpr res regex
'bananarama' 'nana'
1707 echo $?
/$^ERRNAME
:$res:
1708 vput vexpr res regex
'bananarama' 'bana'
1709 echo $?
/$^ERRNAME
:$res:
1710 vput vexpr res regex
'bananarama' 'Bana'
1711 echo $?
/$^ERRNAME
:$res:
1712 vput vexpr res regex
'bananarama' 'rama'
1713 echo $?
/$^ERRNAME
:$res:
1715 vput vexpr res iregex
'bananarama' 'nana'
1716 echo $?
/$^ERRNAME
:$res:
1717 vput vexpr res iregex
'bananarama' 'bana'
1718 echo $?
/$^ERRNAME
:$res:
1719 vput vexpr res iregex
'bananarama' 'Bana'
1720 echo $?
/$^ERRNAME
:$res:
1721 vput vexpr res iregex
'bananarama' 'rama'
1722 echo $?
/$^ERRNAME
:$res:
1724 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1725 echo $?
/$^ERRNAME
:$res:
1726 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1727 echo $?
/$^ERRNAME
:$res:
1728 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1729 echo $?
/$^ERRNAME
:$res:
1730 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1731 echo $?
/$^ERRNAME
:$res:
1733 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1734 echo $?
/$^ERRNAME
:$res:
1735 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1736 echo $?
/$^ERRNAME
:$res:
1737 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1738 echo $?
/$^ERRNAME
:$res:
1739 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1740 echo $?
/$^ERRNAME
:$res:
1744 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
1746 printf 'behave:vexpr-regex: unsupported, skipped\n'
1752 t_behave_call_ret
() {
1755 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1760 vput vexpr j '&' $i 7
1766 vput vexpr j '&' $i 7
1772 echo ! The end for $1
1776 # Transport $?/$! up the call chain
1782 wysh set i=$? j=$! k=$^ERRNAME
1786 echo ! The end for $1
1787 return $i $^ERR-BUSY
1791 # Up and down it goes
1798 vput vexpr k - $1 $2
1802 echo "# <$i/$j> .. "
1806 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
1809 echo ! The end
for $1=$i/$2
1813 return $i $^ERR-BUSY
1819 call w1
0; echo ?
=$?
!=$
!; echo -----;
1820 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
1821 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
1824 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
1832 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1837 vput vexpr j '&' $i 7
1843 echo ! The end for $1/$2
1845 return $i $^ERR-BUSY
1856 echo ?=$? !=$^ERRNAME
1859 echo ?=$? !=$^ERRNAME
1861 echo ?=$? !=$^ERRNAME
1864 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
1868 ${cat} <<- '__EOT' > "${BODY}"
1873 vput vexpr j '&' $i 7
1879 echo ! The end for $1
1882 echo would be err with errexit
1891 echo zwei, ?=$? !=$!
1892 localopts yes; set errexit
1894 echo drei, ?=$? !=$^ERRNAME
1896 echo vier, ?=$? !=$^ERRNAME, this is an error
1899 echo outer 1, ?=$? !=$^ERRNAME
1901 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
1903 echo outer 3, ?=$? !=$^ERRNAME
1904 echo this is definitely an error
1907 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
1909 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
1911 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
1913 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
1918 t_behave_vpospar() {
1921 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1922 vpospar
set hey
, "'you ", world
!
1923 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1924 vput vpospar x quote
; echo x
<$x>
1925 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1926 vput vpospar y quote
;echo y
<$y>
1927 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1928 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1929 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1932 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1933 vput vpospar z quote
;echo infun2
:z
<$z>
1937 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1938 vput vpospar y quote
;echo infun
:y
<$y>
1939 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1940 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1942 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1943 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1946 call infun This
"in a" fun
1947 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1948 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1950 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
1953 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1955 echo ifs<$ifs> ifs-ws<$ifs-ws>
1956 vpospar set hey, "'you ", world!
1957 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1958 vput vpospar x quote; echo x<$x>
1959 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1960 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1963 echo ifs<$ifs> ifs-ws<$ifs-ws>
1964 vpospar set hey, "'you
", world!
1965 echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1966 vput vpospar x quote; echo x<$x>
1967 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1968 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
1971 echo ifs<$ifs> ifs-ws<$ifs-ws>
1972 vpospar set hey, "'you ", world!
1973 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1974 vput vpospar x quote; echo x<$x>
1975 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1976 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
1978 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
1985 TRAP_EXIT_ADDONS="./.t*"
1987 ${cat} <<- '__EOT
' > .tin
1988 hey1, "'you
", world!
1989 hey2, "'you ", bugs bunny!
1994 ${cat} <<- '__EOT
' |\
1995 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
1997 echo $?/$^ERRNAME / <$a><$b><$c>
1999 echo $?/$^ERRNAME / <$a><$b><$c>
2001 echo $?/$^ERRNAME / <$a><$b><$c>
2003 echo $?/$^ERRNAME / <$a><$b><$c>
2005 echo $?/$^ERRNAME / <$a><$b><$c>
2006 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2008 check behave:read-1 0 "${MBOX}" '1527910147 173'
2010 ${cat} <<- '__EOT
' > .tin2
2011 hey2.0,:"'you
",:world!:mars.:
2012 hey2.1,:"'you ",:world!
2013 hey2.2,:"'you
",:bugs bunny!
2019 ${cat} <<- '__EOT' |\
2020 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2023 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2025 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2027 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2029 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2031 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2033 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2035 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2037 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2038 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2040 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2047 TRAP_EXIT_ADDONS
="./.t*"
2051 while [ ${i} -lt 112 ]; do
2052 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2053 "${MBOX}" "${i}" "${i}"
2056 ) |
${MAILX} ${ARGS}
2057 check behave
:mbox-1
0 "${MBOX}" '1140119864 13780'
2063 ' "${MBOX}" .tmbox1 .tmbox1 |
2064 ${MAILX} ${ARGS} > .tlst
2065 check behave
:mbox-2
0 .tlst
'2739893312 9103'
2071 ' "${MBOX}" .tmbox2 .tmbox2 |
2072 ${MAILX} ${ARGS} > .tlst
2073 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2075 # only the odd (even)
2077 printf 'File "file://%s"
2080 while [ ${i} -lt 112 ]; do
2082 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2089 ) |
${MAILX} ${ARGS} > .tlst
2090 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2091 check behave
:mbox-5
- .tlst
'2960975049 4573'
2094 printf 'file "file://%s"
2097 while [ ${i} -lt 112 ]; do
2099 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2107 ' .tmbox3 .tmbox3 .tmbox2
2108 ) | ${MAILX} ${ARGS} > .tlst
2109 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2110 ${sed} 2d < .tlst > .tlstx
2111 check behave:mbox-7 - .tlstx '2729940494 13645'
2116 t_behave_alternates() {
2118 TRAP_EXIT_ADDONS=".
/.t
*"
2120 ${cat} <<-_EOT > ./.tsendmail.sh
2122 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2125 chmod 0755 ./.tsendmail.sh
2127 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2131 alternates a1@b1 a2@b2 a3@b3
2136 echo $?/$^ERRNAME <$rv>
2141 echo $?/$^ERRNAME <$rv>
2144 echo $?/$^ERRNAME <$rv>
2147 echo $?/$^ERRNAME <$rv>
2151 alternates a1@b1 a2@b2 a3@b3
2154 echo $?/$^ERRNAME <$rv>
2157 echo $?/$^ERRNAME <$rv>
2160 echo $?/$^ERRNAME <$rv>
2163 alternates a1@b1 a2@b2 a3@b3
2166 echo $?/$^ERRNAME <$rv>
2169 echo $?/$^ERRNAME <$rv>
2172 echo $?/$^ERRNAME <$rv>
2176 alternates a1@b1 a2@b2 a3@b3
2179 echo $?/$^ERRNAME <$rv>
2183 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2185 ~s all alternates, only a1@b1 remains
2187 ~b a3@b3 a3@c3 a3@d3
2196 alternates a1@b1 a1@c1 a2@b2 a3@b3
2198 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2200 ~b a3@b3 a3@c3 a3@d3
2207 alternates a1@b1 a2@b2 a3; set allnet
2209 ~s all alternates via allnet, only a1@b1 remains
2211 ~b a3@b3 a3@c3 a3@d3
2222 echo $?/$^ERRNAME <$rv>
2226 echo $?/$^ERRNAME <$rv>
2230 echo $?/$^ERRNAME <$rv>
2234 echo $?/$^ERRNAME <$rv>
2238 echo $?/$^ERRNAME <$rv>
2242 alternates a1@b1 a2@b2
2245 echo $?/$^ERRNAME <$rv>
2246 alternates a3@b3 a4@b4
2249 echo $?/$^ERRNAME <$rv>
2251 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2252 check behave:alternates-2 - .tall '1878598364 505'
2259 TRAP_EXIT_ADDONS=".
/.t
*"
2261 ${cat} <<-_EOT > ./.tsendmail.sh
2263 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2266 chmod 0755 ./.tsendmail.sh
2268 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2270 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2272 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2274 alias a4 a5 ex1@a4.ple
2276 alias a6 a7 ex1@a6.ple
2290 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2291 check behave:alias-2 - .tall '3548953204 152'
2293 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2294 # TODO need to somehow provide its contents to the test, then test
2299 t_behave_filetype() {
2301 TRAP_EXIT_ADDONS=".
/.t
*"
2303 ${cat} <<-_EOT > ./.tsendmail.sh
2305 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2308 chmod 0755 ./.tsendmail.sh
2310 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ ./snailmail.jpg\n~.\n' |
2311 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2312 check behave:filetype-1 0 "${MBOX}" '1645747150 13536'
2314 if command -v gzip >/dev/null 2>&1; then
2317 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2318 copy 2 ./.t.mbox.gz' "${MBOX}" |
2320 -X'filetype gz gzip\ -dc gzip\ -c'
2321 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2323 -X'filetype gz gzip\ -dc gzip\ -c'
2325 check behave:filetype-2 0 ".
/.t.mbox
" '1645747150 13536'
2327 echo 'behave:filetype-2: unsupported, skipped'
2332 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2338 -X'filetype gz gzip\ -dc gzip\ -c' \
2339 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2340 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2341 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2343 -X'filetype gz gzip\ -dc gzip\ -c' \
2344 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2347 check behave:filetype-3 - ".
/.t.mbox
" '238021003 27092'
2352 t_behave_record_a_resend() {
2354 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
2358 m %s\n~s Subject 1.\nHello.\n~.
2359 set record-files add-file-recipients
2360 m %s\n~s Subject 2.\nHello.\n~.
2362 resend 2 ./.t.resent
2363 Resend 1 ./.t.resent
2365 resend 2 ./.t.resent
2366 Resend 1 ./.t.resent
2367 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
2370 check behave:record_a_resend-1 0 "${MBOX}" '3057873538 256'
2371 check behave:record_a_resend-2 - .t.record '391356429 460'
2372 check behave:record_a_resend-3 - .t.resent '2685231691 648'
2377 t_behave_e_H_L_opts() {
2379 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2382 ${MAILX} ${ARGS} -ef ./.t.mbox
2383 echo ${?} > "${MBOX}"
2385 ${cat} <<-_EOT > ./.tsendmail.sh
2387 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2390 chmod 0755 ./.tsendmail.sh
2391 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2392 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2393 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2394 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2396 ${MAILX} ${ARGS} -ef ./.t.mbox
2397 echo ${?} >> "${MBOX}"
2398 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
2399 echo ${?} >> "${MBOX}"
2400 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
2401 echo ${?} >> "${MBOX}"
2402 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
2403 echo ${?} >> "${MBOX}"
2404 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
2405 echo ${?} >> "${MBOX}"
2406 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
2407 echo ${?} >> "${MBOX}"
2408 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2409 echo ${?} >> "${MBOX}"
2411 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2412 echo ${?} >> "${MBOX}"
2413 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2414 echo ${?} >> "${MBOX}"
2415 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2416 echo ${?} >> "${MBOX}"
2417 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2418 echo ${?} >> "${MBOX}"
2419 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2420 echo ${?} >> "${MBOX}"
2421 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2422 echo ${?} >> "${MBOX}"
2423 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev
/null
2424 echo ${?} >> "${MBOX}"
2426 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2431 t_behave_compose_hooks
() { # TODO monster
2433 TRAP_EXIT_ADDONS
="./.t*"
2435 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
2436 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
2438 ${cat} <<-_EOT > ./.tsendmail.sh
2440 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2443 chmod 0755 .
/.tsendmail.sh
2445 ${cat} <<'__EOT__' > ./.trc
2447 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
2450 vput vexpr es substr "$1" 0 1
2455 define read_mline_res {
2456 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2457 echo $len/$es/$^ERRNAME: $hl
2458 if [ $es -ne $^ERR-NONE ]
2459 xcall bail read_mline_res
2461 \xcall read_mline_res
2466 echo "~^header list"; read hl; echo $hl;\
2467 call xerr "$hl" "in_addr ($xh) 0-1"
2469 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2470 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
2471 echo "~^header insert $xh <${xh}2@exam.ple>";\
2472 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
2473 echo "~^header insert $xh ${xh}3@exam.ple";\
2474 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
2475 echo "~^header list $xh"; read hl; echo $hl;\
2476 call xerr "$hl" "ins_addr $xh 1-4"
2477 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
2480 if [ "$t_remove" == "" ]
2484 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
2485 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
2487 xcall bail "ins_addr $xh 2-2"
2489 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
2491 xcall bail "ins_addr $xh 2-3"
2493 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
2495 xcall bail "ins_addr $xh 2-4"
2499 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2500 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
2501 echo "~^header insert $xh <${xh}2@exam.ple>";\
2502 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
2503 echo "~^header insert $xh ${xh}3@exam.ple";\
2504 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
2505 echo "~^header list $xh"; read hl; echo $hl;\
2506 call xerr "$hl" "ins_addr $xh 3-4"
2507 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
2510 echo "~^header remove-at $xh 1"; read es;\
2511 call xerr $es "ins_addr $xh 3-6"
2512 echo "~^header remove-at $xh 1"; read es;\
2513 call xerr $es "ins_addr $xh 3-7"
2514 echo "~^header remove-at $xh 1"; read es;\
2515 call xerr $es "ins_addr $xh 3-8"
2516 echo "~^header remove-at $xh 1"; read es;\
2517 vput vexpr es substr $es 0 3
2519 xcall bail "ins_addr $xh 3-9"
2521 echo "~^header remove-at $xh T"; read es;\
2522 vput vexpr es substr $es 0 3
2524 xcall bail "ins_addr $xh 3-10"
2526 echo "~^header list $xh"; read es;\
2527 vput vexpr es substr $es 0 3
2529 xcall bail "ins_addr $xh 3-11"
2531 echo "~^header show $xh"; read es;\
2532 vput vexpr es substr $es 0 3
2534 xcall bail "ins_addr $xh 3-12"
2538 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2539 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
2540 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
2541 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
2542 echo "~^header insert $xh ${xh}3@exam.ple";\
2543 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
2544 echo "~^header list $xh"; read hl; echo $hl;\
2545 call xerr "$hl" "header list $xh 3-4"
2546 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
2549 echo "~^header remove-at $xh 3"; read es;\
2550 call xerr $es "ins_addr $xh 4-6"
2551 echo "~^header remove-at $xh 2"; read es;\
2552 call xerr $es "ins_addr $xh 4-7"
2553 echo "~^header remove-at $xh 1"; read es;\
2554 call xerr $es "ins_addr $xh 4-8"
2555 echo "~^header remove-at $xh 1"; read es;\
2556 vput vexpr es substr $es 0 3
2558 xcall bail "ins_addr $xh 4-9"
2560 echo "~^header remove-at $xh T"; read es;\
2561 vput vexpr es substr $es 0 3
2563 xcall bail "ins_addr $xh 4-10"
2565 echo "~^header list $xh"; read es;\
2566 vput vexpr es substr $es 0 3
2568 xcall bail "ins_addr $xh 4-11"
2570 echo "~^header show $xh"; read es;\
2571 vput vexpr es substr $es 0 3
2573 xcall bail "ins_addr $xh 4-12"
2577 wysh set xh=$1 mult=$2
2578 echo "~^header list"; read hl; echo $hl;\
2579 call xerr "$hl" "ins_ref ($xh) 0-1"
2581 echo "~^header insert $xh <$xh@exam.ple>";\
2582 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
2584 echo "~^header insert $xh <${xh}2@exam.ple>";\
2585 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
2586 echo "~^header insert $xh ${xh}3@exam.ple";\
2587 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
2589 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
2590 vput vexpr es substr $es 0 3
2592 xcall bail "ins_ref $xh 1-4"
2596 echo "~^header list $xh"; read hl; echo $hl;\
2597 call xerr "$hl" "ins_ref $xh 1-5"
2598 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
2601 if [ "$t_remove" == "" ]
2605 echo "~^header remove $xh"; read es;\
2606 call xerr $es "ins_ref $xh 2-1"
2607 echo "~^header remove $xh"; read es;\
2608 vput vexpr es substr $es 0 3
2610 xcall bail "ins_ref $xh 2-2"
2612 echo "~^header list $xh"; read es;\
2613 vput vexpr es substr $es 0 3
2615 xcall bail "$es ins_ref $xh 2-3"
2617 echo "~^header show $xh"; read es;\
2618 vput vexpr es substr $es 0 3
2620 xcall bail "ins_ref $xh 2-4"
2624 echo "~^header insert $xh <$xh@exam.ple>";\
2625 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
2627 echo "~^header insert $xh <${xh}2@exam.ple>";\
2628 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
2629 echo "~^header insert $xh ${xh}3@exam.ple";\
2630 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
2632 echo "~^header list $xh";\
2633 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
2634 echo "~^header show $xh";\
2635 read es; call xerr $es "ins_ref $xh 3-5"
2638 echo "~^header remove-at $xh 1"; read es;\
2639 call xerr $es "ins_ref $xh 3-6"
2640 if [ $mult -ne 0 ] && [ $xh != subject ]
2641 echo "~^header remove-at $xh 1"; read es;\
2642 call xerr $es "ins_ref $xh 3-7"
2643 echo "~^header remove-at $xh 1"; read es;\
2644 call xerr $es "ins_ref $xh 3-8"
2646 echo "~^header remove-at $xh 1"; read es;\
2647 vput vexpr es substr $es 0 3
2649 xcall bail "ins_ref $xh 3-9"
2651 echo "~^header remove-at $xh T"; read es;\
2652 vput vexpr es substr $es 0 3
2654 xcall bail "ins_ref $xh 3-10"
2656 echo "~^header show $xh"; read es;\
2657 vput vexpr es substr $es 0 3
2659 xcall bail "ins_ref $xh 3-11"
2663 echo "~^header insert $xh <$xh@exam.ple> ";\
2664 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
2666 echo "~^header insert $xh <${xh}2@exam.ple> ";\
2667 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
2668 echo "~^header insert $xh ${xh}3@exam.ple";\
2669 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
2671 echo "~^header list $xh"; read hl; echo $hl;\
2672 call xerr "$hl" "ins_ref $xh 4-4"
2673 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
2676 if [ $mult -ne 0 ] && [ $xh != subject ]
2677 echo "~^header remove-at $xh 3"; read es;\
2678 call xerr $es "ins_ref $xh 4-6"
2679 echo "~^header remove-at $xh 2"; read es;\
2680 call xerr $es "ins_ref $xh 4-7"
2682 echo "~^header remove-at $xh 1"; read es;\
2683 call xerr $es "ins_ref $xh 4-8"
2684 echo "~^header remove-at $xh 1"; read es;\
2685 vput vexpr es substr $es 0 3
2687 xcall bail "ins_ref $xh 4-9"
2689 echo "~^header remove-at $xh T"; read es;\
2690 vput vexpr es substr $es 0 3
2692 xcall bail "ins_ref $xh 4-10"
2694 echo "~^header show $xh"; read es;\
2695 vput vexpr es substr $es 0 3
2697 xcall bail "ins_ref $xh 4-11"
2702 # In collect.c order
2704 call ins_ref sender 0 # Not a "ref", but works
2708 call ins_addr reply-To
2709 call ins_addr mail-Followup-to
2710 call ins_ref messAge-id 0
2711 call ins_ref rEfErEncEs 1
2712 call ins_ref in-Reply-to 1
2713 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
2714 call ins_addr freeForm1
2715 call ins_addr freeform2
2717 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
2719 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
2727 echo "~^attachment";\
2728 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2730 xcall bail "attach 0-1"
2733 echo "~^attach attribute ./.treadctl";\
2734 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2736 xcall bail "attach 0-2"
2738 echo "~^attachment attribute-at 1";\
2739 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2741 xcall bail "attach 0-3"
2744 echo "~^attachment insert ./.treadctl=ascii";\
2745 read hl; echo $hl; call xerr "$hl" "attach 1-1"
2746 echo "~^attachment list";\
2747 read es; echo $es;call xerr "$es" "attach 1-2"
2749 echo "~^attachment attribute ./.treadctl";\
2750 read es; echo $es;call xerr "$es" "attach 1-3"
2752 echo "~^attachment attribute .treadctl";\
2753 read es; echo $es;call xerr "$es" "attach 1-4"
2755 echo "~^attachment attribute-at 1";\
2756 read es; echo $es;call xerr "$es" "attach 1-5"
2759 echo "~^attachment attribute-set ./.treadctl filename rctl";\
2760 read es; echo $es;call xerr "$es" "attach 1-6"
2761 echo "~^attachment attribute-set .treadctl content-description Au";\
2762 read es; echo $es;call xerr "$es" "attach 1-7"
2763 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
2764 read es; echo $es;call xerr "$es" "attach 1-8"
2766 echo "~^attachment attribute ./.treadctl";\
2767 read es; echo $es;call xerr "$es" "attach 1-9"
2769 echo "~^attachment attribute .treadctl";\
2770 read es; echo $es;call xerr "$es" "attach 1-10"
2772 echo "~^attachment attribute rctl";\
2773 read es; echo $es;call xerr "$es" "attach 1-11"
2775 echo "~^attachment attribute-at 1";\
2776 read es; echo $es;call xerr "$es" "attach 1-12"
2780 echo "~^attachment insert ./.tattach=latin1";\
2781 read hl; echo $hl; call xerr "$hl" "attach 2-1"
2782 echo "~^attachment list";\
2783 read es; echo $es;call xerr "$es" "attach 2-2"
2785 echo "~^attachment attribute ./.tattach";\
2786 read es; echo $es;call xerr "$es" "attach 2-3"
2788 echo "~^attachment attribute .tattach";\
2789 read es; echo $es;call xerr "$es" "attach 2-4"
2791 echo "~^attachment attribute-at 2";\
2792 read es; echo $es;call xerr "$es" "attach 2-5"
2795 echo "~^attachment attribute-set ./.tattach filename tat";\
2796 read es; echo $es;call xerr "$es" "attach 2-6"
2798 "~^attachment attribute-set .tattach content-description Au2";\
2799 read es; echo $es;call xerr "$es" "attach 2-7"
2800 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
2801 read es; echo $es;call xerr "$es" "attach 2-8"
2803 "~^attachment attribute-set-at 2 content-type application/x-sh";\
2804 read es; echo $es;call xerr "$es" "attach 2-9"
2806 echo "~^attachment attribute ./.tattach";\
2807 read es; echo $es;call xerr "$es" "attach 2-10"
2809 echo "~^attachment attribute .tattach";\
2810 read es; echo $es;call xerr "$es" "attach 2-11"
2812 echo "~^attachment attribute tat";\
2813 read es; echo $es;call xerr "$es" "attach 2-12"
2815 echo "~^attachment attribute-at 2";\
2816 read es; echo $es;call xerr "$es" "attach 2-13"
2820 if [ "$t_remove" == "" ]
2824 echo "~^attachment remove ./.treadctl"; read es;\
2825 call xerr $es "attach 3-1"
2826 echo "~^attachment remove ./.tattach"; read es;\
2827 call xerr $es "attach 3-2"
2828 echo "~^ attachment remove ./.treadctl"; read es;\
2829 vput vexpr es substr $es 0 3
2831 xcall bail "attach 3-3"
2833 echo "~^ attachment remove ./.tattach"; read es;\
2834 vput vexpr es substr $es 0 3
2836 xcall bail "attach 3-4"
2838 echo "~^attachment list"; read es;\
2839 vput vexpr es substr $es 0 3
2841 xcall bail "attach 3-5"
2845 echo "~^attachment insert ./.tattach=latin1";\
2846 read hl; echo $hl; call xerr "$hl" "attach 4-1"
2847 echo "~^attachment insert ./.tattach=latin1";\
2848 read hl; echo $hl; call xerr "$hl" "attach 4-2"
2849 echo "~^attachment list";\
2850 read es; echo $es;call xerr "$es" "attach 4-3"
2852 echo "~^ attachment remove .tattach"; read es;\
2853 vput vexpr es substr $es 0 3
2855 xcall bail "attach 4-4 $es"
2857 echo "~^attachment remove-at T"; read es;\
2858 vput vexpr es substr $es 0 3
2860 xcall bail "attach 4-5"
2862 echo "~^attachment remove ./.tattach"; read es;\
2863 call xerr $es "attach 4-6"
2864 echo "~^attachment remove ./.tattach"; read es;\
2865 call xerr $es "attach 4-7"
2866 echo "~^ attachment remove ./.tattach"; read es;\
2867 vput vexpr es substr $es 0 3
2869 xcall bail "attach 4-8 $es"
2871 echo "~^attachment list"; read es;\
2872 vput vexpr es substr $es 0 3
2874 xcall bail "attach 4-9"
2878 echo "~^attachment insert ./.tattach=latin1";\
2879 read hl; echo $hl; call xerr "$hl" "attach 5-1"
2880 echo "~^attachment insert ./.tattach=latin1";\
2881 read hl; echo $hl; call xerr "$hl" "attach 5-2"
2882 echo "~^attachment insert ./.tattach=latin1";\
2883 read hl; echo $hl; call xerr "$hl" "attach 5-3"
2884 echo "~^attachment list";\
2885 read es; echo $es;call xerr "$es" "attach 5-4"
2888 echo "~^attachment remove-at 3"; read es;\
2889 call xerr $es "attach 5-5"
2890 echo "~^attachment remove-at 3"; read es;\
2891 vput vexpr es substr $es 0 3
2893 xcall bail "attach 5-6"
2895 echo "~^attachment remove-at 2"; read es;\
2896 call xerr $es "attach 5-7"
2897 echo "~^attachment remove-at 2"; read es;\
2898 vput vexpr es substr $es 0 3
2900 xcall bail "attach 5-8"
2902 echo "~^attachment remove-at 1"; read es;\
2903 call xerr $es "attach 5-9"
2904 echo "~^attachment remove-at 1"; read es;\
2905 vput vexpr es substr $es 0 3
2907 xcall bail "attach 5-10"
2910 echo "~^attachment list"; read es;\
2911 vput vexpr es substr $es 0 3
2913 xcall bail "attach 5-11"
2917 echo "~^attachment insert ./.tattach=latin1";\
2918 read hl; echo $hl; call xerr "$hl" "attach 6-1"
2919 echo "~^attachment insert ./.tattach=latin1";\
2920 read hl; echo $hl; call xerr "$hl" "attach 6-2"
2921 echo "~^attachment insert ./.tattach=latin1";\
2922 read hl; echo $hl; call xerr "$hl" "attach 6-3"
2923 echo "~^attachment list";\
2924 read es; echo $es;call xerr "$es" "attach 6-4"
2927 echo "~^attachment remove-at 1"; read es;\
2928 call xerr $es "attach 6-5"
2929 echo "~^attachment remove-at 1"; read es;\
2930 call xerr $es "attach 6-6"
2931 echo "~^attachment remove-at 1"; read es;\
2932 call xerr $es "attach 6-7"
2933 echo "~^attachment remove-at 1"; read es;\
2934 vput vexpr es substr $es 0 3
2936 xcall bail "attach 6-8"
2939 echo "~^attachment list"; read es;\
2940 vput vexpr es substr $es 0 3
2942 xcall bail "attach 6-9"
2954 echo on-compose-enter, mailx-command<$mailx-command>
2955 alternates alter1@exam.ple alter2@exam.ple
2957 set autocc='alter1@exam.ple alter2@exam.ple'
2958 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2959 echo mailx-subject<$mailx-subject>
2960 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2961 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2962 mailx-raw-bcc<$mailx-raw-bcc>
2963 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2964 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2967 echo on-compose-leave, mailx-command<$mailx-command>
2969 eval alternates $al alter3@exam.ple alter4@exam.ple
2971 set autobcc='alter3@exam.ple alter4@exam.ple'
2972 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2973 echo mailx-subject<$mailx-subject>
2974 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2975 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2976 mailx-raw-bcc<$mailx-raw-bcc>
2977 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2978 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2981 echo on-compose-cleanup, mailx-command<$mailx-command>
2984 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
2985 echo mailx-subject<$mailx-subject>
2986 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
2987 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
2988 mailx-raw-bcc<$mailx-raw-bcc>
2989 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
2990 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
2992 wysh set on-compose-splice=t_ocs \
2993 on-compose-enter=t_oce on-compose-leave=t_ocl \
2994 on-compose-cleanup=t_occ
3000 printf 'm this-goes@nowhere\nbody\n!.\n' |
3001 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3002 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3004 ${cat} .
/.tall
>> "${MBOX}"
3005 check behave
:compose_hooks-1
0 "${MBOX}" '3667291468 10101'
3008 printf 'm this-goes@nowhere\nbody\n!.\n' |
3009 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3010 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3012 ${cat} .
/.tall
>> "${MBOX}"
3013 check behave
:compose_hooks-2
0 "${MBOX}" '1746765053 12535'
3015 # Some state machine stress, shell compose hook, localopts for hook, etc.
3016 # readctl in child. ~r as HERE document
3018 printf 'm ex@am.ple\nbody\n!.\nvar t_oce t_ocs t_ocs_sh t_ocl t_occ autocc' |
3019 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3020 -Smta=.
/.tsendmail.sh \
3023 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3026 vput vexpr es substr "$1" 0 1
3031 define read_mline_res {
3032 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3033 echo $len/$es/$^ERRNAME: $hl
3034 if [ $es -ne $^ERR-NONE ]
3035 xcall bail read_mline_res
3037 \xcall read_mline_res
3041 vput vexpr i + 1 "$2"
3043 vput vexpr j % $i 10
3050 eval \\$j _work $1 $i
3053 vput vexpr i + $i "$1"
3057 read line;wysh set es=$? en=$^ERRNAME ; echo read:$es/$en: $line
3058 if [ "${es}" -ne -1 ]
3061 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3066 echo "~^header list"; read hl; echo $hl;\
3067 vput vexpr es substr "$hl" 0 1
3069 xcall bail "header list"
3072 call _work 1; echo $?
3073 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3074 read es; echo $es; vput vexpr es substr "$es" 0 1
3076 xcall bail "be diet"
3078 echo "~^header insert cc <splice2@exam.ple>";\
3079 read es; echo $es; vput vexpr es substr "$es" 0 1
3081 xcall bail "be diet2"
3084 call _work 2; echo $?
3085 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3086 read es; echo $es;vput vexpr es substr "$es" 0 1
3088 xcall bail "be juicy"
3090 echo "~^header insert bcc juice2@exam.ple";\
3091 read es; echo $es;vput vexpr es substr "$es" 0 1
3093 xcall bail "be juicy2"
3095 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3096 read es; echo $es;vput vexpr es substr "$es" 0 1
3098 xcall bail "be juicy3"
3100 echo "~^header insert bcc juice4@exam.ple";\
3101 read es; echo $es;vput vexpr es substr "$es" 0 1
3103 xcall bail "be juicy4"
3106 echo "~^header remove-at bcc 3";\
3107 read es; echo $es;vput vexpr es substr "$es" 0 1
3109 xcall bail "remove juicy5"
3111 echo "~^header remove-at bcc 2";\
3112 read es; echo $es;vput vexpr es substr "$es" 0 1
3114 xcall bail "remove juicy6"
3116 echo "~^header remove-at bcc 3";\
3117 read es; echo $es;vput vexpr es substr "$es" 0 3
3119 xcall bail "failed to remove-at"
3121 # Add duplicates which ought to be removed!
3122 echo "~^header insert bcc juice4@exam.ple";\
3123 read es; echo $es;vput vexpr es substr "$es" 0 1
3125 xcall bail "be juicy4-1"
3127 echo "~^header insert bcc juice4@exam.ple";\
3128 read es; echo $es;vput vexpr es substr "$es" 0 1
3130 xcall bail "be juicy4-2"
3132 echo "~^header insert bcc juice4@exam.ple";\
3133 read es; echo $es;vput vexpr es substr "$es" 0 1
3135 xcall bail "be juicy4-3"
3140 call _work 3; echo $?
3142 vput ! i echo just knock if you can hear me;\
3144 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3146 echon shell-cmd says $?/$^ERRNAME: $i
3147 echo "~x will not become interpreted, we are reading until __EOT"
3149 read r_status; echo "~~r status output: $r_status"
3150 echo "~:echo $? $! $^ERRNAME"
3152 echo "~~r status from parent: $r_status"
3155 call _work 4; echo $?
3156 vput cwd cwd;echo cwd:$?
3157 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3161 call _work 5; echo $?
3162 echo "~^header show MAILX-Command"; read es;\
3163 call xerr $es "t_header 1000"; call read_mline_res
3164 echo "~^header show MAILX-raw-TO"; read es;\
3165 call xerr $es "t_header 1001"; xcall read_mline_res
3167 echoerr IT IS WRONG IF YOU SEE THIS
3170 echo on-compose-enter, mailx-command<$mailx-command>
3171 set t_oce autobcc=oce@exam.ple
3172 alternates alter1@exam.ple alter2@exam.ple
3174 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3175 echo mailx-subject<$mailx-subject>
3176 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3177 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3178 mailx-raw-bcc<$mailx-raw-bcc>
3179 echo mailx-orig-from<$mailx-orig-from> \
3180 mailx-orig-to<$mailx-orig-to> \
3181 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3184 echo on-compose-leave, mailx-command<$mailx-command>
3185 set t_ocl autocc=ocl@exam.ple
3187 alternates alter3@exam.ple alter4@exam.ple
3189 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3190 echo mailx-subject<$mailx-subject>
3191 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3192 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3193 mailx-raw-bcc<$mailx-raw-bcc>
3194 echo mailx-orig-from<$mailx-orig-from> \
3195 mailx-orig-to<$mailx-orig-to> \
3196 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3199 echo on-compose-cleanup, mailx-command<$mailx-command>
3200 set t_occ autocc=occ@exam.ple
3203 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3204 echo mailx-subject<$mailx-subject>
3205 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3206 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3207 mailx-raw-bcc<$mailx-raw-bcc>
3208 echo mailx-orig-from<$mailx-orig-from> \
3209 mailx-orig-to<$mailx-orig-to> \
3210 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3212 wysh set on-compose-splice=t_ocs \
3213 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
3214 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3215 on-compose-enter=t_oce on-compose-leave=t_ocl \
3216 on-compose-cleanup=t_occ
3218 ex0_test behave
:compose_hooks-3
3219 ${cat} .
/.tnotes
>> "${MBOX}"
3221 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3223 # Reply, forward, resend, Resend
3226 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3227 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3228 -Smta=.
/.tsendmail.sh
3231 echo start: $? $! $^ERRNAME
3233 echo File: $? $! $^ERRNAME;echo;echo
3235 this is content of reply 1
3237 echo reply 1: $? $! $^ERRNAME;echo;echo
3239 this is content of Reply 1 2
3241 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3242 forward 1 fwdex@am.ple
3243 this is content of forward 1
3245 echo forward 1: $? $! $^ERRNAME;echo;echo
3246 resend 1 2 resendex@am.ple
3247 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3248 Resend 1 2 Resendex@am.ple
3249 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3251 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3252 -Smta=.
/.tsendmail.sh \
3255 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3258 vput vexpr es substr "$1" 0 1
3263 define read_mline_res {
3264 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3265 echo mline_res:$len/$es/$^ERRNAME: $hl
3266 if [ $es -ne $^ERR-NONE ]
3267 xcall bail read_mline_res
3269 \xcall read_mline_res
3273 echo "~^header show $1"; read es;\
3274 call xerr $es "work_hl $1"; echo $1; call read_mline_res
3282 echo t_ocs version $ver
3283 echo "~^header list"; read hl; echo $hl;\
3284 echoerr the header list is $hl;\
3285 call xerr "$hl" "header list"
3286 eval vpospar set $hl
3289 echoerr IT IS WRONG IF YOU SEE THIS
3292 echo on-XY-enter, mailx-command<$mailx-command>
3293 set t_oce autobcc=oce@exam.ple
3294 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3295 echo mailx-subject<$mailx-subject>
3296 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3297 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3298 mailx-raw-bcc<$mailx-raw-bcc>
3299 echo mailx-orig-from<$mailx-orig-from> \
3300 mailx-orig-to<$mailx-orig-to> \
3301 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3304 echo on-XY-leave, mailx-command<$mailx-command>
3305 set t_ocl autocc=ocl@exam.ple
3306 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3307 echo mailx-subject<$mailx-subject>
3308 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3309 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3310 mailx-raw-bcc<$mailx-raw-bcc>
3311 echo mailx-orig-from<$mailx-orig-from> \
3312 mailx-orig-to<$mailx-orig-to> \
3313 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3316 echo on-XY-cleanup, mailx-command<$mailx-command>
3317 set t_occ autocc=occ@exam.ple
3318 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3319 echo mailx-subject<$mailx-subject>
3320 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3321 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3322 mailx-raw-bcc<$mailx-raw-bcc>
3323 echo mailx-orig-from<$mailx-orig-from> \
3324 mailx-orig-to<$mailx-orig-to> \
3325 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3327 wysh set on-compose-splice=t_ocs \
3328 on-compose-enter=t_oce on-compose-leave=t_ocl \
3329 on-compose-cleanup=t_occ \
3330 on-resend-enter=t_oce on-resend-cleanup=t_occ
3332 ex0_test behave
:compose_hooks-4
3333 ${cat} .
/.tnotes
>> "${MBOX}"
3335 check behave
:compose_hooks-4
- "${MBOX}" '2711778338 7516'
3340 t_behave_message_injections
() {
3342 TRAP_EXIT_ADDONS
="./.t*"
3344 ${cat} <<-_EOT > ./.tsendmail.sh
3346 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3349 chmod 0755 .
/.tsendmail.sh
3351 echo mysig
> .
/.tmysig
3353 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3354 -Smessage-inject-head=head-inject \
3355 -Smessage-inject-tail=tail-inject \
3356 -Ssignature=.
/.tmysig \
3357 ex@am.ple
> .
/.tall
2>&1
3358 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3359 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3361 ${cat} <<-_EOT > ./.template
3365 Subject: This subject is
3367 Body, body, body me.
3369 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3370 -Smessage-inject-head=head-inject \
3371 -Smessage-inject-tail=tail-inject \
3372 -Ssignature=.
/.tmysig \
3374 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3375 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3380 t_behave_mime_types_load_control
() {
3382 TRAP_EXIT_ADDONS
="./.t*"
3384 ${cat} <<-_EOT > ./.tmts1
3385 @ application/mathml+xml mathml
3387 ${cat} <<-_EOT > ./.tmts2
3388 @ x-conference/x-cooltalk ice
3390 @ application/aga-aga aga
3393 ${cat} <<-_EOT > ./.tmts1.mathml
3394 <head>nonsense ML</head>
3396 ${cat} <<-_EOT > ./.tmts2.ice
3399 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3400 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3414 ' "${MBOX}" "${MBOX}" |
3416 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3418 ex0_test behave
:mime_types_load_control
3420 ${cat} "${MBOX}" >> .
/.tout
3421 check behave
:mime_types_load_control-1
- .
/.tout
'529577037 2474'
3423 echo type |
${MAILX} ${ARGS} -R \
3424 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3425 -f "${MBOX}" >> .
/.tout
2>&1
3426 check behave
:mime_types_load_control-2
0 .
/.tout
'2025926659 3558'
3432 have_feat smime ||
{
3433 echo 'behave:s/mime: unsupported, skipped'
3438 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
3439 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
3440 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
3442 printf 'behave:s/mime: .. generating test key and certificate ..\n'
3443 ${cat} <<-_EOT > ./.t.conf
3446 default_keyfile = keyfile.pem
3447 distinguished_name = req_distinguished_name
3448 attributes = req_attributes
3452 [ req_distinguished_name ]
3459 emailAddress = test@localhost
3464 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
3465 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
3466 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
3469 printf 'behave:s/mime:sign/verify: '
3470 echo bla |
${MAILX} ${ARGS} \
3471 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3472 -Ssmime-sign -Sfrom=test@localhost \
3473 -s 'S/MIME test' .
/.VERIFY
3474 if [ $?
-eq 0 ]; then
3485 /^Content-Description: /{ skip = 2; print; next }
3486 /^$/{ if(skip) --skip }
3489 < .
/.VERIFY
> "${MBOX}"
3490 check behave
:s
/mime
:sign
/verify
:checksum
- "${MBOX}" '2900817158 648'
3492 printf 'behave:s/mime:sign/verify:verify '
3493 printf 'verify\nx\n' |
3495 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3496 -Ssmime-sign -Sfrom=test@localhost \
3498 -f .
/.VERIFY
>/dev
/null
2>&1
3499 if [ $?
-eq 0 ]; then
3508 printf 'behave:s/mime:sign/verify:disproof-1 '
3509 if openssl smime
-verify -CAfile .
/.tcert.pem \
3510 -in .
/.VERIFY
>/dev
/null
2>&1; then
3519 # (signing +) encryption / decryption
3520 ${cat} <<-_EOT > ./.tsendmail.sh
3522 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
3524 chmod 0755 .
/.tsendmail.sh
3526 printf 'behave:s/mime:encrypt+sign: '
3529 -Ssmime-force-encryption \
3530 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3531 -Smta=.
/.tsendmail.sh \
3532 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3533 -Ssmime-sign -Sfrom=test@localhost \
3534 -s 'S/MIME test' recei@ver.com
3535 if [ $?
-eq 0 ]; then
3539 printf 'error: encrypt+sign failed\n'
3542 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3543 check behave
:s
/mime
:encrypt
+sign
:checksum
- "${MBOX}" '1937410597 327'
3545 printf 'behave:s/mime:decrypt+verify: '
3546 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
3548 -Ssmime-force-encryption \
3549 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3550 -Smta=.
/.tsendmail.sh \
3551 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3552 -Ssmime-sign -Sfrom=test@localhost \
3554 -f .
/.ENCRYPT
>/dev
/null
2>&1
3555 if [ $?
-eq 0 ]; then
3564 /^Content-Description: /{ skip = 2; print; next }
3565 /^$/{ if(skip) --skip }
3568 < .
/.DECRYPT
> "${MBOX}"
3569 check behave
:s
/mime
:decrypt
+verify
:checksum
- "${MBOX}" '1720739247 931'
3571 printf 'behave:s/mime:decrypt+verify:disproof-1: '
3572 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
3573 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
3580 printf "behave:s/mime:encrypt: "
3581 echo bla |
${MAILX} ${ARGS} \
3582 -Ssmime-force-encryption \
3583 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3584 -Smta=.
/.tsendmail.sh \
3585 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3586 -Sfrom=test@localhost \
3587 -s 'S/MIME test' recei@ver.com
3588 if [ $?
-eq 0 ]; then
3595 # Same as behave:s/mime:encrypt+sign:checksum above
3596 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3597 check behave
:s
/mime
:encrypt
:checksum
- "${MBOX}" '1937410597 327'
3600 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
3601 -Ssmime-force-encryption \
3602 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3603 -Smta=.
/.tsendmail.sh \
3604 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3605 -Sfrom=test@localhost \
3607 -f .
/.ENCRYPT
>/dev
/null
2>&1
3608 check behave
:s
/mime
:decrypt
0 "./.DECRYPT" '2624716890 422'
3610 printf 'behave:s/mime:decrypt:disproof-1: '
3611 if openssl smime
-decrypt -inkey .
/.tkey.pem \
3612 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
3622 t_behave_maildir
() {
3624 TRAP_EXIT_ADDONS
="./.t*"
3628 while [ ${i} -lt 112 ]; do
3629 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
3630 "${MBOX}" "${i}" "${i}"
3633 ) |
${MAILX} ${ARGS}
3634 check behave
:maildir-1
0 "${MBOX}" '1140119864 13780'
3640 ' "${MBOX}" .tmdir1 .tmdir1 |
3641 ${MAILX} ${ARGS} -Snewfolders=maildir
> .tlst
3642 check behave
:maildir-2
0 .tlst
'1797938753 9103'
3645 copy * "maildir://%s"
3648 ' "${MBOX}" .tmdir2 .tmdir2 |
3649 ${MAILX} ${ARGS} > .tlst
3650 check behave
:maildir-3
0 .tlst
'1155631089 9113'
3652 printf 'File "maildir://%s"
3656 ' .tmdir2 .tmbox1 .tmbox1 |
3657 ${MAILX} ${ARGS} > .tlst
3658 check behave
:maildir-4
0 .tmbox1
'2646131190 13220'
3659 check behave
:maildir-5
- .tlst
'3701297796 9110'
3661 # only the odd (even)
3663 printf 'File "maildir://%s"
3666 while [ ${i} -lt 112 ]; do
3668 [ ${j} -eq 1 ] && printf '%s ' "${i}"
3675 ) |
${MAILX} ${ARGS} > .tlst
3676 check behave
:maildir-6
0 .tmbox2
'142890131 6610'
3677 check behave
:maildir-7
- .tlst
'960096773 4573'
3680 printf 'file "maildir://%s"
3683 while [ ${i} -lt 112 ]; do
3685 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
3693 ' .tmbox2 .tmbox2 .tmdir2
3694 ) | ${MAILX} ${ARGS} > .tlst
3695 check behave:maildir-8 0 .tmbox2 '3806905791 13100'
3696 ${sed} 2d < .tlst > .tlstx
3697 check behave:maildir-9 - .tlstx '4216815295 13645'
3702 t_behave_mass_recipients() {
3704 TRAP_EXIT_ADDONS=".
/.t
*"
3706 ${cat} <<-_EOT > ./.tsendmail.sh
3708 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3711 chmod 0755 ./.tsendmail.sh
3713 ${cat} <<'__EOT__' > ./.trc
3715 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3718 wysh set nr=$1 hn=$2
3719 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
3721 xcall bail "ins_addr
$hn 1-$nr"
3723 vput vexpr nr + $nr 1
3724 if [ "$nr" -le "$maximum" ]
3725 xcall ins_addr $nr $hn
3729 wysh set nr=$1 hn=$2
3730 alternates $hn$nr@$hn
3731 vput vexpr nr + $nr 2
3732 if [ "$nr" -le "$maximum" ]
3733 xcall bld_alter $nr $hn
3743 if [ "$t_remove" != '' ]
3748 set on-compose-splice=t_ocs on-compose-leave=t_ocl
3752 printf 'm this-goes@nowhere\nbody\n!.\n' |
3753 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3754 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3756 ${cat} ./.tall >> "${MBOX}"
3757 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
3760 printf 'm this-goes@nowhere\nbody\n!.\n' |
3761 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3762 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3764 ${cat} ./.tall >> "${MBOX}"
3765 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
3771 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
3772 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
3773 # Note we unfortunately need to place some statements without proper
3774 # indentation because of continuation problems
3778 # MIME encoding (QP) stress message body
3780 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
3781 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
3782 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
3783 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
3784 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
3785 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
3786 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
3787 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
3788 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
3789 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
3790 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
3791 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
3792 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
3793 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
3794 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
3795 "auf den zeilen vorher.
\r\n"\
3796 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
3798 "Die letzte Zeile war nur ein Punkt.
\r\n"\
3800 "Das waren deren zwei.
\r\n"\
3802 "Die letzte Zeile war ein Leerschritt.
\n"\
3803 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
3806 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
3808 "Das waren deren zwei. ditto.
\n"\
3810 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
3811 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
3812 "auf den zeilen vorher.
\n"\
3814 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
3815 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
3817 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3819 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3821 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3823 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3825 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
3827 "QP am Zeilenende über soft-nl hinweg
\n"\
3828 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3830 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3832 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3834 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
3836 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
3838 "Die letzte Zeile war ein Leerschritt.
\n"\
3842 # MIME encoding (QP) stress message subject
3843 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
3844 adadaddsssssssddddddddddddddddddddd\
3845 ddddddddddddddddddddddddddddddddddd\
3846 ddddddddddddddddddddddddddddddddddd\
3847 dddddddddddddddddddd Hallelulja? Od\
3848 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
3849 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
3850 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
3851 fffffffffffffffffffffffffffffffffff\
3852 fffffffffffffffffffff ggggggggggggg\
3853 ggggggggggggggggggggggggggggggggggg\
3854 ggggggggggggggggggggggggggggggggggg\
3855 ggggggggggggggggggggggggggggggggggg\
3858 # Three tests for MIME encoding and (a bit) content classification.
3859 # At the same time testing -q FILE, < FILE and -t FILE
3862 < "${BODY}" ${MAILX} ${ARGS} ${ADDARG_UNI} \
3863 -a "${BODY}" -s "${SUB}" "${MBOX}"
3864 check content
:001 0 "${MBOX}" '1145066634 6654'
3867 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3868 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
3869 check content
:002 0 "${MBOX}" '1145066634 6654'
3872 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
3874 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
3875 check content:003 0 "${MBOX}" '1145066634 6654'
3877 # Test for [260e19d] (Juergen Daubert)
3879 echo body | ${MAILX} ${ARGS} "${MBOX}"
3880 check content
:004 0 "${MBOX}" '2917662811 98'
3882 # Sending of multiple mails in a single invocation
3884 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
3885 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
3887 ) |
${MAILX} ${ARGS} ${ADDARG_UNI}
3888 check content
:005 0 "${MBOX}" '2098659767 358'
3892 # "Test for" [d6f316a] (Gavin Troy)
3894 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
3895 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
3896 check content:006 0 "${MBOX}" '2099098650 122'
3897 check content:006-1 - "${BODY}" '794542938 174'
3899 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
3902 for(i = 0; i < 10000; ++i)
3904 #printf "\xF0\x90\x87\x90"
3905 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
3906 check content
:007 0 "${MBOX}" '534262374 61816'
3908 ## Test some more corner cases for header bodies (as good as we can today) ##
3912 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
3913 -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̲' \
3915 check content
:008 0 "${MBOX}" '3370931614 375'
3917 # Single word (overlong line split -- bad standard! Requires injection of
3918 # artificial data!! But can be prevented by using RFC 2047 encoding)
3920 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
3921 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
3922 check content:009 0 "${MBOX}" '489922370 1718'
3924 # Combination of encoded words, space and tabs of varying sort
3926 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3927 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
3928 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
3929 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
3930 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
3931 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
3933 check content:010 0 "${MBOX}" '1676887734 591'
3935 # Overlong multibyte sequence that must be forcefully split
3936 # todo This works even before v15.0, but only by accident
3938 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3939 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3940 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3941 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
3943 check content:011 0 "${MBOX}" '3029301775 659'
3947 echo | ${MAILX} ${ARGS} \
3948 -s "1-1 B2 B3 B4 B5 B6 B\
3949 1-2 B2 B3 B4 B5 B6 B\
3950 1-3 B2 B3 B4 B5 B6 B\
3951 1-4 B2 B3 B4 B5 B6 B\
3952 1-5 B2 B3 B4 B5 B6 B\
3953 1-6 B2 B3 B4 B5 B6
" \
3955 check content:012 0 "${MBOX}" '4126167195 297'
3957 # Leading and trailing WS
3959 echo | ${MAILX} ${ARGS} \
3960 -s " 2-1 B2 B3 B4 B5 B6 B\
3961 1-2 B2 B3 B4 B5 B6 B\
3962 1-3 B2 B3 B4 B5 B6 B\
3963 1-4 B2 B3 B4 B5 B6
" \
3965 check content:013 0 "${MBOX}" '3600624479 236'
3967 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
3968 # have a (better) test framework materialize a quick shot
3970 TRAP_EXIT_ADDONS=./.ttt
3972 mkdir ./.ttt || exit 1
3976 : > 'diet\ is \curd.txt'
3977 : > 'diet "is
" curd.txt'
3979 : > 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
3980 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3981 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3982 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3984 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3985 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
3986 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
3987 -a ./.ttt/höde-tröge.txt \
3988 -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 \
3989 -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 \
3990 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3991 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3993 check content:014-1 0 "${MBOX}" '684985954 3092'
3995 # `resend' test, reusing $MBOX
3997 printf "Resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3998 check content:014-2 0 "${BODY}" '684985954 3092'
4001 printf "resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4002 check content:014-3 0 "${BODY}" '3130352658 3148'
4008 # if have_feat devel; then
4009 # ARGS="${ARGS} -Smemdebug"
4016 if [ -z "${CHECK_ONLY}" ]; then
4022 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'