2 #@ Synopsis: ./cc-test.sh [--check-only s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ The latter generates output files.
5 #@ TODO _All_ the tests should happen in a temporary subdir.
8 # Instead of figuring out the environment in here, require a configured build
9 # system and include that! Our makefile and configure ensure that this test
10 # does not run in the configured, but the user environment nonetheless!
11 if [ -f .
/mk-config.ev
]; then
13 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
14 MAILX__CC_TEST_RUNNING
=1
15 export MAILX__CC_TEST_RUNNING
16 exec "${SHELL}" "${0}" "${@}"
19 echo >&2 'S-nail/S-mailx is not configured.'
20 echo >&2 'This test script requires the shell environment that only the'
21 echo >&2 'configuration script can figure out, even if it will be used to'
22 echo >&2 'test a different binary than the one that would be produced!'
26 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
27 # such is a compile-time variable
28 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
29 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
30 ADDARG_UNI
=-Sttycharset=UTF-8
35 #UTF8_LOCALE= autodetected unless set
37 # Note valgrind has problems with FDs in forked childs, which causes some tests
38 # to fail (the FD is rewound and thus will be dumped twice)
40 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
42 ## -- (>8 -- 8<) -- ##
44 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
49 printf >&2 -- "${fmt}\\n" "${@}"
54 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
58 # Wed Oct 2 01:50:07 UTC 1996
59 SOURCE_DATE_EPOCH
=844221007
61 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
62 unset POSIXLY_CORRECT LOGNAME USER
65 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
66 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
70 CHECK_ONLY
= MAE_TEST
= MAILX
=
71 if [ "${1}" = --check-only ]; then
74 [ -x "${MAILX}" ] || usage
76 elif [ "${1}" = --mae-test ]; then
79 [ -x "${MAILX}" ] || usage
83 MAILX
="${MEMTESTER}${MAILX}"
86 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
87 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
88 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
90 \if [ "${ttycharset}" @i=% utf ]
97 \eval xcall cset_test "${@}"
101 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
102 en_US.utf8 en_US.UTF-8
104 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
106 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
107 UTF8_LOCALE
=`locale -a | { m=
109 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
111 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
125 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
126 trap "exit 1" HUP INT TERM
129 # Test all configs TODO doesn't cover all *combinations*, stupid!
133 NOTME["OPT_AUTOCC"] = 1
134 NOTME["OPT_DEBUG"] = 1
135 NOTME["OPT_DEVEL"] = 1
136 NOTME["OPT_NOEXTMD5"] = 1
137 NOTME["OPT_ASAN_ADDRESS"] = 1
138 NOTME["OPT_ASAN_MEMORY"] = 1
139 NOTME["OPT_FORCED_STACKPROT"] = 1
140 NOTME["OPT_NOMEMDBG"] = 1
141 NOTME["OPT_NYD2"] = 1
144 /^[[:space:]]*OPT_/ {
145 sub(/^[[:space:]]*/, "")
146 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
147 # does not seem to be a compliant escape for =
149 $1 = substr($1, 1, index($1, "=") - 1)
155 # Doing this completely sequentially and not doing make distclean in
156 # between runs should effectively result in lesser compilations.
157 # It is completely dumb nonetheless... TODO
158 for (j = 1; j < i; ++j) {
159 for (k = 1; k < j; ++k)
161 for (k = j; k < i; ++k)
163 printf "OPT_AUTOCC=1\n"
165 for (j = 1; j < i; ++j) {
166 for (k = 1; k < j; ++k)
168 for (k = j; k < i; ++k)
170 printf "OPT_AUTOCC=1\n"
173 for (j = 1; j < i; ++j) {
174 for (k = 1; k < j; ++k)
176 for (k = j; k < i; ++k)
178 printf "OPT_AUTOCC=1\n"
179 printf "OPT_DEBUG=1\n"
181 for (j = 1; j < i; ++j) {
182 for (k = 1; k < j; ++k)
184 for (k = j; k < i; ++k)
186 printf "OPT_AUTOCC=1\n"
187 printf "OPT_DEBUG=1\n"
190 printf "CONFIG=NULL OPT_AUTOCC=0\n"
191 printf "CONFIG=NULL OPT_AUTOCC=1\n"
192 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
193 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
194 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
195 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
196 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
197 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
198 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
199 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
200 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
201 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
202 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
203 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
206 printf "\n\n##########\n$c\n"
207 printf "\n\n##########\n$c\n" >&2
208 sh
-c "${MAKE} ${c} all test"
214 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
215 ${grep} +${1} ) >/dev
/null
2>&1
219 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
221 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
228 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
229 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
230 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
231 csum
="`${cksum} < ${f}`"
232 if [ "${csum}" = "${s}" ]; then
233 printf '%s: ok\n' "${tid}"
236 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
238 if [ -n "${MAE_TEST}" ]; then
239 x
=`echo ${tid} | ${tr} "/:=" "__-"`
240 ${cp} -f "${f}" ./mae-test-"${x}"
246 printf '%s: error: %s\n' ${1} "${2}"
250 # $1=test name [$2=status]
252 [ ${#} -gt 1 ] && __qm__=${2}
253 if [ ${__qm__} -ne 0 ]; then
254 err $1 'unexpected non-0 exit status'
256 printf '%s: ok\n' "${1}"
261 # $1=test name [$2=status]
263 [ ${#} -gt 1 ] && __qm__=${2}
264 if [ ${__qm__} -eq 0 ]; then
265 err $1 'unexpected 0 exit status'
267 printf '%s: ok\n' "${1}"
271 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
273 echo "$
((${1} + ${2}))"
277 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
281 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
283 echo "$
((${1} % ${2}))"
287 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
292 # Basic (easily testable) behaviour tests
294 t_behave_X_opt_input_command_stack
298 t_behave_input_inject_semicolon_seq
299 t_behave_commandalias
302 t_behave_macro_param_shift
314 # FIXME t_behave_mlist
317 t_behave_record_a_resend
320 t_behave_compose_hooks
321 t_behave_message_injections
322 t_behave_mime_types_load_control
327 t_behave_mass_recipients
328 t_behave_lreply_futh_rth_etc
329 t_behave_iconv_mbyte_base64
330 t_behave_iconv_mainbody
333 t_behave_X_opt_input_command_stack() {
334 t_prolog t_behave_X_opt_input_command_stack
336 ${cat} <<- '__EOT' > "${BODY}"
344 echo "define mac1
{";\
345 echo " echo mac1-1 via1 \
$0";\
347 echo " echo mac1-2
";\
349 echo " echo mac1-3
";\
352 echo "define mac2
{";\
353 echo " echo mac2-1 via1 \
$0";\
355 echo " echo mac2-2
";\
361 echo echo 1-1-1 via1 \
$0;\
373 # The -X option supports multiline arguments, and those can internally use
374 # reverse solidus newline escaping. And all -X options are joined...
376 < "${BODY}" ${MAILX} ${ARGS} \
391 echo "define mac1 {";\
392 echo " echo mac1-1 via2 \$0";\
394 echo " echo mac1-2";\
396 echo " echo mac1-3";\
399 echo "define mac2 {";\
400 echo " echo mac2-1 via2 \$0";\
402 echo " echo mac2-2";\
408 echo echo 1-1-1 via2 \$0;\
422 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
427 t_behave_X_errexit
() {
428 t_prolog t_behave_X_errexit
430 ${cat} <<- '__EOT' > "${BODY}"
436 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
437 -X'echo one' -X' echos nono ' -X'echo two' \
439 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
441 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
443 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
445 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
447 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
451 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
452 -X'echo one' -X' echos nono ' -X'echo two' \
454 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
456 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
458 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
460 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
462 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
464 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
466 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
468 ## Repeat 4-7 with ignerr set
470 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
472 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
473 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
475 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
477 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
479 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
481 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
483 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
485 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
487 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
492 t_behave_S_freeze() {
493 t_prolog t_behave_S_freeze
497 # Test basic assumption
498 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
499 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
501 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
504 ${cat} <<- '__EOT' > "${BODY}"
509 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
510 -Snoasksub -Sasksub -Snoasksub \
511 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
513 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
515 ${cat} <<- '__EOT' > "${BODY}"
520 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
521 -Snoasksub -Sasksub \
522 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
524 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
527 ${cat} <<- '__EOT' > "${BODY}"
528 echo dietcurd<$dietcurd>
530 echo dietcurd<$dietcurd>
532 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
533 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
534 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
535 -X'echo dietcurd<$dietcurd>' \
537 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
539 ${cat} <<- '__EOT' > "${BODY}"
540 echo dietcurd<$dietcurd>
542 echo dietcurd<$dietcurd>
544 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
545 -Sdietcurd=strawberry
-Snodietcurd \
546 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
547 -X'echo dietcurd<$dietcurd>' \
549 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
551 # TODO once we have a detached one with env=1..
552 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
553 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
555 ${cat} <<- '__EOT' > "${BODY}"
556 !echo "shell says TERM<$TERM>"
558 !echo "shell says TERM<$TERM>"
560 !echo "shell says TERM<$TERM>"
562 !echo "shell says TERM<$TERM>"
564 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
565 -STERM=strawberry
-SnoTERM -STERM=vanilla \
566 -X'echo mail<$TERM>' -X'unset TERM' \
567 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
569 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
571 ${cat} <<- '__EOT' > "${BODY}"
572 !echo "shell says TERM<$TERM>"
574 !echo "shell says TERM<$TERM>"
576 !echo "shell says TERM<$TERM>"
578 !echo "shell says TERM<$TERM>"
580 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
581 -STERM=strawberry
-SnoTERM \
582 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
583 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
585 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
593 t_prolog t_behave_wysh
595 ${cat} <<- '__EOT' > "${BODY}"
614 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
615 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
616 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
618 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
619 echo a$'\u0041\u41\u0C1\U00000041\U41'c
642 echo a$'b\U0000000'dt
643 echo a$'b\U00000000'du
653 if [ -z "${UTF8_LOCALE}" ]; then
654 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
656 < "${BODY}" DIET=CURD TIED= \
657 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
658 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
661 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
662 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
667 t_behave_input_inject_semicolon_seq() {
668 t_prolog t_behave_input_inject_semicolon_seq
670 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
675 echon this_is_mymac;call mydeepmac;echon ';';
677 echon one';';call mymac;echon two";";call mymac;echo three$';';
679 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
681 echon one';';call mymac;echon two";";call mymac;echo three$';';
684 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
689 t_behave_commandalias() {
690 t_prolog t_behave_commandalias
692 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
693 commandalias echo echo hoho
697 commandalias XxX XxXx
698 commandalias XxXx XxXxX
699 commandalias XxXxX XxXxXx
700 commandalias XxXxXx echo huhu
701 commandalias XxXxXxX echo huhu
703 commandalias XxXxXx XxXxXxX
706 commandalias XxXxXx echo huhu
710 check behave:commandalias 0 "${MBOX}" '3694143612 31'
716 t_prolog t_behave_ifelse
718 # Nestable conditions test
719 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
741 if $dietcurd == 'yoho'
746 if $dietcurd @== 'Yoho'
751 if $dietcurd == 'Yoho'
756 if $dietcurd != 'yoho'
761 if $dietcurd @!= 'Yoho'
766 if $dietcurd != 'Yoho'
827 if $dietcurd == 'yohu'
829 elif $dietcurd == 'yoha'
831 elif $dietcurd == 'yohe'
833 elif $dietcurd == 'yoho'
835 if $dietcurd == 'yohu'
837 elif $dietcurd == 'yoha'
839 elif $dietcurd == 'yohe'
841 elif $dietcurd == 'yoho'
843 if $dietcurd == 'yohu'
845 elif $dietcurd == 'yoha'
847 elif $dietcurd == 'yohe'
849 elif $dietcurd == 'yoho'
998 set diet=abc curd=abc
1004 set diet=abc curd=abcd
1010 # 1. Shitty grouping capabilities as of today
1011 unset diet curd ndefined
1012 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1018 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1023 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1028 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1033 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1038 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1039 && [ no ] || [ yes ]
1044 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1049 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1054 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1059 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1064 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1069 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1074 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1079 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1084 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1089 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1095 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1101 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1106 # 2. Shitty grouping capabilities as of today
1107 unset diet curd ndefined
1108 if [ false || false || true ] && [ false || true ] && yes
1113 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1118 if [ 1 || 0 || 0 || 0 ]
1123 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1128 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1133 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1138 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1143 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1148 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1153 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1158 if 1 || 0 || 0 || 0 && 0
1163 if 1 || 0 || 0 || 0 && 1
1168 if 0 || 0 || 0 || 1 && 0
1173 if 0 || 0 || 0 || 1 && 1
1178 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1183 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1189 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1194 if $diet == 'yo' && $curd == 'ho' && $ndefined
1200 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1205 if $diet == 'yo' && $curd == 'ho' && $ndefined
1210 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1215 # Some more en-braced variables
1217 if ${diet} == ${curd}
1222 if ${diet} != ${curd}
1238 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1243 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1248 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1253 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1258 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1263 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1268 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1273 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1278 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1284 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1289 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1294 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1299 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1304 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1309 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1314 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1319 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1324 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1331 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1333 if have_feat regex; then
1334 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1336 if $dietcurd =~ '^yo.*'
1341 if $dietcurd =~ '^Yo.*'
1346 if $dietcurd @=~ '^Yo.*'
1351 if $dietcurd =~ '^yOho.+'
1356 if $dietcurd @!~ '.*Ho$'
1361 if $dietcurd !~ '.+yohO$'
1366 if [ $dietcurd @i!~ '.+yoho$' ]
1371 if ! [ $dietcurd @i=~ '.+yoho$' ]
1376 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1381 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1386 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1391 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1396 if ! ! ! $dietcurd !~ '.+yoho$'
1401 if ! ! ! $dietcurd =~ '.+yoho$'
1406 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1411 set diet=abc curd='^abc$'
1417 set diet=abc curd='^abcd$'
1425 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1427 printf 'behave:if-regex: unsupported, skipped\n'
1433 t_behave_localopts() {
1434 t_prolog t_behave_localopts
1436 # Nestable conditions test
1437 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1452 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1457 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1458 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1467 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1469 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1478 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1485 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1492 echo ----- $1: $2 -> $3 -> $4
1500 call llx
'call off' on on on
1501 call llx
'call off' off on on
1502 call llx
'call off' on off on
1503 call llx
'call off' on off off
1504 localopts call-fixate on
1505 call llx
'call-fixate on' on on on
1506 call llx
'call-fixate on' off on on
1507 call llx
'call-fixate on' on off on
1508 call llx
'call-fixate on' on off off
1509 unset x
;localopts call on
1510 call llx
'call on' on on on
1511 call llx
'call on' off on on
1512 call llx
'call on' on off on
1513 call llx
'call on' on off off
1518 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1523 t_behave_macro_param_shift
() {
1524 t_prolog t_behave_macro_param_shift
1526 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1529 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1534 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1535 if [ $# > 1 ] || [ $ignerr == '' ]
1540 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1542 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1546 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1551 call t2 1 you get four args
1552 echo t1.1: $?';' ignerr ($ignerr) should not exist
1553 call t2 1 you get 'three args'
1554 echo t1.2: $?';' ignerr ($ignerr) should not exist
1555 call t2 1 you 'get two args'
1556 echo t1.3: $?';' ignerr ($ignerr) should not exist
1557 call t2 1 'you get one arg'
1558 echo t1.4: $?';' ignerr ($ignerr) should not exist
1559 ignerr call t2 '' 'you get one arg'
1560 echo t1.5: $?';' ignerr ($ignerr) should not exist
1565 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1570 t_behave_addrcodec() {
1571 t_prolog t_behave_addrcodec
1573 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1574 vput addrcodec res e
1 <doog@def
>
1575 echo $?
/$^ERRNAME
$res
1576 eval vput addrcodec res d
$res
1577 echo $?
/$^ERRNAME
$res
1578 vput addrcodec res e
2 .
<doog@def
>
1579 echo $?
/$^ERRNAME
$res
1580 eval vput addrcodec res d
$res
1581 echo $?
/$^ERRNAME
$res
1582 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1583 echo $?
/$^ERRNAME
$res
1584 eval vput addrcodec res d
$res
1585 echo $?
/$^ERRNAME
$res
1586 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1587 echo $?
/$^ERRNAME
$res
1588 eval vput addrcodec res d
$res
1589 echo $?
/$^ERRNAME
$res
1590 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1591 echo $?
/$^ERRNAME
$res
1592 eval vput addrcodec res d
$res
1593 echo $?
/$^ERRNAME
$res
1595 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1596 echo $?
/$^ERRNAME
$res
1597 eval vput addrcodec res d
$res
1598 echo $?
/$^ERRNAME
$res
1599 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1600 echo $?
/$^ERRNAME
$res
1601 eval vput addrcodec res d
$res
1602 echo $?
/$^ERRNAME
$res
1603 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1604 echo $?
/$^ERRNAME
$res
1605 eval vput addrcodec res d
$res
1606 echo $?
/$^ERRNAME
$res
1607 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1608 echo $?
/$^ERRNAME
$res
1609 eval vput addrcodec res d
$res
1610 echo $?
/$^ERRNAME
$res
1611 vput addrcodec res
+e
8 \
1612 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1613 echo $?
/$^ERRNAME
$res
1614 eval vput addrcodec res d
$res
1615 echo $?
/$^ERRNAME
$res
1616 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1617 echo $?
/$^ERRNAME
$res
1618 eval vput addrcodec res d
$res
1619 echo $?
/$^ERRNAME
$res
1620 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1621 echo $?
/$^ERRNAME
$res
1622 eval vput addrcodec res d
$res
1623 echo $?
/$^ERRNAME
$res
1624 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1625 echo $?
/$^ERRNAME
$res
1626 eval vput addrcodec res d
$res
1627 echo $?
/$^ERRNAME
$res
1628 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1629 echo $?
/$^ERRNAME
$res
1630 eval vput addrcodec res d
$res
1631 echo $?
/$^ERRNAME
$res
1632 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1633 echo $?
/$^ERRNAME
$res
1634 eval vput addrcodec res d
$res
1635 echo $?
/$^ERRNAME
$res
1636 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1637 echo $?
/$^ERRNAME
$res
1638 eval vput addrcodec res d
$res
1639 echo $?
/$^ERRNAME
$res
1640 vput addrcodec res
+e
15 \
1641 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1642 echo $?
/$^ERRNAME
$res
1643 eval vput addrcodec res d
$res
1644 echo $?
/$^ERRNAME
$res
1645 vput addrcodec res
+e
16 \
1646 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1647 echo $?
/$^ERRNAME
$res
1648 eval vput addrcodec res d
$res
1649 echo $?
/$^ERRNAME
$res
1650 vput addrcodec res
+e
17 \
1651 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1652 echo $?
/$^ERRNAME
$res
1653 eval vput addrcodec res d
$res
1654 echo $?
/$^ERRNAME
$res
1655 vput addrcodec res
+e
18 \
1656 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1657 echo $?
/$^ERRNAME
$res
1658 eval vput addrcodec res d
$res
1659 echo $?
/$^ERRNAME
$res
1660 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1661 echo $?
/$^ERRNAME
$res
1662 eval vput addrcodec res d
$res
1663 echo $?
/$^ERRNAME
$res
1665 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1666 echo $?
/$^ERRNAME
$res
1667 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1668 echo $?/$^ERRNAME $res
1669 eval vput addrcodec res d $res
1670 echo $?/$^ERRNAME $res
1672 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1673 echo $?/$^ERRNAME $res
1674 eval vput addrcodec res d $res
1675 echo $?/$^ERRNAME $res
1677 vput addrcodec res s \
1678 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1679 echo $?/$^ERRNAME $res
1682 check behave:addrcodec-1 0 "${MBOX}" '429099645 2414'
1684 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1686 mlsubscribe isa2@list
1688 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1689 echo $?
/$^ERRNAME
$res
1690 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1691 echo $?
/$^ERRNAME
$res
1692 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1693 echo $?
/$^ERRNAME
$res
1694 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1695 echo $?
/$^ERRNAME
$res
1696 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1697 echo $?
/$^ERRNAME
$res
1698 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1699 echo $?
/$^ERRNAME
$res
1702 check behave
:addrcodec-2
0 "${MBOX}" '1391779299 104'
1708 t_prolog t_behave_vexpr
1710 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1711 vput vexpr res = 9223372036854775807
1712 echo $?/$^ERRNAME $res
1713 vput vexpr res = 9223372036854775808
1714 echo $?/$^ERRNAME $res
1715 vput vexpr res =@ 9223372036854775808
1716 echo $?/$^ERRNAME $res
1717 vput vexpr res = -9223372036854775808
1718 echo $?/$^ERRNAME $res
1719 vput vexpr res = -9223372036854775809
1720 echo $?/$^ERRNAME $res
1721 vput vexpr res =@ -9223372036854775809
1722 echo $?/$^ERRNAME $res
1725 echo $?/$^ERRNAME $res
1727 echo $?/$^ERRNAME $res
1729 echo $?/$^ERRNAME $res
1731 vput vexpr res + 0 0
1732 echo $?/$^ERRNAME $res
1733 vput vexpr res + 0 1
1734 echo $?/$^ERRNAME $res
1735 vput vexpr res + 1 1
1736 echo $?/$^ERRNAME $res
1738 vput vexpr res + 9223372036854775807 0
1739 echo $?/$^ERRNAME $res
1740 vput vexpr res + 9223372036854775807 1
1741 echo $?/$^ERRNAME $res
1742 vput vexpr res +@ 9223372036854775807 1
1743 echo $?/$^ERRNAME $res
1744 vput vexpr res + 0 9223372036854775807
1745 echo $?/$^ERRNAME $res
1746 vput vexpr res + 1 9223372036854775807
1747 echo $?/$^ERRNAME $res
1748 vput vexpr res +@ 1 9223372036854775807
1749 echo $?/$^ERRNAME $res
1751 vput vexpr res + -9223372036854775808 0
1752 echo $?/$^ERRNAME $res
1753 vput vexpr res + -9223372036854775808 -1
1754 echo $?/$^ERRNAME $res
1755 vput vexpr res +@ -9223372036854775808 -1
1756 echo $?/$^ERRNAME $res
1757 vput vexpr res + 0 -9223372036854775808
1758 echo $?/$^ERRNAME $res
1759 vput vexpr res + -1 -9223372036854775808
1760 echo $?/$^ERRNAME $res
1761 vput vexpr res +@ -1 -9223372036854775808
1762 echo $?/$^ERRNAME $res
1764 vput vexpr res - 0 0
1765 echo $?/$^ERRNAME $res
1766 vput vexpr res - 0 1
1767 echo $?/$^ERRNAME $res
1768 vput vexpr res - 1 1
1769 echo $?/$^ERRNAME $res
1771 vput vexpr res - 9223372036854775807 0
1772 echo $?/$^ERRNAME $res
1773 vput vexpr res - 9223372036854775807 -1
1774 echo $?/$^ERRNAME $res
1775 vput vexpr res -@ 9223372036854775807 -1
1776 echo $?/$^ERRNAME $res
1777 vput vexpr res - 0 9223372036854775807
1778 echo $?/$^ERRNAME $res
1779 vput vexpr res - -1 9223372036854775807
1780 echo $?/$^ERRNAME $res
1781 vput vexpr res - -2 9223372036854775807
1782 echo $?/$^ERRNAME $res
1783 vput vexpr res -@ -2 9223372036854775807
1784 echo $?/$^ERRNAME $res
1786 vput vexpr res - -9223372036854775808 +0
1787 echo $?/$^ERRNAME $res
1788 vput vexpr res - -9223372036854775808 +1
1789 echo $?/$^ERRNAME $res
1790 vput vexpr res -@ -9223372036854775808 +1
1791 echo $?/$^ERRNAME $res
1792 vput vexpr res - 0 -9223372036854775808
1793 echo $?/$^ERRNAME $res
1794 vput vexpr res - +1 -9223372036854775808
1795 echo $?/$^ERRNAME $res
1796 vput vexpr res -@ +1 -9223372036854775808
1797 echo $?/$^ERRNAME $res
1799 vput vexpr res + -13 -2
1800 echo $?/$^ERRNAME $res
1801 vput vexpr res - 0 0
1802 echo $?/$^ERRNAME $res
1803 vput vexpr res - 0 1
1804 echo $?/$^ERRNAME $res
1805 vput vexpr res - 1 1
1806 echo $?/$^ERRNAME $res
1807 vput vexpr res - -13 -2
1808 echo $?/$^ERRNAME $res
1810 vput vexpr res * 0 0
1811 echo $?/$^ERRNAME $res
1812 vput vexpr res * 0 1
1813 echo $?/$^ERRNAME $res
1814 vput vexpr res * 1 1
1815 echo $?/$^ERRNAME $res
1816 vput vexpr res * -13 -2
1817 echo $?/$^ERRNAME $res
1819 vput vexpr res / 0 0
1820 echo $?/$^ERRNAME $res
1821 vput vexpr res / 0 1
1822 echo $?/$^ERRNAME $res
1823 vput vexpr res / 1 1
1824 echo $?/$^ERRNAME $res
1825 vput vexpr res / -13 -2
1826 echo $?/$^ERRNAME $res
1828 vput vexpr res % 0 0
1829 echo $?/$^ERRNAME $res
1830 vput vexpr res % 0 1
1831 echo $?/$^ERRNAME $res
1832 vput vexpr res % 1 1
1833 echo $?/$^ERRNAME $res
1834 vput vexpr res % -13 -2
1835 echo $?/$^ERRNAME $res
1838 check behave:vexpr-numeric 0 "${MBOX}" '1723609217 1048'
1840 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1841 vput vexpr res
find 'bananarama' 'nana'
1842 echo $?
/$^ERRNAME
:$res:
1843 vput vexpr res
find 'bananarama' 'bana'
1844 echo $?
/$^ERRNAME
:$res:
1845 vput vexpr res
find 'bananarama' 'Bana'
1846 echo $?
/$^ERRNAME
:$res:
1847 vput vexpr res
find 'bananarama' 'rama'
1848 echo $?
/$^ERRNAME
:$res:
1850 vput vexpr res ifind
'bananarama' 'nana'
1851 echo $?
/$^ERRNAME
:$res:
1852 vput vexpr res ifind
'bananarama' 'bana'
1853 echo $?
/$^ERRNAME
:$res:
1854 vput vexpr res ifind
'bananarama' 'Bana'
1855 echo $?
/$^ERRNAME
:$res:
1856 vput vexpr res ifind
'bananarama' 'rama'
1857 echo $?
/$^ERRNAME
:$res:
1859 vput vexpr res substring
'bananarama' 1
1860 echo $?
/$^ERRNAME
:$res:
1861 vput vexpr res substring
'bananarama' 3
1862 echo $?
/$^ERRNAME
:$res:
1863 vput vexpr res substring
'bananarama' 5
1864 echo $?
/$^ERRNAME
:$res:
1865 vput vexpr res substring
'bananarama' 7
1866 echo $?
/$^ERRNAME
:$res:
1867 vput vexpr res substring
'bananarama' 9
1868 echo $?
/$^ERRNAME
:$res:
1869 vput vexpr res substring
'bananarama' 10
1870 echo $?
/$^ERRNAME
:$res:
1871 vput vexpr res substring
'bananarama' 1 3
1872 echo $?
/$^ERRNAME
:$res:
1873 vput vexpr res substring
'bananarama' 3 3
1874 echo $?
/$^ERRNAME
:$res:
1875 vput vexpr res substring
'bananarama' 5 3
1876 echo $?
/$^ERRNAME
:$res:
1877 vput vexpr res substring
'bananarama' 7 3
1878 echo $?
/$^ERRNAME
:$res:
1879 vput vexpr res substring
'bananarama' 9 3
1880 echo $?
/$^ERRNAME
:$res:
1881 vput vexpr res substring
'bananarama' 10 3
1882 echo $?
/$^ERRNAME
:$res:
1884 vput vexpr res substring
'bananarama' -1
1885 echo $?
/$^ERRNAME
:$res:
1886 vput vexpr res substring
'bananarama' -3
1887 echo $?
/$^ERRNAME
:$res:
1888 vput vexpr res substring
'bananarama' -5
1889 echo $?
/$^ERRNAME
:$res:
1890 vput vexpr res substring
'bananarama' -7
1891 echo $?
/$^ERRNAME
:$res:
1892 vput vexpr res substring
'bananarama' -9
1893 echo $?
/$^ERRNAME
:$res:
1894 vput vexpr res substring
'bananarama' -10
1895 echo $?
/$^ERRNAME
:$res:
1896 vput vexpr res substring
'bananarama' 1 -3
1897 echo $?
/$^ERRNAME
:$res:
1898 vput vexpr res substring
'bananarama' 3 -3
1899 echo $?
/$^ERRNAME
:$res:
1900 vput vexpr res substring
'bananarama' 5 -3
1901 echo $?
/$^ERRNAME
:$res:
1902 vput vexpr res substring
'bananarama' 7 -3
1903 echo $?
/$^ERRNAME
:$res:
1904 vput vexpr res substring
'bananarama' 9 -3
1905 echo $?
/$^ERRNAME
:$res:
1906 vput vexpr res substring
'bananarama' 10 -3
1907 echo $?
/$^ERRNAME
:$res:
1909 vput vexpr res trim
'Cocoon Cocoon'
1910 echo $?
/$^ERRNAME
:$res:
1911 vput vexpr res trim
' Cocoon Cocoon '
1912 echo $?
/$^ERRNAME
:$res:
1913 vput vexpr res trim-front
'Cocoon Cocoon'
1914 echo $?
/$^ERRNAME
:$res:
1915 vput vexpr res trim-front
' Cocoon Cocoon '
1916 echo $?
/$^ERRNAME
:$res:
1917 vput vexpr res trim-end
'Cocoon Cocoon'
1918 echo $?
/$^ERRNAME
:$res:
1919 vput vexpr res trim-end
' Cocoon Cocoon '
1920 echo $?
/$^ERRNAME
:$res:
1923 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
1925 if have_feat regex
; then
1926 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1927 vput vexpr res regex 'bananarama' 'nana'
1928 echo $?/$^ERRNAME :$res:
1929 vput vexpr res regex 'bananarama' 'bana'
1930 echo $?/$^ERRNAME :$res:
1931 vput vexpr res regex 'bananarama' 'Bana'
1932 echo $?/$^ERRNAME :$res:
1933 vput vexpr res regex 'bananarama' 'rama'
1934 echo $?/$^ERRNAME :$res:
1936 vput vexpr res iregex 'bananarama' 'nana'
1937 echo $?/$^ERRNAME :$res:
1938 vput vexpr res iregex 'bananarama' 'bana'
1939 echo $?/$^ERRNAME :$res:
1940 vput vexpr res iregex 'bananarama' 'Bana'
1941 echo $?/$^ERRNAME :$res:
1942 vput vexpr res iregex 'bananarama' 'rama'
1943 echo $?/$^ERRNAME :$res:
1945 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1946 echo $?/$^ERRNAME :$res:
1947 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1948 echo $?/$^ERRNAME :$res:
1949 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
1950 echo $?/$^ERRNAME :$res:
1951 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
1952 echo $?/$^ERRNAME :$res:
1954 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1955 echo $?/$^ERRNAME :$res:
1956 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1957 echo $?/$^ERRNAME :$res:
1958 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
1959 echo $?/$^ERRNAME :$res:
1960 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
1961 echo $?/$^ERRNAME :$res:
1965 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
1967 printf 'behave:vexpr-regex: unsupported, skipped\n'
1973 t_behave_call_ret() {
1974 t_prolog t_behave_call_ret
1976 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1981 vput vexpr j
'&' $i 7
1987 vput vexpr j
'&' $i 7
1993 echo ! The end
for $1
1997 # Transport $?/$! up the call chain
2003 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2007 echo ! The end
for $1
2008 return $i $^ERR-BUSY
2012 # Up and down it goes
2019 vput vexpr k
- $1 $2
2023 echo "# <$i/$j> .. "
2027 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2030 echo ! The end
for $1=$i/$2
2034 return $i $^ERR-BUSY
2040 call w1
0; echo ?
=$?
!=$
!; echo -----;
2041 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2042 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2045 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2051 t_prolog t_behave_xcall
2053 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2058 vput vexpr j '&' $i 7
2064 echo ! The end for $1/$2
2066 return $i $^ERR-BUSY
2077 echo ?=$? !=$^ERRNAME
2080 echo ?=$? !=$^ERRNAME
2082 echo ?=$? !=$^ERRNAME
2085 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2089 ${cat} <<- '__EOT' > "${BODY}"
2094 vput vexpr j '&' $i 7
2100 echo ! The end for $1
2103 echo would be err with errexit
2112 echo zwei, ?=$? !=$!
2113 localopts yes; set errexit
2115 echo drei, ?=$? !=$^ERRNAME
2117 echo vier, ?=$? !=$^ERRNAME, this is an error
2120 echo outer 1, ?=$? !=$^ERRNAME
2122 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2124 echo outer 3, ?=$? !=$^ERRNAME
2125 echo this is definitely an error
2128 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2130 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2132 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2134 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2139 t_behave_vpospar() {
2140 t_prolog t_behave_vpospar
2142 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2143 vpospar
set hey
, "'you ", world
!
2144 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2145 vput vpospar x quote
; echo x
<$x>
2146 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2147 vput vpospar y quote
;echo y
<$y>
2148 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2149 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2150 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2153 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2154 vput vpospar z quote
;echo infun2
:z
<$z>
2158 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2159 vput vpospar y quote
;echo infun
:y
<$y>
2160 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2161 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2163 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2164 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2167 call infun This
"in a" fun
2168 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2169 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2171 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2174 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2176 echo ifs<$ifs> ifs-ws<$ifs-ws>
2177 vpospar set hey, "'you ", world!
2178 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2179 vput vpospar x quote; echo x<$x>
2180 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2181 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2184 echo ifs<$ifs> ifs-ws<$ifs-ws>
2185 vpospar set hey, "'you
", world!
2186 echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2187 vput vpospar x quote; echo x<$x>
2188 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2189 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2192 echo ifs<$ifs> ifs-ws<$ifs-ws>
2193 vpospar set hey, "'you ", world!
2194 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2195 vput vpospar x quote; echo x<$x>
2196 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2197 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2199 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2204 t_behave_atxplode() {
2205 t_prolog t_behave_atxplode
2206 TRAP_EXIT_ADDONS="./.t*"
2208 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2211 printf " (1/$#: <$1>)"
2213 if [ $# -gt 0 ]; then
2227 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2228 printf xxx;xxx arg ,b u.
2229 printf xxx;xxx arg , .
2230 printf xxx;xxx arg ,ball.
2236 echon " (1/$#: <$1>)"
2251 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2252 echon xxx;call xxx arg ,b u.
2253 echon xxx;call xxx arg , .
2254 echon xxx;call xxx arg ,ball.
2257 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2258 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2260 #${SHELL} ./.t.sh > ./.tshout 2>&1
2261 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2267 t_prolog t_behave_read
2268 TRAP_EXIT_ADDONS="./.t*"
2270 ${cat} <<- '__EOT
' > .tin
2271 hey1, "'you
", world!
2272 hey2, "'you ", bugs bunny!
2277 ${cat} <<- '__EOT
' |\
2278 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2280 echo $?/$^ERRNAME / <$a><$b><$c>
2282 echo $?/$^ERRNAME / <$a><$b><$c>
2284 echo $?/$^ERRNAME / <$a><$b><$c>
2286 echo $?/$^ERRNAME / <$a><$b><$c>
2287 unset a b c;read a b c
2288 echo $?/$^ERRNAME / <$a><$b><$c>
2289 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2291 check behave:read-1 0 "${MBOX}" '1527910147 173'
2293 ${cat} <<- '__EOT
' > .tin2
2294 hey2.0,:"'you
",:world!:mars.:
2295 hey2.1,:"'you ",:world!
2296 hey2.2,:"'you
",:bugs bunny!
2302 ${cat} <<- '__EOT' |\
2303 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2306 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2308 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2310 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2312 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2314 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2316 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2317 unset a b c
;read a b c
2318 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2320 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2321 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2323 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2325 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2327 readall d; echo $?/$^ERRNAME / <$d>
2328 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2329 readctl create .tin2
2330 readall d; echo $?/$^ERRNAME / <$d>
2331 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2332 readctl remove .tin;echo $?/$^ERRNAME;\
2333 readctl remove .tin2;echo $?/$^ERRNAME
2335 check behave:readall 0 "${MBOX}" '860434889 333'
2341 t_prolog t_behave_mbox
2342 TRAP_EXIT_ADDONS=".
/.t
*"
2346 while [ ${i} -lt 112 ]; do
2347 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2348 "${MBOX}" "${i}" "${i}"
2351 ) | ${MAILX} ${ARGS}
2352 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2354 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2355 ${MAILX} ${ARGS} > .tlst
2356 check behave:mbox-2 0 .tlst '2739893312 9103'
2358 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2359 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} > .tlst
2360 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2362 # only the odd (even)
2364 printf 'File "file://%s"\ncopy ' .tmbox2
2366 while [ ${i} -lt 112 ]; do
2368 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2371 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2372 ) |
${MAILX} ${ARGS} > .tlst
2373 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2374 check behave
:mbox-5
- .tlst
'2960975049 4573'
2377 printf 'file "file://%s"\nmove ' .tmbox2
2379 while [ ${i} -lt 112 ]; do
2381 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2384 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2385 .tmbox3 .tmbox3 .tmbox2
2386 ) | ${MAILX} ${ARGS} > .tlst
2387 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2388 ${sed} 2d < .tlst > .tlstx
2389 check behave:mbox-7 - .tlstx '2729940494 13645'
2394 t_behave_alternates() {
2395 t_prolog t_behave_alternates
2396 TRAP_EXIT_ADDONS=".
/.t
*"
2398 ${cat} <<-_EOT > ./.tsendmail.sh
2400 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2403 chmod 0755 ./.tsendmail.sh
2405 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2409 alternates a1@b1 a2@b2 a3@b3
2414 echo $?/$^ERRNAME <$rv>
2419 echo $?/$^ERRNAME <$rv>
2422 echo $?/$^ERRNAME <$rv>
2425 echo $?/$^ERRNAME <$rv>
2429 alternates a1@b1 a2@b2 a3@b3
2432 echo $?/$^ERRNAME <$rv>
2435 echo $?/$^ERRNAME <$rv>
2438 echo $?/$^ERRNAME <$rv>
2441 alternates a1@b1 a2@b2 a3@b3
2444 echo $?/$^ERRNAME <$rv>
2447 echo $?/$^ERRNAME <$rv>
2450 echo $?/$^ERRNAME <$rv>
2454 alternates a1@b1 a2@b2 a3@b3
2457 echo $?/$^ERRNAME <$rv>
2461 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2463 ~s all alternates, only a1@b1 remains
2465 ~b a3@b3 a3@c3 a3@d3
2474 alternates a1@b1 a1@c1 a2@b2 a3@b3
2476 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2478 ~b a3@b3 a3@c3 a3@d3
2485 alternates a1@b1 a2@b2 a3; set allnet
2487 ~s all alternates via allnet, only a1@b1 remains
2489 ~b a3@b3 a3@c3 a3@d3
2500 echo $?/$^ERRNAME <$rv>
2504 echo $?/$^ERRNAME <$rv>
2508 echo $?/$^ERRNAME <$rv>
2512 echo $?/$^ERRNAME <$rv>
2516 echo $?/$^ERRNAME <$rv>
2520 alternates a1@b1 a2@b2
2523 echo $?/$^ERRNAME <$rv>
2524 alternates a3@b3 a4@b4
2527 echo $?/$^ERRNAME <$rv>
2529 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2530 check behave:alternates-2 - .tall '1878598364 505'
2536 t_prolog t_behave_alias
2537 TRAP_EXIT_ADDONS=".
/.t
*"
2539 ${cat} <<-_EOT > ./.tsendmail.sh
2541 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2544 chmod 0755 ./.tsendmail.sh
2546 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2548 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2550 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2552 alias a4 a5 ex1@a4.ple
2554 alias a6 a7 ex1@a6.ple
2568 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2569 check behave:alias-2 - .tall '3548953204 152'
2571 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2572 # TODO need to somehow provide its contents to the test, then test
2577 t_behave_filetype() {
2578 t_prolog t_behave_filetype
2579 TRAP_EXIT_ADDONS=".
/.t
*"
2581 ${cat} <<-_EOT > ./.tsendmail.sh
2583 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2586 chmod 0755 ./.tsendmail.sh
2588 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2589 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2590 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2592 if (echo |
gzip -c) >/dev
/null
2>&1; then
2595 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2596 "${MBOX}" | ${MAILX} ${ARGS} \
2597 -X'filetype gz gzip\ -dc gzip\ -c'
2598 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2599 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2601 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2602 check behave:filetype-3 - ".
/.t.out
" '2494681730 102'
2604 echo 'behave:filetype-2: unsupported, skipped'
2605 echo 'behave:filetype-3: unsupported, skipped'
2610 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2616 -X'filetype gz gzip\ -dc gzip\ -c' \
2617 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2618 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2619 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2621 -X'filetype gz gzip\ -dc gzip\ -c' \
2622 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2624 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2625 check behave:filetype-5 - ".
/.t.out
" '838452520 172'
2630 t_behave_record_a_resend() {
2631 t_prolog t_behave_record_a_resend
2632 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
2636 m %s\n~s Subject 1.\nHello.\n~.
2637 set record-files add-file-recipients
2638 m %s\n~s Subject 2.\nHello.\n~.
2640 resend 2 ./.t.resent
2641 Resend 1 ./.t.resent
2643 resend 2 ./.t.resent
2644 Resend 1 ./.t.resent
2645 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
2648 check behave:record_a_resend-1 0 "${MBOX}" '3057873538 256'
2649 check behave:record_a_resend-2 - .t.record '391356429 460'
2650 check behave:record_a_resend-3 - .t.resent '2685231691 648'
2655 t_behave_e_H_L_opts() {
2656 t_prolog t_behave_e_H_L_opts
2657 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2660 ${MAILX} ${ARGS} -ef ./.t.mbox
2661 echo ${?} > "${MBOX}"
2663 ${cat} <<-_EOT > ./.tsendmail.sh
2665 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2668 chmod 0755 ./.tsendmail.sh
2669 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2670 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2671 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2672 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2674 ${MAILX} ${ARGS} -ef ./.t.mbox
2675 echo ${?} >> "${MBOX}"
2676 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
2677 echo ${?} >> "${MBOX}"
2678 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
2679 echo ${?} >> "${MBOX}"
2680 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
2681 echo ${?} >> "${MBOX}"
2682 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
2683 echo ${?} >> "${MBOX}"
2684 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
2685 echo ${?} >> "${MBOX}"
2686 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2687 echo ${?} >> "${MBOX}"
2689 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2690 echo ${?} >> "${MBOX}"
2691 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2692 echo ${?} >> "${MBOX}"
2693 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2694 echo ${?} >> "${MBOX}"
2695 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2696 echo ${?} >> "${MBOX}"
2697 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2698 echo ${?} >> "${MBOX}"
2699 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2700 echo ${?} >> "${MBOX}"
2701 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev
/null
2702 echo ${?} >> "${MBOX}"
2704 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2709 t_behave_compose_hooks
() { # TODO monster
2710 t_prolog t_behave_compose_hooks
2711 TRAP_EXIT_ADDONS
="./.t*"
2713 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
2714 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
2716 ${cat} <<-_EOT > ./.tsendmail.sh
2718 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2721 chmod 0755 .
/.tsendmail.sh
2723 ${cat} <<'__EOT__' > ./.trc
2725 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
2728 vput vexpr es substr "$1" 0 1
2733 define read_mline_res {
2734 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2735 echo $len/$es/$^ERRNAME: $hl
2736 if [ $es -ne $^ERR-NONE ]
2737 xcall bail read_mline_res
2739 \xcall read_mline_res
2744 echo "~^header list"; read hl; echo $hl;\
2745 call xerr "$hl" "in_addr ($xh) 0-1"
2747 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2748 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
2749 echo "~^header insert $xh <${xh}2@exam.ple>";\
2750 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
2751 echo "~^header insert $xh ${xh}3@exam.ple";\
2752 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
2753 echo "~^header list $xh"; read hl; echo $hl;\
2754 call xerr "$hl" "ins_addr $xh 1-4"
2755 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
2758 if [ "$t_remove" == "" ]
2762 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
2763 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
2765 xcall bail "ins_addr $xh 2-2"
2767 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
2769 xcall bail "ins_addr $xh 2-3"
2771 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
2773 xcall bail "ins_addr $xh 2-4"
2777 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2778 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
2779 echo "~^header insert $xh <${xh}2@exam.ple>";\
2780 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
2781 echo "~^header insert $xh ${xh}3@exam.ple";\
2782 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
2783 echo "~^header list $xh"; read hl; echo $hl;\
2784 call xerr "$hl" "ins_addr $xh 3-4"
2785 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
2788 echo "~^header remove-at $xh 1"; read es;\
2789 call xerr $es "ins_addr $xh 3-6"
2790 echo "~^header remove-at $xh 1"; read es;\
2791 call xerr $es "ins_addr $xh 3-7"
2792 echo "~^header remove-at $xh 1"; read es;\
2793 call xerr $es "ins_addr $xh 3-8"
2794 echo "~^header remove-at $xh 1"; read es;\
2795 vput vexpr es substr $es 0 3
2797 xcall bail "ins_addr $xh 3-9"
2799 echo "~^header remove-at $xh T"; read es;\
2800 vput vexpr es substr $es 0 3
2802 xcall bail "ins_addr $xh 3-10"
2804 echo "~^header list $xh"; read es;\
2805 vput vexpr es substr $es 0 3
2807 xcall bail "ins_addr $xh 3-11"
2809 echo "~^header show $xh"; read es;\
2810 vput vexpr es substr $es 0 3
2812 xcall bail "ins_addr $xh 3-12"
2816 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2817 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
2818 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
2819 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
2820 echo "~^header insert $xh ${xh}3@exam.ple";\
2821 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
2822 echo "~^header list $xh"; read hl; echo $hl;\
2823 call xerr "$hl" "header list $xh 3-4"
2824 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
2827 echo "~^header remove-at $xh 3"; read es;\
2828 call xerr $es "ins_addr $xh 4-6"
2829 echo "~^header remove-at $xh 2"; read es;\
2830 call xerr $es "ins_addr $xh 4-7"
2831 echo "~^header remove-at $xh 1"; read es;\
2832 call xerr $es "ins_addr $xh 4-8"
2833 echo "~^header remove-at $xh 1"; read es;\
2834 vput vexpr es substr $es 0 3
2836 xcall bail "ins_addr $xh 4-9"
2838 echo "~^header remove-at $xh T"; read es;\
2839 vput vexpr es substr $es 0 3
2841 xcall bail "ins_addr $xh 4-10"
2843 echo "~^header list $xh"; read es;\
2844 vput vexpr es substr $es 0 3
2846 xcall bail "ins_addr $xh 4-11"
2848 echo "~^header show $xh"; read es;\
2849 vput vexpr es substr $es 0 3
2851 xcall bail "ins_addr $xh 4-12"
2855 wysh set xh=$1 mult=$2
2856 echo "~^header list"; read hl; echo $hl;\
2857 call xerr "$hl" "ins_ref ($xh) 0-1"
2859 echo "~^header insert $xh <$xh@exam.ple>";\
2860 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
2862 echo "~^header insert $xh <${xh}2@exam.ple>";\
2863 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
2864 echo "~^header insert $xh ${xh}3@exam.ple";\
2865 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
2867 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
2868 vput vexpr es substr $es 0 3
2870 xcall bail "ins_ref $xh 1-4"
2874 echo "~^header list $xh"; read hl; echo $hl;\
2875 call xerr "$hl" "ins_ref $xh 1-5"
2876 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
2879 if [ "$t_remove" == "" ]
2883 echo "~^header remove $xh"; read es;\
2884 call xerr $es "ins_ref $xh 2-1"
2885 echo "~^header remove $xh"; read es;\
2886 vput vexpr es substr $es 0 3
2888 xcall bail "ins_ref $xh 2-2"
2890 echo "~^header list $xh"; read es;\
2891 vput vexpr es substr $es 0 3
2893 xcall bail "$es ins_ref $xh 2-3"
2895 echo "~^header show $xh"; read es;\
2896 vput vexpr es substr $es 0 3
2898 xcall bail "ins_ref $xh 2-4"
2902 echo "~^header insert $xh <$xh@exam.ple>";\
2903 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
2905 echo "~^header insert $xh <${xh}2@exam.ple>";\
2906 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
2907 echo "~^header insert $xh ${xh}3@exam.ple";\
2908 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
2910 echo "~^header list $xh";\
2911 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
2912 echo "~^header show $xh";\
2913 read es; call xerr $es "ins_ref $xh 3-5"
2916 echo "~^header remove-at $xh 1"; read es;\
2917 call xerr $es "ins_ref $xh 3-6"
2918 if [ $mult -ne 0 ] && [ $xh != subject ]
2919 echo "~^header remove-at $xh 1"; read es;\
2920 call xerr $es "ins_ref $xh 3-7"
2921 echo "~^header remove-at $xh 1"; read es;\
2922 call xerr $es "ins_ref $xh 3-8"
2924 echo "~^header remove-at $xh 1"; read es;\
2925 vput vexpr es substr $es 0 3
2927 xcall bail "ins_ref $xh 3-9"
2929 echo "~^header remove-at $xh T"; read es;\
2930 vput vexpr es substr $es 0 3
2932 xcall bail "ins_ref $xh 3-10"
2934 echo "~^header show $xh"; read es;\
2935 vput vexpr es substr $es 0 3
2937 xcall bail "ins_ref $xh 3-11"
2941 echo "~^header insert $xh <$xh@exam.ple> ";\
2942 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
2944 echo "~^header insert $xh <${xh}2@exam.ple> ";\
2945 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
2946 echo "~^header insert $xh ${xh}3@exam.ple";\
2947 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
2949 echo "~^header list $xh"; read hl; echo $hl;\
2950 call xerr "$hl" "ins_ref $xh 4-4"
2951 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
2954 if [ $mult -ne 0 ] && [ $xh != subject ]
2955 echo "~^header remove-at $xh 3"; read es;\
2956 call xerr $es "ins_ref $xh 4-6"
2957 echo "~^header remove-at $xh 2"; read es;\
2958 call xerr $es "ins_ref $xh 4-7"
2960 echo "~^header remove-at $xh 1"; read es;\
2961 call xerr $es "ins_ref $xh 4-8"
2962 echo "~^header remove-at $xh 1"; read es;\
2963 vput vexpr es substr $es 0 3
2965 xcall bail "ins_ref $xh 4-9"
2967 echo "~^header remove-at $xh T"; read es;\
2968 vput vexpr es substr $es 0 3
2970 xcall bail "ins_ref $xh 4-10"
2972 echo "~^header show $xh"; read es;\
2973 vput vexpr es substr $es 0 3
2975 xcall bail "ins_ref $xh 4-11"
2980 # In collect.c order
2982 call ins_ref sender 0 # Not a "ref", but works
2986 call ins_addr reply-To
2987 call ins_addr mail-Followup-to
2988 call ins_ref messAge-id 0
2989 call ins_ref rEfErEncEs 1
2990 call ins_ref in-Reply-to 1
2991 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
2992 call ins_addr freeForm1
2993 call ins_addr freeform2
2995 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
2997 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3005 echo "~^attachment";\
3006 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3008 xcall bail "attach 0-1"
3011 echo "~^attach attribute ./.treadctl";\
3012 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3014 xcall bail "attach 0-2"
3016 echo "~^attachment attribute-at 1";\
3017 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3019 xcall bail "attach 0-3"
3022 echo "~^attachment insert ./.treadctl=ascii";\
3023 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3024 echo "~^attachment list";\
3025 read es; echo $es;call xerr "$es" "attach 1-2"
3027 echo "~^attachment attribute ./.treadctl";\
3028 read es; echo $es;call xerr "$es" "attach 1-3"
3030 echo "~^attachment attribute .treadctl";\
3031 read es; echo $es;call xerr "$es" "attach 1-4"
3033 echo "~^attachment attribute-at 1";\
3034 read es; echo $es;call xerr "$es" "attach 1-5"
3037 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3038 read es; echo $es;call xerr "$es" "attach 1-6"
3039 echo "~^attachment attribute-set .treadctl content-description Au";\
3040 read es; echo $es;call xerr "$es" "attach 1-7"
3041 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3042 read es; echo $es;call xerr "$es" "attach 1-8"
3044 echo "~^attachment attribute ./.treadctl";\
3045 read es; echo $es;call xerr "$es" "attach 1-9"
3047 echo "~^attachment attribute .treadctl";\
3048 read es; echo $es;call xerr "$es" "attach 1-10"
3050 echo "~^attachment attribute rctl";\
3051 read es; echo $es;call xerr "$es" "attach 1-11"
3053 echo "~^attachment attribute-at 1";\
3054 read es; echo $es;call xerr "$es" "attach 1-12"
3058 echo "~^attachment insert ./.tattach=latin1";\
3059 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3060 echo "~^attachment list";\
3061 read es; echo $es;call xerr "$es" "attach 2-2"
3063 echo "~^attachment attribute ./.tattach";\
3064 read es; echo $es;call xerr "$es" "attach 2-3"
3066 echo "~^attachment attribute .tattach";\
3067 read es; echo $es;call xerr "$es" "attach 2-4"
3069 echo "~^attachment attribute-at 2";\
3070 read es; echo $es;call xerr "$es" "attach 2-5"
3073 echo "~^attachment attribute-set ./.tattach filename tat";\
3074 read es; echo $es;call xerr "$es" "attach 2-6"
3076 "~^attachment attribute-set .tattach content-description Au2";\
3077 read es; echo $es;call xerr "$es" "attach 2-7"
3078 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3079 read es; echo $es;call xerr "$es" "attach 2-8"
3081 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3082 read es; echo $es;call xerr "$es" "attach 2-9"
3084 echo "~^attachment attribute ./.tattach";\
3085 read es; echo $es;call xerr "$es" "attach 2-10"
3087 echo "~^attachment attribute .tattach";\
3088 read es; echo $es;call xerr "$es" "attach 2-11"
3090 echo "~^attachment attribute tat";\
3091 read es; echo $es;call xerr "$es" "attach 2-12"
3093 echo "~^attachment attribute-at 2";\
3094 read es; echo $es;call xerr "$es" "attach 2-13"
3098 if [ "$t_remove" == "" ]
3102 echo "~^attachment remove ./.treadctl"; read es;\
3103 call xerr $es "attach 3-1"
3104 echo "~^attachment remove ./.tattach"; read es;\
3105 call xerr $es "attach 3-2"
3106 echo "~^ attachment remove ./.treadctl"; read es;\
3107 vput vexpr es substr $es 0 3
3109 xcall bail "attach 3-3"
3111 echo "~^ attachment remove ./.tattach"; read es;\
3112 vput vexpr es substr $es 0 3
3114 xcall bail "attach 3-4"
3116 echo "~^attachment list"; read es;\
3117 vput vexpr es substr $es 0 3
3119 xcall bail "attach 3-5"
3123 echo "~^attachment insert ./.tattach=latin1";\
3124 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3125 echo "~^attachment insert ./.tattach=latin1";\
3126 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3127 echo "~^attachment list";\
3128 read es; echo $es;call xerr "$es" "attach 4-3"
3130 echo "~^ attachment remove .tattach"; read es;\
3131 vput vexpr es substr $es 0 3
3133 xcall bail "attach 4-4 $es"
3135 echo "~^attachment remove-at T"; read es;\
3136 vput vexpr es substr $es 0 3
3138 xcall bail "attach 4-5"
3140 echo "~^attachment remove ./.tattach"; read es;\
3141 call xerr $es "attach 4-6"
3142 echo "~^attachment remove ./.tattach"; read es;\
3143 call xerr $es "attach 4-7"
3144 echo "~^ attachment remove ./.tattach"; read es;\
3145 vput vexpr es substr $es 0 3
3147 xcall bail "attach 4-8 $es"
3149 echo "~^attachment list"; read es;\
3150 vput vexpr es substr $es 0 3
3152 xcall bail "attach 4-9"
3156 echo "~^attachment insert ./.tattach=latin1";\
3157 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3158 echo "~^attachment insert ./.tattach=latin1";\
3159 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3160 echo "~^attachment insert ./.tattach=latin1";\
3161 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3162 echo "~^attachment list";\
3163 read es; echo $es;call xerr "$es" "attach 5-4"
3166 echo "~^attachment remove-at 3"; read es;\
3167 call xerr $es "attach 5-5"
3168 echo "~^attachment remove-at 3"; read es;\
3169 vput vexpr es substr $es 0 3
3171 xcall bail "attach 5-6"
3173 echo "~^attachment remove-at 2"; read es;\
3174 call xerr $es "attach 5-7"
3175 echo "~^attachment remove-at 2"; read es;\
3176 vput vexpr es substr $es 0 3
3178 xcall bail "attach 5-8"
3180 echo "~^attachment remove-at 1"; read es;\
3181 call xerr $es "attach 5-9"
3182 echo "~^attachment remove-at 1"; read es;\
3183 vput vexpr es substr $es 0 3
3185 xcall bail "attach 5-10"
3188 echo "~^attachment list"; read es;\
3189 vput vexpr es substr $es 0 3
3191 xcall bail "attach 5-11"
3195 echo "~^attachment insert ./.tattach=latin1";\
3196 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3197 echo "~^attachment insert ./.tattach=latin1";\
3198 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3199 echo "~^attachment insert ./.tattach=latin1";\
3200 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3201 echo "~^attachment list";\
3202 read es; echo $es;call xerr "$es" "attach 6-4"
3205 echo "~^attachment remove-at 1"; read es;\
3206 call xerr $es "attach 6-5"
3207 echo "~^attachment remove-at 1"; read es;\
3208 call xerr $es "attach 6-6"
3209 echo "~^attachment remove-at 1"; read es;\
3210 call xerr $es "attach 6-7"
3211 echo "~^attachment remove-at 1"; read es;\
3212 vput vexpr es substr $es 0 3
3214 xcall bail "attach 6-8"
3217 echo "~^attachment list"; read es;\
3218 vput vexpr es substr $es 0 3
3220 xcall bail "attach 6-9"
3232 echo on-compose-enter, mailx-command<$mailx-command>
3233 alternates alter1@exam.ple alter2@exam.ple
3235 set autocc='alter1@exam.ple alter2@exam.ple'
3236 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3237 echo mailx-subject<$mailx-subject>
3238 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3239 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3240 mailx-raw-bcc<$mailx-raw-bcc>
3241 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3242 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3245 echo on-compose-leave, mailx-command<$mailx-command>
3247 eval alternates $al alter3@exam.ple alter4@exam.ple
3249 set autobcc='alter3@exam.ple alter4@exam.ple'
3250 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3251 echo mailx-subject<$mailx-subject>
3252 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3253 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3254 mailx-raw-bcc<$mailx-raw-bcc>
3255 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3256 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3259 echo on-compose-cleanup, mailx-command<$mailx-command>
3262 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3263 echo mailx-subject<$mailx-subject>
3264 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3265 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3266 mailx-raw-bcc<$mailx-raw-bcc>
3267 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3268 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3270 wysh set on-compose-splice=t_ocs \
3271 on-compose-enter=t_oce on-compose-leave=t_ocl \
3272 on-compose-cleanup=t_occ
3276 printf 'm this-goes@nowhere\nbody\n!.\n' |
3277 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3278 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3280 ${cat} .
/.tall
>> "${MBOX}"
3281 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3284 printf 'm this-goes@nowhere\nbody\n!.\n' |
3285 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3286 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3288 ${cat} .
/.tall
>> "${MBOX}"
3289 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3293 # Some state machine stress, shell compose hook, localopts for hook, etc.
3294 # readctl in child. ~r as HERE document
3296 printf 'm ex@am.ple\nbody\n!.
3297 echon ${mailx-command}${mailx-subject}
3298 echon ${mailx-from}${mailx-sender}
3299 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3300 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3301 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3302 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3303 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3304 -Smta=.
/.tsendmail.sh \
3307 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3310 vput vexpr es substr "$1" 0 1
3315 define read_mline_res {
3316 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3317 echo $len/$es/$^ERRNAME: $hl
3318 if [ $es -ne $^ERR-NONE ]
3319 xcall bail read_mline_res
3321 \xcall read_mline_res
3325 vput vexpr i + 1 "$2"
3327 vput vexpr j % $i 10
3334 eval \\$j _work $1 $i
3337 vput vexpr i + $i "$1"
3341 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3342 echo read:$es/$en: $line
3343 if [ "${es}" -ne -1 ]
3346 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3351 echo "~^header list"; read hl; echo $hl;\
3352 vput vexpr es substr "$hl" 0 1
3354 xcall bail "header list"
3357 call _work 1; echo $?
3358 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3359 read es; echo $es; vput vexpr es substr "$es" 0 1
3361 xcall bail "be diet"
3363 echo "~^header insert cc <splice2@exam.ple>";\
3364 read es; echo $es; vput vexpr es substr "$es" 0 1
3366 xcall bail "be diet2"
3369 call _work 2; echo $?
3370 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3371 read es; echo $es;vput vexpr es substr "$es" 0 1
3373 xcall bail "be juicy"
3375 echo "~^header insert bcc juice2@exam.ple";\
3376 read es; echo $es;vput vexpr es substr "$es" 0 1
3378 xcall bail "be juicy2"
3380 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3381 read es; echo $es;vput vexpr es substr "$es" 0 1
3383 xcall bail "be juicy3"
3385 echo "~^header insert bcc juice4@exam.ple";\
3386 read es; echo $es;vput vexpr es substr "$es" 0 1
3388 xcall bail "be juicy4"
3391 echo "~^header remove-at bcc 3";\
3392 read es; echo $es;vput vexpr es substr "$es" 0 1
3394 xcall bail "remove juicy5"
3396 echo "~^header remove-at bcc 2";\
3397 read es; echo $es;vput vexpr es substr "$es" 0 1
3399 xcall bail "remove juicy6"
3401 echo "~^header remove-at bcc 3";\
3402 read es; echo $es;vput vexpr es substr "$es" 0 3
3404 xcall bail "failed to remove-at"
3406 # Add duplicates which ought to be removed!
3407 echo "~^header insert bcc juice4@exam.ple";\
3408 read es; echo $es;vput vexpr es substr "$es" 0 1
3410 xcall bail "be juicy4-1"
3412 echo "~^header insert bcc juice4@exam.ple";\
3413 read es; echo $es;vput vexpr es substr "$es" 0 1
3415 xcall bail "be juicy4-2"
3417 echo "~^header insert bcc juice4@exam.ple";\
3418 read es; echo $es;vput vexpr es substr "$es" 0 1
3420 xcall bail "be juicy4-3"
3425 call _work 3; echo $?
3427 vput ! i echo just knock if you can hear me;\
3429 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3431 echon shell-cmd says $?/$^ERRNAME: $i
3432 echo "~x will not become interpreted, we are reading until __EOT"
3434 read r_status; echo "~~r status output: $r_status"
3435 echo "~:echo $? $! $^ERRNAME"
3437 echo "~~r status from parent: $r_status"
3440 call _work 4; echo $?
3441 vput cwd cwd;echo cwd:$?
3442 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3446 call _work 5; echo $?
3447 echo "~^header show MAILX-Command"; read es;\
3448 call xerr $es "t_header 1000"; call read_mline_res
3449 echo "~^header show MAILX-raw-TO"; read es;\
3450 call xerr $es "t_header 1001"; xcall read_mline_res
3452 echoerr IT IS WRONG IF YOU SEE THIS
3455 echo on-compose-enter, mailx-command<$mailx-command>
3456 set t_oce autobcc=oce@exam.ple
3457 alternates alter1@exam.ple alter2@exam.ple
3459 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3460 echo mailx-subject<$mailx-subject>
3461 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3462 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3463 mailx-raw-bcc<$mailx-raw-bcc>
3464 echo mailx-orig-from<$mailx-orig-from> \
3465 mailx-orig-to<$mailx-orig-to> \
3466 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3469 echo on-compose-leave, mailx-command<$mailx-command>
3470 set t_ocl autocc=ocl@exam.ple
3472 alternates alter3@exam.ple alter4@exam.ple
3474 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3475 echo mailx-subject<$mailx-subject>
3476 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3477 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3478 mailx-raw-bcc<$mailx-raw-bcc>
3479 echo mailx-orig-from<$mailx-orig-from> \
3480 mailx-orig-to<$mailx-orig-to> \
3481 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3484 echo on-compose-cleanup, mailx-command<$mailx-command>
3485 set t_occ autocc=occ@exam.ple
3488 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3489 echo mailx-subject<$mailx-subject>
3490 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3491 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3492 mailx-raw-bcc<$mailx-raw-bcc>
3493 echo mailx-orig-from<$mailx-orig-from> \
3494 mailx-orig-to<$mailx-orig-to> \
3495 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3497 wysh set on-compose-splice=t_ocs \
3498 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
3499 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3500 on-compose-enter=t_oce on-compose-leave=t_ocl \
3501 on-compose-cleanup=t_occ
3503 ex0_test behave
:compose_hooks-3-estat
3504 ${cat} .
/.tnotes
>> "${MBOX}"
3506 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3508 # Reply, forward, resend, Resend
3511 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3512 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3513 -Smta=.
/.tsendmail.sh
3516 echo start: $? $! $^ERRNAME
3518 echo File: $? $! $^ERRNAME;echo;echo
3520 this is content of reply 1
3522 echo reply 1: $? $! $^ERRNAME;echo;echo
3524 this is content of Reply 1 2
3526 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3527 forward 1 fwdex@am.ple
3528 this is content of forward 1
3530 echo forward 1: $? $! $^ERRNAME;echo;echo
3531 resend 1 2 resendex@am.ple
3532 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3533 Resend 1 2 Resendex@am.ple
3534 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3536 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3537 -Smta=.
/.tsendmail.sh \
3540 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3543 vput vexpr es substr "$1" 0 1
3548 define read_mline_res {
3549 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3550 echo mline_res:$len/$es/$^ERRNAME: $hl
3551 if [ $es -ne $^ERR-NONE ]
3552 xcall bail read_mline_res
3554 \xcall read_mline_res
3558 echo "~^header show $1"; read es;\
3559 call xerr $es "work_hl $1"; echo $1; call read_mline_res
3567 echo t_ocs version $ver
3568 echo "~^header list"; read hl; echo $hl;\
3569 echoerr the header list is $hl;\
3570 call xerr "$hl" "header list"
3571 eval vpospar set $hl
3574 echoerr IT IS WRONG IF YOU SEE THIS
3577 echo on-XY-enter, mailx-command<$mailx-command>
3578 set t_oce autobcc=oce@exam.ple
3579 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3580 echo mailx-subject<$mailx-subject>
3581 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3582 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3583 mailx-raw-bcc<$mailx-raw-bcc>
3584 echo mailx-orig-from<$mailx-orig-from> \
3585 mailx-orig-to<$mailx-orig-to> \
3586 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3589 echo on-XY-leave, mailx-command<$mailx-command>
3590 set t_ocl autocc=ocl@exam.ple
3591 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3592 echo mailx-subject<$mailx-subject>
3593 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3594 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3595 mailx-raw-bcc<$mailx-raw-bcc>
3596 echo mailx-orig-from<$mailx-orig-from> \
3597 mailx-orig-to<$mailx-orig-to> \
3598 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3601 echo on-XY-cleanup, mailx-command<$mailx-command>
3602 set t_occ autocc=occ@exam.ple
3603 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3604 echo mailx-subject<$mailx-subject>
3605 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3606 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3607 mailx-raw-bcc<$mailx-raw-bcc>
3608 echo mailx-orig-from<$mailx-orig-from> \
3609 mailx-orig-to<$mailx-orig-to> \
3610 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3612 wysh set on-compose-splice=t_ocs \
3613 on-compose-enter=t_oce on-compose-leave=t_ocl \
3614 on-compose-cleanup=t_occ \
3615 on-resend-enter=t_oce on-resend-cleanup=t_occ
3617 ex0_test behave
:compose_hooks-4-estat
3618 ${cat} .
/.tnotes
>> "${MBOX}"
3620 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
3625 t_behave_message_injections
() {
3626 t_prolog t_behave_message_injections
3627 TRAP_EXIT_ADDONS
="./.t*"
3629 ${cat} <<-_EOT > ./.tsendmail.sh
3631 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3634 chmod 0755 .
/.tsendmail.sh
3636 echo mysig
> .
/.tmysig
3638 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3639 -Smessage-inject-head=head-inject \
3640 -Smessage-inject-tail=tail-inject \
3641 -Ssignature=.
/.tmysig \
3642 ex@am.ple
> .
/.tall
2>&1
3643 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3644 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3646 ${cat} <<-_EOT > ./.template
3650 Subject: This subject is
3652 Body, body, body me.
3654 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3655 -Smessage-inject-head=head-inject \
3656 -Smessage-inject-tail=tail-inject \
3657 -Ssignature=.
/.tmysig \
3659 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3660 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3665 t_behave_mime_types_load_control
() {
3666 t_prolog t_behave_mime_types_load_control
3667 TRAP_EXIT_ADDONS
="./.t*"
3669 ${cat} <<-_EOT > ./.tmts1
3670 @ application/mathml+xml mathml
3672 ${cat} <<-_EOT > ./.tmts2
3673 @ x-conference/x-cooltalk ice
3675 @ application/aga-aga aga
3678 ${cat} <<-_EOT > ./.tmts1.mathml
3679 <head>nonsense ML</head>
3681 ${cat} <<-_EOT > ./.tmts2.ice
3684 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3685 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3699 ' "${MBOX}" "${MBOX}" |
3701 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3703 ex0_test behave
:mime_types_load_control
3705 ${cat} "${MBOX}" >> .
/.tout
3706 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
3708 echo type |
${MAILX} ${ARGS} -R \
3709 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3710 -f "${MBOX}" >> .
/.tout
2>&1
3711 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
3717 have_feat smime ||
{
3718 echo 'behave:s/mime: unsupported, skipped'
3722 t_prolog t_behave_s_mime
3723 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
3724 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
3725 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
3727 printf 'behave:s/mime: .. generating test key and certificate ..\n'
3728 ${cat} <<-_EOT > ./.t.conf
3731 default_keyfile = keyfile.pem
3732 distinguished_name = req_distinguished_name
3733 attributes = req_attributes
3737 [ req_distinguished_name ]
3744 emailAddress = test@localhost
3749 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
3750 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
3751 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
3754 printf 'behave:s/mime:sign/verify: '
3755 echo bla |
${MAILX} ${ARGS} \
3756 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3757 -Ssmime-sign -Sfrom=test@localhost \
3758 -s 'S/MIME test' .
/.VERIFY
3759 if [ $?
-eq 0 ]; then
3770 /^Content-Description: /{ skip = 2; print; next }
3771 /^$/{ if(skip) --skip }
3774 < .
/.VERIFY
> "${MBOX}"
3775 check behave
:s
/mime
:sign
/verify
:checksum
- "${MBOX}" '2900817158 648'
3777 printf 'behave:s/mime:sign/verify:verify '
3778 printf 'verify\nx\n' |
3780 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3781 -Ssmime-sign -Sfrom=test@localhost \
3783 -f .
/.VERIFY
>/dev
/null
2>&1
3784 if [ $?
-eq 0 ]; then
3793 printf 'behave:s/mime:sign/verify:disproof-1 '
3794 if openssl smime
-verify -CAfile .
/.tcert.pem \
3795 -in .
/.VERIFY
>/dev
/null
2>&1; then
3804 # (signing +) encryption / decryption
3805 ${cat} <<-_EOT > ./.tsendmail.sh
3807 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
3809 chmod 0755 .
/.tsendmail.sh
3811 printf 'behave:s/mime:encrypt+sign: '
3814 -Ssmime-force-encryption \
3815 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3816 -Smta=.
/.tsendmail.sh \
3817 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3818 -Ssmime-sign -Sfrom=test@localhost \
3819 -s 'S/MIME test' recei@ver.com
3820 if [ $?
-eq 0 ]; then
3824 printf 'error: encrypt+sign failed\n'
3827 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3828 check behave
:s
/mime
:encrypt
+sign
:checksum
- "${MBOX}" '1937410597 327'
3830 printf 'behave:s/mime:decrypt+verify: '
3831 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
3833 -Ssmime-force-encryption \
3834 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3835 -Smta=.
/.tsendmail.sh \
3836 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3837 -Ssmime-sign -Sfrom=test@localhost \
3839 -f .
/.ENCRYPT
>/dev
/null
2>&1
3840 if [ $?
-eq 0 ]; then
3849 /^Content-Description: /{ skip = 2; print; next }
3850 /^$/{ if(skip) --skip }
3853 < .
/.DECRYPT
> "${MBOX}"
3854 check behave
:s
/mime
:decrypt
+verify
:checksum
- "${MBOX}" '1720739247 931'
3856 printf 'behave:s/mime:decrypt+verify:disproof-1: '
3857 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
3858 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
3865 printf "behave:s/mime:encrypt: "
3866 echo bla |
${MAILX} ${ARGS} \
3867 -Ssmime-force-encryption \
3868 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3869 -Smta=.
/.tsendmail.sh \
3870 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3871 -Sfrom=test@localhost \
3872 -s 'S/MIME test' recei@ver.com
3873 if [ $?
-eq 0 ]; then
3880 # Same as behave:s/mime:encrypt+sign:checksum above
3881 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3882 check behave
:s
/mime
:encrypt
:checksum
- "${MBOX}" '1937410597 327'
3885 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
3886 -Ssmime-force-encryption \
3887 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3888 -Smta=.
/.tsendmail.sh \
3889 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3890 -Sfrom=test@localhost \
3892 -f .
/.ENCRYPT
>/dev
/null
2>&1
3893 check behave
:s
/mime
:decrypt
0 "./.DECRYPT" '2624716890 422'
3895 printf 'behave:s/mime:decrypt:disproof-1: '
3896 if openssl smime
-decrypt -inkey .
/.tkey.pem \
3897 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
3907 t_behave_maildir
() {
3908 t_prolog t_behave_maildir
3909 TRAP_EXIT_ADDONS
="./.t*"
3913 while [ ${i} -lt 112 ]; do
3914 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
3915 "${MBOX}" "${i}" "${i}"
3918 ) |
${MAILX} ${ARGS}
3919 check behave
:maildir-1
0 "${MBOX}" '1140119864 13780'
3925 ' "${MBOX}" .tmdir1 .tmdir1 |
3926 ${MAILX} ${ARGS} -Snewfolders=maildir
> .tlst
3927 check behave
:maildir-2
0 .tlst
'1797938753 9103'
3930 copy * "maildir://%s"
3933 ' "${MBOX}" .tmdir2 .tmdir2 |
3934 ${MAILX} ${ARGS} > .tlst
3935 check behave
:maildir-3
0 .tlst
'1155631089 9113'
3937 printf 'File "maildir://%s"
3941 ' .tmdir2 .tmbox1 .tmbox1 |
3942 ${MAILX} ${ARGS} > .tlst
3943 check behave
:maildir-4
0 .tmbox1
'2646131190 13220'
3944 check behave
:maildir-5
- .tlst
'3701297796 9110'
3946 # only the odd (even)
3948 printf 'File "maildir://%s"
3951 while [ ${i} -lt 112 ]; do
3953 [ ${j} -eq 1 ] && printf '%s ' "${i}"
3960 ) |
${MAILX} ${ARGS} > .tlst
3961 check behave
:maildir-6
0 .tmbox2
'142890131 6610'
3962 check behave
:maildir-7
- .tlst
'960096773 4573'
3965 printf 'file "maildir://%s"
3968 while [ ${i} -lt 112 ]; do
3970 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
3978 ' .tmbox2 .tmbox2 .tmdir2
3979 ) | ${MAILX} ${ARGS} > .tlst
3980 check behave:maildir-8 0 .tmbox2 '3806905791 13100'
3981 ${sed} 2d < .tlst > .tlstx
3982 check behave:maildir-9 - .tlstx '4216815295 13645'
3987 t_behave_mass_recipients() {
3988 t_prolog t_behave_mass_recipients
3989 TRAP_EXIT_ADDONS=".
/.t
*"
3991 ${cat} <<-_EOT > ./.tsendmail.sh
3993 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3996 chmod 0755 ./.tsendmail.sh
3998 ${cat} <<'__EOT__' > ./.trc
4000 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4003 wysh set nr=$1 hn=$2
4004 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
4006 xcall bail "ins_addr
$hn 1-$nr"
4008 vput vexpr nr + $nr 1
4009 if [ "$nr" -le "$maximum" ]
4010 xcall ins_addr $nr $hn
4014 wysh set nr=$1 hn=$2
4015 alternates $hn$nr@$hn
4016 vput vexpr nr + $nr 2
4017 if [ "$nr" -le "$maximum" ]
4018 xcall bld_alter $nr $hn
4028 if [ "$t_remove" != '' ]
4033 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4037 printf 'm this-goes@nowhere\nbody\n!.\n' |
4038 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4039 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
4041 ${cat} ./.tall >> "${MBOX}"
4042 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
4045 printf 'm this-goes@nowhere\nbody\n!.\n' |
4046 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4047 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
4049 ${cat} ./.tall >> "${MBOX}"
4050 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
4055 t_behave_lreply_futh_rth_etc() {
4056 t_prolog t_behave_lreply_futh_rth_etc
4057 TRAP_EXIT_ADDONS=".
/.t
*"
4059 ${cat} <<-_EOT > ./.tsendmail.sh
4061 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4064 chmod 0755 ./.tsendmail.sh
4066 ${cat} <<-_EOT > ./.tmbox
4067 From neverneverland Sun Jul 23 13:46:25 2017
4068 Subject: Bugstop: five miles out 1
4069 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4070 From: mister originator <mr@originator>
4071 To: bugstop-commit@five.miles.out, laber@backe.eu
4073 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4074 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4075 Date: Wed, 19 Jul 2017 09:22:57 -0400
4076 Message-Id: <20170719132257.766AF781267@originator>
4079 > |Sorry, I think I misunderstand something. I would think that
4083 From neverneverland Fri Jul 7 22:39:11 2017
4084 Subject: Bugstop: five miles out 2
4085 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4086 Content-Transfer-Encoding: 7bit
4087 From: mister originator <mr@originator>
4088 To: bugstop-commit@five.miles.out
4090 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4091 Date: Fri, 07 Jul 2017 16:33:59 -0400
4094 capable of changing back.
4096 From neverneverland Fri Jul 7 22:42:00 2017
4097 Subject: Bugstop: five miles out 3
4098 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4099 Content-Transfer-Encoding: 7bit
4100 From: mister originator <mr@originator>
4101 To: bugstop-commit@five.miles.out
4103 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4104 Date: Fri, 07 Jul 2017 16:33:59 -0400
4105 List-Post: <mailto:bugstop@five.miles.out>
4108 are you ready, boots?
4110 From neverneverland Sat Aug 19 23:15:00 2017
4111 Subject: Bugstop: five miles out 4
4112 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4113 Content-Transfer-Encoding: 7bit
4114 From: mister originator <mr@originator>
4115 To: bugstop@five.miles.out
4117 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4118 Date: Fri, 07 Jul 2017 16:33:59 -0400
4119 List-Post: <mailto:bugstop@five.miles.out>
4122 are you ready, boots?
4127 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
4128 -Rf ./.tmbox >> "${MBOX}" 2>&1
4130 wysh set m="This is text of
\"reply
${1}.
"
4141 echo -----After reply
$1.1
- $1.3
: $?
/$^ERRNAME
4144 wysh
set m
="This is text of \"Reply ${1}."
4150 echo -----After Reply $1.$2: $?/$^ERRNAME
4159 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
4163 # We need two indirections for this test: one for the case that Lreply
4164 # fails because of missing recipients: we need to read EOF next, thus
4165 # place this in _Ls last; and second for the succeeding cases EOF is
4166 # not what these should read, so go over the backside and splice it in!
4168 echo -----After Lreply $1.$2: $?/$^ERRNAME
4171 localopts call-fixate yes
4173 call R $1 1; call R $1 2; call R $1 3; call R $1 4
4174 call L $1 1; call L $1 2; call L $1 3
4177 echo;echo '===== CHANGING
=== '"$*"' =====';echo
4181 set from=laber@backe.eu
4184 call tweak set reply-to-honour
4186 call tweak set followup-to
4188 call tweak set followup-to-honour
4190 call tweak mlist bugstop@five.miles.out
4192 call tweak mlsubscribe bugstop@five.miles.out
4194 call tweak set recipients-in-cc
4198 check behave:lreply_futh_rth_etc-1 0 "${MBOX}" '940818845 29373'
4202 ${cat} <<-_EOT > ./.tmbox
4203 From tom@i-i.example Thu Oct 26 03:15:55 2017
4204 Date: Wed, 25 Oct 2017 21:15:46 -0400
4205 From: tom <tom@i-i.example>
4206 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4207 Cc: tom <tom@i-i.example>
4208 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4209 Message-ID: <20171026011546.GA11643@i-i.example>
4210 Reply-To: tom@i-i.example
4211 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4212 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4215 The report's useful
:-)
4218 printf 'reply 1\nthank you\n!.\n' |
4219 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4220 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4221 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4226 t_behave_iconv_mbyte_base64
() {
4227 t_prolog t_behave_iconv_mbyte_base64
4228 TRAP_EXIT_ADDONS
="./.t*"
4230 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv &&
4231 (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1 ||
4232 (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4235 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4239 ${cat} <<-_EOT > ./.tsendmail.sh
4241 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4244 chmod 0755 .
/.tsendmail.sh
4246 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1; then
4247 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4248 -Smta=./.tsendmail.sh \
4249 -Sescape=! -Smime-encoding=base64 2>./.terr
4250 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4252 !s Japanese from UTF-8 to ISO-2022-JP
4253 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4255 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4258 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4260 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4263 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4265 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4266 \e$B%7%8%e%&%+%i2J!J%7%8%e%&%+%i$+!"3XL>\e(B Paridae\e$B!K$O!"D;N`%9%:%aL\$N2J$G$"$k!#%7%8%e%&%+%i!J;M==?}!K$HAm>N$5$l$k$,!"695A$K$O$3$N\e(B1\e$B<o$r%7%8%e%&%+%i$H8F$V!#\e(B
4268 \e$B%+%s%`%j%,%i!J3XL>\e(BParus cristatus\e$B!K$O!"%9%:%aL\%7%8%e%&%+%i2J$KJ,N`$5$l$kD;N`$N0l<o!#\e(B
4271 \e$B%+%s%`%j%,%i!J3XL>\e(BParus cristatus\e$B!K$O!"%9%:%aL\%7%8%e%&%+%i2J$KJ,N`$5$l$kD;N`$N0l<o!#\e(B
4273 \e$B%7%8%e%&%+%i2J!J%7%8%e%&%+%i$+!"3XL>\e(B Paridae\e$B!K$O!"D;N`%9%:%aL\$N2J$G$"$k!#%7%8%e%&%+%i!J;M==?}!K$HAm>N$5$l$k$,!"695A$K$O$3$N\e(B1\e$B<o$r%7%8%e%&%+%i$H8F$V!#\e(B
4276 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4277 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4279 printf 'eval f 1; write ./.twrite\n' |
4280 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4281 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4282 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4284 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4287 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4288 rm -f "${MBOX}" ./.twrite
4289 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4290 -Smta=./.tsendmail.sh \
4291 -Sescape=! -Smime-encoding=base64 2>./.terr
4292 set ttycharset=utf-8 sendcharsets=euc-jp
4294 !s Japanese from UTF-8 to EUC-JP
4295 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4297 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4300 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4302 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4305 set ttycharset=EUC-JP sendcharsets=utf-8
4307 !s Japanese from EUC-JP to UTF-8
4308 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4310 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4313 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4315 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4318 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4319 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4321 printf 'eval f 1; write ./.twrite\n' |
4322 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4323 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4324 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4326 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4332 t_behave_iconv_mainbody
() {
4333 t_prolog t_behave_iconv_mainbody
4334 TRAP_EXIT_ADDONS
="./.t*"
4337 if have_feat
iconv &&
4338 (</dev
/null
iconv -f utf-8
-t ascii
) >/dev
/null
2>&1; then
4339 j
="`printf '–' | iconv -f utf-8 -t ascii 2>/dev/null`"
4340 # This assumes iconv(1) behaves like iconv(3), but well
4341 if [ ${?} -ne 0 ]; then
4343 elif [ x
"${j}" = 'x?' ]; then
4345 elif [ x
"${j}" = 'x*' ]; then
4349 if [ -z "${i}" ]; then
4350 echo 'behave:iconv_mainbody: unsupported, skipped'
4354 ${cat} <<-_EOT > ./.tsendmail.sh
4356 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4359 chmod 0755 .
/.tsendmail.sh
4361 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4362 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4363 -s '–' over-the@rain.bow
2>.
/.terr
4364 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4365 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4367 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4368 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4369 -s '–' over-the@rain.bow
2>.
/.terr
4370 exn0_test behave
:iconv_mainbody-3
4371 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4372 check behave
:iconv_mainbody-4
- .
/.terr
'1960148192 128'
4374 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4376 if [ ${i} -eq 1 ]; then
4377 # yuck, just assume ???, we need a test program for that one!
4378 ex0_test behave:iconv_mainbody-5-1 ${j}
4379 check behave:iconv_mainbody-6-1 - ./.tout '1959197095 283'
4380 check behave:iconv_mainbody-7-1 - ./.terr '4294967295 0'
4381 elif [ ${i} -eq 2 ]; then
4382 ex0_test behave:iconv_mainbody-5-2 ${j}
4383 check behave:iconv_mainbody-6-2 - ./.tout '1959197095 283'
4384 check behave:iconv_mainbody-7-2 - ./.terr '4294967295 0'
4386 ex0_test behave:iconv_mainbody-5-3 ${j}
4387 check behave:iconv_mainbody-6-3 - ./.tout '3196380198 279'
4388 check behave:iconv_mainbody-7-3 - ./.terr '4294967295 0'
4395 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4396 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4397 # Note we unfortunately need to place some statements without proper
4398 # indentation because of continuation problems
4402 # MIME encoding (QP) stress message body
4404 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4405 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4406 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
4407 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
4408 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
4409 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
4410 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
4411 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
4412 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
4413 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
4414 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
4415 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
4416 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
4417 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
4418 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
4419 "auf den zeilen vorher.
\r\n"\
4420 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
4422 "Die letzte Zeile war nur ein Punkt.
\r\n"\
4424 "Das waren deren zwei.
\r\n"\
4426 "Die letzte Zeile war ein Leerschritt.
\n"\
4427 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
4430 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
4432 "Das waren deren zwei. ditto.
\n"\
4434 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
4435 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
4436 "auf den zeilen vorher.
\n"\
4438 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
4439 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
4441 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
4443 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
4445 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
4447 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
4449 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
4451 "QP am Zeilenende über soft-nl hinweg
\n"\
4452 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
4454 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
4456 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
4458 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
4460 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
4462 "Die letzte Zeile war ein Leerschritt.
\n"\
4466 # MIME encoding (QP) stress message subject
4467 SUB="Äbrä Kä?dä
=brö Fü?di
=bus? \
4468 adadaddsssssssddddddddddddddddddddd\
4469 ddddddddddddddddddddddddddddddddddd\
4470 ddddddddddddddddddddddddddddddddddd\
4471 dddddddddddddddddddd Hallelulja? Od\
4472 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4473 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4474 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
4475 fffffffffffffffffffffffffffffffffff\
4476 fffffffffffffffffffff ggggggggggggg\
4477 ggggggggggggggggggggggggggggggggggg\
4478 ggggggggggggggggggggggggggggggggggg\
4479 ggggggggggggggggggggggggggggggggggg\
4482 # Three tests for MIME encoding and (a bit) content classification.
4483 # At the same time testing -q FILE, < FILE and -t FILE
4486 < "${BODY}" ${MAILX} ${ARGS} ${ADDARG_UNI} \
4487 -a "${BODY}" -s "${SUB}" "${MBOX}"
4488 check content
:001 0 "${MBOX}" '1145066634 6654'
4491 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
4492 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
4493 check content
:002 0 "${MBOX}" '1145066634 6654'
4496 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
4498 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
4499 check content:003 0 "${MBOX}" '1145066634 6654'
4501 # Test for [260e19d] (Juergen Daubert)
4503 echo body | ${MAILX} ${ARGS} "${MBOX}"
4504 check content
:004 0 "${MBOX}" '2917662811 98'
4506 # Sending of multiple mails in a single invocation
4508 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
4509 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
4511 ) |
${MAILX} ${ARGS} ${ADDARG_UNI}
4512 check content
:005 0 "${MBOX}" '2098659767 358'
4516 # "Test for" [d6f316a] (Gavin Troy)
4518 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4519 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4520 check content:006 0 "${MBOX}" '2099098650 122'
4521 check content:006-1 - "${BODY}" '794542938 174'
4523 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4526 for(i = 0; i < 10000; ++i)
4528 #printf "\xF0\x90\x87\x90"
4529 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4530 check content
:007 0 "${MBOX}" '534262374 61816'
4532 ## Test some more corner cases for header bodies (as good as we can today) ##
4536 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4537 -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̲' \
4539 check content
:008 0 "${MBOX}" '3370931614 375'
4541 # Single word (overlong line split -- bad standard! Requires injection of
4542 # artificial data!! But can be prevented by using RFC 2047 encoding)
4544 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4545 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4546 check content:009 0 "${MBOX}" '489922370 1718'
4548 # Combination of encoded words, space and tabs of varying sort
4550 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4551 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4552 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4553 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4554 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4555 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4557 check content:010 0 "${MBOX}" '1676887734 591'
4559 # Overlong multibyte sequence that must be forcefully split
4560 # todo This works even before v15.0, but only by accident
4562 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4563 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4564 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4565 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4567 check content:011 0 "${MBOX}" '3029301775 659'
4571 echo | ${MAILX} ${ARGS} \
4572 -s "1-1 B2 B3 B4 B5 B6 B\
4573 1-2 B2 B3 B4 B5 B6 B\
4574 1-3 B2 B3 B4 B5 B6 B\
4575 1-4 B2 B3 B4 B5 B6 B\
4576 1-5 B2 B3 B4 B5 B6 B\
4577 1-6 B2 B3 B4 B5 B6
" \
4579 check content:012 0 "${MBOX}" '4126167195 297'
4581 # Leading and trailing WS
4583 echo | ${MAILX} ${ARGS} \
4584 -s " 2-1 B2 B3 B4 B5 B6 B\
4585 1-2 B2 B3 B4 B5 B6 B\
4586 1-3 B2 B3 B4 B5 B6 B\
4587 1-4 B2 B3 B4 B5 B6
" \
4589 check content:013 0 "${MBOX}" '3600624479 236'
4591 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
4592 # have a (better) test framework materialize a quick shot
4594 TRAP_EXIT_ADDONS=./.ttt
4596 mkdir ./.ttt || exit 1
4600 : > 'diet\ is \curd.txt'
4601 : > 'diet "is
" curd.txt'
4603 : > 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
4604 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4605 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4606 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4608 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4609 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4610 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4611 -a ./.ttt/höde-tröge.txt \
4612 -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 \
4613 -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 \
4614 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4615 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4617 check content:014-1 0 "${MBOX}" '684985954 3092'
4619 # `resend' test, reusing $MBOX
4621 printf "Resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4622 check content:014-2 0 "${BODY}" '684985954 3092'
4625 printf "resend
${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4626 check content:014-3 0 "${BODY}" '3130352658 3148'
4632 # if have_feat devel; then
4633 # ARGS="${ARGS} -Smemdebug"
4637 if [ -n "${UTF8_LOCALE}" ]; then
4638 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
4640 printf 'No Unicode locale found, disabling Unicode tests\n'
4647 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
4649 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
4652 while [ ${#} -gt 0 ]; do
4658 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'