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 ex0_test should say TESTNUMBER-estat instead of having own numbers
6 #@ TODO _All_ the tests should happen in a temporary subdir.
9 # Instead of figuring out the environment in here, require a configured build
10 # system and include that! Our makefile and configure ensure that this test
11 # does not run in the configured, but the user environment nonetheless!
12 if [ -f .
/mk-config.ev
]; then
14 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
15 MAILX__CC_TEST_RUNNING
=1
16 export MAILX__CC_TEST_RUNNING
17 exec "${SHELL}" "${0}" "${@}"
20 echo >&2 'S-nail/S-mailx is not configured.'
21 echo >&2 'This test script requires the shell environment that only the'
22 echo >&2 'configuration script can figure out, even if it will be used to'
23 echo >&2 'test a different binary than the one that would be produced!'
27 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
28 # such is a compile-time variable
29 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
30 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
31 ADDARG_UNI
=-Sttycharset=UTF-8
36 #UTF8_LOCALE= autodetected unless set
38 # Note valgrind has problems with FDs in forked childs, which causes some tests
39 # to fail (the FD is rewound and thus will be dumped twice)
41 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
43 ## -- (>8 -- 8<) -- ##
45 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
50 printf >&2 -- "${fmt}\\n" "${@}"
55 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
59 # Wed Oct 2 01:50:07 UTC 1996
60 SOURCE_DATE_EPOCH
=844221007
62 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
63 unset POSIXLY_CORRECT LOGNAME USER
66 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
67 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
71 CHECK_ONLY
= MAE_TEST
= MAILX
=
72 if [ "${1}" = --check-only ]; then
75 [ -x "${MAILX}" ] || usage
77 elif [ "${1}" = --mae-test ]; then
80 [ -x "${MAILX}" ] || usage
84 MAILX
="${MEMTESTER}${MAILX}"
87 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
88 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
89 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
91 \if [ "${ttycharset}" @i=% utf ]
98 \eval xcall cset_test "${@}"
102 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
103 en_US.utf8 en_US.UTF-8
105 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
107 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
108 UTF8_LOCALE
=`locale -a | { m=
110 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
112 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
126 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
127 trap "exit 1" HUP INT TERM
130 # Test all configs TODO doesn't cover all *combinations*, stupid!
134 NOTME["OPT_AUTOCC"] = 1
135 NOTME["OPT_DEBUG"] = 1
136 NOTME["OPT_DEVEL"] = 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
303 t_behave_macro_param_shift
314 t_behave_record_a_resend
319 # FIXME t_behave_mlist
322 t_behave_message_injections
324 t_behave_compose_hooks
325 t_behave_C_opt_customhdr
327 t_behave_mass_recipients
328 t_behave_mime_types_load_control
329 t_behave_lreply_futh_rth_etc
331 t_behave_xxxheads_rfc2047
333 t_behave_iconv_mbyte_base64
334 t_behave_iconv_mainbody
335 t_behave_binary_mainbody
336 t_behave_q_t_etc_opts
341 t_behave_X_opt_input_command_stack() {
342 t_prolog t_behave_X_opt_input_command_stack
344 ${cat} <<- '__EOT' > "${BODY}"
352 echo "define mac1
{";\
353 echo " echo mac1-1 via1 \
$0";\
355 echo " echo mac1-2
";\
357 echo " echo mac1-3
";\
360 echo "define mac2
{";\
361 echo " echo mac2-1 via1 \
$0";\
363 echo " echo mac2-2
";\
369 echo echo 1-1-1 via1 \
$0;\
381 # The -X option supports multiline arguments, and those can internally use
382 # reverse solidus newline escaping. And all -X options are joined...
384 < "${BODY}" ${MAILX} ${ARGS} \
399 echo "define mac1 {";\
400 echo " echo mac1-1 via2 \$0";\
402 echo " echo mac1-2";\
404 echo " echo mac1-3";\
407 echo "define mac2 {";\
408 echo " echo mac2-1 via2 \$0";\
410 echo " echo mac2-2";\
416 echo echo 1-1-1 via2 \$0;\
430 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
435 t_behave_X_errexit
() {
436 t_prolog t_behave_X_errexit
438 ${cat} <<- '__EOT' > "${BODY}"
444 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
445 -X'echo one' -X' echos nono ' -X'echo two' \
447 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
449 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
451 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
453 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
455 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
459 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
460 -X'echo one' -X' echos nono ' -X'echo two' \
462 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
464 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
466 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
468 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
470 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
472 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
474 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
476 ## Repeat 4-7 with ignerr set
478 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
480 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
481 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
483 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
485 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
487 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
489 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
491 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
493 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
495 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
500 t_behave_S_freeze() {
501 t_prolog t_behave_S_freeze
505 # Test basic assumption
506 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
507 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
509 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
512 ${cat} <<- '__EOT' > "${BODY}"
517 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
518 -Snoasksub -Sasksub -Snoasksub \
519 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
521 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
523 ${cat} <<- '__EOT' > "${BODY}"
528 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
529 -Snoasksub -Sasksub \
530 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
532 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
535 ${cat} <<- '__EOT' > "${BODY}"
536 echo dietcurd<$dietcurd>
538 echo dietcurd<$dietcurd>
540 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
541 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
542 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
543 -X'echo dietcurd<$dietcurd>' \
545 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
547 ${cat} <<- '__EOT' > "${BODY}"
548 echo dietcurd<$dietcurd>
550 echo dietcurd<$dietcurd>
552 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
553 -Sdietcurd=strawberry
-Snodietcurd \
554 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
555 -X'echo dietcurd<$dietcurd>' \
557 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
559 # TODO once we have a detached one with env=1..
560 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
561 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
563 ${cat} <<- '__EOT' > "${BODY}"
564 !echo "shell says TERM<$TERM>"
566 !echo "shell says TERM<$TERM>"
568 !echo "shell says TERM<$TERM>"
570 !echo "shell says TERM<$TERM>"
572 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
573 -STERM=strawberry
-SnoTERM -STERM=vanilla \
574 -X'echo mail<$TERM>' -X'unset TERM' \
575 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
577 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
579 ${cat} <<- '__EOT' > "${BODY}"
580 !echo "shell says TERM<$TERM>"
582 !echo "shell says TERM<$TERM>"
584 !echo "shell says TERM<$TERM>"
586 !echo "shell says TERM<$TERM>"
588 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
589 -STERM=strawberry
-SnoTERM \
590 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
591 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
593 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
601 t_prolog t_behave_wysh
603 ${cat} <<- '__EOT' > "${BODY}"
622 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
623 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
624 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
626 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
627 echo a$'\u0041\u41\u0C1\U00000041\U41'c
650 echo a$'b\U0000000'dt
651 echo a$'b\U00000000'du
661 if [ -z "${UTF8_LOCALE}" ]; then
662 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
664 < "${BODY}" DIET=CURD TIED= \
665 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
666 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
669 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
670 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
672 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
673 wysh set mager='\hey\'
675 wysh set mager="\hey\\"
677 wysh set mager=$'\hey\\'
680 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
685 t_behave_input_inject_semicolon_seq() {
686 t_prolog t_behave_input_inject_semicolon_seq
688 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
693 echon this_is_mymac;call mydeepmac;echon ';';
695 echon one';';call mymac;echon two";";call mymac;echo three$';';
697 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
699 echon one';';call mymac;echon two";";call mymac;echo three$';';
702 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
707 t_behave_commandalias() {
708 t_prolog t_behave_commandalias
710 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
711 commandalias echo echo hoho
715 commandalias XxX XxXx
716 commandalias XxXx XxXxX
717 commandalias XxXxX XxXxXx
718 commandalias XxXxXx echo huhu
719 commandalias XxXxXxX echo huhu
721 commandalias XxXxXx XxXxXxX
724 commandalias XxXxXx echo huhu
728 check behave:commandalias 0 "${MBOX}" '3694143612 31'
734 t_prolog t_behave_ifelse
736 # Nestable conditions test
737 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
759 if $dietcurd == 'yoho'
764 if $dietcurd @== 'Yoho'
769 if $dietcurd == 'Yoho'
774 if $dietcurd != 'yoho'
779 if $dietcurd @!= 'Yoho'
784 if $dietcurd != 'Yoho'
845 if $dietcurd == 'yohu'
847 elif $dietcurd == 'yoha'
849 elif $dietcurd == 'yohe'
851 elif $dietcurd == 'yoho'
853 if $dietcurd == 'yohu'
855 elif $dietcurd == 'yoha'
857 elif $dietcurd == 'yohe'
859 elif $dietcurd == 'yoho'
861 if $dietcurd == 'yohu'
863 elif $dietcurd == 'yoha'
865 elif $dietcurd == 'yohe'
867 elif $dietcurd == 'yoho'
1016 set diet=abc curd=abc
1022 set diet=abc curd=abcd
1028 # 1. Shitty grouping capabilities as of today
1029 unset diet curd ndefined
1030 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1036 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1041 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1046 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1051 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1056 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1057 && [ no ] || [ yes ]
1062 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1067 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1072 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1077 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1082 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1087 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1092 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1097 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1102 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1107 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1113 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1119 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1124 # 2. Shitty grouping capabilities as of today
1125 unset diet curd ndefined
1126 if [ false || false || true ] && [ false || true ] && yes
1131 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1136 if [ 1 || 0 || 0 || 0 ]
1141 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1146 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1151 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1156 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1161 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1166 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1171 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1176 if 1 || 0 || 0 || 0 && 0
1181 if 1 || 0 || 0 || 0 && 1
1186 if 0 || 0 || 0 || 1 && 0
1191 if 0 || 0 || 0 || 1 && 1
1196 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1201 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1207 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1212 if $diet == 'yo' && $curd == 'ho' && $ndefined
1218 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1223 if $diet == 'yo' && $curd == 'ho' && $ndefined
1228 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1233 # Some more en-braced variables
1235 if ${diet} == ${curd}
1240 if ${diet} != ${curd}
1256 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1261 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1266 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1271 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1276 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1281 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1286 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1291 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1296 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1302 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1307 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1312 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1317 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1322 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1327 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1332 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1337 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1342 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1349 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1351 if have_feat regex; then
1352 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1354 if $dietcurd =~ '^yo.*'
1359 if $dietcurd =~ '^Yo.*'
1364 if $dietcurd @=~ '^Yo.*'
1369 if $dietcurd =~ '^yOho.+'
1374 if $dietcurd @!~ '.*Ho$'
1379 if $dietcurd !~ '.+yohO$'
1384 if [ $dietcurd @i!~ '.+yoho$' ]
1389 if ! [ $dietcurd @i=~ '.+yoho$' ]
1394 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1399 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1404 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1409 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1414 if ! ! ! $dietcurd !~ '.+yoho$'
1419 if ! ! ! $dietcurd =~ '.+yoho$'
1424 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1429 set diet=abc curd='^abc$'
1435 set diet=abc curd='^abcd$'
1443 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1445 printf 'behave:if-regex: unsupported, skipped\n'
1451 t_behave_localopts() {
1452 t_prolog t_behave_localopts
1454 # Nestable conditions test
1455 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1470 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1475 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1476 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1485 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1487 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1496 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1503 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1510 echo ----- $1: $2 -> $3 -> $4
1518 call llx
'call off' on on on
1519 call llx
'call off' off on on
1520 call llx
'call off' on off on
1521 call llx
'call off' on off off
1522 localopts call-fixate on
1523 call llx
'call-fixate on' on on on
1524 call llx
'call-fixate on' off on on
1525 call llx
'call-fixate on' on off on
1526 call llx
'call-fixate on' on off off
1527 unset x
;localopts call on
1528 call llx
'call on' on on on
1529 call llx
'call on' off on on
1530 call llx
'call on' on off on
1531 call llx
'call on' on off off
1536 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1542 t_prolog t_behave_local
1544 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1572 echo ------- global-1 du=$du
1574 echo ------- global-2 du=$du
1577 echo ------- global-3 du=$du
1579 echo ------- global-4 du=$du
1581 echo ------- global-5 du=$du
1584 check behave:local-1 0 "${MBOX}" '2411598140 641'
1589 t_behave_macro_param_shift() {
1590 t_prolog t_behave_macro_param_shift
1592 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1595 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1600 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1601 if [ $# > 1 ] ||
[ $ignerr == '' ]
1606 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1608 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1612 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1617 call t2
1 you get four args
1618 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1619 call t2
1 you get
'three args'
1620 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1621 call t2
1 you
'get two args'
1622 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1623 call t2
1 'you get one arg'
1624 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1625 ignerr call t2
'' 'you get one arg'
1626 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1631 check behave
:macro_param_shift
0 "${MBOX}" '1402489146 1682'
1636 t_behave_addrcodec
() {
1637 t_prolog t_behave_addrcodec
1639 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1640 vput addrcodec res e 1 <doog@def>
1641 echo $?/$^ERRNAME $res
1642 eval vput addrcodec res d $res
1643 echo $?/$^ERRNAME $res
1644 vput addrcodec res e 2 . <doog@def>
1645 echo $?/$^ERRNAME $res
1646 eval vput addrcodec res d $res
1647 echo $?/$^ERRNAME $res
1648 vput addrcodec res e 3 Sauer Dr. <doog@def>
1649 echo $?/$^ERRNAME $res
1650 eval vput addrcodec res d $res
1651 echo $?/$^ERRNAME $res
1652 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1653 echo $?/$^ERRNAME $res
1654 eval vput addrcodec res d $res
1655 echo $?/$^ERRNAME $res
1656 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1657 echo $?/$^ERRNAME $res
1658 eval vput addrcodec res d $res
1659 echo $?/$^ERRNAME $res
1661 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1662 echo $?/$^ERRNAME $res
1663 eval vput addrcodec res d $res
1664 echo $?/$^ERRNAME $res
1665 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1666 echo $?/$^ERRNAME $res
1667 eval vput addrcodec res d $res
1668 echo $?/$^ERRNAME $res
1669 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1670 echo $?/$^ERRNAME $res
1671 eval vput addrcodec res d $res
1672 echo $?/$^ERRNAME $res
1673 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1674 echo $?/$^ERRNAME $res
1675 eval vput addrcodec res d $res
1676 echo $?/$^ERRNAME $res
1677 vput addrcodec res +e 8 \
1678 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1679 echo $?/$^ERRNAME $res
1680 eval vput addrcodec res d $res
1681 echo $?/$^ERRNAME $res
1682 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1683 echo $?/$^ERRNAME $res
1684 eval vput addrcodec res d $res
1685 echo $?/$^ERRNAME $res
1686 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1687 echo $?/$^ERRNAME $res
1688 eval vput addrcodec res d $res
1689 echo $?/$^ERRNAME $res
1690 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1691 echo $?/$^ERRNAME $res
1692 eval vput addrcodec res d $res
1693 echo $?/$^ERRNAME $res
1694 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1695 echo $?/$^ERRNAME $res
1696 eval vput addrcodec res d $res
1697 echo $?/$^ERRNAME $res
1698 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1699 echo $?/$^ERRNAME $res
1700 eval vput addrcodec res d $res
1701 echo $?/$^ERRNAME $res
1702 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1703 echo $?/$^ERRNAME $res
1704 eval vput addrcodec res d $res
1705 echo $?/$^ERRNAME $res
1706 vput addrcodec res +e 15 \
1707 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1708 echo $?/$^ERRNAME $res
1709 eval vput addrcodec res d $res
1710 echo $?/$^ERRNAME $res
1711 vput addrcodec res +e 16 \
1712 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1713 echo $?/$^ERRNAME $res
1714 eval vput addrcodec res d $res
1715 echo $?/$^ERRNAME $res
1716 vput addrcodec res +e 17 \
1717 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1718 echo $?/$^ERRNAME $res
1719 eval vput addrcodec res d $res
1720 echo $?/$^ERRNAME $res
1721 vput addrcodec res +e 18 \
1722 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1723 echo $?/$^ERRNAME $res
1724 eval vput addrcodec res d $res
1725 echo $?/$^ERRNAME $res
1726 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1727 echo $?/$^ERRNAME $res
1728 eval vput addrcodec res d $res
1729 echo $?/$^ERRNAME $res
1731 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1732 echo $?/$^ERRNAME $res
1733 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1734 echo $?
/$^ERRNAME
$res
1735 eval vput addrcodec res d
$res
1736 echo $?
/$^ERRNAME
$res
1738 vput addrcodec res
+++e
22 Hey
\\,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1739 echo $?
/$^ERRNAME
$res
1740 eval vput addrcodec res d
$res
1741 echo $?
/$^ERRNAME
$res
1743 vput addrcodec res s \
1744 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1745 echo $?
/$^ERRNAME
$res
1747 # Fix for [f3852f88]
1748 vput addrcodec res
++e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1749 echo $?
/$^ERRNAME
$res
1750 eval vput addrcodec res d
$res
1751 echo $?
/$^ERRNAME
$res
1752 vput addrcodec res e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1753 echo $?
/$^ERRNAME
$res
1754 eval vput addrcodec res d
$res
1755 echo $?
/$^ERRNAME
$res
1758 check behave
:addrcodec-1
0 "${MBOX}" '1047317989 2612'
1760 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1762 mlsubscribe isa2@list
1764 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1765 echo $?/$^ERRNAME $res
1766 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1767 echo $?/$^ERRNAME $res
1768 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1769 echo $?/$^ERRNAME $res
1770 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1771 echo $?/$^ERRNAME $res
1772 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1773 echo $?/$^ERRNAME $res
1774 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1775 echo $?/$^ERRNAME $res
1778 check behave:addrcodec-2 0 "${MBOX}" '1391779299 104'
1780 if have_feat idna; then
1781 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1782 vput addrcodec res e
(heu
) <du@blödiän
> "stroh" du
1783 echo $?
/$^ERRNAME
$res
1784 eval vput addrcodec res d
$res
1785 echo $?
/$^ERRNAME
$res
1786 vput addrcodec res e
<du@blödiän
> du
1787 echo $?
/$^ERRNAME
$res
1788 eval vput addrcodec res d
$res
1789 echo $?
/$^ERRNAME
$res
1790 vput addrcodec res e du
<du@blödiän
>
1791 echo $?
/$^ERRNAME
$res
1792 eval vput addrcodec res d
$res
1793 echo $?
/$^ERRNAME
$res
1794 vput addrcodec res e
<du@blödiän
>
1795 echo $?
/$^ERRNAME
$res
1796 eval vput addrcodec res d
$res
1797 echo $?
/$^ERRNAME
$res
1798 vput addrcodec res e du@blödiän
1799 echo $?
/$^ERRNAME
$res
1800 eval vput addrcodec res d
$res
1801 echo $?
/$^ERRNAME
$res
1804 check behave
:addrcodec-idna
0 "${MBOX}" '498775983 326'
1806 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1813 t_prolog t_behave_vexpr
1815 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1817 vput vexpr res = 9223372036854775807
1818 echo $?/$^ERRNAME $res
1819 vput vexpr res = 9223372036854775808
1820 echo $?/$^ERRNAME $res
1821 vput vexpr res = u9223372036854775808
1822 echo $?/$^ERRNAME $res
1823 vput vexpr res @= 9223372036854775808
1824 echo $?/$^ERRNAME $res
1825 vput vexpr res = -9223372036854775808
1826 echo $?/$^ERRNAME $res
1827 vput vexpr res = -9223372036854775809
1828 echo $?/$^ERRNAME $res
1829 vput vexpr res @= -9223372036854775809
1830 echo $?/$^ERRNAME $res
1831 vput vexpr res = U9223372036854775809
1832 echo $?/$^ERRNAME $res
1835 0b0111111111111111111111111111111111111111111111111111111111111111
1836 echo $?/$^ERRNAME $res
1838 S0b1000000000000000000000000000000000000000000000000000000000000000
1839 echo $?/$^ERRNAME $res
1841 S0b1000000000000000000000000000000000000000000000000000000000000000
1842 echo $?/$^ERRNAME $res
1844 U0b1000000000000000000000000000000000000000000000000000000000000000
1845 echo $?/$^ERRNAME $res
1847 0b1000000000000000000000000000000000000000000000000000000000000000
1848 echo $?/$^ERRNAME $res
1850 0b1000000000000000000000000000000000000000000000000000000000000000
1851 echo $?/$^ERRNAME $res
1853 -0b1000000000000000000000000000000000000000000000000000000000000000
1854 echo $?/$^ERRNAME $res
1856 S0b1000000000000000000000000000000000000000000000000000000000000001
1857 echo $?/$^ERRNAME $res
1859 S0b1000000000000000000000000000000000000000000000000000000000000001
1860 echo $?/$^ERRNAME $res
1862 -0b1000000000000000000000000000000000000000000000000000000000000001
1863 echo $?/$^ERRNAME $res
1865 U0b1000000000000000000000000000000000000000000000000000000000000001
1866 echo $?/$^ERRNAME $res
1868 vput vexpr res = 0777777777777777777777
1869 echo $?/$^ERRNAME $res
1870 vput vexpr res = S01000000000000000000000
1871 echo $?/$^ERRNAME $res
1872 vput vexpr res @= S01000000000000000000000
1873 echo $?/$^ERRNAME $res
1874 vput vexpr res = U01000000000000000000000
1875 echo $?/$^ERRNAME $res
1876 vput vexpr res = 01000000000000000000000
1877 echo $?/$^ERRNAME $res
1878 vput vexpr res @= 01000000000000000000000
1879 echo $?/$^ERRNAME $res
1880 vput vexpr res = -01000000000000000000000
1881 echo $?/$^ERRNAME $res
1882 vput vexpr res = S01000000000000000000001
1883 echo $?/$^ERRNAME $res
1884 vput vexpr res @= S01000000000000000000001
1885 echo $?/$^ERRNAME $res
1886 vput vexpr res @= -01000000000000000000001
1887 echo $?/$^ERRNAME $res
1888 vput vexpr res = U01000000000000000000001
1889 echo $?/$^ERRNAME $res
1891 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1892 echo $?/$^ERRNAME $res
1893 vput vexpr res = S0x8000000000000000
1894 echo $?/$^ERRNAME $res
1895 vput vexpr res @= S0x8000000000000000
1896 echo $?/$^ERRNAME $res
1897 vput vexpr res = U0x8000000000000000
1898 echo $?/$^ERRNAME $res
1899 vput vexpr res = 0x8000000000000000
1900 echo $?/$^ERRNAME $res
1901 vput vexpr res @= 0x8000000000000000
1902 echo $?/$^ERRNAME $res
1903 vput vexpr res = -0x8000000000000000
1904 echo $?/$^ERRNAME $res
1905 vput vexpr res = S0x8000000000000001
1906 echo $?/$^ERRNAME $res
1907 vput vexpr res @= S0x8000000000000001
1908 echo $?/$^ERRNAME $res
1909 vput vexpr res @= -0x8000000000000001
1910 echo $?/$^ERRNAME $res
1911 vput vexpr res = u0x8000000000000001
1912 echo $?/$^ERRNAME $res
1915 echo $?/$^ERRNAME $res
1917 echo $?/$^ERRNAME $res
1919 echo $?/$^ERRNAME $res
1921 vput vexpr res + 0 0
1922 echo $?/$^ERRNAME $res
1923 vput vexpr res + 0 1
1924 echo $?/$^ERRNAME $res
1925 vput vexpr res + 1 1
1926 echo $?/$^ERRNAME $res
1928 vput vexpr res + 9223372036854775807 0
1929 echo $?/$^ERRNAME $res
1930 vput vexpr res + 9223372036854775807 1
1931 echo $?/$^ERRNAME $res
1932 vput vexpr res @+ 9223372036854775807 1
1933 echo $?/$^ERRNAME $res
1934 vput vexpr res + 0 9223372036854775807
1935 echo $?/$^ERRNAME $res
1936 vput vexpr res + 1 9223372036854775807
1937 echo $?/$^ERRNAME $res
1938 vput vexpr res @+ 1 9223372036854775807
1939 echo $?/$^ERRNAME $res
1941 vput vexpr res + -9223372036854775808 0
1942 echo $?/$^ERRNAME $res
1943 vput vexpr res + -9223372036854775808 -1
1944 echo $?/$^ERRNAME $res
1945 vput vexpr res @+ -9223372036854775808 -1
1946 echo $?/$^ERRNAME $res
1947 vput vexpr res + 0 -9223372036854775808
1948 echo $?/$^ERRNAME $res
1949 vput vexpr res + -1 -9223372036854775808
1950 echo $?/$^ERRNAME $res
1951 vput vexpr res @+ -1 -9223372036854775808
1952 echo $?/$^ERRNAME $res
1954 vput vexpr res - 0 0
1955 echo $?/$^ERRNAME $res
1956 vput vexpr res - 0 1
1957 echo $?/$^ERRNAME $res
1958 vput vexpr res - 1 1
1959 echo $?/$^ERRNAME $res
1961 vput vexpr res - 9223372036854775807 0
1962 echo $?/$^ERRNAME $res
1963 vput vexpr res - 9223372036854775807 -1
1964 echo $?/$^ERRNAME $res
1965 vput vexpr res @- 9223372036854775807 -1
1966 echo $?/$^ERRNAME $res
1967 vput vexpr res - 0 9223372036854775807
1968 echo $?/$^ERRNAME $res
1969 vput vexpr res - -1 9223372036854775807
1970 echo $?/$^ERRNAME $res
1971 vput vexpr res - -2 9223372036854775807
1972 echo $?/$^ERRNAME $res
1973 vput vexpr res @- -2 9223372036854775807
1974 echo $?/$^ERRNAME $res
1976 vput vexpr res - -9223372036854775808 +0
1977 echo $?/$^ERRNAME $res
1978 vput vexpr res - -9223372036854775808 +1
1979 echo $?/$^ERRNAME $res
1980 vput vexpr res @- -9223372036854775808 +1
1981 echo $?/$^ERRNAME $res
1982 vput vexpr res - 0 -9223372036854775808
1983 echo $?/$^ERRNAME $res
1984 vput vexpr res - +1 -9223372036854775808
1985 echo $?/$^ERRNAME $res
1986 vput vexpr res @- +1 -9223372036854775808
1987 echo $?/$^ERRNAME $res
1989 vput vexpr res + -13 -2
1990 echo $?/$^ERRNAME $res
1991 vput vexpr res - 0 0
1992 echo $?/$^ERRNAME $res
1993 vput vexpr res - 0 1
1994 echo $?/$^ERRNAME $res
1995 vput vexpr res - 1 1
1996 echo $?/$^ERRNAME $res
1997 vput vexpr res - -13 -2
1998 echo $?/$^ERRNAME $res
2000 vput vexpr res * 0 0
2001 echo $?/$^ERRNAME $res
2002 vput vexpr res * 0 1
2003 echo $?/$^ERRNAME $res
2004 vput vexpr res * 1 1
2005 echo $?/$^ERRNAME $res
2006 vput vexpr res * -13 -2
2007 echo $?/$^ERRNAME $res
2009 vput vexpr res / 0 0
2010 echo $?/$^ERRNAME $res
2011 vput vexpr res / 0 1
2012 echo $?/$^ERRNAME $res
2013 vput vexpr res / 1 1
2014 echo $?/$^ERRNAME $res
2015 vput vexpr res / -13 -2
2016 echo $?/$^ERRNAME $res
2018 vput vexpr res % 0 0
2019 echo $?/$^ERRNAME $res
2020 vput vexpr res % 0 1
2021 echo $?/$^ERRNAME $res
2022 vput vexpr res % 1 1
2023 echo $?/$^ERRNAME $res
2024 vput vexpr res % -13 -2
2025 echo $?/$^ERRNAME $res
2028 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
2030 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2031 vput vexpr res
find 'bananarama' 'nana'
2032 echo $?
/$^ERRNAME
:$res:
2033 vput vexpr res
find 'bananarama' 'bana'
2034 echo $?
/$^ERRNAME
:$res:
2035 vput vexpr res
find 'bananarama' 'Bana'
2036 echo $?
/$^ERRNAME
:$res:
2037 vput vexpr res
find 'bananarama' 'rama'
2038 echo $?
/$^ERRNAME
:$res:
2040 vput vexpr res ifind
'bananarama' 'nana'
2041 echo $?
/$^ERRNAME
:$res:
2042 vput vexpr res ifind
'bananarama' 'bana'
2043 echo $?
/$^ERRNAME
:$res:
2044 vput vexpr res ifind
'bananarama' 'Bana'
2045 echo $?
/$^ERRNAME
:$res:
2046 vput vexpr res ifind
'bananarama' 'rama'
2047 echo $?
/$^ERRNAME
:$res:
2049 vput vexpr res substring
'bananarama' 1
2050 echo $?
/$^ERRNAME
:$res:
2051 vput vexpr res substring
'bananarama' 3
2052 echo $?
/$^ERRNAME
:$res:
2053 vput vexpr res substring
'bananarama' 5
2054 echo $?
/$^ERRNAME
:$res:
2055 vput vexpr res substring
'bananarama' 7
2056 echo $?
/$^ERRNAME
:$res:
2057 vput vexpr res substring
'bananarama' 9
2058 echo $?
/$^ERRNAME
:$res:
2059 vput vexpr res substring
'bananarama' 10
2060 echo $?
/$^ERRNAME
:$res:
2061 vput vexpr res substring
'bananarama' 1 3
2062 echo $?
/$^ERRNAME
:$res:
2063 vput vexpr res substring
'bananarama' 3 3
2064 echo $?
/$^ERRNAME
:$res:
2065 vput vexpr res substring
'bananarama' 5 3
2066 echo $?
/$^ERRNAME
:$res:
2067 vput vexpr res substring
'bananarama' 7 3
2068 echo $?
/$^ERRNAME
:$res:
2069 vput vexpr res substring
'bananarama' 9 3
2070 echo $?
/$^ERRNAME
:$res:
2071 vput vexpr res substring
'bananarama' 10 3
2072 echo $?
/$^ERRNAME
:$res:
2074 vput vexpr res substring
'bananarama' -1
2075 echo $?
/$^ERRNAME
:$res:
2076 vput vexpr res substring
'bananarama' -3
2077 echo $?
/$^ERRNAME
:$res:
2078 vput vexpr res substring
'bananarama' -5
2079 echo $?
/$^ERRNAME
:$res:
2080 vput vexpr res substring
'bananarama' -7
2081 echo $?
/$^ERRNAME
:$res:
2082 vput vexpr res substring
'bananarama' -9
2083 echo $?
/$^ERRNAME
:$res:
2084 vput vexpr res substring
'bananarama' -10
2085 echo $?
/$^ERRNAME
:$res:
2086 vput vexpr res substring
'bananarama' 1 -3
2087 echo $?
/$^ERRNAME
:$res:
2088 vput vexpr res substring
'bananarama' 3 -3
2089 echo $?
/$^ERRNAME
:$res:
2090 vput vexpr res substring
'bananarama' 5 -3
2091 echo $?
/$^ERRNAME
:$res:
2092 vput vexpr res substring
'bananarama' 7 -3
2093 echo $?
/$^ERRNAME
:$res:
2094 vput vexpr res substring
'bananarama' 9 -3
2095 echo $?
/$^ERRNAME
:$res:
2096 vput vexpr res substring
'bananarama' 10 -3
2097 echo $?
/$^ERRNAME
:$res:
2099 vput vexpr res trim
'Cocoon Cocoon'
2100 echo $?
/$^ERRNAME
:$res:
2101 vput vexpr res trim
' Cocoon Cocoon '
2102 echo $?
/$^ERRNAME
:$res:
2103 vput vexpr res trim-front
'Cocoon Cocoon'
2104 echo $?
/$^ERRNAME
:$res:
2105 vput vexpr res trim-front
' Cocoon Cocoon '
2106 echo $?
/$^ERRNAME
:$res:
2107 vput vexpr res trim-end
'Cocoon Cocoon'
2108 echo $?
/$^ERRNAME
:$res:
2109 vput vexpr res trim-end
' Cocoon Cocoon '
2110 echo $?
/$^ERRNAME
:$res:
2113 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2115 if have_feat regex
; then
2116 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2117 vput vexpr res regex 'bananarama' 'nana'
2118 echo $?/$^ERRNAME :$res:
2119 vput vexpr res regex 'bananarama' 'bana'
2120 echo $?/$^ERRNAME :$res:
2121 vput vexpr res regex 'bananarama' 'Bana'
2122 echo $?/$^ERRNAME :$res:
2123 vput vexpr res regex 'bananarama' 'rama'
2124 echo $?/$^ERRNAME :$res:
2126 vput vexpr res iregex 'bananarama' 'nana'
2127 echo $?/$^ERRNAME :$res:
2128 vput vexpr res iregex 'bananarama' 'bana'
2129 echo $?/$^ERRNAME :$res:
2130 vput vexpr res iregex 'bananarama' 'Bana'
2131 echo $?/$^ERRNAME :$res:
2132 vput vexpr res iregex 'bananarama' 'rama'
2133 echo $?/$^ERRNAME :$res:
2135 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2136 echo $?/$^ERRNAME :$res:
2137 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2138 echo $?/$^ERRNAME :$res:
2139 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2140 echo $?/$^ERRNAME :$res:
2141 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2142 echo $?/$^ERRNAME :$res:
2144 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2145 echo $?/$^ERRNAME :$res:
2146 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2147 echo $?/$^ERRNAME :$res:
2148 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2149 echo $?/$^ERRNAME :$res:
2150 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2151 echo $?/$^ERRNAME :$res:
2155 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2157 printf 'behave:vexpr-regex: unsupported, skipped\n'
2163 t_behave_call_ret() {
2164 t_prolog t_behave_call_ret
2166 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2171 vput vexpr j
'&' $i 7
2177 vput vexpr j
'&' $i 7
2183 echo ! The end
for $1
2187 # Transport $?/$! up the call chain
2193 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2197 echo ! The end
for $1
2198 return $i $^ERR-BUSY
2202 # Up and down it goes
2209 vput vexpr k
- $1 $2
2213 echo "# <$i/$j> .. "
2217 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2220 echo ! The end
for $1=$i/$2
2224 return $i $^ERR-BUSY
2230 call w1
0; echo ?
=$?
!=$
!; echo -----;
2231 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2232 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2235 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2241 t_prolog t_behave_xcall
2243 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2248 vput vexpr j '&' $i 7
2254 echo ! The end for $1/$2
2256 return $i $^ERR-BUSY
2267 echo ?=$? !=$^ERRNAME
2270 echo ?=$? !=$^ERRNAME
2272 echo ?=$? !=$^ERRNAME
2275 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2279 ${cat} <<- '__EOT' > "${BODY}"
2284 vput vexpr j '&' $i 7
2290 echo ! The end for $1
2293 echo would be err with errexit
2302 echo zwei, ?=$? !=$!
2303 localopts yes; set errexit
2305 echo drei, ?=$? !=$^ERRNAME
2307 echo vier, ?=$? !=$^ERRNAME, this is an error
2310 echo outer 1, ?=$? !=$^ERRNAME
2312 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2314 echo outer 3, ?=$? !=$^ERRNAME
2315 echo this is definitely an error
2318 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2320 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2322 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2324 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2329 t_behave_vpospar() {
2330 t_prolog t_behave_vpospar
2332 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2333 vpospar
set hey
, "'you ", world
!
2334 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2335 vput vpospar x quote
; echo x
<$x>
2336 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2337 vput vpospar y quote
;echo y
<$y>
2338 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2339 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2340 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2343 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2344 vput vpospar z quote
;echo infun2
:z
<$z>
2348 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2349 vput vpospar y quote
;echo infun
:y
<$y>
2350 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2351 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2353 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2354 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2357 call infun This
"in a" fun
2358 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2359 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2361 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2364 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2366 echo ifs<$ifs> ifs-ws<$ifs-ws>
2367 vpospar set hey, "'you ", world!
2368 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2369 vput vpospar x quote; echo x<$x>
2370 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2371 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2374 echo ifs<$ifs> ifs-ws<$ifs-ws>
2375 vpospar set hey, "'you
", world!
2376 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2378 vput vpospar x quote; echo x<$x>
2379 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2380 eval vpospar set ${x};\
2381 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2384 echo ifs<$ifs> ifs-ws<$ifs-ws>
2385 vpospar set hey, "'you ", world!
2386 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2388 vput vpospar x quote; echo x<$x>
2389 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2390 eval vpospar set ${x};\
2391 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2393 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2398 t_behave_atxplode() {
2399 t_prolog t_behave_atxplode
2400 TRAP_EXIT_ADDONS="./.t*"
2402 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2405 printf " (1/$#: <$1>)"
2407 if [ $# -gt 0 ]; then
2421 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2422 printf xxx;xxx arg ,b u.
2423 printf xxx;xxx arg , .
2424 printf xxx;xxx arg ,ball.
2430 echon " (1/$#: <$1>)"
2445 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2446 echon xxx;call xxx arg ,b u.
2447 echon xxx;call xxx arg , .
2448 echon xxx;call xxx arg ,ball.
2451 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2452 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2454 #${SHELL} ./.t.sh > ./.tshout 2>&1
2455 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2461 t_prolog t_behave_read
2462 TRAP_EXIT_ADDONS="./.t*"
2464 ${cat} <<- '__EOT
' > .tin
2465 hey1, "'you
", world!
2466 hey2, "'you ", bugs bunny!
2471 ${cat} <<- '__EOT
' |\
2472 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2474 echo $?/$^ERRNAME / <$a><$b><$c>
2476 echo $?/$^ERRNAME / <$a><$b><$c>
2478 echo $?/$^ERRNAME / <$a><$b><$c>
2480 echo $?/$^ERRNAME / <$a><$b><$c>
2481 unset a b c;read a b c
2482 echo $?/$^ERRNAME / <$a><$b><$c>
2483 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2485 check behave:read-1 0 "${MBOX}" '1527910147 173'
2487 ${cat} <<- '__EOT
' > .tin2
2488 hey2.0,:"'you
",:world!:mars.:
2489 hey2.1,:"'you ",:world!
2490 hey2.2,:"'you
",:bugs bunny!
2496 ${cat} <<- '__EOT' |\
2497 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2500 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2502 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2504 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2506 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2508 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2510 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2511 unset a b c
;read a b c
2512 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2514 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2515 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2517 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2519 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2521 readall d; echo $?/$^ERRNAME / <$d>
2522 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2523 readctl create .tin2
2524 readall d; echo $?/$^ERRNAME / <$d>
2525 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2526 readctl remove .tin;echo $?/$^ERRNAME;\
2527 readctl remove .tin2;echo $?/$^ERRNAME
2529 check behave:readall 0 "${MBOX}" '860434889 333'
2535 t_prolog t_behave_mbox
2536 TRAP_EXIT_ADDONS=".
/.t
*"
2540 while [ ${i} -lt 112 ]; do
2541 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2542 "${MBOX}" "${i}" "${i}"
2545 ) | ${MAILX} ${ARGS} > .tall 2>&1
2546 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2547 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2549 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2550 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2551 check behave:mbox-2 0 .tall '2739893312 9103'
2553 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2554 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2555 check behave
:mbox-3
0 .tall
'1702194178 9110'
2557 # only the odd (even)
2559 printf 'File "file://%s"\ncopy ' .tmbox2
2561 while [ ${i} -lt 112 ]; do
2563 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2566 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2567 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2568 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2569 check behave
:mbox-5
- .tall
'2960975049 4573'
2572 printf 'file "file://%s"\nmove ' .tmbox2
2574 while [ ${i} -lt 112 ]; do
2576 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2579 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2580 .tmbox3 .tmbox3 .tmbox2
2581 ) | ${MAILX} ${ARGS} -Sshowlast > .tall #2>&1
2582 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2583 ${sed} 2d < .tall > .tallx
2584 check behave:mbox-7 - .tallx '2729940494 13645'
2586 # Invalid MBOXes (after [f4db93b3])
2588 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2589 check behave
:mbox-8
0 .tinvmbox
'999592329 122'
2590 check behave
:mbox-9
- .
/.tall
'3146754194 33'
2592 echo ' ' > .tinvmbox
2593 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2594 check behave:mbox-10 0 .tinvmbox '3790411604 124'
2595 check behave:mbox-11 - ./.tall '3146754194 33'
2597 { echo; echo; } > .tinvmbox # (not invalid)
2598 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2599 check behave
:mbox-12
0 .tinvmbox
'534457575 123'
2600 check behave
:mbox-13
- .
/.tall
'3146754194 33'
2602 # *mbox-rfc4155*, plus
2603 ${cat} <<-_EOT > ./.tinv
2606 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2607 Date: Wed, 02 Oct 1996 01:50:07 +0000
2609 Subject: Bad bad message 1
2611 From me to you, blinde Kuh!
2613 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2614 Date: Wed, 02 Oct 1996 01:50:07 +0000
2616 Subject: Bad bad message 2
2618 From me to you, blindes Kalb!
2623 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2624 \\eval copy * "${2}"
2626 call mboxfix ./.tinv ./.tok' |
${MAILX} ${ARGS} > .tall
2>&1
2627 ex0_test behave
:mbox-12-estat
2628 ${cat} .
/.tinv .
/.tok
>> .tall
2629 check behave
:mbox-12
- .
/.tall
'739301109 616'
2634 t_behave_maildir
() {
2635 t_prolog t_behave_maildir
2636 TRAP_EXIT_ADDONS
="./.t*"
2640 while [ ${i} -lt 112 ]; do
2641 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2642 "${MBOX}" "${i}" "${i}"
2645 ) |
${MAILX} ${ARGS}
2646 check behave
:maildir-1
0 "${MBOX}" '1140119864 13780'
2652 ' "${MBOX}" .tmdir1 .tmdir1 |
2653 ${MAILX} ${ARGS} -Snewfolders=maildir
-Sshowlast > .tlst
2654 check behave
:maildir-2
0 .tlst
'1797938753 9103'
2657 copy * "maildir://%s"
2660 ' "${MBOX}" .tmdir2 .tmdir2 |
2661 ${MAILX} ${ARGS} -Sshowlast > .tlst
2662 check behave
:maildir-3
0 .tlst
'1155631089 9113'
2664 printf 'File "maildir://%s"
2668 ' .tmdir2 .tmbox1 .tmbox1 |
2669 ${MAILX} ${ARGS} -Sshowlast > .tlst
2670 check behave
:maildir-4
0 .tmbox1
'2646131190 13220'
2671 check behave
:maildir-5
- .tlst
'3701297796 9110'
2673 # only the odd (even)
2675 printf 'File "maildir://%s"
2678 while [ ${i} -lt 112 ]; do
2680 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2687 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2688 check behave
:maildir-6
0 .tmbox2
'142890131 6610'
2689 check behave
:maildir-7
- .tlst
'960096773 4573'
2692 printf 'file "maildir://%s"
2695 while [ ${i} -lt 112 ]; do
2697 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2705 ' .tmbox2 .tmbox2 .tmdir2
2706 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2707 check behave:maildir-8 0 .tmbox2 '3806905791 13100'
2708 ${sed} 2d < .tlst > .tlstx
2709 check behave:maildir-9 - .tlstx '4216815295 13645'
2714 t_behave_record_a_resend() {
2715 t_prolog t_behave_record_a_resend
2716 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
2720 m %s\n~s Subject 1.\nHello.\n~.
2721 set record-files add-file-recipients
2722 m %s\n~s Subject 2.\nHello.\n~.
2724 resend 2 ./.t.resent
2725 Resend 1 ./.t.resent
2727 resend 2 ./.t.resent
2728 Resend 1 ./.t.resent
2729 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
2732 check behave:record_a_resend-1 0 "${MBOX}" '3057873538 256'
2733 check behave:record_a_resend-2 - .t.record '391356429 460'
2734 check behave:record_a_resend-3 - .t.resent '2685231691 648'
2739 t_behave_e_H_L_opts() {
2740 t_prolog t_behave_e_H_L_opts
2741 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2744 ${MAILX} ${ARGS} -ef ./.t.mbox
2745 echo ${?} > "${MBOX}"
2747 ${cat} <<-_EOT > ./.tsendmail.sh
2749 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2752 chmod 0755 ./.tsendmail.sh
2753 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2754 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2755 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2756 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2758 ${MAILX} ${ARGS} -ef ./.t.mbox
2759 echo ${?} >> "${MBOX}"
2760 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
2761 echo ${?} >> "${MBOX}"
2762 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
2763 echo ${?} >> "${MBOX}"
2764 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
2765 echo ${?} >> "${MBOX}"
2766 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
2767 echo ${?} >> "${MBOX}"
2768 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
2769 echo ${?} >> "${MBOX}"
2770 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2771 echo ${?} >> "${MBOX}"
2773 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2774 echo ${?} >> "${MBOX}"
2775 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2776 echo ${?} >> "${MBOX}"
2777 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2778 echo ${?} >> "${MBOX}"
2779 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2780 echo ${?} >> "${MBOX}"
2781 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2782 echo ${?} >> "${MBOX}"
2783 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2784 echo ${?} >> "${MBOX}"
2785 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev
/null
2786 echo ${?} >> "${MBOX}"
2788 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2793 t_behave_alternates
() {
2794 t_prolog t_behave_alternates
2795 TRAP_EXIT_ADDONS
="./.t*"
2797 ${cat} <<-_EOT > ./.tsendmail.sh
2799 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2802 chmod 0755 .
/.tsendmail.sh
2804 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2808 alternates a1@b1 a2@b2 a3@b3
2813 echo $?
/$^ERRNAME
<$rv>
2818 echo $?
/$^ERRNAME
<$rv>
2821 echo $?
/$^ERRNAME
<$rv>
2824 echo $?
/$^ERRNAME
<$rv>
2828 alternates a1@b1 a2@b2 a3@b3
2831 echo $?
/$^ERRNAME
<$rv>
2834 echo $?
/$^ERRNAME
<$rv>
2837 echo $?
/$^ERRNAME
<$rv>
2840 alternates a1@b1 a2@b2 a3@b3
2843 echo $?
/$^ERRNAME
<$rv>
2846 echo $?
/$^ERRNAME
<$rv>
2849 echo $?
/$^ERRNAME
<$rv>
2853 alternates a1@b1 a2@b2 a3@b3
2856 echo $?
/$^ERRNAME
<$rv>
2860 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2862 ~s all alternates
, only a1@b1 remains
2864 ~b a3@b3 a3@c3 a3@d3
2873 alternates a1@b1 a1@c1 a2@b2 a3@b3
2875 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2877 ~b a3@b3 a3@c3 a3@d3
2884 alternates a1@b1 a2@b2 a3
; set allnet
2886 ~s all alternates via allnet
, only a1@b1 remains
2888 ~b a3@b3 a3@c3 a3@d3
2899 echo $?
/$^ERRNAME
<$rv>
2903 echo $?
/$^ERRNAME
<$rv>
2907 echo $?
/$^ERRNAME
<$rv>
2911 echo $?
/$^ERRNAME
<$rv>
2915 echo $?
/$^ERRNAME
<$rv>
2919 alternates a1@b1 a2@b2
2922 echo $?
/$^ERRNAME
<$rv>
2923 alternates a3@b3 a4@b4
2926 echo $?
/$^ERRNAME
<$rv>
2928 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2929 check behave
:alternates-2
- .tall
'1878598364 505'
2935 t_prolog t_behave_alias
2936 TRAP_EXIT_ADDONS
="./.t*"
2938 ${cat} <<-_EOT > ./.tsendmail.sh
2940 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2943 chmod 0755 .
/.tsendmail.sh
2945 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2947 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2949 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2951 alias a4 a5 ex1@a4.ple
2953 alias a6 a7 ex1@a6.ple
2967 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2968 check behave
:alias-2
- .tall
'3548953204 152'
2970 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2971 # TODO need to somehow provide its contents to the test, then test
2976 t_behave_filetype
() {
2977 t_prolog t_behave_filetype
2978 TRAP_EXIT_ADDONS
="./.t*"
2980 ${cat} <<-_EOT > ./.tsendmail.sh
2982 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2985 chmod 0755 .
/.tsendmail.sh
2987 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2988 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2989 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2991 if (echo | gzip -c) >/dev/null 2>&1; then
2994 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2995 "${MBOX}" | ${MAILX} ${ARGS} \
2996 -X'filetype gz gzip\ -dc gzip\ -c'
2997 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2998 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3000 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
3001 check behave
:filetype-3
- "./.t.out" '2392348396 102'
3003 echo 'behave:filetype-2: unsupported, skipped'
3004 echo 'behave:filetype-3: unsupported, skipped'
3009 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
3015 -X'filetype gz gzip\ -dc gzip\ -c' \
3016 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
3017 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
3018 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3020 -X'filetype gz gzip\ -dc gzip\ -c' \
3021 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
3023 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
3024 check behave
:filetype-5
- "./.t.out" '852335377 172'
3029 t_behave_message_injections
() {
3030 t_prolog t_behave_message_injections
3031 TRAP_EXIT_ADDONS
="./.t*"
3033 ${cat} <<-_EOT > ./.tsendmail.sh
3035 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3038 chmod 0755 .
/.tsendmail.sh
3040 echo mysig
> .
/.tmysig
3042 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3043 -Smessage-inject-head=head-inject \
3044 -Smessage-inject-tail=tail-inject \
3045 -Ssignature=.
/.tmysig \
3046 ex@am.ple
> .
/.tall
2>&1
3047 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3048 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3050 ${cat} <<-_EOT > ./.template
3054 Subject: This subject is
3056 Body, body, body me.
3058 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3059 -Smessage-inject-head=head-inject \
3060 -Smessage-inject-tail=tail-inject \
3061 -Ssignature=.
/.tmysig \
3063 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3064 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3069 t_behave_attachments
() {
3070 t_prolog t_behave_attachments
3071 TRAP_EXIT_ADDONS
="./.t*"
3073 ${cat} <<-_EOT > ./.tsendmail.sh
3075 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3078 chmod 0755 .
/.tsendmail.sh
3080 ${cat} <<-_EOT > ./.tx
3081 From steffen Sun Feb 18 02:48:40 2018
3082 Date: Sun, 18 Feb 2018 02:48:40 +0100
3085 User-Agent: s-nail v14.9.7
3088 From steffen Sun Feb 18 02:48:42 2018
3089 Date: Sun, 18 Feb 2018 02:48:42 +0100
3092 User-Agent: s-nail v14.9.7
3097 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3098 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3099 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3102 '!@ ./.t3 "./.t 4" ""
3110 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
3111 -a .
/.t1
-a './.t 2' \
3112 -s attachment-test \
3113 ex@am.ple
> .
/.tall
2>&1
3114 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3115 check behave
:attachments-2
- .tall
'1928331872 720'
3120 !s This the subject is
3121 !@ ./.t3 "#2" "./.t 4" "#1" ""
3131 !@ ./.t3 "#2" "./.t 4" "#1" ""
3139 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3148 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3162 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Rf .
/.tx \
3164 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3165 check behave
:attachments-4
- .tall
'2526106274 1910'
3170 t_behave_compose_hooks
() { # TODO monster
3171 t_prolog t_behave_compose_hooks
3172 TRAP_EXIT_ADDONS
="./.t*"
3174 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3175 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3177 ${cat} <<-_EOT > ./.tsendmail.sh
3179 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3182 chmod 0755 .
/.tsendmail.sh
3184 ${cat} <<'__EOT__' > ./.trc
3186 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3189 vput vexpr es substr "$1" 0 1
3194 define read_mline_res {
3195 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3196 echo $len/$es/$^ERRNAME: $hl
3197 if [ $es -ne $^ERR-NONE ]
3198 xcall bail read_mline_res
3200 \xcall read_mline_res
3205 echo "~^header list"; read hl; echo $hl;\
3206 call xerr "$hl" "in_addr ($xh) 0-1"
3208 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3209 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3210 echo "~^header insert $xh <${xh}2@exam.ple>";\
3211 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3212 echo "~^header insert $xh ${xh}3@exam.ple";\
3213 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3214 echo "~^header list $xh"; read hl; echo $hl;\
3215 call xerr "$hl" "ins_addr $xh 1-4"
3216 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3219 if [ "$t_remove" == "" ]
3223 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3224 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3226 xcall bail "ins_addr $xh 2-2"
3228 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3230 xcall bail "ins_addr $xh 2-3"
3232 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3234 xcall bail "ins_addr $xh 2-4"
3238 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3239 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3240 echo "~^header insert $xh <${xh}2@exam.ple>";\
3241 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3242 echo "~^header insert $xh ${xh}3@exam.ple";\
3243 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3244 echo "~^header list $xh"; read hl; echo $hl;\
3245 call xerr "$hl" "ins_addr $xh 3-4"
3246 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3249 echo "~^header remove-at $xh 1"; read es;\
3250 call xerr $es "ins_addr $xh 3-6"
3251 echo "~^header remove-at $xh 1"; read es;\
3252 call xerr $es "ins_addr $xh 3-7"
3253 echo "~^header remove-at $xh 1"; read es;\
3254 call xerr $es "ins_addr $xh 3-8"
3255 echo "~^header remove-at $xh 1"; read es;\
3256 vput vexpr es substr $es 0 3
3258 xcall bail "ins_addr $xh 3-9"
3260 echo "~^header remove-at $xh T"; read es;\
3261 vput vexpr es substr $es 0 3
3263 xcall bail "ins_addr $xh 3-10"
3265 echo "~^header list $xh"; read es;\
3266 vput vexpr es substr $es 0 3
3268 xcall bail "ins_addr $xh 3-11"
3270 echo "~^header show $xh"; read es;\
3271 vput vexpr es substr $es 0 3
3273 xcall bail "ins_addr $xh 3-12"
3277 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3278 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3279 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3280 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3281 echo "~^header insert $xh ${xh}3@exam.ple";\
3282 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3283 echo "~^header list $xh"; read hl; echo $hl;\
3284 call xerr "$hl" "header list $xh 3-4"
3285 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3288 echo "~^header remove-at $xh 3"; read es;\
3289 call xerr $es "ins_addr $xh 4-6"
3290 echo "~^header remove-at $xh 2"; read es;\
3291 call xerr $es "ins_addr $xh 4-7"
3292 echo "~^header remove-at $xh 1"; read es;\
3293 call xerr $es "ins_addr $xh 4-8"
3294 echo "~^header remove-at $xh 1"; read es;\
3295 vput vexpr es substr $es 0 3
3297 xcall bail "ins_addr $xh 4-9"
3299 echo "~^header remove-at $xh T"; read es;\
3300 vput vexpr es substr $es 0 3
3302 xcall bail "ins_addr $xh 4-10"
3304 echo "~^header list $xh"; read es;\
3305 vput vexpr es substr $es 0 3
3307 xcall bail "ins_addr $xh 4-11"
3309 echo "~^header show $xh"; read es;\
3310 vput vexpr es substr $es 0 3
3312 xcall bail "ins_addr $xh 4-12"
3316 wysh set xh=$1 mult=$2
3317 echo "~^header list"; read hl; echo $hl;\
3318 call xerr "$hl" "ins_ref ($xh) 0-1"
3320 echo "~^header insert $xh <$xh@exam.ple>";\
3321 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3323 echo "~^header insert $xh <${xh}2@exam.ple>";\
3324 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3325 echo "~^header insert $xh ${xh}3@exam.ple";\
3326 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3328 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3329 vput vexpr es substr $es 0 3
3331 xcall bail "ins_ref $xh 1-4"
3335 echo "~^header list $xh"; read hl; echo $hl;\
3336 call xerr "$hl" "ins_ref $xh 1-5"
3337 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3340 if [ "$t_remove" == "" ]
3344 echo "~^header remove $xh"; read es;\
3345 call xerr $es "ins_ref $xh 2-1"
3346 echo "~^header remove $xh"; read es;\
3347 vput vexpr es substr $es 0 3
3349 xcall bail "ins_ref $xh 2-2"
3351 echo "~^header list $xh"; read es;\
3352 vput vexpr es substr $es 0 3
3354 xcall bail "$es ins_ref $xh 2-3"
3356 echo "~^header show $xh"; read es;\
3357 vput vexpr es substr $es 0 3
3359 xcall bail "ins_ref $xh 2-4"
3363 echo "~^header insert $xh <$xh@exam.ple>";\
3364 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3366 echo "~^header insert $xh <${xh}2@exam.ple>";\
3367 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3368 echo "~^header insert $xh ${xh}3@exam.ple";\
3369 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3371 echo "~^header list $xh";\
3372 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3373 echo "~^header show $xh";\
3374 read es; call xerr $es "ins_ref $xh 3-5"
3377 echo "~^header remove-at $xh 1"; read es;\
3378 call xerr $es "ins_ref $xh 3-6"
3379 if [ $mult -ne 0 ] && [ $xh != subject ]
3380 echo "~^header remove-at $xh 1"; read es;\
3381 call xerr $es "ins_ref $xh 3-7"
3382 echo "~^header remove-at $xh 1"; read es;\
3383 call xerr $es "ins_ref $xh 3-8"
3385 echo "~^header remove-at $xh 1"; read es;\
3386 vput vexpr es substr $es 0 3
3388 xcall bail "ins_ref $xh 3-9"
3390 echo "~^header remove-at $xh T"; read es;\
3391 vput vexpr es substr $es 0 3
3393 xcall bail "ins_ref $xh 3-10"
3395 echo "~^header show $xh"; read es;\
3396 vput vexpr es substr $es 0 3
3398 xcall bail "ins_ref $xh 3-11"
3402 echo "~^header insert $xh <$xh@exam.ple> ";\
3403 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3405 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3406 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3407 echo "~^header insert $xh ${xh}3@exam.ple";\
3408 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3410 echo "~^header list $xh"; read hl; echo $hl;\
3411 call xerr "$hl" "ins_ref $xh 4-4"
3412 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3415 if [ $mult -ne 0 ] && [ $xh != subject ]
3416 echo "~^header remove-at $xh 3"; read es;\
3417 call xerr $es "ins_ref $xh 4-6"
3418 echo "~^header remove-at $xh 2"; read es;\
3419 call xerr $es "ins_ref $xh 4-7"
3421 echo "~^header remove-at $xh 1"; read es;\
3422 call xerr $es "ins_ref $xh 4-8"
3423 echo "~^header remove-at $xh 1"; read es;\
3424 vput vexpr es substr $es 0 3
3426 xcall bail "ins_ref $xh 4-9"
3428 echo "~^header remove-at $xh T"; read es;\
3429 vput vexpr es substr $es 0 3
3431 xcall bail "ins_ref $xh 4-10"
3433 echo "~^header show $xh"; read es;\
3434 vput vexpr es substr $es 0 3
3436 xcall bail "ins_ref $xh 4-11"
3441 # In collect.c order
3443 call ins_ref sender 0 # Not a "ref", but works
3447 call ins_addr reply-To
3448 call ins_addr mail-Followup-to
3449 call ins_ref messAge-id 0
3450 call ins_ref rEfErEncEs 1
3451 call ins_ref in-Reply-to 1
3452 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3453 call ins_addr freeForm1
3454 call ins_addr freeform2
3456 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3458 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3466 echo "~^attachment";\
3467 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3469 xcall bail "attach 0-1"
3472 echo "~^attach attribute ./.treadctl";\
3473 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3475 xcall bail "attach 0-2"
3477 echo "~^attachment attribute-at 1";\
3478 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3480 xcall bail "attach 0-3"
3483 echo "~^attachment insert ./.treadctl=ascii";\
3484 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3485 echo "~^attachment list";\
3486 read es; echo $es;call xerr "$es" "attach 1-2"
3488 echo "~^attachment attribute ./.treadctl";\
3489 read es; echo $es;call xerr "$es" "attach 1-3"
3491 echo "~^attachment attribute .treadctl";\
3492 read es; echo $es;call xerr "$es" "attach 1-4"
3494 echo "~^attachment attribute-at 1";\
3495 read es; echo $es;call xerr "$es" "attach 1-5"
3498 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3499 read es; echo $es;call xerr "$es" "attach 1-6"
3500 echo "~^attachment attribute-set .treadctl content-description Au";\
3501 read es; echo $es;call xerr "$es" "attach 1-7"
3502 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3503 read es; echo $es;call xerr "$es" "attach 1-8"
3505 echo "~^attachment attribute ./.treadctl";\
3506 read es; echo $es;call xerr "$es" "attach 1-9"
3508 echo "~^attachment attribute .treadctl";\
3509 read es; echo $es;call xerr "$es" "attach 1-10"
3511 echo "~^attachment attribute rctl";\
3512 read es; echo $es;call xerr "$es" "attach 1-11"
3514 echo "~^attachment attribute-at 1";\
3515 read es; echo $es;call xerr "$es" "attach 1-12"
3519 echo "~^attachment insert ./.tattach=latin1";\
3520 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3521 echo "~^attachment list";\
3522 read es; echo $es;call xerr "$es" "attach 2-2"
3524 echo "~^attachment attribute ./.tattach";\
3525 read es; echo $es;call xerr "$es" "attach 2-3"
3527 echo "~^attachment attribute .tattach";\
3528 read es; echo $es;call xerr "$es" "attach 2-4"
3530 echo "~^attachment attribute-at 2";\
3531 read es; echo $es;call xerr "$es" "attach 2-5"
3534 echo "~^attachment attribute-set ./.tattach filename tat";\
3535 read es; echo $es;call xerr "$es" "attach 2-6"
3537 "~^attachment attribute-set .tattach content-description Au2";\
3538 read es; echo $es;call xerr "$es" "attach 2-7"
3539 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3540 read es; echo $es;call xerr "$es" "attach 2-8"
3542 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3543 read es; echo $es;call xerr "$es" "attach 2-9"
3545 echo "~^attachment attribute ./.tattach";\
3546 read es; echo $es;call xerr "$es" "attach 2-10"
3548 echo "~^attachment attribute .tattach";\
3549 read es; echo $es;call xerr "$es" "attach 2-11"
3551 echo "~^attachment attribute tat";\
3552 read es; echo $es;call xerr "$es" "attach 2-12"
3554 echo "~^attachment attribute-at 2";\
3555 read es; echo $es;call xerr "$es" "attach 2-13"
3559 if [ "$t_remove" == "" ]
3563 echo "~^attachment remove ./.treadctl"; read es;\
3564 call xerr $es "attach 3-1"
3565 echo "~^attachment remove ./.tattach"; read es;\
3566 call xerr $es "attach 3-2"
3567 echo "~^ attachment remove ./.treadctl"; read es;\
3568 vput vexpr es substr $es 0 3
3570 xcall bail "attach 3-3"
3572 echo "~^ attachment remove ./.tattach"; read es;\
3573 vput vexpr es substr $es 0 3
3575 xcall bail "attach 3-4"
3577 echo "~^attachment list"; read es;\
3578 vput vexpr es substr $es 0 3
3580 xcall bail "attach 3-5"
3584 echo "~^attachment insert ./.tattach=latin1";\
3585 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3586 echo "~^attachment insert ./.tattach=latin1";\
3587 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3588 echo "~^attachment list";\
3589 read es; echo $es;call xerr "$es" "attach 4-3"
3591 echo "~^ attachment remove .tattach"; read es;\
3592 vput vexpr es substr $es 0 3
3594 xcall bail "attach 4-4 $es"
3596 echo "~^attachment remove-at T"; read es;\
3597 vput vexpr es substr $es 0 3
3599 xcall bail "attach 4-5"
3601 echo "~^attachment remove ./.tattach"; read es;\
3602 call xerr $es "attach 4-6"
3603 echo "~^attachment remove ./.tattach"; read es;\
3604 call xerr $es "attach 4-7"
3605 echo "~^ attachment remove ./.tattach"; read es;\
3606 vput vexpr es substr $es 0 3
3608 xcall bail "attach 4-8 $es"
3610 echo "~^attachment list"; read es;\
3611 vput vexpr es substr $es 0 3
3613 xcall bail "attach 4-9"
3617 echo "~^attachment insert ./.tattach=latin1";\
3618 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3619 echo "~^attachment insert ./.tattach=latin1";\
3620 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3621 echo "~^attachment insert ./.tattach=latin1";\
3622 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3623 echo "~^attachment list";\
3624 read es; echo $es;call xerr "$es" "attach 5-4"
3627 echo "~^attachment remove-at 3"; read es;\
3628 call xerr $es "attach 5-5"
3629 echo "~^attachment remove-at 3"; read es;\
3630 vput vexpr es substr $es 0 3
3632 xcall bail "attach 5-6"
3634 echo "~^attachment remove-at 2"; read es;\
3635 call xerr $es "attach 5-7"
3636 echo "~^attachment remove-at 2"; read es;\
3637 vput vexpr es substr $es 0 3
3639 xcall bail "attach 5-8"
3641 echo "~^attachment remove-at 1"; read es;\
3642 call xerr $es "attach 5-9"
3643 echo "~^attachment remove-at 1"; read es;\
3644 vput vexpr es substr $es 0 3
3646 xcall bail "attach 5-10"
3649 echo "~^attachment list"; read es;\
3650 vput vexpr es substr $es 0 3
3652 xcall bail "attach 5-11"
3656 echo "~^attachment insert ./.tattach=latin1";\
3657 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3658 echo "~^attachment insert ./.tattach=latin1";\
3659 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3660 echo "~^attachment insert ./.tattach=latin1";\
3661 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3662 echo "~^attachment list";\
3663 read es; echo $es;call xerr "$es" "attach 6-4"
3666 echo "~^attachment remove-at 1"; read es;\
3667 call xerr $es "attach 6-5"
3668 echo "~^attachment remove-at 1"; read es;\
3669 call xerr $es "attach 6-6"
3670 echo "~^attachment remove-at 1"; read es;\
3671 call xerr $es "attach 6-7"
3672 echo "~^attachment remove-at 1"; read es;\
3673 vput vexpr es substr $es 0 3
3675 xcall bail "attach 6-8"
3678 echo "~^attachment list"; read es;\
3679 vput vexpr es substr $es 0 3
3681 xcall bail "attach 6-9"
3693 echo on-compose-enter, mailx-command<$mailx-command>
3694 alternates alter1@exam.ple alter2@exam.ple
3696 set autocc='alter1@exam.ple alter2@exam.ple'
3697 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3698 echo mailx-subject<$mailx-subject>
3699 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3700 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3701 mailx-raw-bcc<$mailx-raw-bcc>
3702 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3703 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3706 echo on-compose-leave, mailx-command<$mailx-command>
3708 eval alternates $al alter3@exam.ple alter4@exam.ple
3710 set autobcc='alter3@exam.ple alter4@exam.ple'
3711 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3712 echo mailx-subject<$mailx-subject>
3713 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3714 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3715 mailx-raw-bcc<$mailx-raw-bcc>
3716 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3717 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3720 echo on-compose-cleanup, mailx-command<$mailx-command>
3723 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3724 echo mailx-subject<$mailx-subject>
3725 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3726 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3727 mailx-raw-bcc<$mailx-raw-bcc>
3728 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3729 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3731 wysh set on-compose-splice=t_ocs \
3732 on-compose-enter=t_oce on-compose-leave=t_ocl \
3733 on-compose-cleanup=t_occ
3737 printf 'm this-goes@nowhere\nbody\n!.\n' |
3738 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3739 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3741 ${cat} .
/.tall
>> "${MBOX}"
3742 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3745 printf 'm this-goes@nowhere\nbody\n!.\n' |
3746 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3747 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3749 ${cat} .
/.tall
>> "${MBOX}"
3750 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3754 # Some state machine stress, shell compose hook, localopts for hook, etc.
3755 # readctl in child. ~r as HERE document
3757 printf 'm ex@am.ple\nbody\n!.
3758 echon ${mailx-command}${mailx-subject}
3759 echon ${mailx-from}${mailx-sender}
3760 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3761 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3762 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3763 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3764 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3765 -Smta=.
/.tsendmail.sh \
3768 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3771 vput vexpr es substr "$1" 0 1
3776 define read_mline_res {
3777 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3778 echo $len/$es/$^ERRNAME: $hl
3779 if [ $es -ne $^ERR-NONE ]
3780 xcall bail read_mline_res
3782 \xcall read_mline_res
3786 vput vexpr i + 1 "$2"
3788 vput vexpr j % $i 10
3795 eval \\$j _work $1 $i
3798 vput vexpr i + $i "$1"
3802 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3803 echo read:$es/$en: $line
3804 if [ "${es}" -ne -1 ]
3807 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3812 echo "~^header list"; read hl; echo $hl;\
3813 vput vexpr es substr "$hl" 0 1
3815 xcall bail "header list"
3818 call _work 1; echo $?
3819 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3820 read es; echo $es; vput vexpr es substr "$es" 0 1
3822 xcall bail "be diet"
3824 echo "~^header insert cc <splice2@exam.ple>";\
3825 read es; echo $es; vput vexpr es substr "$es" 0 1
3827 xcall bail "be diet2"
3830 call _work 2; echo $?
3831 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3832 read es; echo $es;vput vexpr es substr "$es" 0 1
3834 xcall bail "be juicy"
3836 echo "~^header insert bcc juice2@exam.ple";\
3837 read es; echo $es;vput vexpr es substr "$es" 0 1
3839 xcall bail "be juicy2"
3841 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3842 read es; echo $es;vput vexpr es substr "$es" 0 1
3844 xcall bail "be juicy3"
3846 echo "~^header insert bcc juice4@exam.ple";\
3847 read es; echo $es;vput vexpr es substr "$es" 0 1
3849 xcall bail "be juicy4"
3852 echo "~^header remove-at bcc 3";\
3853 read es; echo $es;vput vexpr es substr "$es" 0 1
3855 xcall bail "remove juicy5"
3857 echo "~^header remove-at bcc 2";\
3858 read es; echo $es;vput vexpr es substr "$es" 0 1
3860 xcall bail "remove juicy6"
3862 echo "~^header remove-at bcc 3";\
3863 read es; echo $es;vput vexpr es substr "$es" 0 3
3865 xcall bail "failed to remove-at"
3867 # Add duplicates which ought to be removed!
3868 echo "~^header insert bcc juice4@exam.ple";\
3869 read es; echo $es;vput vexpr es substr "$es" 0 1
3871 xcall bail "be juicy4-1"
3873 echo "~^header insert bcc juice4@exam.ple";\
3874 read es; echo $es;vput vexpr es substr "$es" 0 1
3876 xcall bail "be juicy4-2"
3878 echo "~^header insert bcc juice4@exam.ple";\
3879 read es; echo $es;vput vexpr es substr "$es" 0 1
3881 xcall bail "be juicy4-3"
3886 call _work 3; echo $?
3888 vput ! i echo just knock if you can hear me;\
3890 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3892 echon shell-cmd says $?/$^ERRNAME: $i
3893 echo "~x will not become interpreted, we are reading until __EOT"
3895 read r_status; echo "~~r status output: $r_status"
3896 echo "~:echo $? $! $^ERRNAME"
3898 echo "~~r status from parent: $r_status"
3901 call _work 4; echo $?
3902 vput cwd cwd;echo cwd:$?
3903 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3907 call _work 5; echo $?
3908 echo "~^header show MAILX-Command"; read es;\
3909 call xerr $es "t_header 1000"; call read_mline_res
3910 echo "~^header show MAILX-raw-TO"; read es;\
3911 call xerr $es "t_header 1001"; xcall read_mline_res
3913 echoerr IT IS WRONG IF YOU SEE THIS
3916 echo on-compose-enter, mailx-command<$mailx-command>
3917 set t_oce autobcc=oce@exam.ple
3918 alternates alter1@exam.ple alter2@exam.ple
3920 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3921 echo mailx-subject<$mailx-subject>
3922 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3923 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3924 mailx-raw-bcc<$mailx-raw-bcc>
3925 echo mailx-orig-from<$mailx-orig-from> \
3926 mailx-orig-to<$mailx-orig-to> \
3927 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3930 echo on-compose-leave, mailx-command<$mailx-command>
3931 set t_ocl autocc=ocl@exam.ple
3933 alternates alter3@exam.ple alter4@exam.ple
3935 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3936 echo mailx-subject<$mailx-subject>
3937 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3938 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3939 mailx-raw-bcc<$mailx-raw-bcc>
3940 echo mailx-orig-from<$mailx-orig-from> \
3941 mailx-orig-to<$mailx-orig-to> \
3942 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3945 echo on-compose-cleanup, mailx-command<$mailx-command>
3946 set t_occ autocc=occ@exam.ple
3949 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3950 echo mailx-subject<$mailx-subject>
3951 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3952 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3953 mailx-raw-bcc<$mailx-raw-bcc>
3954 echo mailx-orig-from<$mailx-orig-from> \
3955 mailx-orig-to<$mailx-orig-to> \
3956 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3958 wysh set on-compose-splice=t_ocs \
3959 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
3960 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3961 on-compose-enter=t_oce on-compose-leave=t_ocl \
3962 on-compose-cleanup=t_occ
3964 ex0_test behave
:compose_hooks-3-estat
3965 ${cat} .
/.tnotes
>> "${MBOX}"
3967 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3969 # Reply, forward, resend, Resend
3972 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3973 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3974 -Smta=.
/.tsendmail.sh
3977 echo start: $? $! $^ERRNAME
3979 echo File: $? $! $^ERRNAME;echo;echo
3981 this is content of reply 1
3983 echo reply 1: $? $! $^ERRNAME;echo;echo
3985 this is content of Reply 1 2
3987 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3988 forward 1 fwdex@am.ple
3989 this is content of forward 1
3991 echo forward 1: $? $! $^ERRNAME;echo;echo
3992 resend 1 2 resendex@am.ple
3993 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3994 Resend 1 2 Resendex@am.ple
3995 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3997 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3998 -Smta=.
/.tsendmail.sh \
4001 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4004 vput vexpr es substr "$1" 0 1
4009 define read_mline_res {
4010 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4011 echo mline_res:$len/$es/$^ERRNAME: $hl
4012 if [ $es -ne $^ERR-NONE ]
4013 xcall bail read_mline_res
4015 \xcall read_mline_res
4019 echo "~^header show $1"; read es;\
4020 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4028 echo t_ocs version $ver
4029 echo "~^header list"; read hl; echo $hl;\
4030 echoerr the header list is $hl;\
4031 call xerr "$hl" "header list"
4032 eval vpospar set $hl
4035 echoerr IT IS WRONG IF YOU SEE THIS
4038 echo on-XY-enter, mailx-command<$mailx-command>
4039 set t_oce autobcc=oce@exam.ple
4040 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4041 echo mailx-subject<$mailx-subject>
4042 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4043 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4044 mailx-raw-bcc<$mailx-raw-bcc>
4045 echo mailx-orig-from<$mailx-orig-from> \
4046 mailx-orig-to<$mailx-orig-to> \
4047 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4050 echo on-XY-leave, mailx-command<$mailx-command>
4051 set t_ocl autocc=ocl@exam.ple
4052 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4053 echo mailx-subject<$mailx-subject>
4054 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4055 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4056 mailx-raw-bcc<$mailx-raw-bcc>
4057 echo mailx-orig-from<$mailx-orig-from> \
4058 mailx-orig-to<$mailx-orig-to> \
4059 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4062 echo on-XY-cleanup, mailx-command<$mailx-command>
4063 set t_occ autocc=occ@exam.ple
4064 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4065 echo mailx-subject<$mailx-subject>
4066 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4067 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4068 mailx-raw-bcc<$mailx-raw-bcc>
4069 echo mailx-orig-from<$mailx-orig-from> \
4070 mailx-orig-to<$mailx-orig-to> \
4071 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4073 wysh set on-compose-splice=t_ocs \
4074 on-compose-enter=t_oce on-compose-leave=t_ocl \
4075 on-compose-cleanup=t_occ \
4076 on-resend-enter=t_oce on-resend-cleanup=t_occ
4078 ex0_test behave
:compose_hooks-4-estat
4079 ${cat} .
/.tnotes
>> "${MBOX}"
4081 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4086 t_behave_C_opt_customhdr
() {
4087 t_prolog t_behave_C_opt_customhdr
4088 TRAP_EXIT_ADDONS
="./.t*"
4090 ${cat} <<-_EOT > ./.tsendmail.sh
4092 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
4096 chmod 0755 .
/.tsendmail.sh
4099 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
4100 -C 'C-One : Custom One Body' \
4101 -C 'C-Two:CustomTwoBody' \
4102 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4103 this-goes@nowhere
>.
/.tall
2>&1
4104 ex0_test behave
:C_opt_customhdr-1-estat
4105 ${cat} .
/.tall
>> "${MBOX}"
4106 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4109 printf 'm this-goes@nowhere\nbody\n!.
4111 m this-goes2@nowhere\nbody2\n!.
4112 set customhdr=%ccustom1 : custom1 body%c
4113 m this-goes2@nowhere\nbody2\n!.
4114 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4115 m this-goes3@nowhere\nbody3\n!.
4117 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
-Sescape=! \
4118 -C 'C-One : Custom One Body' \
4119 -C 'C-Two:CustomTwoBody' \
4120 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4122 ex0_test behave
:C_opt_customhdr-2-estat
4123 ${cat} .
/.tall
>> "${MBOX}"
4124 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4129 t_behave_mass_recipients
() {
4130 t_prolog t_behave_mass_recipients
4131 TRAP_EXIT_ADDONS
="./.t*"
4133 ${cat} <<-_EOT > ./.tsendmail.sh
4135 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4138 chmod 0755 .
/.tsendmail.sh
4140 ${cat} <<'__EOT__' > ./.trc
4142 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4145 wysh set nr=$1 hn=$2
4146 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4148 xcall bail "ins_addr $hn 1-$nr"
4150 vput vexpr nr + $nr 1
4151 if [ "$nr" -le "$maximum" ]
4152 xcall ins_addr $nr $hn
4156 wysh set nr=$1 hn=$2
4157 alternates $hn$nr@$hn
4158 vput vexpr nr + $nr 2
4159 if [ "$nr" -le "$maximum" ]
4160 xcall bld_alter $nr $hn
4170 if [ "$t_remove" != '' ]
4175 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4178 printf 'm this-goes@nowhere\nbody\n!.\n' |
4179 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4180 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4182 ex0_test behave
:mass_recipients-1-estat
4183 ${cat} .
/.tall
>> "${MBOX}"
4184 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4187 printf 'm this-goes@nowhere\nbody\n!.\n' |
4188 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4189 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4191 ex0_test behave
:mass_recipients-2-estat
4192 ${cat} .
/.tall
>> "${MBOX}"
4193 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4198 t_behave_mime_types_load_control
() {
4199 t_prolog t_behave_mime_types_load_control
4200 TRAP_EXIT_ADDONS
="./.t*"
4202 ${cat} <<-_EOT > ./.tmts1
4203 @ application/mathml+xml mathml
4205 ${cat} <<-_EOT > ./.tmts2
4206 @ x-conference/x-cooltalk ice
4208 @ application/aga-aga aga
4211 ${cat} <<-_EOT > ./.tmts1.mathml
4212 <head>nonsense ML</head>
4214 ${cat} <<-_EOT > ./.tmts2.ice
4217 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4218 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4232 ' "${MBOX}" "${MBOX}" |
4234 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4236 ex0_test behave
:mime_types_load_control-1-estat
4237 ${cat} "${MBOX}" >> .
/.tout
4238 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4240 echo type |
${MAILX} ${ARGS} -R \
4241 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4242 -f "${MBOX}" >> .
/.tout
2>&1
4243 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4248 t_behave_lreply_futh_rth_etc
() {
4249 t_prolog t_behave_lreply_futh_rth_etc
4250 TRAP_EXIT_ADDONS
="./.t*"
4252 ${cat} <<-_EOT > ./.tsendmail.sh
4254 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4257 chmod 0755 .
/.tsendmail.sh
4259 ${cat} <<-_EOT > ./.tmbox
4260 From neverneverland Sun Jul 23 13:46:25 2017
4261 Subject: Bugstop: five miles out 1
4262 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4263 From: mister originator <mr@originator>
4264 To: bugstop-commit@five.miles.out, laber@backe.eu
4266 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4267 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4268 Date: Wed, 19 Jul 2017 09:22:57 -0400
4269 Message-Id: <20170719132257.766AF781267@originator>
4272 > |Sorry, I think I misunderstand something. I would think that
4276 From neverneverland Fri Jul 7 22:39:11 2017
4277 Subject: Bugstop: five miles out 2
4278 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4279 Content-Transfer-Encoding: 7bit
4280 From: mister originator <mr@originator>
4281 To: bugstop-commit@five.miles.out
4283 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4284 Date: Fri, 07 Jul 2017 16:33:59 -0400
4287 capable of changing back.
4289 From neverneverland Fri Jul 7 22:42:00 2017
4290 Subject: Bugstop: five miles out 3
4291 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4292 Content-Transfer-Encoding: 7bit
4293 From: mister originator <mr@originator>
4294 To: bugstop-commit@five.miles.out
4296 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4297 Date: Fri, 07 Jul 2017 16:33:59 -0400
4298 List-Post: <mailto:bugstop@five.miles.out>
4301 are you ready, boots?
4303 From neverneverland Sat Aug 19 23:15:00 2017
4304 Subject: Bugstop: five miles out 4
4305 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4306 Content-Transfer-Encoding: 7bit
4307 From: mister originator <mr@originator>
4308 To: bugstop@five.miles.out
4310 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4311 Date: Fri, 07 Jul 2017 16:33:59 -0400
4312 List-Post: <mailto:bugstop@five.miles.out>
4315 are you ready, boots?
4320 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4321 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4323 wysh
set m
="This is text of \"reply ${1}."
4334 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4337 wysh set m="This is text of
\"Reply
${1}.
"
4343 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4352 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4356 # We need two indirections for this test: one for the case that Lreply
4357 # fails because of missing recipients: we need to read EOF next, thus
4358 # place this in _Ls last; and second for the succeeding cases EOF is
4359 # not what these should read, so go over the backside and splice it in!
4361 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4364 localopts call-fixate
yes
4366 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4367 call L
$1 1; call L
$1 2; call L
$1 3
4370 echo;echo '===== CHANGING === '"$*"' =====';echo
4374 set from
=laber@backe.eu
4377 call tweak
set reply-to-honour
4379 call tweak
set followup-to
4381 call tweak
set followup-to-honour
4383 call tweak mlist bugstop@five.miles.out
4385 call tweak mlsubscribe bugstop@five.miles.out
4387 call tweak
set recipients-in-cc
4391 check behave
:lreply_futh_rth_etc-1
0 "${MBOX}" '940818845 29373'
4395 ${cat} <<-_EOT > ./.tmbox
4396 From tom@i-i.example Thu Oct 26 03:15:55 2017
4397 Date: Wed, 25 Oct 2017 21:15:46 -0400
4398 From: tom <tom@i-i.example>
4399 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4400 Cc: tom <tom@i-i.example>
4401 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4402 Message-ID: <20171026011546.GA11643@i-i.example>
4403 Reply-To: tom@i-i.example
4404 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4405 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4408 The report's useful :-)
4411 printf 'reply 1\nthank you\n!.\n' |
4412 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4413 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4414 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4419 t_behave_xxxheads_rfc2047
() {
4420 t_prolog t_behave_xxxheads_rfc2047
4421 TRAP_EXIT_ADDONS
="./.t*"
4423 ${cat} <<-_EOT > ./.tsendmail.sh
4425 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4428 chmod 0755 .
/.tsendmail.sh
4432 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4433 -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̲' \
4435 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4437 # Single word (overlong line split -- bad standard! Requires injection of
4438 # artificial data!! But can be prevented by using RFC 2047 encoding)
4440 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4441 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4442 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4444 # Combination of encoded words, space and tabs of varying sort
4446 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4447 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4448 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4449 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4450 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4451 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4453 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4455 # Overlong multibyte sequence that must be forcefully split
4456 # todo This works even before v15.0, but only by accident
4458 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4459 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4460 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4461 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4463 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4467 echo | ${MAILX} ${ARGS} \
4468 -s "1-1 B2 B3 B4 B5 B6 B\
4469 1-2 B2 B3 B4 B5 B6 B\
4470 1-3 B2 B3 B4 B5 B6 B\
4471 1-4 B2 B3 B4 B5 B6 B\
4472 1-5 B2 B3 B4 B5 B6 B\
4473 1-6 B2 B3 B4 B5 B6
" \
4475 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4477 # Leading and trailing WS
4479 echo | ${MAILX} ${ARGS} \
4480 -s " 2-1 B2 B3 B4 B5 B6 B\
4481 1-2 B2 B3 B4 B5 B6 B\
4482 1-3 B2 B3 B4 B5 B6 B\
4483 1-4 B2 B3 B4 B5 B6
" \
4485 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4487 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4489 echo "Dat Früchtchen riecht häußlich
" |
4490 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4492 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4493 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4495 # RFC 2047 in an address field, and iconv involved
4496 if have_feat iconv; then
4498 ${cat} > ./.trebox <<_EOT
4499 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4500 Date: Fri, 2 Mar 2018 20:31:45 +0000
4501 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4502 To: dude <dude@exam.ple>
4503 Subject: houston(...)
4504 Message-ID: <abra@1>
4506 Content-Type: text/plain; charset=iso-8859-1
4507 Content-Disposition: inline
4508 Content-Transfer-Encoding: 8bit
4511 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4512 -Sfullnames -Sreply-in-same-charset \
4513 -Smta=./.tsendmail.sh -Rf ./.trebox
4514 check behave:xxxheads_rfc2047-8 0 "${MBOX}" '2821484185 280'
4516 echo 'behave:xxxheads_rfc2047-8: iconv unsupported, skipped'
4522 t_behave_rfc2231() {
4523 t_prolog t_behave_rfc2231
4524 TRAP_EXIT_ADDONS=".
/.t
*"
4527 mkdir ./.ttt || exit 1
4531 : > 'diet\ is \curd.txt'
4532 : > 'diet "is
" curd.txt'
4534 : > 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
4535 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4536 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4537 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4539 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4540 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4541 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4542 -a ./.ttt/höde-tröge.txt \
4543 -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 \
4544 -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 \
4545 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4546 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4548 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4550 # `resend' test, reusing $MBOX
4551 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4552 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4554 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4555 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4560 t_behave_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4561 t_prolog t_behave_iconv_mbyte_base64
4562 TRAP_EXIT_ADDONS=".
/.t
*"
4564 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4565 (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4566 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4569 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4573 ${cat} <<-_EOT > ./.tsendmail.sh
4575 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4578 chmod 0755 ./.tsendmail.sh
4580 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4581 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4582 -Smta=./.tsendmail.sh \
4583 -Sescape=! -Smime-encoding=base64 2>./.terr
4584 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4586 !s Japanese from UTF-8 to ISO-2022-JP
4587 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4589 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4592 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4594 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4597 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4599 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4600 \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
4602 \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
4605 \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
4607 \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
4610 # May not presume iconv output as long as roundtrip possible [489a7122]
4611 ex0_test behave
:iconv_mbyte_base64-1-estat
4612 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4613 < "${MBOX}" > .
/.tcksum
4614 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4615 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4617 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4618 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4619 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4620 -Rf "${MBOX}" >.
/.tlog
2>&1
4621 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4622 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4623 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4624 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4626 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4629 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4630 rm -f "${MBOX}" .
/.twrite
4631 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4632 -Smta=.
/.tsendmail.sh \
4633 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4634 set ttycharset
=utf-8 sendcharsets
=euc-jp
4636 !s Japanese from UTF-8 to EUC-JP
4637 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4639 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4642 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4644 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4647 set ttycharset
=EUC-JP sendcharsets
=utf-8
4649 !s Japanese from EUC-JP to UTF-8
4650 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4652 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4655 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4657 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4660 ex0_test behave
:iconv_mbyte_base64-5-estat
4661 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4662 < "${MBOX}" > .
/.tcksum
4663 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4664 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4666 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4667 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4668 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4669 -Rf "${MBOX}" >.
/.tlog
2>&1
4670 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4671 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4672 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4673 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4675 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4681 t_behave_iconv_mainbody
() {
4682 t_prolog t_behave_iconv_mainbody
4683 TRAP_EXIT_ADDONS
="./.t*"
4685 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4688 echo 'behave:iconv_mainbody: unsupported, skipped'
4692 ${cat} <<-_EOT > ./.tsendmail.sh
4694 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4697 chmod 0755 .
/.tsendmail.sh
4699 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4700 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4701 -s '–' over-the@rain.bow
2>.
/.terr
4702 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4703 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4705 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4706 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4707 -s '–' over-the@rain.bow
2>.
/.terr
4708 exn0_test behave
:iconv_mainbody-3
4709 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4710 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4712 # The different iconv(3) implementations use different replacement sequence
4713 # types (character-wise, byte-wise, and the character(s) used differ)
4714 i
="${MAILX_ICONV_MODE}"
4715 if [ -n "${i}" ]; then
4716 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4718 ex0_test behave:iconv_mainbody-5-0 ${j}
4719 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4720 if [ ${i} -eq 13 ]; then
4721 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4722 elif [ ${i} -eq 12 ]; then
4723 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4724 elif [ ${i} -eq 3 ]; then
4725 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4727 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4730 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4736 t_behave_binary_mainbody() {
4737 t_prolog t_behave_binary_mainbody
4738 TRAP_EXIT_ADDONS=".
/.t
*"
4740 printf 'abra\0\nka\r\ndabra' |
4741 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4743 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4744 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4746 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4747 ${MAILX} ${ARGS} -Rf \
4748 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4749 "${MBOX}" >./.tall 2>&1
4750 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4751 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4752 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4757 t_behave_q_t_etc_opts() {
4758 t_prolog t_behave_q_t_etc_opts
4759 TRAP_EXIT_ADDONS=".
/.t
*"
4761 # Three tests for MIME encoding and (a bit) content classification.
4762 # At the same time testing -q FILE, < FILE and -t FILE
4763 t__put_body > ./.tin
4766 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4767 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4768 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4771 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4772 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4773 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4776 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4778 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4779 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4785 have_feat smime || {
4786 echo 'behave:s/mime: unsupported, skipped'
4790 t_prolog t_behave_s_mime
4791 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4792 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4793 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4795 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4796 ${cat} <<-_EOT > ./.t.conf
4799 default_keyfile = keyfile.pem
4800 distinguished_name = req_distinguished_name
4801 attributes = req_attributes
4805 [ req_distinguished_name ]
4812 emailAddress = test@localhost
4817 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4818 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
4819 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4822 printf 'behave:s/mime:sign/verify: '
4823 echo bla | ${MAILX} ${ARGS} \
4824 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4825 -Ssmime-sign -Sfrom=test@localhost \
4826 -s 'S/MIME test' ./.VERIFY
4827 if [ $? -eq 0 ]; then
4838 /^Content-Description: /{ skip = 2; print; next }
4839 /^$/{ if(skip) --skip }
4842 < ./.VERIFY > "${MBOX}"
4843 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4845 printf 'behave:s/mime:sign/verify:verify '
4846 printf 'verify\nx\n' |
4848 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4849 -Ssmime-sign -Sfrom=test@localhost \
4851 -f ./.VERIFY >/dev/null 2>&1
4852 if [ $? -eq 0 ]; then
4861 printf 'behave:s/mime:sign/verify:disproof-1 '
4862 if openssl smime -verify -CAfile ./.tcert.pem \
4863 -in ./.VERIFY >/dev/null 2>&1; then
4872 # (signing +) encryption / decryption
4873 ${cat} <<-_EOT > ./.tsendmail.sh
4875 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4877 chmod 0755 ./.tsendmail.sh
4879 printf 'behave:s/mime:encrypt+sign: '
4882 -Ssmime-force-encryption \
4883 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4884 -Smta=./.tsendmail.sh \
4885 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4886 -Ssmime-sign -Sfrom=test@localhost \
4887 -s 'S/MIME test' recei@ver.com
4888 if [ $? -eq 0 ]; then
4892 printf 'error: encrypt+sign failed\n'
4895 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4896 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4898 printf 'behave:s/mime:decrypt+verify: '
4899 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4901 -Ssmime-force-encryption \
4902 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4903 -Smta=./.tsendmail.sh \
4904 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4905 -Ssmime-sign -Sfrom=test@localhost \
4907 -f ./.ENCRYPT >/dev/null 2>&1
4908 if [ $? -eq 0 ]; then
4917 /^Content-Description: /{ skip = 2; print; next }
4918 /^$/{ if(skip) --skip }
4921 < ./.DECRYPT > "${MBOX}"
4922 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4924 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4925 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4926 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
4933 printf "behave
:s
/mime
:encrypt
: "
4934 echo bla | ${MAILX} ${ARGS} \
4935 -Ssmime-force-encryption \
4936 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4937 -Smta=./.tsendmail.sh \
4938 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4939 -Sfrom=test@localhost \
4940 -s 'S/MIME test' recei@ver.com
4941 if [ $? -eq 0 ]; then
4948 # Same as behave:s/mime:encrypt+sign:checksum above
4949 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4950 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4953 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4954 -Ssmime-force-encryption \
4955 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4956 -Smta=./.tsendmail.sh \
4957 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4958 -Sfrom=test@localhost \
4960 -f ./.ENCRYPT >/dev/null 2>&1
4961 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4963 printf 'behave:s/mime:decrypt:disproof-1: '
4964 if openssl smime -decrypt -inkey ./.tkey.pem \
4965 -in ./.ENCRYPT >/dev/null 2>&1; then
4976 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4977 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4978 # Note we unfortunately need to place some statements without proper
4979 # indentation because of continuation problems
4980 # xxx Note: t_content() was the first test (series) written. Today many
4981 # xxx aspects are (better) covered by other tests above, some are not.
4982 # xxx At some future date and time, convert the last remains not covered
4983 # xxx elsewhere to a real t_behave_* test and drop t_content()
4987 # Test for [260e19d] (Juergen Daubert)
4989 echo body | ${MAILX} ${ARGS} "${MBOX}"
4990 check content
:004 0 "${MBOX}" '2917662811 98'
4992 # "Test for" [d6f316a] (Gavin Troy)
4994 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4995 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4996 check content:006 0 "${MBOX}" '2099098650 122'
4997 check content:006-1 - "${BODY}" '794542938 174'
4999 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5002 for(i = 0; i < 10000; ++i)
5004 #printf "\xF0\x90\x87\x90"
5005 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5006 check content
:007 0 "${MBOX}" '534262374 61816'
5012 # MIME encoding (QP) stress message subject
5013 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5014 'adadaddsssssssddddddddddddddddddddd'\
5015 'ddddddddddddddddddddddddddddddddddd'\
5016 'ddddddddddddddddddddddddddddddddddd'\
5017 'dddddddddddddddddddd Hallelulja? Od'\
5018 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5019 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5020 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5021 'fffffffffffffffffffffffffffffffffff'\
5022 'fffffffffffffffffffff ggggggggggggg'\
5023 'ggggggggggggggggggggggggggggggggggg'\
5024 'ggggggggggggggggggggggggggggggggggg'\
5025 'ggggggggggggggggggggggggggggggggggg'\
5030 # MIME encoding (QP) stress message body
5032 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5033 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5034 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5035 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5036 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5037 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5038 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5039 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5040 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5041 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5042 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5043 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5044 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5045 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5046 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5047 "auf den zeilen vorher.\r\n"\
5048 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5050 "Die letzte Zeile war nur ein Punkt.\r\n"\
5052 "Das waren deren zwei.\r\n"\
5054 "Die letzte Zeile war ein Leerschritt.\n"\
5055 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5058 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5060 "Das waren deren zwei. ditto.\n"\
5062 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5063 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5064 "auf den zeilen vorher.\n"\
5066 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5067 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5069 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5071 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5073 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5075 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5077 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5079 "QP am Zeilenende über soft-nl hinweg\n"\
5080 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5082 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5084 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5086 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5088 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5090 "Die letzte Zeile war ein Leerschritt.\n"\
5095 # if have_feat devel; then
5096 # ARGS="${ARGS} -Smemdebug"
5100 if [ -n "${UTF8_LOCALE}" ]; then
5101 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5103 printf 'No Unicode locale found, disabling Unicode tests\n'
5110 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5112 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
5115 while [ ${#} -gt 0 ]; do
5121 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'