2 #@ Synopsis: ./cc-test.sh --check-only [s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ [./cc-test.sh # Note: performs hundreds of compilations!]
5 #@ The latter generates output files.
6 #@ TODO All ex0_test should say TESTNUMBER-estat instead of having own numbers
7 #@ TODO _All_ the tests should happen in a temporary subdir.
10 # Instead of figuring out the environment in here, require a configured build
11 # system and include that! Our makefile and configure ensure that this test
12 # does not run in the configured, but the user environment nonetheless!
13 if [ -f .
/mk-config.ev
]; then :; else
14 echo >&2 'S-nail/S-mailx is not configured.'
15 echo >&2 'This test script requires the shell environment that only the'
16 echo >&2 'configuration script can figure out, even if it will be used to'
17 echo >&2 'test a different binary than the one that would be produced!'
18 echo >&2 'Hit RETURN to run "make config CONFIG=null'
20 make config CONFIG
=null
23 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
24 MAILX__CC_TEST_RUNNING
=1
25 export MAILX__CC_TEST_RUNNING
26 exec "${SHELL}" "${0}" "${@}"
29 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
30 # such is a compile-time variable
31 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
32 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
33 ADDARG_UNI
=-Sttycharset=UTF-8
37 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
39 #UTF8_LOCALE= autodetected unless set
41 # Note valgrind has problems with FDs in forked childs, which causes some tests
42 # to fail (the FD is rewound and thus will be dumped twice)
44 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
46 ## -- (>8 -- 8<) -- ##
48 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
53 printf >&2 -- "${fmt}\\n" "${@}"
58 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
62 # Wed Oct 2 01:50:07 UTC 1996
63 SOURCE_DATE_EPOCH
=844221007
65 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
66 unset POSIXLY_CORRECT LOGNAME USER
69 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
70 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
74 CHECK_ONLY
= MAE_TEST
= MAILX
=
75 if [ "${1}" = --check-only ]; then
78 [ -x "${MAILX}" ] || usage
80 elif [ "${1}" = --mae-test ]; then
83 [ -x "${MAILX}" ] || usage
87 MAILX
="${MEMTESTER}${MAILX}"
90 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
91 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
92 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
93 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
94 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
96 \if [ "${ttycharset}" @i=% utf ]
101 \wysh set LC_ALL=${1}
103 \eval xcall cset_test "${@}"
107 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
108 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
110 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
113 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
114 UTF8_LOCALE
=`locale -a | { m=
117 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
120 ${grep} -e POSIX -e en_EN -e en_US; } >/dev/null 2>&1; then
133 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
134 trap "exit 1" HUP INT TERM
137 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
138 ${grep} +${1} ) >/dev
/null
2>&1
142 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
144 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
151 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
152 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
153 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
154 csum
="`${cksum} < ${f}`"
155 if [ "${csum}" = "${s}" ]; then
157 printf '%s: ok\n' "${tid}"
161 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
164 if [ -n "${MAE_TEST}" ]; then
165 x
=mae-test-
`echo ${tid} | ${tr} "/:=" "__-"`
166 ${cp} -f "${f}" ./"${x}"
168 if [ -n "${maex}" ] && [ -d .git ] &&
169 command -v diff >/dev/null 2>&1 &&
170 (git rev-parse --verify test-out) >/dev/null 2>&1 &&
171 git show test-out:"${x}" > ./"${x}".old 2>/dev/null; then
172 diff -ru ./"${x}".old ./"${x}" > "${x}".diff
179 printf '%s: error: %s\n' ${1} "${2}"
183 # $1=test name [$2=status]
185 [ ${#} -gt 1 ] && __qm__=${2}
186 if [ ${__qm__} -ne 0 ]; then
187 err $1 'unexpected non-0 exit status'
189 printf '%s: ok\n' "${1}"
194 # $1=test name [$2=status]
196 [ ${#} -gt 1 ] && __qm__=${2}
197 if [ ${__qm__} -eq 0 ]; then
198 err $1 'unexpected 0 exit status'
200 printf '%s: ok\n' "${1}"
204 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
206 echo "$
((${1} + ${2}))"
210 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
214 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
216 echo "$
((${1} % ${2}))"
220 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
225 # Basic (easily testable) behaviour tests
227 t_behave_X_opt_input_command_stack
231 t_behave_input_inject_semicolon_seq
232 t_behave_commandalias
236 t_behave_macro_param_shift
247 t_behave_record_a_resend
252 # FIXME t_behave_mlist
255 t_behave_message_injections
257 t_behave_compose_hooks
258 t_behave_C_opt_customhdr
260 t_behave_mass_recipients
261 t_behave_mime_types_load_control
262 t_behave_lreply_futh_rth_etc
264 t_behave_mime_if_not_ascii
265 t_behave_xxxheads_rfc2047
267 t_behave_iconv_mbyte_base64
268 t_behave_iconv_mainbody
269 t_behave_binary_mainbody
270 t_behave_q_t_etc_opts
275 t_behave_X_opt_input_command_stack() {
276 t_prolog t_behave_X_opt_input_command_stack
278 ${cat} <<- '__EOT' > "${BODY}"
286 echo "define mac1
{";\
287 echo " echo mac1-1 via1 \
$0";\
289 echo " echo mac1-2
";\
291 echo " echo mac1-3
";\
294 echo "define mac2
{";\
295 echo " echo mac2-1 via1 \
$0";\
297 echo " echo mac2-2
";\
303 echo echo 1-1-1 via1 \
$0;\
315 # The -X option supports multiline arguments, and those can internally use
316 # reverse solidus newline escaping. And all -X options are joined...
318 < "${BODY}" ${MAILX} ${ARGS} \
333 echo "define mac1 {";\
334 echo " echo mac1-1 via2 \$0";\
336 echo " echo mac1-2";\
338 echo " echo mac1-3";\
341 echo "define mac2 {";\
342 echo " echo mac2-1 via2 \$0";\
344 echo " echo mac2-2";\
350 echo echo 1-1-1 via2 \$0;\
364 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
369 t_behave_X_errexit
() {
370 t_prolog t_behave_X_errexit
371 if have_feat uistrings
; then :; else
372 echo 'behave:x_errexit: unsupported, skipped'
376 ${cat} <<- '__EOT' > "${BODY}"
382 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
383 -X'echo one' -X' echos nono ' -X'echo two' \
385 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
387 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
389 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
391 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
393 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
397 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
398 -X'echo one' -X' echos nono ' -X'echo two' \
400 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
402 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
404 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
406 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
408 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
410 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
412 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
414 ## Repeat 4-7 with ignerr set
416 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
418 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
419 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
421 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
423 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
425 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
427 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
429 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
431 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
433 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
438 t_behave_S_freeze() {
439 t_prolog t_behave_S_freeze
443 # Test basic assumption
444 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
445 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
447 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
450 ${cat} <<- '__EOT' > "${BODY}"
455 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
456 -Snoasksub -Sasksub -Snoasksub \
457 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
459 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
461 ${cat} <<- '__EOT' > "${BODY}"
466 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
467 -Snoasksub -Sasksub \
468 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
470 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
473 ${cat} <<- '__EOT' > "${BODY}"
474 echo dietcurd<$dietcurd>
476 echo dietcurd<$dietcurd>
478 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
479 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
480 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
481 -X'echo dietcurd<$dietcurd>' \
483 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
485 ${cat} <<- '__EOT' > "${BODY}"
486 echo dietcurd<$dietcurd>
488 echo dietcurd<$dietcurd>
490 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
491 -Sdietcurd=strawberry
-Snodietcurd \
492 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
493 -X'echo dietcurd<$dietcurd>' \
495 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
497 # TODO once we have a detached one with env=1..
498 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
499 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
501 ${cat} <<- '__EOT' > "${BODY}"
502 !echo "shell says TERM<$TERM>"
504 !echo "shell says TERM<$TERM>"
506 !echo "shell says TERM<$TERM>"
508 !echo "shell says TERM<$TERM>"
510 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
511 -STERM=strawberry
-SnoTERM -STERM=vanilla \
512 -X'echo mail<$TERM>' -X'unset TERM' \
513 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
515 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
517 ${cat} <<- '__EOT' > "${BODY}"
518 !echo "shell says TERM<$TERM>"
520 !echo "shell says TERM<$TERM>"
522 !echo "shell says TERM<$TERM>"
524 !echo "shell says TERM<$TERM>"
526 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
527 -STERM=strawberry
-SnoTERM \
528 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
529 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
531 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
539 t_prolog t_behave_wysh
541 ${cat} <<- '__EOT' > "${BODY}"
560 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
561 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
562 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
564 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
565 echo a$'\u0041\u41\u0C1\U00000041\U41'c
588 echo a$'b\U0000000'dt
589 echo a$'b\U00000000'du
599 if [ -z "${UTF8_LOCALE}" ]; then
600 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
602 < "${BODY}" DIET=CURD TIED= \
603 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
604 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
607 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
608 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
610 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
611 wysh set mager='\hey\'
613 wysh set mager="\hey\\"
615 wysh set mager=$'\hey\\'
618 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
623 t_behave_input_inject_semicolon_seq() {
624 t_prolog t_behave_input_inject_semicolon_seq
626 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
631 echon this_is_mymac;call mydeepmac;echon ';';
633 echon one';';call mymac;echon two";";call mymac;echo three$';';
635 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
637 echon one';';call mymac;echon two";";call mymac;echo three$';';
640 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
645 t_behave_commandalias() {
646 t_prolog t_behave_commandalias
648 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
649 commandalias echo echo hoho
653 commandalias XxX XxXx
654 commandalias XxXx XxXxX
655 commandalias XxXxX XxXxXx
656 commandalias XxXxXx echo huhu
657 commandalias XxXxXxX echo huhu
659 commandalias XxXxXx XxXxXxX
662 commandalias XxXxXx echo huhu
666 check behave:commandalias 0 "${MBOX}" '1638809585 36'
672 t_prolog t_behave_ifelse
674 # Nestable conditions test
675 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
697 if $dietcurd == 'yoho'
702 if $dietcurd @== 'Yoho'
707 if $dietcurd == 'Yoho'
712 if $dietcurd != 'yoho'
717 if $dietcurd @!= 'Yoho'
722 if $dietcurd != 'Yoho'
783 if $dietcurd == 'yohu'
785 elif $dietcurd == 'yoha'
787 elif $dietcurd == 'yohe'
789 elif $dietcurd == 'yoho'
791 if $dietcurd == 'yohu'
793 elif $dietcurd == 'yoha'
795 elif $dietcurd == 'yohe'
797 elif $dietcurd == 'yoho'
799 if $dietcurd == 'yohu'
801 elif $dietcurd == 'yoha'
803 elif $dietcurd == 'yohe'
805 elif $dietcurd == 'yoho'
954 set diet=abc curd=abc
960 set diet=abc curd=abcd
966 # 1. Shitty grouping capabilities as of today
967 unset diet curd ndefined
968 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
974 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
979 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
984 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
989 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
994 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1000 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1005 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1010 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1015 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1020 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1025 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1030 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1035 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1040 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1045 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1051 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1057 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1062 # 2. Shitty grouping capabilities as of today
1063 unset diet curd ndefined
1064 if [ false || false || true ] && [ false || true ] && yes
1069 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1074 if [ 1 || 0 || 0 || 0 ]
1079 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1084 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1089 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1094 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1099 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1104 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1109 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1114 if 1 || 0 || 0 || 0 && 0
1119 if 1 || 0 || 0 || 0 && 1
1124 if 0 || 0 || 0 || 1 && 0
1129 if 0 || 0 || 0 || 1 && 1
1134 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1139 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1145 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1150 if $diet == 'yo' && $curd == 'ho' && $ndefined
1156 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1161 if $diet == 'yo' && $curd == 'ho' && $ndefined
1166 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1171 # Some more en-braced variables
1173 if ${diet} == ${curd}
1178 if ${diet} != ${curd}
1194 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1199 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1204 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1209 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1214 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1219 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1224 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1229 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1234 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1240 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1245 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1250 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1255 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1260 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1265 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1270 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1275 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1280 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1287 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1289 if have_feat regex; then
1290 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1292 if $dietcurd =~ '^yo.*'
1297 if $dietcurd =~ '^Yo.*'
1302 if $dietcurd @=~ '^Yo.*'
1307 if $dietcurd =~ '^yOho.+'
1312 if $dietcurd @!~ '.*Ho$'
1317 if $dietcurd !~ '.+yohO$'
1322 if [ $dietcurd @i!~ '.+yoho$' ]
1327 if ! [ $dietcurd @i=~ '.+yoho$' ]
1332 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1337 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1342 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1347 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1352 if ! ! ! $dietcurd !~ '.+yoho$'
1357 if ! ! ! $dietcurd =~ '.+yoho$'
1362 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1367 set diet=abc curd='^abc$'
1373 set diet=abc curd='^abcd$'
1381 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1383 printf 'behave:if-regex: unsupported, skipped\n'
1389 t_behave_localopts() {
1390 t_prolog t_behave_localopts
1392 # Nestable conditions test
1393 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1408 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1413 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1414 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1423 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1425 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1434 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1441 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1448 echo ----- $1: $2 -> $3 -> $4
1456 call llx
'call off' on on on
1457 call llx
'call off' off on on
1458 call llx
'call off' on off on
1459 call llx
'call off' on off off
1460 localopts call-fixate on
1461 call llx
'call-fixate on' on on on
1462 call llx
'call-fixate on' off on on
1463 call llx
'call-fixate on' on off on
1464 call llx
'call-fixate on' on off off
1465 unset x
;localopts call on
1466 call llx
'call on' on on on
1467 call llx
'call on' off on on
1468 call llx
'call on' on off on
1469 call llx
'call on' on off off
1474 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1480 t_prolog t_behave_local
1482 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1510 echo ------- global-1 du=$du
1512 echo ------- global-2 du=$du
1515 echo ------- global-3 du=$du
1517 echo ------- global-4 du=$du
1519 echo ------- global-5 du=$du
1522 check behave:local-1 0 "${MBOX}" '2411598140 641'
1527 t_behave_macro_param_shift() {
1528 t_prolog t_behave_macro_param_shift
1530 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1533 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1538 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1539 if [ $# > 1 ] || [ $ignerr == '' ]
1544 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1546 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1550 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1555 call t2 1 you get four args
1556 echo t1.1: $?';' ignerr ($ignerr) should not exist
1557 call t2 1 you get 'three args'
1558 echo t1.2: $?';' ignerr ($ignerr) should not exist
1559 call t2 1 you 'get two args'
1560 echo t1.3: $?';' ignerr ($ignerr) should not exist
1561 call t2 1 'you get one arg'
1562 echo t1.4: $?';' ignerr ($ignerr) should not exist
1563 ignerr call t2 '' 'you get one arg'
1564 echo t1.5: $?';' ignerr ($ignerr) should not exist
1569 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1574 t_behave_addrcodec() {
1575 t_prolog t_behave_addrcodec
1577 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1578 vput addrcodec res e
1 <doog@def
>
1579 echo $?
/$^ERRNAME
$res
1580 eval vput addrcodec res d
$res
1581 echo $?
/$^ERRNAME
$res
1582 vput addrcodec res e
2 .
<doog@def
>
1583 echo $?
/$^ERRNAME
$res
1584 eval vput addrcodec res d
$res
1585 echo $?
/$^ERRNAME
$res
1586 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1587 echo $?
/$^ERRNAME
$res
1588 eval vput addrcodec res d
$res
1589 echo $?
/$^ERRNAME
$res
1590 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1591 echo $?
/$^ERRNAME
$res
1592 eval vput addrcodec res d
$res
1593 echo $?
/$^ERRNAME
$res
1594 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1595 echo $?
/$^ERRNAME
$res
1596 eval vput addrcodec res d
$res
1597 echo $?
/$^ERRNAME
$res
1599 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1600 echo $?
/$^ERRNAME
$res
1601 eval vput addrcodec res d
$res
1602 echo $?
/$^ERRNAME
$res
1603 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1604 echo $?
/$^ERRNAME
$res
1605 eval vput addrcodec res d
$res
1606 echo $?
/$^ERRNAME
$res
1607 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1608 echo $?
/$^ERRNAME
$res
1609 eval vput addrcodec res d
$res
1610 echo $?
/$^ERRNAME
$res
1611 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1612 echo $?
/$^ERRNAME
$res
1613 eval vput addrcodec res d
$res
1614 echo $?
/$^ERRNAME
$res
1615 vput addrcodec res
+e
8 \
1616 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1617 echo $?
/$^ERRNAME
$res
1618 eval vput addrcodec res d
$res
1619 echo $?
/$^ERRNAME
$res
1620 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1621 echo $?
/$^ERRNAME
$res
1622 eval vput addrcodec res d
$res
1623 echo $?
/$^ERRNAME
$res
1624 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1625 echo $?
/$^ERRNAME
$res
1626 eval vput addrcodec res d
$res
1627 echo $?
/$^ERRNAME
$res
1628 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1629 echo $?
/$^ERRNAME
$res
1630 eval vput addrcodec res d
$res
1631 echo $?
/$^ERRNAME
$res
1632 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1633 echo $?
/$^ERRNAME
$res
1634 eval vput addrcodec res d
$res
1635 echo $?
/$^ERRNAME
$res
1636 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1637 echo $?
/$^ERRNAME
$res
1638 eval vput addrcodec res d
$res
1639 echo $?
/$^ERRNAME
$res
1640 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1641 echo $?
/$^ERRNAME
$res
1642 eval vput addrcodec res d
$res
1643 echo $?
/$^ERRNAME
$res
1644 vput addrcodec res
+e
15 \
1645 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1646 echo $?
/$^ERRNAME
$res
1647 eval vput addrcodec res d
$res
1648 echo $?
/$^ERRNAME
$res
1649 vput addrcodec res
+e
16 \
1650 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1651 echo $?
/$^ERRNAME
$res
1652 eval vput addrcodec res d
$res
1653 echo $?
/$^ERRNAME
$res
1654 vput addrcodec res
+e
17 \
1655 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1656 echo $?
/$^ERRNAME
$res
1657 eval vput addrcodec res d
$res
1658 echo $?
/$^ERRNAME
$res
1659 vput addrcodec res
+e
18 \
1660 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1661 echo $?
/$^ERRNAME
$res
1662 eval vput addrcodec res d
$res
1663 echo $?
/$^ERRNAME
$res
1664 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1665 echo $?
/$^ERRNAME
$res
1666 eval vput addrcodec res d
$res
1667 echo $?
/$^ERRNAME
$res
1669 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1670 echo $?
/$^ERRNAME
$res
1671 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1672 echo $?/$^ERRNAME $res
1673 eval vput addrcodec res d $res
1674 echo $?/$^ERRNAME $res
1676 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1677 echo $?/$^ERRNAME $res
1678 eval vput addrcodec res d $res
1679 echo $?/$^ERRNAME $res
1681 vput addrcodec res s \
1682 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1683 echo $?/$^ERRNAME $res
1685 # Fix for [f3852f88]
1686 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1687 echo $?/$^ERRNAME $res
1688 eval vput addrcodec res d $res
1689 echo $?/$^ERRNAME $res
1690 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1691 echo $?/$^ERRNAME $res
1692 eval vput addrcodec res d $res
1693 echo $?/$^ERRNAME $res
1696 check behave:addrcodec-1 0 "${MBOX}" '1047317989 2612'
1698 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1700 mlsubscribe isa2@list
1702 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1703 echo $?
/$^ERRNAME
$res
1704 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1705 echo $?
/$^ERRNAME
$res
1706 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1707 echo $?
/$^ERRNAME
$res
1708 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1709 echo $?
/$^ERRNAME
$res
1710 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1711 echo $?
/$^ERRNAME
$res
1712 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1713 echo $?
/$^ERRNAME
$res
1716 check behave
:addrcodec-2
0 "${MBOX}" '1391779299 104'
1718 if have_feat idna
; then
1719 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1720 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
1721 echo $?/$^ERRNAME $res
1722 eval vput addrcodec res d $res
1723 echo $?/$^ERRNAME $res
1724 vput addrcodec res e <du@blödiän> du
1725 echo $?/$^ERRNAME $res
1726 eval vput addrcodec res d $res
1727 echo $?/$^ERRNAME $res
1728 vput addrcodec res e du <du@blödiän>
1729 echo $?/$^ERRNAME $res
1730 eval vput addrcodec res d $res
1731 echo $?/$^ERRNAME $res
1732 vput addrcodec res e <du@blödiän>
1733 echo $?/$^ERRNAME $res
1734 eval vput addrcodec res d $res
1735 echo $?/$^ERRNAME $res
1736 vput addrcodec res e du@blödiän
1737 echo $?/$^ERRNAME $res
1738 eval vput addrcodec res d $res
1739 echo $?/$^ERRNAME $res
1742 check behave:addrcodec-idna 0 "${MBOX}" '498775983 326'
1744 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1751 t_prolog t_behave_vexpr
1753 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1755 vput vexpr res = 9223372036854775807
1756 echo $?/$^ERRNAME $res
1757 vput vexpr res = 9223372036854775808
1758 echo $?/$^ERRNAME $res
1759 vput vexpr res = u9223372036854775808
1760 echo $?/$^ERRNAME $res
1761 vput vexpr res @= 9223372036854775808
1762 echo $?/$^ERRNAME $res
1763 vput vexpr res = -9223372036854775808
1764 echo $?/$^ERRNAME $res
1765 vput vexpr res = -9223372036854775809
1766 echo $?/$^ERRNAME $res
1767 vput vexpr res @= -9223372036854775809
1768 echo $?/$^ERRNAME $res
1769 vput vexpr res = U9223372036854775809
1770 echo $?/$^ERRNAME $res
1773 0b0111111111111111111111111111111111111111111111111111111111111111
1774 echo $?/$^ERRNAME $res
1776 S0b1000000000000000000000000000000000000000000000000000000000000000
1777 echo $?/$^ERRNAME $res
1779 S0b1000000000000000000000000000000000000000000000000000000000000000
1780 echo $?/$^ERRNAME $res
1782 U0b1000000000000000000000000000000000000000000000000000000000000000
1783 echo $?/$^ERRNAME $res
1785 0b1000000000000000000000000000000000000000000000000000000000000000
1786 echo $?/$^ERRNAME $res
1788 0b1000000000000000000000000000000000000000000000000000000000000000
1789 echo $?/$^ERRNAME $res
1791 -0b1000000000000000000000000000000000000000000000000000000000000000
1792 echo $?/$^ERRNAME $res
1794 S0b1000000000000000000000000000000000000000000000000000000000000001
1795 echo $?/$^ERRNAME $res
1797 S0b1000000000000000000000000000000000000000000000000000000000000001
1798 echo $?/$^ERRNAME $res
1800 -0b1000000000000000000000000000000000000000000000000000000000000001
1801 echo $?/$^ERRNAME $res
1803 U0b1000000000000000000000000000000000000000000000000000000000000001
1804 echo $?/$^ERRNAME $res
1806 vput vexpr res = 0777777777777777777777
1807 echo $?/$^ERRNAME $res
1808 vput vexpr res = S01000000000000000000000
1809 echo $?/$^ERRNAME $res
1810 vput vexpr res @= S01000000000000000000000
1811 echo $?/$^ERRNAME $res
1812 vput vexpr res = U01000000000000000000000
1813 echo $?/$^ERRNAME $res
1814 vput vexpr res = 01000000000000000000000
1815 echo $?/$^ERRNAME $res
1816 vput vexpr res @= 01000000000000000000000
1817 echo $?/$^ERRNAME $res
1818 vput vexpr res = -01000000000000000000000
1819 echo $?/$^ERRNAME $res
1820 vput vexpr res = S01000000000000000000001
1821 echo $?/$^ERRNAME $res
1822 vput vexpr res @= S01000000000000000000001
1823 echo $?/$^ERRNAME $res
1824 vput vexpr res @= -01000000000000000000001
1825 echo $?/$^ERRNAME $res
1826 vput vexpr res = U01000000000000000000001
1827 echo $?/$^ERRNAME $res
1829 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1830 echo $?/$^ERRNAME $res
1831 vput vexpr res = S0x8000000000000000
1832 echo $?/$^ERRNAME $res
1833 vput vexpr res @= S0x8000000000000000
1834 echo $?/$^ERRNAME $res
1835 vput vexpr res = U0x8000000000000000
1836 echo $?/$^ERRNAME $res
1837 vput vexpr res = 0x8000000000000000
1838 echo $?/$^ERRNAME $res
1839 vput vexpr res @= 0x8000000000000000
1840 echo $?/$^ERRNAME $res
1841 vput vexpr res = -0x8000000000000000
1842 echo $?/$^ERRNAME $res
1843 vput vexpr res = S0x8000000000000001
1844 echo $?/$^ERRNAME $res
1845 vput vexpr res @= S0x8000000000000001
1846 echo $?/$^ERRNAME $res
1847 vput vexpr res @= -0x8000000000000001
1848 echo $?/$^ERRNAME $res
1849 vput vexpr res = u0x8000000000000001
1850 echo $?/$^ERRNAME $res
1853 echo $?/$^ERRNAME $res
1855 echo $?/$^ERRNAME $res
1857 echo $?/$^ERRNAME $res
1859 vput vexpr res + 0 0
1860 echo $?/$^ERRNAME $res
1861 vput vexpr res + 0 1
1862 echo $?/$^ERRNAME $res
1863 vput vexpr res + 1 1
1864 echo $?/$^ERRNAME $res
1866 vput vexpr res + 9223372036854775807 0
1867 echo $?/$^ERRNAME $res
1868 vput vexpr res + 9223372036854775807 1
1869 echo $?/$^ERRNAME $res
1870 vput vexpr res @+ 9223372036854775807 1
1871 echo $?/$^ERRNAME $res
1872 vput vexpr res + 0 9223372036854775807
1873 echo $?/$^ERRNAME $res
1874 vput vexpr res + 1 9223372036854775807
1875 echo $?/$^ERRNAME $res
1876 vput vexpr res @+ 1 9223372036854775807
1877 echo $?/$^ERRNAME $res
1879 vput vexpr res + -9223372036854775808 0
1880 echo $?/$^ERRNAME $res
1881 vput vexpr res + -9223372036854775808 -1
1882 echo $?/$^ERRNAME $res
1883 vput vexpr res @+ -9223372036854775808 -1
1884 echo $?/$^ERRNAME $res
1885 vput vexpr res + 0 -9223372036854775808
1886 echo $?/$^ERRNAME $res
1887 vput vexpr res + -1 -9223372036854775808
1888 echo $?/$^ERRNAME $res
1889 vput vexpr res @+ -1 -9223372036854775808
1890 echo $?/$^ERRNAME $res
1892 vput vexpr res - 0 0
1893 echo $?/$^ERRNAME $res
1894 vput vexpr res - 0 1
1895 echo $?/$^ERRNAME $res
1896 vput vexpr res - 1 1
1897 echo $?/$^ERRNAME $res
1899 vput vexpr res - 9223372036854775807 0
1900 echo $?/$^ERRNAME $res
1901 vput vexpr res - 9223372036854775807 -1
1902 echo $?/$^ERRNAME $res
1903 vput vexpr res @- 9223372036854775807 -1
1904 echo $?/$^ERRNAME $res
1905 vput vexpr res - 0 9223372036854775807
1906 echo $?/$^ERRNAME $res
1907 vput vexpr res - -1 9223372036854775807
1908 echo $?/$^ERRNAME $res
1909 vput vexpr res - -2 9223372036854775807
1910 echo $?/$^ERRNAME $res
1911 vput vexpr res @- -2 9223372036854775807
1912 echo $?/$^ERRNAME $res
1914 vput vexpr res - -9223372036854775808 +0
1915 echo $?/$^ERRNAME $res
1916 vput vexpr res - -9223372036854775808 +1
1917 echo $?/$^ERRNAME $res
1918 vput vexpr res @- -9223372036854775808 +1
1919 echo $?/$^ERRNAME $res
1920 vput vexpr res - 0 -9223372036854775808
1921 echo $?/$^ERRNAME $res
1922 vput vexpr res - +1 -9223372036854775808
1923 echo $?/$^ERRNAME $res
1924 vput vexpr res @- +1 -9223372036854775808
1925 echo $?/$^ERRNAME $res
1927 vput vexpr res + -13 -2
1928 echo $?/$^ERRNAME $res
1929 vput vexpr res - 0 0
1930 echo $?/$^ERRNAME $res
1931 vput vexpr res - 0 1
1932 echo $?/$^ERRNAME $res
1933 vput vexpr res - 1 1
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res - -13 -2
1936 echo $?/$^ERRNAME $res
1938 vput vexpr res * 0 0
1939 echo $?/$^ERRNAME $res
1940 vput vexpr res * 0 1
1941 echo $?/$^ERRNAME $res
1942 vput vexpr res * 1 1
1943 echo $?/$^ERRNAME $res
1944 vput vexpr res * -13 -2
1945 echo $?/$^ERRNAME $res
1947 vput vexpr res / 0 0
1948 echo $?/$^ERRNAME $res
1949 vput vexpr res / 0 1
1950 echo $?/$^ERRNAME $res
1951 vput vexpr res / 1 1
1952 echo $?/$^ERRNAME $res
1953 vput vexpr res / -13 -2
1954 echo $?/$^ERRNAME $res
1956 vput vexpr res % 0 0
1957 echo $?/$^ERRNAME $res
1958 vput vexpr res % 0 1
1959 echo $?/$^ERRNAME $res
1960 vput vexpr res % 1 1
1961 echo $?/$^ERRNAME $res
1962 vput vexpr res % -13 -2
1963 echo $?/$^ERRNAME $res
1966 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
1968 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1969 vput vexpr res
find 'bananarama' 'nana'
1970 echo $?
/$^ERRNAME
:$res:
1971 vput vexpr res
find 'bananarama' 'bana'
1972 echo $?
/$^ERRNAME
:$res:
1973 vput vexpr res
find 'bananarama' 'Bana'
1974 echo $?
/$^ERRNAME
:$res:
1975 vput vexpr res
find 'bananarama' 'rama'
1976 echo $?
/$^ERRNAME
:$res:
1978 vput vexpr res ifind
'bananarama' 'nana'
1979 echo $?
/$^ERRNAME
:$res:
1980 vput vexpr res ifind
'bananarama' 'bana'
1981 echo $?
/$^ERRNAME
:$res:
1982 vput vexpr res ifind
'bananarama' 'Bana'
1983 echo $?
/$^ERRNAME
:$res:
1984 vput vexpr res ifind
'bananarama' 'rama'
1985 echo $?
/$^ERRNAME
:$res:
1987 vput vexpr res substring
'bananarama' 1
1988 echo $?
/$^ERRNAME
:$res:
1989 vput vexpr res substring
'bananarama' 3
1990 echo $?
/$^ERRNAME
:$res:
1991 vput vexpr res substring
'bananarama' 5
1992 echo $?
/$^ERRNAME
:$res:
1993 vput vexpr res substring
'bananarama' 7
1994 echo $?
/$^ERRNAME
:$res:
1995 vput vexpr res substring
'bananarama' 9
1996 echo $?
/$^ERRNAME
:$res:
1997 vput vexpr res substring
'bananarama' 10
1998 echo $?
/$^ERRNAME
:$res:
1999 vput vexpr res substring
'bananarama' 1 3
2000 echo $?
/$^ERRNAME
:$res:
2001 vput vexpr res substring
'bananarama' 3 3
2002 echo $?
/$^ERRNAME
:$res:
2003 vput vexpr res substring
'bananarama' 5 3
2004 echo $?
/$^ERRNAME
:$res:
2005 vput vexpr res substring
'bananarama' 7 3
2006 echo $?
/$^ERRNAME
:$res:
2007 vput vexpr res substring
'bananarama' 9 3
2008 echo $?
/$^ERRNAME
:$res:
2009 vput vexpr res substring
'bananarama' 10 3
2010 echo $?
/$^ERRNAME
:$res:
2012 vput vexpr res substring
'bananarama' -1
2013 echo $?
/$^ERRNAME
:$res:
2014 vput vexpr res substring
'bananarama' -3
2015 echo $?
/$^ERRNAME
:$res:
2016 vput vexpr res substring
'bananarama' -5
2017 echo $?
/$^ERRNAME
:$res:
2018 vput vexpr res substring
'bananarama' -7
2019 echo $?
/$^ERRNAME
:$res:
2020 vput vexpr res substring
'bananarama' -9
2021 echo $?
/$^ERRNAME
:$res:
2022 vput vexpr res substring
'bananarama' -10
2023 echo $?
/$^ERRNAME
:$res:
2024 vput vexpr res substring
'bananarama' 1 -3
2025 echo $?
/$^ERRNAME
:$res:
2026 vput vexpr res substring
'bananarama' 3 -3
2027 echo $?
/$^ERRNAME
:$res:
2028 vput vexpr res substring
'bananarama' 5 -3
2029 echo $?
/$^ERRNAME
:$res:
2030 vput vexpr res substring
'bananarama' 7 -3
2031 echo $?
/$^ERRNAME
:$res:
2032 vput vexpr res substring
'bananarama' 9 -3
2033 echo $?
/$^ERRNAME
:$res:
2034 vput vexpr res substring
'bananarama' 10 -3
2035 echo $?
/$^ERRNAME
:$res:
2037 vput vexpr res trim
'Cocoon Cocoon'
2038 echo $?
/$^ERRNAME
:$res:
2039 vput vexpr res trim
' Cocoon Cocoon '
2040 echo $?
/$^ERRNAME
:$res:
2041 vput vexpr res trim-front
'Cocoon Cocoon'
2042 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res trim-front
' Cocoon Cocoon '
2044 echo $?
/$^ERRNAME
:$res:
2045 vput vexpr res trim-end
'Cocoon Cocoon'
2046 echo $?
/$^ERRNAME
:$res:
2047 vput vexpr res trim-end
' Cocoon Cocoon '
2048 echo $?
/$^ERRNAME
:$res:
2051 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2053 if have_feat regex
; then
2054 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2055 vput vexpr res regex 'bananarama' 'nana'
2056 echo $?/$^ERRNAME :$res:
2057 vput vexpr res regex 'bananarama' 'bana'
2058 echo $?/$^ERRNAME :$res:
2059 vput vexpr res regex 'bananarama' 'Bana'
2060 echo $?/$^ERRNAME :$res:
2061 vput vexpr res regex 'bananarama' 'rama'
2062 echo $?/$^ERRNAME :$res:
2064 vput vexpr res iregex 'bananarama' 'nana'
2065 echo $?/$^ERRNAME :$res:
2066 vput vexpr res iregex 'bananarama' 'bana'
2067 echo $?/$^ERRNAME :$res:
2068 vput vexpr res iregex 'bananarama' 'Bana'
2069 echo $?/$^ERRNAME :$res:
2070 vput vexpr res iregex 'bananarama' 'rama'
2071 echo $?/$^ERRNAME :$res:
2073 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2074 echo $?/$^ERRNAME :$res:
2075 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2076 echo $?/$^ERRNAME :$res:
2077 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2078 echo $?/$^ERRNAME :$res:
2079 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2080 echo $?/$^ERRNAME :$res:
2082 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2083 echo $?/$^ERRNAME :$res:
2084 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2085 echo $?/$^ERRNAME :$res:
2086 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2087 echo $?/$^ERRNAME :$res:
2088 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2089 echo $?/$^ERRNAME :$res:
2093 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2095 printf 'behave:vexpr-regex: unsupported, skipped\n'
2101 t_behave_call_ret() {
2102 t_prolog t_behave_call_ret
2104 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2109 vput vexpr j
'&' $i 7
2115 vput vexpr j
'&' $i 7
2121 echo ! The end
for $1
2125 # Transport $?/$! up the call chain
2131 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2135 echo ! The end
for $1
2136 return $i $^ERR-BUSY
2140 # Up and down it goes
2147 vput vexpr k
- $1 $2
2151 echo "# <$i/$j> .. "
2155 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2158 echo ! The end
for $1=$i/$2
2162 return $i $^ERR-BUSY
2168 call w1
0; echo ?
=$?
!=$
!; echo -----;
2169 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2170 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2173 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2179 t_prolog t_behave_xcall
2181 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2186 vput vexpr j '&' $i 7
2192 echo ! The end for $1/$2
2194 return $i $^ERR-BUSY
2205 echo ?=$? !=$^ERRNAME
2208 echo ?=$? !=$^ERRNAME
2210 echo ?=$? !=$^ERRNAME
2213 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2217 if have_feat uistrings; then
2218 ${cat} <<- '__EOT' > "${BODY}"
2223 vput vexpr j '&' $i 7
2229 echo ! The end for $1
2232 echo would be err with errexit
2241 echo zwei, ?=$? !=$!
2242 localopts yes; set errexit
2244 echo drei, ?=$? !=$^ERRNAME
2246 echo vier, ?=$? !=$^ERRNAME, this is an error
2249 echo outer 1, ?=$? !=$^ERRNAME
2251 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2253 echo outer 3, ?=$? !=$^ERRNAME
2254 echo this is definitely an error
2257 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2258 -Snomemdebug > "${MBOX}" 2>&1
2259 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2261 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2262 -Snomemdebug > "${MBOX}" 2>&1
2263 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2265 echo 'behave:xcall-2: unsupported, skipped'
2266 echo 'behave:xcall-3: unsupported, skipped'
2272 t_behave_vpospar() {
2273 t_prolog t_behave_vpospar
2275 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2276 vpospar
set hey
, "'you ", world
!
2277 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2278 vput vpospar x quote
; echo x
<$x>
2279 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2280 vput vpospar y quote
;echo y
<$y>
2281 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2282 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2283 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2286 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2287 vput vpospar z quote
;echo infun2
:z
<$z>
2291 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2292 vput vpospar y quote
;echo infun
:y
<$y>
2293 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2294 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2296 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2297 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2300 call infun This
"in a" fun
2301 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2302 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2304 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2307 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2309 echo ifs<$ifs> ifs-ws<$ifs-ws>
2310 vpospar set hey, "'you ", world!
2311 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2312 vput vpospar x quote; echo x<$x>
2313 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2314 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2317 echo ifs<$ifs> ifs-ws<$ifs-ws>
2318 vpospar set hey, "'you
", world!
2319 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2321 vput vpospar x quote; echo x<$x>
2322 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2323 eval vpospar set ${x};\
2324 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2327 echo ifs<$ifs> ifs-ws<$ifs-ws>
2328 vpospar set hey, "'you ", world!
2329 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2331 vput vpospar x quote; echo x<$x>
2332 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2333 eval vpospar set ${x};\
2334 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2336 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2341 t_behave_atxplode() {
2342 t_prolog t_behave_atxplode
2343 TRAP_EXIT_ADDONS="./.t*"
2345 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2348 printf " (1/$#: <$1>)"
2350 if [ $# -gt 0 ]; then
2364 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2365 printf xxx;xxx arg ,b u.
2366 printf xxx;xxx arg , .
2367 printf xxx;xxx arg ,ball.
2373 echon " (1/$#: <$1>)"
2388 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2389 echon xxx;call xxx arg ,b u.
2390 echon xxx;call xxx arg , .
2391 echon xxx;call xxx arg ,ball.
2394 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2395 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2397 #${SHELL} ./.t.sh > ./.tshout 2>&1
2398 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2404 t_prolog t_behave_read
2405 TRAP_EXIT_ADDONS="./.t*"
2407 ${cat} <<- '__EOT
' > .tin
2408 hey1, "'you
", world!
2409 hey2, "'you ", bugs bunny!
2414 ${cat} <<- '__EOT
' |\
2415 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2417 echo $?/$^ERRNAME / <$a><$b><$c>
2419 echo $?/$^ERRNAME / <$a><$b><$c>
2421 echo $?/$^ERRNAME / <$a><$b><$c>
2423 echo $?/$^ERRNAME / <$a><$b><$c>
2424 unset a b c;read a b c
2425 echo $?/$^ERRNAME / <$a><$b><$c>
2426 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2428 check behave:read-1 0 "${MBOX}" '1527910147 173'
2430 ${cat} <<- '__EOT
' > .tin2
2431 hey2.0,:"'you
",:world!:mars.:
2432 hey2.1,:"'you ",:world!
2433 hey2.2,:"'you
",:bugs bunny!
2439 ${cat} <<- '__EOT' |\
2440 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2443 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2445 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2447 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2449 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2451 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2453 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2454 unset a b c
;read a b c
2455 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2457 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2458 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2460 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2462 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2464 readall d; echo $?/$^ERRNAME / <$d>
2465 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2466 readctl create .tin2
2467 readall d; echo $?/$^ERRNAME / <$d>
2468 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2469 readctl remove .tin;echo $?/$^ERRNAME;\
2470 readctl remove .tin2;echo $?/$^ERRNAME
2471 echo '### now with empty lines'
2472 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2473 readctl create .temptynl;echo $?/$^ERRNAME
2474 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2475 readctl remove .temptynl;echo $?/$^ERRNAME
2477 check readall 0 "${MBOX}" '4113506527 405'
2483 t_prolog t_behave_mbox
2484 TRAP_EXIT_ADDONS=".
/.t
*"
2488 while [ ${i} -lt 113 ]; do
2489 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2490 "${MBOX}" "${i}" "${i}"
2493 ) | ${MAILX} ${ARGS} > .tall 2>&1
2494 check behave:mbox-1 0 "${MBOX}" '1872102723 13784'
2495 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2497 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2498 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2499 check behave:mbox-2 0 .tall '3498373999 9103'
2501 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2502 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2503 check behave
:mbox-3
0 .tall
'381610797 9110'
2505 # copy only the odd (but the first), move the even
2507 printf 'File "file://%s"\ncopy ' .tmbox2
2509 while [ ${i} -lt 113 ]; do
2513 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2514 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2515 check behave
:mbox-4
0 .tmbox3
'4145104131 6890'
2516 check behave
:mbox-5
- .tall
'361127721 4573'
2519 printf 'file "file://%s"\nmove ' .tmbox2
2521 while [ ${i} -lt 113 ]; do
2525 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2526 .tmbox3 .tmbox3 .tmbox2
2527 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2528 check behave
:mbox-6
0 .tmbox3
'3249991493 13784'
2529 if have_feat uistrings
; then
2530 ${sed} 2d
< .tall
> .tallx
2534 check behave
:mbox-7
- .tallx
'1584413080 13645'
2536 # Invalid MBOXes (after [f4db93b3])
2538 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2539 check behave:mbox-8 0 .tinvmbox '896415941 122'
2540 check behave:mbox-9 - ./.tall '3146754194 33'
2542 echo ' ' > .tinvmbox
2543 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2544 check behave
:mbox-10
0 .tinvmbox
'4011310616 124'
2545 check behave
:mbox-11
- .
/.tall
'3146754194 33'
2547 { echo; echo; } > .tinvmbox
# (not invalid)
2548 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2549 check behave:mbox-12 0 .tinvmbox '287409579 123'
2550 check behave:mbox-13 - ./.tall '3146754194 33'
2552 # *mbox-rfc4155*, plus
2553 ${cat} <<-_EOT > ./.tinv1
2556 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2557 Date: Wed, 02 Oct 1996 01:50:07 +0000
2559 Subject: Bad bad message 1
2561 From me to you, blinde Kuh!
2563 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2564 Date: Wed, 02 Oct 1996 01:50:07 +0000
2566 Subject: Bad bad message 2
2568 From me to you, blindes Kalb!
2570 ${cp} ./.tinv1 ./.tinv2
2574 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2575 \\eval copy * "${2}"
2577 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2578 ex0_test behave:mbox-14-estat
2579 ${cat} ./.tinv1 ./.tok >> .tall
2580 check behave:mbox-14 - ./.tall '739301109 616'
2583 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2584 wysh File ./.tok # Just move away to nowhere
2586 wysh file ./.tinv2 # Fully repaired
2587 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2588 ex0_test behave:mbox-15-estat
2589 check behave:mbox-15-1 - ./.tinv1 '3178048820 332'
2590 check behave:mbox-15-2 - ./.tinv2 '4151504442 314'
2595 t_behave_maildir() {
2596 t_prolog t_behave_maildir
2597 TRAP_EXIT_ADDONS=".
/.t
*"
2601 while [ ${i} -lt 112 ]; do
2602 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2603 "${MBOX}" "${i}" "${i}"
2606 ) | ${MAILX} ${ARGS}
2607 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2613 ' "${MBOX}" .tmdir1 .tmdir1 |
2614 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2615 check behave:maildir-2 0 .tlst '1797938753 9103'
2618 copy * "maildir
://%s
"
2621 ' "${MBOX}" .tmdir2 .tmdir2 |
2622 ${MAILX} ${ARGS} -Sshowlast > .tlst
2623 check behave:maildir-3 0 .tlst '1155631089 9113'
2625 printf 'File "maildir
://%s
"
2629 ' .tmdir2 .tmbox1 .tmbox1 |
2630 ${MAILX} ${ARGS} -Sshowlast > .tlst
2631 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2632 check behave:maildir-5 - .tlst '3701297796 9110'
2634 # only the odd (even)
2636 printf 'File "maildir
://%s
"
2639 while [ ${i} -lt 112 ]; do
2641 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2648 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2649 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2650 check behave:maildir-7 - .tlst '960096773 4573'
2653 printf 'file "maildir
://%s
"
2656 while [ ${i} -lt 112 ]; do
2658 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2666 ' .tmbox2 .tmbox2 .tmdir2
2667 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2668 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2669 ${sed} 2d
< .tlst
> .tlstx
2670 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2675 t_behave_record_a_resend
() {
2676 t_prolog t_behave_record_a_resend
2677 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2681 m %s\n~s Subject 1.\nHello.\n~.
2682 set record-files add-file-recipients
2683 m %s\n~s Subject 2.\nHello.\n~.
2685 resend 2 ./.t.resent
2686 Resend 1 ./.t.resent
2688 resend 2 ./.t.resent
2689 Resend 1 ./.t.resent
2690 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2693 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2694 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2695 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2700 t_behave_e_H_L_opts
() {
2701 t_prolog t_behave_e_H_L_opts
2702 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2705 ${MAILX} ${ARGS} -ef .
/.t.mbox
2706 echo ${?} > "${MBOX}"
2708 ${cat} <<-_EOT > ./.tsendmail.sh
2710 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2713 chmod 0755 .
/.tsendmail.sh
2714 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2715 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2716 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2717 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2719 ${MAILX} ${ARGS} -ef .
/.t.mbox
2720 echo ${?} >> "${MBOX}"
2721 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2722 echo ${?} >> "${MBOX}"
2723 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2724 echo ${?} >> "${MBOX}"
2725 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2726 echo ${?} >> "${MBOX}"
2727 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2728 echo ${?} >> "${MBOX}"
2729 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2730 echo ${?} >> "${MBOX}"
2731 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2732 echo ${?} >> "${MBOX}"
2734 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2735 echo ${?} >> "${MBOX}"
2736 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2737 echo ${?} >> "${MBOX}"
2738 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2739 echo ${?} >> "${MBOX}"
2740 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2741 echo ${?} >> "${MBOX}"
2742 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2743 echo ${?} >> "${MBOX}"
2744 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2745 echo ${?} >> "${MBOX}"
2746 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2747 echo ${?} >> "${MBOX}"
2749 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2754 t_behave_alternates
() {
2755 t_prolog t_behave_alternates
2756 TRAP_EXIT_ADDONS
="./.t*"
2758 ${cat} <<-_EOT > ./.tsendmail.sh
2760 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2763 chmod 0755 .
/.tsendmail.sh
2765 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2769 alternates a1@b1 a2@b2 a3@b3
2774 echo $?
/$^ERRNAME
<$rv>
2779 echo $?
/$^ERRNAME
<$rv>
2782 echo $?
/$^ERRNAME
<$rv>
2785 echo $?
/$^ERRNAME
<$rv>
2789 alternates a1@b1 a2@b2 a3@b3
2792 echo $?
/$^ERRNAME
<$rv>
2795 echo $?
/$^ERRNAME
<$rv>
2798 echo $?
/$^ERRNAME
<$rv>
2801 alternates a1@b1 a2@b2 a3@b3
2804 echo $?
/$^ERRNAME
<$rv>
2807 echo $?
/$^ERRNAME
<$rv>
2810 echo $?
/$^ERRNAME
<$rv>
2814 alternates a1@b1 a2@b2 a3@b3
2817 echo $?
/$^ERRNAME
<$rv>
2821 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2823 ~s all alternates
, only a1@b1 remains
2825 ~b a3@b3 a3@c3 a3@d3
2834 alternates a1@b1 a1@c1 a2@b2 a3@b3
2836 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2838 ~b a3@b3 a3@c3 a3@d3
2845 alternates a1@b1 a2@b2 a3
; set allnet
2847 ~s all alternates via allnet
, only a1@b1 remains
2849 ~b a3@b3 a3@c3 a3@d3
2860 echo $?
/$^ERRNAME
<$rv>
2864 echo $?
/$^ERRNAME
<$rv>
2868 echo $?
/$^ERRNAME
<$rv>
2872 echo $?
/$^ERRNAME
<$rv>
2876 echo $?
/$^ERRNAME
<$rv>
2880 alternates a1@b1 a2@b2
2883 echo $?
/$^ERRNAME
<$rv>
2884 alternates a3@b3 a4@b4
2887 echo $?
/$^ERRNAME
<$rv>
2890 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2891 if have_feat uistrings
; then
2892 check behave
:alternates-2
- .tall
'1878598364 505'
2894 echo 'behave:alternates-2: unsupported, skipped'
2901 t_prolog t_behave_alias
2902 TRAP_EXIT_ADDONS
="./.t*"
2904 ${cat} <<-_EOT > ./.tsendmail.sh
2906 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2909 chmod 0755 .
/.tsendmail.sh
2911 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2913 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2915 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2917 alias a4 a5 ex1@a4.ple
2919 alias a6 a7 ex1@a6.ple
2933 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2934 check behave
:alias-2
- .tall
'3548953204 152'
2936 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2937 # TODO need to somehow provide its contents to the test, then test
2942 t_behave_filetype
() {
2943 t_prolog t_behave_filetype
2944 TRAP_EXIT_ADDONS
="./.t*"
2946 ${cat} <<-_EOT > ./.tsendmail.sh
2948 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2951 chmod 0755 .
/.tsendmail.sh
2953 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2954 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2955 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2957 if (echo | gzip -c) >/dev/null 2>&1; then
2960 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2961 "${MBOX}" | ${MAILX} ${ARGS} \
2962 -X'filetype gz gzip\ -dc gzip\ -c'
2963 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2964 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2966 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2967 check behave
:filetype-3
- "./.t.out" '2392348396 102'
2969 echo 'behave:filetype-2: unsupported, skipped'
2970 echo 'behave:filetype-3: unsupported, skipped'
2975 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2981 -X'filetype gz gzip\ -dc gzip\ -c' \
2982 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2983 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2984 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2986 -X'filetype gz gzip\ -dc gzip\ -c' \
2987 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2989 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2990 check behave
:filetype-5
- "./.t.out" '852335377 172'
2995 t_behave_message_injections
() {
2996 t_prolog t_behave_message_injections
2997 TRAP_EXIT_ADDONS
="./.t*"
2999 ${cat} <<-_EOT > ./.tsendmail.sh
3001 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3004 chmod 0755 .
/.tsendmail.sh
3006 echo mysig
> .
/.tmysig
3008 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3009 -Smessage-inject-head=head-inject \
3010 -Smessage-inject-tail=tail-inject \
3011 -Ssignature=.
/.tmysig \
3012 ex@am.ple
> .
/.tall
2>&1
3013 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3014 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3016 ${cat} <<-_EOT > ./.template
3020 Subject: This subject is
3022 Body, body, body me.
3024 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3025 -Smessage-inject-head=head-inject \
3026 -Smessage-inject-tail=tail-inject \
3027 -Ssignature=.
/.tmysig \
3029 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3030 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3035 t_behave_attachments
() {
3036 t_prolog t_behave_attachments
3037 TRAP_EXIT_ADDONS
="./.t*"
3039 ${cat} <<-_EOT > ./.tsendmail.sh
3041 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3044 chmod 0755 .
/.tsendmail.sh
3046 ${cat} <<-_EOT > ./.tx
3047 From steffen Sun Feb 18 02:48:40 2018
3048 Date: Sun, 18 Feb 2018 02:48:40 +0100
3051 User-Agent: s-nail v14.9.7
3054 From steffen Sun Feb 18 02:48:42 2018
3055 Date: Sun, 18 Feb 2018 02:48:42 +0100
3058 User-Agent: s-nail v14.9.7
3063 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3064 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3065 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3068 '!@ ./.t3 "./.t 4" ""
3076 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
3077 -a .
/.t1
-a './.t 2' \
3078 -s attachment-test \
3079 ex@am.ple
> .
/.tall
2>&1
3080 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3081 if have_feat uistrings
; then
3082 check behave
:attachments-2
- .tall
'1928331872 720'
3084 echo 'behave:attachments-2: unsupported, skipped'
3090 !s This the subject is
3091 !@ ./.t3 "#2" "./.t 4" "#1" ""
3101 !@ ./.t3 "#2" "./.t 4" "#1" ""
3109 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3118 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3132 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Rf .
/.tx \
3134 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3135 if have_feat uistrings
; then
3136 check behave
:attachments-4
- .tall
'2526106274 1910'
3138 echo 'behave:attachments-4: unsupported, skipped'
3144 t_behave_compose_hooks
() { # TODO monster
3145 t_prolog t_behave_compose_hooks
3146 if have_feat uistrings
; then :; else
3147 echo 'behave:compose_hooks: unsupported, skipped'
3150 TRAP_EXIT_ADDONS
="./.t*"
3152 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3153 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3155 ${cat} <<-_EOT > ./.tsendmail.sh
3157 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3160 chmod 0755 .
/.tsendmail.sh
3162 ${cat} <<'__EOT__' > ./.trc
3164 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3167 vput vexpr es substr "$1" 0 1
3172 define read_mline_res {
3173 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3174 echo $len/$es/$^ERRNAME: $hl
3175 if [ $es -ne $^ERR-NONE ]
3176 xcall bail read_mline_res
3178 \xcall read_mline_res
3183 echo "~^header list"; read hl; echo $hl;\
3184 call xerr "$hl" "in_addr ($xh) 0-1"
3186 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3187 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3188 echo "~^header insert $xh <${xh}2@exam.ple>";\
3189 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3190 echo "~^header insert $xh ${xh}3@exam.ple";\
3191 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3192 echo "~^header list $xh"; read hl; echo $hl;\
3193 call xerr "$hl" "ins_addr $xh 1-4"
3194 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3197 if [ "$t_remove" == "" ]
3201 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3202 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3204 xcall bail "ins_addr $xh 2-2"
3206 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3208 xcall bail "ins_addr $xh 2-3"
3210 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3212 xcall bail "ins_addr $xh 2-4"
3216 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3217 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3218 echo "~^header insert $xh <${xh}2@exam.ple>";\
3219 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3220 echo "~^header insert $xh ${xh}3@exam.ple";\
3221 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3222 echo "~^header list $xh"; read hl; echo $hl;\
3223 call xerr "$hl" "ins_addr $xh 3-4"
3224 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3227 echo "~^header remove-at $xh 1"; read es;\
3228 call xerr $es "ins_addr $xh 3-6"
3229 echo "~^header remove-at $xh 1"; read es;\
3230 call xerr $es "ins_addr $xh 3-7"
3231 echo "~^header remove-at $xh 1"; read es;\
3232 call xerr $es "ins_addr $xh 3-8"
3233 echo "~^header remove-at $xh 1"; read es;\
3234 vput vexpr es substr $es 0 3
3236 xcall bail "ins_addr $xh 3-9"
3238 echo "~^header remove-at $xh T"; read es;\
3239 vput vexpr es substr $es 0 3
3241 xcall bail "ins_addr $xh 3-10"
3243 echo "~^header list $xh"; read es;\
3244 vput vexpr es substr $es 0 3
3246 xcall bail "ins_addr $xh 3-11"
3248 echo "~^header show $xh"; read es;\
3249 vput vexpr es substr $es 0 3
3251 xcall bail "ins_addr $xh 3-12"
3255 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3256 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3257 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3258 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3259 echo "~^header insert $xh ${xh}3@exam.ple";\
3260 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3261 echo "~^header list $xh"; read hl; echo $hl;\
3262 call xerr "$hl" "header list $xh 3-4"
3263 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3266 echo "~^header remove-at $xh 3"; read es;\
3267 call xerr $es "ins_addr $xh 4-6"
3268 echo "~^header remove-at $xh 2"; read es;\
3269 call xerr $es "ins_addr $xh 4-7"
3270 echo "~^header remove-at $xh 1"; read es;\
3271 call xerr $es "ins_addr $xh 4-8"
3272 echo "~^header remove-at $xh 1"; read es;\
3273 vput vexpr es substr $es 0 3
3275 xcall bail "ins_addr $xh 4-9"
3277 echo "~^header remove-at $xh T"; read es;\
3278 vput vexpr es substr $es 0 3
3280 xcall bail "ins_addr $xh 4-10"
3282 echo "~^header list $xh"; read es;\
3283 vput vexpr es substr $es 0 3
3285 xcall bail "ins_addr $xh 4-11"
3287 echo "~^header show $xh"; read es;\
3288 vput vexpr es substr $es 0 3
3290 xcall bail "ins_addr $xh 4-12"
3294 wysh set xh=$1 mult=$2
3295 echo "~^header list"; read hl; echo $hl;\
3296 call xerr "$hl" "ins_ref ($xh) 0-1"
3298 echo "~^header insert $xh <$xh@exam.ple>";\
3299 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3301 echo "~^header insert $xh <${xh}2@exam.ple>";\
3302 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3303 echo "~^header insert $xh ${xh}3@exam.ple";\
3304 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3306 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3307 vput vexpr es substr $es 0 3
3309 xcall bail "ins_ref $xh 1-4"
3313 echo "~^header list $xh"; read hl; echo $hl;\
3314 call xerr "$hl" "ins_ref $xh 1-5"
3315 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3318 if [ "$t_remove" == "" ]
3322 echo "~^header remove $xh"; read es;\
3323 call xerr $es "ins_ref $xh 2-1"
3324 echo "~^header remove $xh"; read es;\
3325 vput vexpr es substr $es 0 3
3327 xcall bail "ins_ref $xh 2-2"
3329 echo "~^header list $xh"; read es;\
3330 vput vexpr es substr $es 0 3
3332 xcall bail "$es ins_ref $xh 2-3"
3334 echo "~^header show $xh"; read es;\
3335 vput vexpr es substr $es 0 3
3337 xcall bail "ins_ref $xh 2-4"
3341 echo "~^header insert $xh <$xh@exam.ple>";\
3342 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3344 echo "~^header insert $xh <${xh}2@exam.ple>";\
3345 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3346 echo "~^header insert $xh ${xh}3@exam.ple";\
3347 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3349 echo "~^header list $xh";\
3350 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3351 echo "~^header show $xh";\
3352 read es; call xerr $es "ins_ref $xh 3-5"
3355 echo "~^header remove-at $xh 1"; read es;\
3356 call xerr $es "ins_ref $xh 3-6"
3357 if [ $mult -ne 0 ] && [ $xh != subject ]
3358 echo "~^header remove-at $xh 1"; read es;\
3359 call xerr $es "ins_ref $xh 3-7"
3360 echo "~^header remove-at $xh 1"; read es;\
3361 call xerr $es "ins_ref $xh 3-8"
3363 echo "~^header remove-at $xh 1"; read es;\
3364 vput vexpr es substr $es 0 3
3366 xcall bail "ins_ref $xh 3-9"
3368 echo "~^header remove-at $xh T"; read es;\
3369 vput vexpr es substr $es 0 3
3371 xcall bail "ins_ref $xh 3-10"
3373 echo "~^header show $xh"; read es;\
3374 vput vexpr es substr $es 0 3
3376 xcall bail "ins_ref $xh 3-11"
3380 echo "~^header insert $xh <$xh@exam.ple> ";\
3381 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3383 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3384 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3385 echo "~^header insert $xh ${xh}3@exam.ple";\
3386 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3388 echo "~^header list $xh"; read hl; echo $hl;\
3389 call xerr "$hl" "ins_ref $xh 4-4"
3390 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3393 if [ $mult -ne 0 ] && [ $xh != subject ]
3394 echo "~^header remove-at $xh 3"; read es;\
3395 call xerr $es "ins_ref $xh 4-6"
3396 echo "~^header remove-at $xh 2"; read es;\
3397 call xerr $es "ins_ref $xh 4-7"
3399 echo "~^header remove-at $xh 1"; read es;\
3400 call xerr $es "ins_ref $xh 4-8"
3401 echo "~^header remove-at $xh 1"; read es;\
3402 vput vexpr es substr $es 0 3
3404 xcall bail "ins_ref $xh 4-9"
3406 echo "~^header remove-at $xh T"; read es;\
3407 vput vexpr es substr $es 0 3
3409 xcall bail "ins_ref $xh 4-10"
3411 echo "~^header show $xh"; read es;\
3412 vput vexpr es substr $es 0 3
3414 xcall bail "ins_ref $xh 4-11"
3419 # In collect.c order
3421 call ins_ref sender 0 # Not a "ref", but works
3425 call ins_addr reply-To
3426 call ins_addr mail-Followup-to
3427 call ins_ref messAge-id 0
3428 call ins_ref rEfErEncEs 1
3429 call ins_ref in-Reply-to 1
3430 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3431 call ins_addr freeForm1
3432 call ins_addr freeform2
3434 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3436 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3444 echo "~^attachment";\
3445 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3447 xcall bail "attach 0-1"
3450 echo "~^attach attribute ./.treadctl";\
3451 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3453 xcall bail "attach 0-2"
3455 echo "~^attachment attribute-at 1";\
3456 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3458 xcall bail "attach 0-3"
3461 echo "~^attachment insert ./.treadctl=ascii";\
3462 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3463 echo "~^attachment list";\
3464 read es; echo $es;call xerr "$es" "attach 1-2"
3466 echo "~^attachment attribute ./.treadctl";\
3467 read es; echo $es;call xerr "$es" "attach 1-3"
3469 echo "~^attachment attribute .treadctl";\
3470 read es; echo $es;call xerr "$es" "attach 1-4"
3472 echo "~^attachment attribute-at 1";\
3473 read es; echo $es;call xerr "$es" "attach 1-5"
3476 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3477 read es; echo $es;call xerr "$es" "attach 1-6"
3478 echo "~^attachment attribute-set .treadctl content-description Au";\
3479 read es; echo $es;call xerr "$es" "attach 1-7"
3480 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3481 read es; echo $es;call xerr "$es" "attach 1-8"
3483 echo "~^attachment attribute ./.treadctl";\
3484 read es; echo $es;call xerr "$es" "attach 1-9"
3486 echo "~^attachment attribute .treadctl";\
3487 read es; echo $es;call xerr "$es" "attach 1-10"
3489 echo "~^attachment attribute rctl";\
3490 read es; echo $es;call xerr "$es" "attach 1-11"
3492 echo "~^attachment attribute-at 1";\
3493 read es; echo $es;call xerr "$es" "attach 1-12"
3497 echo "~^attachment insert ./.tattach=latin1";\
3498 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3499 echo "~^attachment list";\
3500 read es; echo $es;call xerr "$es" "attach 2-2"
3502 echo "~^attachment attribute ./.tattach";\
3503 read es; echo $es;call xerr "$es" "attach 2-3"
3505 echo "~^attachment attribute .tattach";\
3506 read es; echo $es;call xerr "$es" "attach 2-4"
3508 echo "~^attachment attribute-at 2";\
3509 read es; echo $es;call xerr "$es" "attach 2-5"
3512 echo "~^attachment attribute-set ./.tattach filename tat";\
3513 read es; echo $es;call xerr "$es" "attach 2-6"
3515 "~^attachment attribute-set .tattach content-description Au2";\
3516 read es; echo $es;call xerr "$es" "attach 2-7"
3517 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3518 read es; echo $es;call xerr "$es" "attach 2-8"
3520 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3521 read es; echo $es;call xerr "$es" "attach 2-9"
3523 echo "~^attachment attribute ./.tattach";\
3524 read es; echo $es;call xerr "$es" "attach 2-10"
3526 echo "~^attachment attribute .tattach";\
3527 read es; echo $es;call xerr "$es" "attach 2-11"
3529 echo "~^attachment attribute tat";\
3530 read es; echo $es;call xerr "$es" "attach 2-12"
3532 echo "~^attachment attribute-at 2";\
3533 read es; echo $es;call xerr "$es" "attach 2-13"
3537 if [ "$t_remove" == "" ]
3541 echo "~^attachment remove ./.treadctl"; read es;\
3542 call xerr $es "attach 3-1"
3543 echo "~^attachment remove ./.tattach"; read es;\
3544 call xerr $es "attach 3-2"
3545 echo "~^ attachment remove ./.treadctl"; read es;\
3546 vput vexpr es substr $es 0 3
3548 xcall bail "attach 3-3"
3550 echo "~^ attachment remove ./.tattach"; read es;\
3551 vput vexpr es substr $es 0 3
3553 xcall bail "attach 3-4"
3555 echo "~^attachment list"; read es;\
3556 vput vexpr es substr $es 0 3
3558 xcall bail "attach 3-5"
3562 echo "~^attachment insert ./.tattach=latin1";\
3563 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3564 echo "~^attachment insert ./.tattach=latin1";\
3565 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3566 echo "~^attachment list";\
3567 read es; echo $es;call xerr "$es" "attach 4-3"
3569 echo "~^ attachment remove .tattach"; read es;\
3570 vput vexpr es substr $es 0 3
3572 xcall bail "attach 4-4 $es"
3574 echo "~^attachment remove-at T"; read es;\
3575 vput vexpr es substr $es 0 3
3577 xcall bail "attach 4-5"
3579 echo "~^attachment remove ./.tattach"; read es;\
3580 call xerr $es "attach 4-6"
3581 echo "~^attachment remove ./.tattach"; read es;\
3582 call xerr $es "attach 4-7"
3583 echo "~^ attachment remove ./.tattach"; read es;\
3584 vput vexpr es substr $es 0 3
3586 xcall bail "attach 4-8 $es"
3588 echo "~^attachment list"; read es;\
3589 vput vexpr es substr $es 0 3
3591 xcall bail "attach 4-9"
3595 echo "~^attachment insert ./.tattach=latin1";\
3596 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3597 echo "~^attachment insert ./.tattach=latin1";\
3598 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3599 echo "~^attachment insert ./.tattach=latin1";\
3600 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3601 echo "~^attachment list";\
3602 read es; echo $es;call xerr "$es" "attach 5-4"
3605 echo "~^attachment remove-at 3"; read es;\
3606 call xerr $es "attach 5-5"
3607 echo "~^attachment remove-at 3"; read es;\
3608 vput vexpr es substr $es 0 3
3610 xcall bail "attach 5-6"
3612 echo "~^attachment remove-at 2"; read es;\
3613 call xerr $es "attach 5-7"
3614 echo "~^attachment remove-at 2"; read es;\
3615 vput vexpr es substr $es 0 3
3617 xcall bail "attach 5-8"
3619 echo "~^attachment remove-at 1"; read es;\
3620 call xerr $es "attach 5-9"
3621 echo "~^attachment remove-at 1"; read es;\
3622 vput vexpr es substr $es 0 3
3624 xcall bail "attach 5-10"
3627 echo "~^attachment list"; read es;\
3628 vput vexpr es substr $es 0 3
3630 xcall bail "attach 5-11"
3634 echo "~^attachment insert ./.tattach=latin1";\
3635 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3636 echo "~^attachment insert ./.tattach=latin1";\
3637 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3638 echo "~^attachment insert ./.tattach=latin1";\
3639 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3640 echo "~^attachment list";\
3641 read es; echo $es;call xerr "$es" "attach 6-4"
3644 echo "~^attachment remove-at 1"; read es;\
3645 call xerr $es "attach 6-5"
3646 echo "~^attachment remove-at 1"; read es;\
3647 call xerr $es "attach 6-6"
3648 echo "~^attachment remove-at 1"; read es;\
3649 call xerr $es "attach 6-7"
3650 echo "~^attachment remove-at 1"; read es;\
3651 vput vexpr es substr $es 0 3
3653 xcall bail "attach 6-8"
3656 echo "~^attachment list"; read es;\
3657 vput vexpr es substr $es 0 3
3659 xcall bail "attach 6-9"
3671 echo on-compose-enter, mailx-command<$mailx-command>
3672 alternates alter1@exam.ple alter2@exam.ple
3674 set autocc='alter1@exam.ple alter2@exam.ple'
3675 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3676 echo mailx-subject<$mailx-subject>
3677 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3678 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3679 mailx-raw-bcc<$mailx-raw-bcc>
3680 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3681 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3684 echo on-compose-leave, mailx-command<$mailx-command>
3686 eval alternates $al alter3@exam.ple alter4@exam.ple
3688 set autobcc='alter3@exam.ple alter4@exam.ple'
3689 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3690 echo mailx-subject<$mailx-subject>
3691 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3692 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3693 mailx-raw-bcc<$mailx-raw-bcc>
3694 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3695 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3698 echo on-compose-cleanup, mailx-command<$mailx-command>
3701 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3702 echo mailx-subject<$mailx-subject>
3703 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3704 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3705 mailx-raw-bcc<$mailx-raw-bcc>
3706 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3707 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3709 wysh set on-compose-splice=t_ocs \
3710 on-compose-enter=t_oce on-compose-leave=t_ocl \
3711 on-compose-cleanup=t_occ
3715 printf 'm this-goes@nowhere\nbody\n!.\n' |
3716 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3717 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3719 ${cat} .
/.tall
>> "${MBOX}"
3720 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3723 printf 'm this-goes@nowhere\nbody\n!.\n' |
3724 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3725 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3727 ${cat} .
/.tall
>> "${MBOX}"
3728 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3732 # Some state machine stress, shell compose hook, localopts for hook, etc.
3733 # readctl in child. ~r as HERE document
3735 printf 'm ex@am.ple\nbody\n!.
3736 echon ${mailx-command}${mailx-subject}
3737 echon ${mailx-from}${mailx-sender}
3738 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3739 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3740 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3741 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3742 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3743 -Smta=.
/.tsendmail.sh \
3746 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3749 vput vexpr es substr "$1" 0 1
3754 define read_mline_res {
3755 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3756 echo $len/$es/$^ERRNAME: $hl
3757 if [ $es -ne $^ERR-NONE ]
3758 xcall bail read_mline_res
3760 \xcall read_mline_res
3764 vput vexpr i + 1 "$2"
3766 vput vexpr j % $i 10
3773 eval \\$j _work $1 $i
3776 vput vexpr i + $i "$1"
3780 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3781 echo read:$es/$en: $line
3782 if [ "${es}" -ne -1 ]
3785 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3790 echo "~^header list"; read hl; echo $hl;\
3791 vput vexpr es substr "$hl" 0 1
3793 xcall bail "header list"
3796 call _work 1; echo $?
3797 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3798 read es; echo $es; vput vexpr es substr "$es" 0 1
3800 xcall bail "be diet"
3802 echo "~^header insert cc <splice2@exam.ple>";\
3803 read es; echo $es; vput vexpr es substr "$es" 0 1
3805 xcall bail "be diet2"
3808 call _work 2; echo $?
3809 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3810 read es; echo $es;vput vexpr es substr "$es" 0 1
3812 xcall bail "be juicy"
3814 echo "~^header insert bcc juice2@exam.ple";\
3815 read es; echo $es;vput vexpr es substr "$es" 0 1
3817 xcall bail "be juicy2"
3819 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3820 read es; echo $es;vput vexpr es substr "$es" 0 1
3822 xcall bail "be juicy3"
3824 echo "~^header insert bcc juice4@exam.ple";\
3825 read es; echo $es;vput vexpr es substr "$es" 0 1
3827 xcall bail "be juicy4"
3830 echo "~^header remove-at bcc 3";\
3831 read es; echo $es;vput vexpr es substr "$es" 0 1
3833 xcall bail "remove juicy5"
3835 echo "~^header remove-at bcc 2";\
3836 read es; echo $es;vput vexpr es substr "$es" 0 1
3838 xcall bail "remove juicy6"
3840 echo "~^header remove-at bcc 3";\
3841 read es; echo $es;vput vexpr es substr "$es" 0 3
3843 xcall bail "failed to remove-at"
3845 # Add duplicates which ought to be removed!
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-1"
3851 echo "~^header insert bcc juice4@exam.ple";\
3852 read es; echo $es;vput vexpr es substr "$es" 0 1
3854 xcall bail "be juicy4-2"
3856 echo "~^header insert bcc juice4@exam.ple";\
3857 read es; echo $es;vput vexpr es substr "$es" 0 1
3859 xcall bail "be juicy4-3"
3864 call _work 3; echo $?
3866 vput ! i echo just knock if you can hear me;\
3868 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3870 echon shell-cmd says $?/$^ERRNAME: $i
3871 echo "~x will not become interpreted, we are reading until __EOT"
3873 read r_status; echo "~~r status output: $r_status"
3874 echo "~:echo $? $! $^ERRNAME"
3876 echo "~~r status from parent: $r_status"
3879 call _work 4; echo $?
3880 vput cwd cwd;echo cwd:$?
3881 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3885 call _work 5; echo $?
3886 echo "~^header show MAILX-Command"; read es;\
3887 call xerr $es "t_header 1000"; call read_mline_res
3888 echo "~^header show MAILX-raw-TO"; read es;\
3889 call xerr $es "t_header 1001"; xcall read_mline_res
3891 echoerr IT IS WRONG IF YOU SEE THIS
3894 echo on-compose-enter, mailx-command<$mailx-command>
3895 set t_oce autobcc=oce@exam.ple
3896 alternates alter1@exam.ple alter2@exam.ple
3898 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3899 echo mailx-subject<$mailx-subject>
3900 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3901 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3902 mailx-raw-bcc<$mailx-raw-bcc>
3903 echo mailx-orig-from<$mailx-orig-from> \
3904 mailx-orig-to<$mailx-orig-to> \
3905 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3908 echo on-compose-leave, mailx-command<$mailx-command>
3909 set t_ocl autocc=ocl@exam.ple
3911 alternates alter3@exam.ple alter4@exam.ple
3913 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3914 echo mailx-subject<$mailx-subject>
3915 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3916 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3917 mailx-raw-bcc<$mailx-raw-bcc>
3918 echo mailx-orig-from<$mailx-orig-from> \
3919 mailx-orig-to<$mailx-orig-to> \
3920 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3923 echo on-compose-cleanup, mailx-command<$mailx-command>
3924 set t_occ autocc=occ@exam.ple
3927 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3928 echo mailx-subject<$mailx-subject>
3929 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3930 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3931 mailx-raw-bcc<$mailx-raw-bcc>
3932 echo mailx-orig-from<$mailx-orig-from> \
3933 mailx-orig-to<$mailx-orig-to> \
3934 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3936 wysh set on-compose-splice=t_ocs \
3937 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3938 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3939 on-compose-enter=t_oce on-compose-leave=t_ocl \
3940 on-compose-cleanup=t_occ
3942 ex0_test behave
:compose_hooks-3-estat
3943 ${cat} .
/.tnotes
>> "${MBOX}"
3945 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3947 # Reply, forward, resend, Resend
3950 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3951 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3952 -Smta=.
/.tsendmail.sh
3955 echo start: $? $! $^ERRNAME
3957 echo File: $? $! $^ERRNAME;echo;echo
3959 this is content of reply 1
3961 echo reply 1: $? $! $^ERRNAME;echo;echo
3963 this is content of Reply 1 2
3965 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3966 forward 1 fwdex@am.ple
3967 this is content of forward 1
3969 echo forward 1: $? $! $^ERRNAME;echo;echo
3970 resend 1 2 resendex@am.ple
3971 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3972 Resend 1 2 Resendex@am.ple
3973 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3975 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3976 -Smta=.
/.tsendmail.sh \
3979 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3982 vput vexpr es substr "$1" 0 1
3987 define read_mline_res {
3988 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3989 echo mline_res:$len/$es/$^ERRNAME: $hl
3990 if [ $es -ne $^ERR-NONE ]
3991 xcall bail read_mline_res
3993 \xcall read_mline_res
3997 echo "~^header show $1"; read es;\
3998 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4006 echo t_ocs version $ver
4007 echo "~^header list"; read hl; echo $hl;\
4008 echoerr the header list is $hl;\
4009 call xerr "$hl" "header list"
4010 eval vpospar set $hl
4013 echoerr IT IS WRONG IF YOU SEE THIS
4016 echo on-XY-enter, mailx-command<$mailx-command>
4017 set t_oce autobcc=oce@exam.ple
4018 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4019 echo mailx-subject<$mailx-subject>
4020 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4021 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4022 mailx-raw-bcc<$mailx-raw-bcc>
4023 echo mailx-orig-from<$mailx-orig-from> \
4024 mailx-orig-to<$mailx-orig-to> \
4025 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4028 echo on-XY-leave, mailx-command<$mailx-command>
4029 set t_ocl autocc=ocl@exam.ple
4030 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4031 echo mailx-subject<$mailx-subject>
4032 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4033 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4034 mailx-raw-bcc<$mailx-raw-bcc>
4035 echo mailx-orig-from<$mailx-orig-from> \
4036 mailx-orig-to<$mailx-orig-to> \
4037 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4040 echo on-XY-cleanup, mailx-command<$mailx-command>
4041 set t_occ autocc=occ@exam.ple
4042 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4043 echo mailx-subject<$mailx-subject>
4044 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4045 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4046 mailx-raw-bcc<$mailx-raw-bcc>
4047 echo mailx-orig-from<$mailx-orig-from> \
4048 mailx-orig-to<$mailx-orig-to> \
4049 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4051 wysh set on-compose-splice=t_ocs \
4052 on-compose-enter=t_oce on-compose-leave=t_ocl \
4053 on-compose-cleanup=t_occ \
4054 on-resend-enter=t_oce on-resend-cleanup=t_occ
4056 ex0_test behave
:compose_hooks-4-estat
4057 ${cat} .
/.tnotes
>> "${MBOX}"
4059 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4064 t_behave_C_opt_customhdr
() {
4065 t_prolog t_behave_C_opt_customhdr
4066 TRAP_EXIT_ADDONS
="./.t*"
4068 ${cat} <<-_EOT > ./.tsendmail.sh
4070 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
4074 chmod 0755 .
/.tsendmail.sh
4077 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
4078 -C 'C-One : Custom One Body' \
4079 -C 'C-Two:CustomTwoBody' \
4080 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4081 this-goes@nowhere
>.
/.tall
2>&1
4082 ex0_test behave
:C_opt_customhdr-1-estat
4083 ${cat} .
/.tall
>> "${MBOX}"
4084 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4087 printf 'm this-goes@nowhere\nbody\n!.
4089 m this-goes2@nowhere\nbody2\n!.
4090 set customhdr=%ccustom1 : custom1 body%c
4091 m this-goes2@nowhere\nbody2\n!.
4092 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4093 m this-goes3@nowhere\nbody3\n!.
4095 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
-Sescape=! \
4096 -C 'C-One : Custom One Body' \
4097 -C 'C-Two:CustomTwoBody' \
4098 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4100 ex0_test behave
:C_opt_customhdr-2-estat
4101 ${cat} .
/.tall
>> "${MBOX}"
4102 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4107 t_behave_mass_recipients
() {
4108 t_prolog t_behave_mass_recipients
4109 TRAP_EXIT_ADDONS
="./.t*"
4111 ${cat} <<-_EOT > ./.tsendmail.sh
4113 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4116 chmod 0755 .
/.tsendmail.sh
4118 ${cat} <<'__EOT__' > ./.trc
4120 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4123 wysh set nr=$1 hn=$2
4124 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4126 xcall bail "ins_addr $hn 1-$nr"
4128 vput vexpr nr + $nr 1
4129 if [ "$nr" -le "$maximum" ]
4130 xcall ins_addr $nr $hn
4134 wysh set nr=$1 hn=$2
4135 alternates $hn$nr@$hn
4136 vput vexpr nr + $nr 2
4137 if [ "$nr" -le "$maximum" ]
4138 xcall bld_alter $nr $hn
4148 if [ "$t_remove" != '' ]
4153 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4156 printf 'm this-goes@nowhere\nbody\n!.\n' |
4157 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4158 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4160 ex0_test behave
:mass_recipients-1-estat
4161 ${cat} .
/.tall
>> "${MBOX}"
4162 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4165 printf 'm this-goes@nowhere\nbody\n!.\n' |
4166 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4167 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4169 ex0_test behave
:mass_recipients-2-estat
4170 ${cat} .
/.tall
>> "${MBOX}"
4171 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4176 t_behave_mime_types_load_control
() {
4177 t_prolog t_behave_mime_types_load_control
4178 if have_feat uistrings
; then :; else
4179 echo 'behave:mime_types_load_control: unsupported, skipped'
4182 TRAP_EXIT_ADDONS
="./.t*"
4184 ${cat} <<-_EOT > ./.tmts1
4185 @ application/mathml+xml mathml
4187 ${cat} <<-_EOT > ./.tmts2
4188 @ x-conference/x-cooltalk ice
4190 @ application/aga-aga aga
4193 ${cat} <<-_EOT > ./.tmts1.mathml
4194 <head>nonsense ML</head>
4196 ${cat} <<-_EOT > ./.tmts2.ice
4199 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4200 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4214 ' "${MBOX}" "${MBOX}" |
4216 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4218 ex0_test behave
:mime_types_load_control-1-estat
4219 ${cat} "${MBOX}" >> .
/.tout
4220 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4222 echo type |
${MAILX} ${ARGS} -R \
4223 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4224 -f "${MBOX}" >> .
/.tout
2>&1
4225 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4230 t_behave_lreply_futh_rth_etc
() {
4231 t_prolog t_behave_lreply_futh_rth_etc
4232 TRAP_EXIT_ADDONS
="./.t*"
4234 ${cat} <<-_EOT > ./.tsendmail.sh
4236 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4239 chmod 0755 .
/.tsendmail.sh
4241 ${cat} <<-_EOT > ./.tmbox
4242 From neverneverland Sun Jul 23 13:46:25 2017
4243 Subject: Bugstop: five miles out 1
4244 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4245 From: mister originator <mr@originator>
4246 To: bugstop-commit@five.miles.out, laber@backe.eu
4248 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4249 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4250 Date: Wed, 19 Jul 2017 09:22:57 -0400
4251 Message-Id: <20170719132257.766AF781267@originator>
4254 > |Sorry, I think I misunderstand something. I would think that
4258 From neverneverland Fri Jul 7 22:39:11 2017
4259 Subject: Bugstop: five miles out 2
4260 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4261 Content-Transfer-Encoding: 7bit
4262 From: mister originator <mr@originator>
4263 To: bugstop-commit@five.miles.out
4265 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4266 Date: Fri, 07 Jul 2017 16:33:59 -0400
4269 capable of changing back.
4271 From neverneverland Fri Jul 7 22:42:00 2017
4272 Subject: Bugstop: five miles out 3
4273 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4274 Content-Transfer-Encoding: 7bit
4275 From: mister originator <mr@originator>
4276 To: bugstop-commit@five.miles.out
4278 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4279 Date: Fri, 07 Jul 2017 16:33:59 -0400
4280 List-Post: <mailto:bugstop@five.miles.out>
4283 are you ready, boots?
4285 From neverneverland Sat Aug 19 23:15:00 2017
4286 Subject: Bugstop: five miles out 4
4287 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4288 Content-Transfer-Encoding: 7bit
4289 From: mister originator <mr@originator>
4290 To: bugstop@five.miles.out
4292 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4293 Date: Fri, 07 Jul 2017 16:33:59 -0400
4294 List-Post: <mailto:bugstop@five.miles.out>
4297 are you ready, boots?
4302 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4303 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4305 wysh
set m
="This is text of \"reply ${1}."
4316 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4319 wysh set m="This is text of
\"Reply
${1}.
"
4325 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4334 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4338 # We need two indirections for this test: one for the case that Lreply
4339 # fails because of missing recipients: we need to read EOF next, thus
4340 # place this in _Ls last; and second for the succeeding cases EOF is
4341 # not what these should read, so go over the backside and splice it in!
4343 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4346 localopts call-fixate
yes
4348 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4349 call L
$1 1; call L
$1 2; call L
$1 3
4352 echo;echo '===== CHANGING === '"$*"' =====';echo
4356 set from
=laber@backe.eu
4359 call tweak
set reply-to-honour
4361 call tweak
set followup-to
4363 call tweak
set followup-to-honour
4365 call tweak mlist bugstop@five.miles.out
4367 call tweak mlsubscribe bugstop@five.miles.out
4369 call tweak
set recipients-in-cc
4373 ex0_test behave
:lreply_futh_rth_etc-1-estat
4374 if have_feat uistrings
; then # xxx should not be so, skip??
4375 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '940818845 29373'
4377 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '3917430455 29259'
4382 ${cat} <<-_EOT > ./.tmbox
4383 From tom@i-i.example Thu Oct 26 03:15:55 2017
4384 Date: Wed, 25 Oct 2017 21:15:46 -0400
4385 From: tom <tom@i-i.example>
4386 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4387 Cc: tom <tom@i-i.example>
4388 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4389 Message-ID: <20171026011546.GA11643@i-i.example>
4390 Reply-To: tom@i-i.example
4391 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4392 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4395 The report's useful :-)
4398 printf 'reply 1\nthank you\n!.\n' |
4399 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4400 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4401 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4406 t_behave_mime_if_not_ascii
() {
4407 t_prolog t_behave_mime_if_not_ascii
4409 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4410 check behave:mime_if_not_ascii-1 0 "${MBOX}" '2287855519 110'
4412 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4414 check behave
:mime_if_not_ascii-2
0 "${MBOX}" '70754682 282'
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; then
4565 if (</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 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4577 ${cat} <<-_EOT > ./.tsendmail.sh
4579 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4582 chmod 0755 ./.tsendmail.sh
4584 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4585 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4586 -Smta=./.tsendmail.sh \
4587 -Sescape=! -Smime-encoding=base64 2>./.terr
4588 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4590 !s Japanese from UTF-8 to ISO-2022-JP
4591 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4593 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4596 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4598 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4601 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4603 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4604 \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
4606 \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
4609 \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
4611 \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
4614 # May not presume iconv output as long as roundtrip possible [489a7122]
4615 ex0_test behave
:iconv_mbyte_base64-1-estat
4616 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4617 < "${MBOX}" > .
/.tcksum
4618 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4619 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4621 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4622 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4623 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4624 -Rf "${MBOX}" >.
/.tlog
2>&1
4625 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4626 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4627 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4628 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4630 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4633 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4634 rm -f "${MBOX}" .
/.twrite
4635 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4636 -Smta=.
/.tsendmail.sh \
4637 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4638 set ttycharset
=utf-8 sendcharsets
=euc-jp
4640 !s Japanese from UTF-8 to EUC-JP
4641 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4643 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4646 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4648 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4651 set ttycharset
=EUC-JP sendcharsets
=utf-8
4653 !s Japanese from EUC-JP to UTF-8
4654 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4656 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4659 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4661 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4664 ex0_test behave
:iconv_mbyte_base64-5-estat
4665 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4666 < "${MBOX}" > .
/.tcksum
4667 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4668 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4670 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4671 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4672 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4673 -Rf "${MBOX}" >.
/.tlog
2>&1
4674 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4675 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4676 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4677 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4679 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4685 t_behave_iconv_mainbody
() {
4686 t_prolog t_behave_iconv_mainbody
4687 TRAP_EXIT_ADDONS
="./.t*"
4689 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4692 echo 'behave:iconv_mainbody: unsupported, skipped'
4696 ${cat} <<-_EOT > ./.tsendmail.sh
4698 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4701 chmod 0755 .
/.tsendmail.sh
4703 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4704 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4705 -s '–' over-the@rain.bow
2>.
/.terr
4706 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4707 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4709 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4710 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4711 -s '–' over-the@rain.bow
2>.
/.terr
4712 exn0_test behave
:iconv_mainbody-3
4713 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4714 if have_feat uistrings
; then
4715 if have_feat docstrings
; then # xxx should not be like that
4716 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4718 check behave
:iconv_mainbody-4
- .
/.terr
'271380835 121'
4721 echo 'behave:iconv_mainbody-4: unsupported, skipped'
4724 # The different iconv(3) implementations use different replacement sequence
4725 # types (character-wise, byte-wise, and the character(s) used differ)
4726 i
="${MAILX_ICONV_MODE}"
4727 if [ -n "${i}" ]; then
4728 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4730 ex0_test behave:iconv_mainbody-5-0 ${j}
4731 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4732 if [ ${i} -eq 13 ]; then
4733 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4734 elif [ ${i} -eq 12 ]; then
4735 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4736 elif [ ${i} -eq 3 ]; then
4737 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4739 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4742 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4748 t_behave_binary_mainbody() {
4749 t_prolog t_behave_binary_mainbody
4750 TRAP_EXIT_ADDONS=".
/.t
*"
4752 printf 'abra\0\nka\r\ndabra' |
4753 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4755 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4756 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4758 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4759 ${MAILX} ${ARGS} -Rf \
4760 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4761 "${MBOX}" >./.tall 2>&1
4762 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4763 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4764 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4769 t_behave_q_t_etc_opts() {
4770 t_prolog t_behave_q_t_etc_opts
4771 TRAP_EXIT_ADDONS=".
/.t
*"
4773 # Three tests for MIME encoding and (a bit) content classification.
4774 # At the same time testing -q FILE, < FILE and -t FILE
4775 t__put_body > ./.tin
4778 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4779 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4780 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4783 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4784 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4785 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4788 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4790 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4791 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4797 have_feat smime || {
4798 echo 'behave:s/mime: unsupported, skipped'
4802 t_prolog t_behave_s_mime
4803 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4804 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4805 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4807 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4808 ${cat} <<-_EOT > ./.t.conf
4811 default_keyfile = keyfile.pem
4812 distinguished_name = req_distinguished_name
4813 attributes = req_attributes
4817 [ req_distinguished_name ]
4824 emailAddress = test@localhost
4829 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4830 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4831 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4834 printf 'behave:s/mime:sign/verify: '
4835 echo bla | ${MAILX} ${ARGS} \
4836 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4837 -Ssmime-sign -Sfrom=test@localhost \
4838 -s 'S/MIME test' ./.VERIFY
4839 if [ $? -eq 0 ]; then
4850 /^Content-Description: /{ skip = 2; print; next }
4851 /^$/{ if(skip) --skip }
4854 < ./.VERIFY > "${MBOX}"
4855 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4857 printf 'behave:s/mime:sign/verify:verify '
4858 printf 'verify\nx\n' |
4860 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4861 -Ssmime-sign -Sfrom=test@localhost \
4863 -f ./.VERIFY >>${ERR} 2>&1
4864 if [ $? -eq 0 ]; then
4873 printf 'behave:s/mime:sign/verify:disproof-1 '
4874 if openssl smime -verify -CAfile ./.tcert.pem \
4875 -in ./.VERIFY >>${ERR} 2>&1; then
4884 # (signing +) encryption / decryption
4885 ${cat} <<-_EOT > ./.tsendmail.sh
4887 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4889 chmod 0755 ./.tsendmail.sh
4891 printf 'behave:s/mime:encrypt+sign: '
4894 -Ssmime-force-encryption \
4895 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4896 -Smta=./.tsendmail.sh \
4897 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4898 -Ssmime-sign -Sfrom=test@localhost \
4899 -s 'S/MIME test' recei@ver.com
4900 if [ $? -eq 0 ]; then
4904 printf 'error: encrypt+sign failed\n'
4907 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4908 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4910 printf 'behave:s/mime:decrypt+verify: '
4911 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4913 -Ssmime-force-encryption \
4914 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4915 -Smta=./.tsendmail.sh \
4916 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4917 -Ssmime-sign -Sfrom=test@localhost \
4919 -f ./.ENCRYPT >>${ERR} 2>&1
4920 if [ $? -eq 0 ]; then
4929 /^Content-Description: /{ skip = 2; print; next }
4930 /^$/{ if(skip) --skip }
4933 < ./.DECRYPT > "${MBOX}"
4934 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4936 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4937 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4938 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1; then
4945 printf "behave
:s
/mime
:encrypt
: "
4946 echo bla | ${MAILX} ${ARGS} \
4947 -Ssmime-force-encryption \
4948 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4949 -Smta=./.tsendmail.sh \
4950 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4951 -Sfrom=test@localhost \
4952 -s 'S/MIME test' recei@ver.com
4953 if [ $? -eq 0 ]; then
4960 # Same as behave:s/mime:encrypt+sign:checksum above
4961 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4962 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4965 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4966 -Ssmime-force-encryption \
4967 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4968 -Smta=./.tsendmail.sh \
4969 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4970 -Sfrom=test@localhost \
4972 -f ./.ENCRYPT >>${ERR} 2>&1
4973 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4975 printf 'behave:s/mime:decrypt:disproof-1: '
4976 if openssl smime -decrypt -inkey ./.tkey.pem \
4977 -in ./.ENCRYPT >>${ERR} 2>&1; then
4988 # xxx Note: t_content() was the first test (series) written. Today many
4989 # xxx aspects are (better) covered by other tests above, some are not.
4990 # xxx At some future date and time, convert the last remains not covered
4991 # xxx elsewhere to a real t_behave_* test and drop t_content()
4995 # Test for [260e19d] (Juergen Daubert)
4997 echo body | ${MAILX} ${ARGS} "${MBOX}"
4998 check content
:004 0 "${MBOX}" '2917662811 98'
5000 # "Test for" [d6f316a] (Gavin Troy)
5002 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
5003 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5004 check content:006 0 "${MBOX}" '2099098650 122'
5005 check content:006-1 - "${BODY}" '794542938 174'
5007 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5010 for(i = 0; i < 10000; ++i)
5012 #printf "\xF0\x90\x87\x90"
5013 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5014 check content
:007 0 "${MBOX}" '534262374 61816'
5020 # MIME encoding (QP) stress message subject
5021 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5022 'adadaddsssssssddddddddddddddddddddd'\
5023 'ddddddddddddddddddddddddddddddddddd'\
5024 'ddddddddddddddddddddddddddddddddddd'\
5025 'dddddddddddddddddddd Hallelulja? Od'\
5026 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5027 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5028 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5029 'fffffffffffffffffffffffffffffffffff'\
5030 'fffffffffffffffffffff ggggggggggggg'\
5031 'ggggggggggggggggggggggggggggggggggg'\
5032 'ggggggggggggggggggggggggggggggggggg'\
5033 'ggggggggggggggggggggggggggggggggggg'\
5038 # MIME encoding (QP) stress message body
5040 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5041 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5042 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5043 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5044 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5045 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5046 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5047 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5048 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5049 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5050 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5051 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5052 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5053 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5054 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5055 "auf den zeilen vorher.\r\n"\
5056 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5058 "Die letzte Zeile war nur ein Punkt.\r\n"\
5060 "Das waren deren zwei.\r\n"\
5062 "Die letzte Zeile war ein Leerschritt.\n"\
5063 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5066 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5068 "Das waren deren zwei. ditto.\n"\
5070 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5071 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5072 "auf den zeilen vorher.\n"\
5074 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5075 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5077 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5079 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5081 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5083 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5085 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5087 "QP am Zeilenende über soft-nl hinweg\n"\
5088 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5090 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5092 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5094 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5096 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5098 "Die letzte Zeile war ein Leerschritt.\n"\
5103 # if have_feat devel; then
5104 # ARGS="${ARGS} -Smemdebug"
5108 if [ -n "${UTF8_LOCALE}" ]; then
5109 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5111 printf 'No Unicode locale found, disabling Unicode tests\n'
5119 # Test all configs TODO doesn't cover all *combinations*, stupid!
5123 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5124 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5125 NOTME["OPT_CROSS_BUILD"] = 1
5126 NOTME["OPT_AUTOCC"] = 1
5127 NOTME["OPT_AMALGAMATION"] = 1
5128 NOTME["OPT_DEBUG"] = 1
5129 NOTME["OPT_DEVEL"] = 1
5130 NOTME["OPT_ASAN_ADDRESS"] = 1
5131 NOTME["OPT_ASAN_MEMORY"] = 1
5132 NOTME["OPT_FORCED_STACKPROT"] = 1
5133 NOTME["OPT_NOMEMDBG"] = 1
5134 NOTME["OPT_NYD2"] = 1
5139 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5140 MULVALS["VAL_IDNA"] = 1
5142 #VALKEYS[0] = "VAL_RANDOM"
5143 VALVALS["VAL_RANDOM"] = 1
5146 /^[[:space:]]*OPT_/{
5147 sub(/^[[:space:]]*/, "")
5148 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5149 # does not seem to be a compliant escape for =
5151 $1 = substr($1, 1, index($1, "=") - 1)
5153 OPTVALS[OPTNO++] = $1
5156 /^[[:space:]]*VAL_/{
5157 sub(/^[[:space:]]*/, "")
5158 val = substr($0, index($0, "=") + 1)
5160 val = substr(val, 2)
5161 val = substr(val, 1, length(val) - 1)
5163 $1 = substr($1, 1, index($1, "=") - 1)
5166 else if(VALVALS[$1]){
5167 VALKEYS[VALNO++] = $1
5172 function onepass(addons){
5173 a_onepass__worker(addons, "1", "0")
5174 a_onepass__worker(addons, "0", "1")
5176 function a_onepass__worker(addons, b0, b1){
5177 # Doing this completely sequentially and not doing make distclean in
5178 # between runs should effectively result in lesser compilations.
5179 # It is completely dumb nonetheless... TODO
5180 for(ono = 0; ono < OPTNO; ++ono){
5182 for(i = 0; i < ono; ++i){
5183 myconf = myconf " " OPTVALS[i] "=" b0 " "
5185 j = MULCHOICE[OPTVALS[i]]
5190 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5194 for(i = ono; i < OPTNO; ++i){
5195 myconf = myconf " " OPTVALS[i] "=" b1 " "
5197 j = MULCHOICE[OPTVALS[i]]
5202 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5208 myconf = VALKEYS[i] "=any " myconf
5210 myconf = myconf " " ALWAYS " " addons
5215 i = split(MULVALS[mula], ia)
5219 print mula "=\"" j "\" " myconf
5225 # We cannot test NULL because of missing UI strings, which will end
5226 # up with different checksums
5227 print "CONFIG=NULLI OPT_AUTOCC=1"
5229 j = split(VALVALS[VALKEYS[i]], ia)
5233 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5236 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5237 print "CONFIG=NETSEND OPT_AUTOCC=1"
5238 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5240 j = split(VALVALS[VALKEYS[i]], ia)
5244 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5247 print "CONFIG=DEVEL OPT_AUTOCC=1"
5248 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5250 onepass("OPT_DEBUG=1")
5253 ' |
while read c
; do
5254 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5255 printf "\n\n##########\n$c\n"
5256 printf "\n\n##########\n$c\n" >&2
5257 ${SHELL} -c "${MAKE} ${c} config
"
5258 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5259 printf 'Skipping after config, nothing changed\n'
5260 printf 'Skipping after config, nothing changed\n' >&2
5263 ${SHELL} -c "${MAKE} build
test"
5269 [ -n "${ERR}" ] && echo > ${ERR}
5270 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5272 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5275 while [ ${#} -gt 0 ]; do
5281 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'