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
2472 check behave:readall 0 "${MBOX}" '860434889 333'
2478 t_prolog t_behave_mbox
2479 TRAP_EXIT_ADDONS=".
/.t
*"
2483 while [ ${i} -lt 113 ]; do
2484 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2485 "${MBOX}" "${i}" "${i}"
2488 ) | ${MAILX} ${ARGS} > .tall 2>&1
2489 check behave:mbox-1 0 "${MBOX}" '1872102723 13784'
2490 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2492 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2493 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2494 check behave:mbox-2 0 .tall '3498373999 9103'
2496 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2497 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2498 check behave
:mbox-3
0 .tall
'381610797 9110'
2500 # copy only the odd (but the first), move the even
2502 printf 'File "file://%s"\ncopy ' .tmbox2
2504 while [ ${i} -lt 113 ]; do
2508 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2509 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2510 check behave
:mbox-4
0 .tmbox3
'4145104131 6890'
2511 check behave
:mbox-5
- .tall
'361127721 4573'
2514 printf 'file "file://%s"\nmove ' .tmbox2
2516 while [ ${i} -lt 113 ]; do
2520 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2521 .tmbox3 .tmbox3 .tmbox2
2522 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2523 check behave
:mbox-6
0 .tmbox3
'3249991493 13784'
2524 if have_feat uistrings
; then
2525 ${sed} 2d
< .tall
> .tallx
2529 check behave
:mbox-7
- .tallx
'1584413080 13645'
2531 # Invalid MBOXes (after [f4db93b3])
2533 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2534 check behave:mbox-8 0 .tinvmbox '896415941 122'
2535 check behave:mbox-9 - ./.tall '3146754194 33'
2537 echo ' ' > .tinvmbox
2538 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2539 check behave
:mbox-10
0 .tinvmbox
'4011310616 124'
2540 check behave
:mbox-11
- .
/.tall
'3146754194 33'
2542 { echo; echo; } > .tinvmbox
# (not invalid)
2543 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2544 check behave:mbox-12 0 .tinvmbox '287409579 123'
2545 check behave:mbox-13 - ./.tall '3146754194 33'
2547 # *mbox-rfc4155*, plus
2548 ${cat} <<-_EOT > ./.tinv1
2551 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2552 Date: Wed, 02 Oct 1996 01:50:07 +0000
2554 Subject: Bad bad message 1
2556 From me to you, blinde Kuh!
2558 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2559 Date: Wed, 02 Oct 1996 01:50:07 +0000
2561 Subject: Bad bad message 2
2563 From me to you, blindes Kalb!
2565 ${cp} ./.tinv1 ./.tinv2
2569 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2570 \\eval copy * "${2}"
2572 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2573 ex0_test behave:mbox-14-estat
2574 ${cat} ./.tinv1 ./.tok >> .tall
2575 check behave:mbox-14 - ./.tall '739301109 616'
2578 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2579 wysh File ./.tok # Just move away to nowhere
2581 wysh file ./.tinv2 # Fully repaired
2582 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2583 ex0_test behave:mbox-15-estat
2584 check behave:mbox-15-1 - ./.tinv1 '3178048820 332'
2585 check behave:mbox-15-2 - ./.tinv2 '4151504442 314'
2590 t_behave_maildir() {
2591 t_prolog t_behave_maildir
2592 TRAP_EXIT_ADDONS=".
/.t
*"
2596 while [ ${i} -lt 112 ]; do
2597 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2598 "${MBOX}" "${i}" "${i}"
2601 ) | ${MAILX} ${ARGS}
2602 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2608 ' "${MBOX}" .tmdir1 .tmdir1 |
2609 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2610 check behave:maildir-2 0 .tlst '1797938753 9103'
2613 copy * "maildir
://%s
"
2616 ' "${MBOX}" .tmdir2 .tmdir2 |
2617 ${MAILX} ${ARGS} -Sshowlast > .tlst
2618 check behave:maildir-3 0 .tlst '1155631089 9113'
2620 printf 'File "maildir
://%s
"
2624 ' .tmdir2 .tmbox1 .tmbox1 |
2625 ${MAILX} ${ARGS} -Sshowlast > .tlst
2626 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2627 check behave:maildir-5 - .tlst '3701297796 9110'
2629 # only the odd (even)
2631 printf 'File "maildir
://%s
"
2634 while [ ${i} -lt 112 ]; do
2636 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2643 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2644 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2645 check behave:maildir-7 - .tlst '960096773 4573'
2648 printf 'file "maildir
://%s
"
2651 while [ ${i} -lt 112 ]; do
2653 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2661 ' .tmbox2 .tmbox2 .tmdir2
2662 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2663 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2664 ${sed} 2d
< .tlst
> .tlstx
2665 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2670 t_behave_record_a_resend
() {
2671 t_prolog t_behave_record_a_resend
2672 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2676 m %s\n~s Subject 1.\nHello.\n~.
2677 set record-files add-file-recipients
2678 m %s\n~s Subject 2.\nHello.\n~.
2680 resend 2 ./.t.resent
2681 Resend 1 ./.t.resent
2683 resend 2 ./.t.resent
2684 Resend 1 ./.t.resent
2685 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2688 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2689 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2690 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2695 t_behave_e_H_L_opts
() {
2696 t_prolog t_behave_e_H_L_opts
2697 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2700 ${MAILX} ${ARGS} -ef .
/.t.mbox
2701 echo ${?} > "${MBOX}"
2703 ${cat} <<-_EOT > ./.tsendmail.sh
2705 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2708 chmod 0755 .
/.tsendmail.sh
2709 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2710 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2711 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2712 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2714 ${MAILX} ${ARGS} -ef .
/.t.mbox
2715 echo ${?} >> "${MBOX}"
2716 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2717 echo ${?} >> "${MBOX}"
2718 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2719 echo ${?} >> "${MBOX}"
2720 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2721 echo ${?} >> "${MBOX}"
2722 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2723 echo ${?} >> "${MBOX}"
2724 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2725 echo ${?} >> "${MBOX}"
2726 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2727 echo ${?} >> "${MBOX}"
2729 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2730 echo ${?} >> "${MBOX}"
2731 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2732 echo ${?} >> "${MBOX}"
2733 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2734 echo ${?} >> "${MBOX}"
2735 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2736 echo ${?} >> "${MBOX}"
2737 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2738 echo ${?} >> "${MBOX}"
2739 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2740 echo ${?} >> "${MBOX}"
2741 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2742 echo ${?} >> "${MBOX}"
2744 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2749 t_behave_alternates
() {
2750 t_prolog t_behave_alternates
2751 TRAP_EXIT_ADDONS
="./.t*"
2753 ${cat} <<-_EOT > ./.tsendmail.sh
2755 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2758 chmod 0755 .
/.tsendmail.sh
2760 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2764 alternates a1@b1 a2@b2 a3@b3
2769 echo $?
/$^ERRNAME
<$rv>
2774 echo $?
/$^ERRNAME
<$rv>
2777 echo $?
/$^ERRNAME
<$rv>
2780 echo $?
/$^ERRNAME
<$rv>
2784 alternates a1@b1 a2@b2 a3@b3
2787 echo $?
/$^ERRNAME
<$rv>
2790 echo $?
/$^ERRNAME
<$rv>
2793 echo $?
/$^ERRNAME
<$rv>
2796 alternates a1@b1 a2@b2 a3@b3
2799 echo $?
/$^ERRNAME
<$rv>
2802 echo $?
/$^ERRNAME
<$rv>
2805 echo $?
/$^ERRNAME
<$rv>
2809 alternates a1@b1 a2@b2 a3@b3
2812 echo $?
/$^ERRNAME
<$rv>
2816 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2818 ~s all alternates
, only a1@b1 remains
2820 ~b a3@b3 a3@c3 a3@d3
2829 alternates a1@b1 a1@c1 a2@b2 a3@b3
2831 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2833 ~b a3@b3 a3@c3 a3@d3
2840 alternates a1@b1 a2@b2 a3
; set allnet
2842 ~s all alternates via allnet
, only a1@b1 remains
2844 ~b a3@b3 a3@c3 a3@d3
2855 echo $?
/$^ERRNAME
<$rv>
2859 echo $?
/$^ERRNAME
<$rv>
2863 echo $?
/$^ERRNAME
<$rv>
2867 echo $?
/$^ERRNAME
<$rv>
2871 echo $?
/$^ERRNAME
<$rv>
2875 alternates a1@b1 a2@b2
2878 echo $?
/$^ERRNAME
<$rv>
2879 alternates a3@b3 a4@b4
2882 echo $?
/$^ERRNAME
<$rv>
2885 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2886 if have_feat uistrings
; then
2887 check behave
:alternates-2
- .tall
'1878598364 505'
2889 echo 'behave:alternates-2: unsupported, skipped'
2896 t_prolog t_behave_alias
2897 TRAP_EXIT_ADDONS
="./.t*"
2899 ${cat} <<-_EOT > ./.tsendmail.sh
2901 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2904 chmod 0755 .
/.tsendmail.sh
2906 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2908 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2910 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2912 alias a4 a5 ex1@a4.ple
2914 alias a6 a7 ex1@a6.ple
2928 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2929 check behave
:alias-2
- .tall
'3548953204 152'
2931 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2932 # TODO need to somehow provide its contents to the test, then test
2937 t_behave_filetype
() {
2938 t_prolog t_behave_filetype
2939 TRAP_EXIT_ADDONS
="./.t*"
2941 ${cat} <<-_EOT > ./.tsendmail.sh
2943 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2946 chmod 0755 .
/.tsendmail.sh
2948 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2949 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2950 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2952 if (echo | gzip -c) >/dev/null 2>&1; then
2955 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2956 "${MBOX}" | ${MAILX} ${ARGS} \
2957 -X'filetype gz gzip\ -dc gzip\ -c'
2958 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2959 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2961 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2962 check behave
:filetype-3
- "./.t.out" '2392348396 102'
2964 echo 'behave:filetype-2: unsupported, skipped'
2965 echo 'behave:filetype-3: unsupported, skipped'
2970 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2976 -X'filetype gz gzip\ -dc gzip\ -c' \
2977 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2978 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2979 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2981 -X'filetype gz gzip\ -dc gzip\ -c' \
2982 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2984 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2985 check behave
:filetype-5
- "./.t.out" '852335377 172'
2990 t_behave_message_injections
() {
2991 t_prolog t_behave_message_injections
2992 TRAP_EXIT_ADDONS
="./.t*"
2994 ${cat} <<-_EOT > ./.tsendmail.sh
2996 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
2999 chmod 0755 .
/.tsendmail.sh
3001 echo mysig
> .
/.tmysig
3003 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3004 -Smessage-inject-head=head-inject \
3005 -Smessage-inject-tail=tail-inject \
3006 -Ssignature=.
/.tmysig \
3007 ex@am.ple
> .
/.tall
2>&1
3008 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3009 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3011 ${cat} <<-_EOT > ./.template
3015 Subject: This subject is
3017 Body, body, body me.
3019 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3020 -Smessage-inject-head=head-inject \
3021 -Smessage-inject-tail=tail-inject \
3022 -Ssignature=.
/.tmysig \
3024 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3025 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3030 t_behave_attachments
() {
3031 t_prolog t_behave_attachments
3032 TRAP_EXIT_ADDONS
="./.t*"
3034 ${cat} <<-_EOT > ./.tsendmail.sh
3036 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3039 chmod 0755 .
/.tsendmail.sh
3041 ${cat} <<-_EOT > ./.tx
3042 From steffen Sun Feb 18 02:48:40 2018
3043 Date: Sun, 18 Feb 2018 02:48:40 +0100
3046 User-Agent: s-nail v14.9.7
3049 From steffen Sun Feb 18 02:48:42 2018
3050 Date: Sun, 18 Feb 2018 02:48:42 +0100
3053 User-Agent: s-nail v14.9.7
3058 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3059 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3060 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3063 '!@ ./.t3 "./.t 4" ""
3071 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
3072 -a .
/.t1
-a './.t 2' \
3073 -s attachment-test \
3074 ex@am.ple
> .
/.tall
2>&1
3075 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3076 if have_feat uistrings
; then
3077 check behave
:attachments-2
- .tall
'1928331872 720'
3079 echo 'behave:attachments-2: unsupported, skipped'
3085 !s This the subject is
3086 !@ ./.t3 "#2" "./.t 4" "#1" ""
3096 !@ ./.t3 "#2" "./.t 4" "#1" ""
3104 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3113 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3127 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Rf .
/.tx \
3129 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3130 if have_feat uistrings
; then
3131 check behave
:attachments-4
- .tall
'2526106274 1910'
3133 echo 'behave:attachments-4: unsupported, skipped'
3139 t_behave_compose_hooks
() { # TODO monster
3140 t_prolog t_behave_compose_hooks
3141 if have_feat uistrings
; then :; else
3142 echo 'behave:compose_hooks: unsupported, skipped'
3145 TRAP_EXIT_ADDONS
="./.t*"
3147 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3148 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3150 ${cat} <<-_EOT > ./.tsendmail.sh
3152 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3155 chmod 0755 .
/.tsendmail.sh
3157 ${cat} <<'__EOT__' > ./.trc
3159 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3162 vput vexpr es substr "$1" 0 1
3167 define read_mline_res {
3168 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3169 echo $len/$es/$^ERRNAME: $hl
3170 if [ $es -ne $^ERR-NONE ]
3171 xcall bail read_mline_res
3173 \xcall read_mline_res
3178 echo "~^header list"; read hl; echo $hl;\
3179 call xerr "$hl" "in_addr ($xh) 0-1"
3181 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3182 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3183 echo "~^header insert $xh <${xh}2@exam.ple>";\
3184 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3185 echo "~^header insert $xh ${xh}3@exam.ple";\
3186 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3187 echo "~^header list $xh"; read hl; echo $hl;\
3188 call xerr "$hl" "ins_addr $xh 1-4"
3189 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3192 if [ "$t_remove" == "" ]
3196 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3197 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3199 xcall bail "ins_addr $xh 2-2"
3201 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3203 xcall bail "ins_addr $xh 2-3"
3205 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3207 xcall bail "ins_addr $xh 2-4"
3211 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3212 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3213 echo "~^header insert $xh <${xh}2@exam.ple>";\
3214 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3215 echo "~^header insert $xh ${xh}3@exam.ple";\
3216 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3217 echo "~^header list $xh"; read hl; echo $hl;\
3218 call xerr "$hl" "ins_addr $xh 3-4"
3219 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3222 echo "~^header remove-at $xh 1"; read es;\
3223 call xerr $es "ins_addr $xh 3-6"
3224 echo "~^header remove-at $xh 1"; read es;\
3225 call xerr $es "ins_addr $xh 3-7"
3226 echo "~^header remove-at $xh 1"; read es;\
3227 call xerr $es "ins_addr $xh 3-8"
3228 echo "~^header remove-at $xh 1"; read es;\
3229 vput vexpr es substr $es 0 3
3231 xcall bail "ins_addr $xh 3-9"
3233 echo "~^header remove-at $xh T"; read es;\
3234 vput vexpr es substr $es 0 3
3236 xcall bail "ins_addr $xh 3-10"
3238 echo "~^header list $xh"; read es;\
3239 vput vexpr es substr $es 0 3
3241 xcall bail "ins_addr $xh 3-11"
3243 echo "~^header show $xh"; read es;\
3244 vput vexpr es substr $es 0 3
3246 xcall bail "ins_addr $xh 3-12"
3250 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3251 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3252 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3253 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3254 echo "~^header insert $xh ${xh}3@exam.ple";\
3255 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3256 echo "~^header list $xh"; read hl; echo $hl;\
3257 call xerr "$hl" "header list $xh 3-4"
3258 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3261 echo "~^header remove-at $xh 3"; read es;\
3262 call xerr $es "ins_addr $xh 4-6"
3263 echo "~^header remove-at $xh 2"; read es;\
3264 call xerr $es "ins_addr $xh 4-7"
3265 echo "~^header remove-at $xh 1"; read es;\
3266 call xerr $es "ins_addr $xh 4-8"
3267 echo "~^header remove-at $xh 1"; read es;\
3268 vput vexpr es substr $es 0 3
3270 xcall bail "ins_addr $xh 4-9"
3272 echo "~^header remove-at $xh T"; read es;\
3273 vput vexpr es substr $es 0 3
3275 xcall bail "ins_addr $xh 4-10"
3277 echo "~^header list $xh"; read es;\
3278 vput vexpr es substr $es 0 3
3280 xcall bail "ins_addr $xh 4-11"
3282 echo "~^header show $xh"; read es;\
3283 vput vexpr es substr $es 0 3
3285 xcall bail "ins_addr $xh 4-12"
3289 wysh set xh=$1 mult=$2
3290 echo "~^header list"; read hl; echo $hl;\
3291 call xerr "$hl" "ins_ref ($xh) 0-1"
3293 echo "~^header insert $xh <$xh@exam.ple>";\
3294 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3296 echo "~^header insert $xh <${xh}2@exam.ple>";\
3297 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3298 echo "~^header insert $xh ${xh}3@exam.ple";\
3299 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3301 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3302 vput vexpr es substr $es 0 3
3304 xcall bail "ins_ref $xh 1-4"
3308 echo "~^header list $xh"; read hl; echo $hl;\
3309 call xerr "$hl" "ins_ref $xh 1-5"
3310 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3313 if [ "$t_remove" == "" ]
3317 echo "~^header remove $xh"; read es;\
3318 call xerr $es "ins_ref $xh 2-1"
3319 echo "~^header remove $xh"; read es;\
3320 vput vexpr es substr $es 0 3
3322 xcall bail "ins_ref $xh 2-2"
3324 echo "~^header list $xh"; read es;\
3325 vput vexpr es substr $es 0 3
3327 xcall bail "$es ins_ref $xh 2-3"
3329 echo "~^header show $xh"; read es;\
3330 vput vexpr es substr $es 0 3
3332 xcall bail "ins_ref $xh 2-4"
3336 echo "~^header insert $xh <$xh@exam.ple>";\
3337 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3339 echo "~^header insert $xh <${xh}2@exam.ple>";\
3340 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3341 echo "~^header insert $xh ${xh}3@exam.ple";\
3342 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3344 echo "~^header list $xh";\
3345 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3346 echo "~^header show $xh";\
3347 read es; call xerr $es "ins_ref $xh 3-5"
3350 echo "~^header remove-at $xh 1"; read es;\
3351 call xerr $es "ins_ref $xh 3-6"
3352 if [ $mult -ne 0 ] && [ $xh != subject ]
3353 echo "~^header remove-at $xh 1"; read es;\
3354 call xerr $es "ins_ref $xh 3-7"
3355 echo "~^header remove-at $xh 1"; read es;\
3356 call xerr $es "ins_ref $xh 3-8"
3358 echo "~^header remove-at $xh 1"; read es;\
3359 vput vexpr es substr $es 0 3
3361 xcall bail "ins_ref $xh 3-9"
3363 echo "~^header remove-at $xh T"; read es;\
3364 vput vexpr es substr $es 0 3
3366 xcall bail "ins_ref $xh 3-10"
3368 echo "~^header show $xh"; read es;\
3369 vput vexpr es substr $es 0 3
3371 xcall bail "ins_ref $xh 3-11"
3375 echo "~^header insert $xh <$xh@exam.ple> ";\
3376 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3378 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3379 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3380 echo "~^header insert $xh ${xh}3@exam.ple";\
3381 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3383 echo "~^header list $xh"; read hl; echo $hl;\
3384 call xerr "$hl" "ins_ref $xh 4-4"
3385 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3388 if [ $mult -ne 0 ] && [ $xh != subject ]
3389 echo "~^header remove-at $xh 3"; read es;\
3390 call xerr $es "ins_ref $xh 4-6"
3391 echo "~^header remove-at $xh 2"; read es;\
3392 call xerr $es "ins_ref $xh 4-7"
3394 echo "~^header remove-at $xh 1"; read es;\
3395 call xerr $es "ins_ref $xh 4-8"
3396 echo "~^header remove-at $xh 1"; read es;\
3397 vput vexpr es substr $es 0 3
3399 xcall bail "ins_ref $xh 4-9"
3401 echo "~^header remove-at $xh T"; read es;\
3402 vput vexpr es substr $es 0 3
3404 xcall bail "ins_ref $xh 4-10"
3406 echo "~^header show $xh"; read es;\
3407 vput vexpr es substr $es 0 3
3409 xcall bail "ins_ref $xh 4-11"
3414 # In collect.c order
3416 call ins_ref sender 0 # Not a "ref", but works
3420 call ins_addr reply-To
3421 call ins_addr mail-Followup-to
3422 call ins_ref messAge-id 0
3423 call ins_ref rEfErEncEs 1
3424 call ins_ref in-Reply-to 1
3425 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3426 call ins_addr freeForm1
3427 call ins_addr freeform2
3429 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3431 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3439 echo "~^attachment";\
3440 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3442 xcall bail "attach 0-1"
3445 echo "~^attach attribute ./.treadctl";\
3446 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3448 xcall bail "attach 0-2"
3450 echo "~^attachment attribute-at 1";\
3451 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3453 xcall bail "attach 0-3"
3456 echo "~^attachment insert ./.treadctl=ascii";\
3457 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3458 echo "~^attachment list";\
3459 read es; echo $es;call xerr "$es" "attach 1-2"
3461 echo "~^attachment attribute ./.treadctl";\
3462 read es; echo $es;call xerr "$es" "attach 1-3"
3464 echo "~^attachment attribute .treadctl";\
3465 read es; echo $es;call xerr "$es" "attach 1-4"
3467 echo "~^attachment attribute-at 1";\
3468 read es; echo $es;call xerr "$es" "attach 1-5"
3471 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3472 read es; echo $es;call xerr "$es" "attach 1-6"
3473 echo "~^attachment attribute-set .treadctl content-description Au";\
3474 read es; echo $es;call xerr "$es" "attach 1-7"
3475 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3476 read es; echo $es;call xerr "$es" "attach 1-8"
3478 echo "~^attachment attribute ./.treadctl";\
3479 read es; echo $es;call xerr "$es" "attach 1-9"
3481 echo "~^attachment attribute .treadctl";\
3482 read es; echo $es;call xerr "$es" "attach 1-10"
3484 echo "~^attachment attribute rctl";\
3485 read es; echo $es;call xerr "$es" "attach 1-11"
3487 echo "~^attachment attribute-at 1";\
3488 read es; echo $es;call xerr "$es" "attach 1-12"
3492 echo "~^attachment insert ./.tattach=latin1";\
3493 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3494 echo "~^attachment list";\
3495 read es; echo $es;call xerr "$es" "attach 2-2"
3497 echo "~^attachment attribute ./.tattach";\
3498 read es; echo $es;call xerr "$es" "attach 2-3"
3500 echo "~^attachment attribute .tattach";\
3501 read es; echo $es;call xerr "$es" "attach 2-4"
3503 echo "~^attachment attribute-at 2";\
3504 read es; echo $es;call xerr "$es" "attach 2-5"
3507 echo "~^attachment attribute-set ./.tattach filename tat";\
3508 read es; echo $es;call xerr "$es" "attach 2-6"
3510 "~^attachment attribute-set .tattach content-description Au2";\
3511 read es; echo $es;call xerr "$es" "attach 2-7"
3512 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3513 read es; echo $es;call xerr "$es" "attach 2-8"
3515 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3516 read es; echo $es;call xerr "$es" "attach 2-9"
3518 echo "~^attachment attribute ./.tattach";\
3519 read es; echo $es;call xerr "$es" "attach 2-10"
3521 echo "~^attachment attribute .tattach";\
3522 read es; echo $es;call xerr "$es" "attach 2-11"
3524 echo "~^attachment attribute tat";\
3525 read es; echo $es;call xerr "$es" "attach 2-12"
3527 echo "~^attachment attribute-at 2";\
3528 read es; echo $es;call xerr "$es" "attach 2-13"
3532 if [ "$t_remove" == "" ]
3536 echo "~^attachment remove ./.treadctl"; read es;\
3537 call xerr $es "attach 3-1"
3538 echo "~^attachment remove ./.tattach"; read es;\
3539 call xerr $es "attach 3-2"
3540 echo "~^ attachment remove ./.treadctl"; read es;\
3541 vput vexpr es substr $es 0 3
3543 xcall bail "attach 3-3"
3545 echo "~^ attachment remove ./.tattach"; read es;\
3546 vput vexpr es substr $es 0 3
3548 xcall bail "attach 3-4"
3550 echo "~^attachment list"; read es;\
3551 vput vexpr es substr $es 0 3
3553 xcall bail "attach 3-5"
3557 echo "~^attachment insert ./.tattach=latin1";\
3558 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3559 echo "~^attachment insert ./.tattach=latin1";\
3560 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3561 echo "~^attachment list";\
3562 read es; echo $es;call xerr "$es" "attach 4-3"
3564 echo "~^ attachment remove .tattach"; read es;\
3565 vput vexpr es substr $es 0 3
3567 xcall bail "attach 4-4 $es"
3569 echo "~^attachment remove-at T"; read es;\
3570 vput vexpr es substr $es 0 3
3572 xcall bail "attach 4-5"
3574 echo "~^attachment remove ./.tattach"; read es;\
3575 call xerr $es "attach 4-6"
3576 echo "~^attachment remove ./.tattach"; read es;\
3577 call xerr $es "attach 4-7"
3578 echo "~^ attachment remove ./.tattach"; read es;\
3579 vput vexpr es substr $es 0 3
3581 xcall bail "attach 4-8 $es"
3583 echo "~^attachment list"; read es;\
3584 vput vexpr es substr $es 0 3
3586 xcall bail "attach 4-9"
3590 echo "~^attachment insert ./.tattach=latin1";\
3591 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3592 echo "~^attachment insert ./.tattach=latin1";\
3593 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3594 echo "~^attachment insert ./.tattach=latin1";\
3595 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3596 echo "~^attachment list";\
3597 read es; echo $es;call xerr "$es" "attach 5-4"
3600 echo "~^attachment remove-at 3"; read es;\
3601 call xerr $es "attach 5-5"
3602 echo "~^attachment remove-at 3"; read es;\
3603 vput vexpr es substr $es 0 3
3605 xcall bail "attach 5-6"
3607 echo "~^attachment remove-at 2"; read es;\
3608 call xerr $es "attach 5-7"
3609 echo "~^attachment remove-at 2"; read es;\
3610 vput vexpr es substr $es 0 3
3612 xcall bail "attach 5-8"
3614 echo "~^attachment remove-at 1"; read es;\
3615 call xerr $es "attach 5-9"
3616 echo "~^attachment remove-at 1"; read es;\
3617 vput vexpr es substr $es 0 3
3619 xcall bail "attach 5-10"
3622 echo "~^attachment list"; read es;\
3623 vput vexpr es substr $es 0 3
3625 xcall bail "attach 5-11"
3629 echo "~^attachment insert ./.tattach=latin1";\
3630 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3631 echo "~^attachment insert ./.tattach=latin1";\
3632 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3633 echo "~^attachment insert ./.tattach=latin1";\
3634 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3635 echo "~^attachment list";\
3636 read es; echo $es;call xerr "$es" "attach 6-4"
3639 echo "~^attachment remove-at 1"; read es;\
3640 call xerr $es "attach 6-5"
3641 echo "~^attachment remove-at 1"; read es;\
3642 call xerr $es "attach 6-6"
3643 echo "~^attachment remove-at 1"; read es;\
3644 call xerr $es "attach 6-7"
3645 echo "~^attachment remove-at 1"; read es;\
3646 vput vexpr es substr $es 0 3
3648 xcall bail "attach 6-8"
3651 echo "~^attachment list"; read es;\
3652 vput vexpr es substr $es 0 3
3654 xcall bail "attach 6-9"
3666 echo on-compose-enter, mailx-command<$mailx-command>
3667 alternates alter1@exam.ple alter2@exam.ple
3669 set autocc='alter1@exam.ple alter2@exam.ple'
3670 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3671 echo mailx-subject<$mailx-subject>
3672 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3673 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3674 mailx-raw-bcc<$mailx-raw-bcc>
3675 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3676 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3679 echo on-compose-leave, mailx-command<$mailx-command>
3681 eval alternates $al alter3@exam.ple alter4@exam.ple
3683 set autobcc='alter3@exam.ple alter4@exam.ple'
3684 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3685 echo mailx-subject<$mailx-subject>
3686 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3687 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3688 mailx-raw-bcc<$mailx-raw-bcc>
3689 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3690 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3693 echo on-compose-cleanup, mailx-command<$mailx-command>
3696 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3697 echo mailx-subject<$mailx-subject>
3698 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3699 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3700 mailx-raw-bcc<$mailx-raw-bcc>
3701 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3702 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3704 wysh set on-compose-splice=t_ocs \
3705 on-compose-enter=t_oce on-compose-leave=t_ocl \
3706 on-compose-cleanup=t_occ
3710 printf 'm this-goes@nowhere\nbody\n!.\n' |
3711 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3712 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3714 ${cat} .
/.tall
>> "${MBOX}"
3715 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3718 printf 'm this-goes@nowhere\nbody\n!.\n' |
3719 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3720 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3722 ${cat} .
/.tall
>> "${MBOX}"
3723 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3727 # Some state machine stress, shell compose hook, localopts for hook, etc.
3728 # readctl in child. ~r as HERE document
3730 printf 'm ex@am.ple\nbody\n!.
3731 echon ${mailx-command}${mailx-subject}
3732 echon ${mailx-from}${mailx-sender}
3733 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3734 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3735 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3736 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3737 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3738 -Smta=.
/.tsendmail.sh \
3741 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3744 vput vexpr es substr "$1" 0 1
3749 define read_mline_res {
3750 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3751 echo $len/$es/$^ERRNAME: $hl
3752 if [ $es -ne $^ERR-NONE ]
3753 xcall bail read_mline_res
3755 \xcall read_mline_res
3759 vput vexpr i + 1 "$2"
3761 vput vexpr j % $i 10
3768 eval \\$j _work $1 $i
3771 vput vexpr i + $i "$1"
3775 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3776 echo read:$es/$en: $line
3777 if [ "${es}" -ne -1 ]
3780 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3785 echo "~^header list"; read hl; echo $hl;\
3786 vput vexpr es substr "$hl" 0 1
3788 xcall bail "header list"
3791 call _work 1; echo $?
3792 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3793 read es; echo $es; vput vexpr es substr "$es" 0 1
3795 xcall bail "be diet"
3797 echo "~^header insert cc <splice2@exam.ple>";\
3798 read es; echo $es; vput vexpr es substr "$es" 0 1
3800 xcall bail "be diet2"
3803 call _work 2; echo $?
3804 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3805 read es; echo $es;vput vexpr es substr "$es" 0 1
3807 xcall bail "be juicy"
3809 echo "~^header insert bcc juice2@exam.ple";\
3810 read es; echo $es;vput vexpr es substr "$es" 0 1
3812 xcall bail "be juicy2"
3814 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3815 read es; echo $es;vput vexpr es substr "$es" 0 1
3817 xcall bail "be juicy3"
3819 echo "~^header insert bcc juice4@exam.ple";\
3820 read es; echo $es;vput vexpr es substr "$es" 0 1
3822 xcall bail "be juicy4"
3825 echo "~^header remove-at bcc 3";\
3826 read es; echo $es;vput vexpr es substr "$es" 0 1
3828 xcall bail "remove juicy5"
3830 echo "~^header remove-at bcc 2";\
3831 read es; echo $es;vput vexpr es substr "$es" 0 1
3833 xcall bail "remove juicy6"
3835 echo "~^header remove-at bcc 3";\
3836 read es; echo $es;vput vexpr es substr "$es" 0 3
3838 xcall bail "failed to remove-at"
3840 # Add duplicates which ought to be removed!
3841 echo "~^header insert bcc juice4@exam.ple";\
3842 read es; echo $es;vput vexpr es substr "$es" 0 1
3844 xcall bail "be juicy4-1"
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-2"
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-3"
3859 call _work 3; echo $?
3861 vput ! i echo just knock if you can hear me;\
3863 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3865 echon shell-cmd says $?/$^ERRNAME: $i
3866 echo "~x will not become interpreted, we are reading until __EOT"
3868 read r_status; echo "~~r status output: $r_status"
3869 echo "~:echo $? $! $^ERRNAME"
3871 echo "~~r status from parent: $r_status"
3874 call _work 4; echo $?
3875 vput cwd cwd;echo cwd:$?
3876 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3880 call _work 5; echo $?
3881 echo "~^header show MAILX-Command"; read es;\
3882 call xerr $es "t_header 1000"; call read_mline_res
3883 echo "~^header show MAILX-raw-TO"; read es;\
3884 call xerr $es "t_header 1001"; xcall read_mline_res
3886 echoerr IT IS WRONG IF YOU SEE THIS
3889 echo on-compose-enter, mailx-command<$mailx-command>
3890 set t_oce autobcc=oce@exam.ple
3891 alternates alter1@exam.ple alter2@exam.ple
3893 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3894 echo mailx-subject<$mailx-subject>
3895 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3896 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3897 mailx-raw-bcc<$mailx-raw-bcc>
3898 echo mailx-orig-from<$mailx-orig-from> \
3899 mailx-orig-to<$mailx-orig-to> \
3900 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3903 echo on-compose-leave, mailx-command<$mailx-command>
3904 set t_ocl autocc=ocl@exam.ple
3906 alternates alter3@exam.ple alter4@exam.ple
3908 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3909 echo mailx-subject<$mailx-subject>
3910 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3911 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3912 mailx-raw-bcc<$mailx-raw-bcc>
3913 echo mailx-orig-from<$mailx-orig-from> \
3914 mailx-orig-to<$mailx-orig-to> \
3915 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3918 echo on-compose-cleanup, mailx-command<$mailx-command>
3919 set t_occ autocc=occ@exam.ple
3922 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3923 echo mailx-subject<$mailx-subject>
3924 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3925 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3926 mailx-raw-bcc<$mailx-raw-bcc>
3927 echo mailx-orig-from<$mailx-orig-from> \
3928 mailx-orig-to<$mailx-orig-to> \
3929 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3931 wysh set on-compose-splice=t_ocs \
3932 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3933 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3934 on-compose-enter=t_oce on-compose-leave=t_ocl \
3935 on-compose-cleanup=t_occ
3937 ex0_test behave
:compose_hooks-3-estat
3938 ${cat} .
/.tnotes
>> "${MBOX}"
3940 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3942 # Reply, forward, resend, Resend
3945 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3946 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3947 -Smta=.
/.tsendmail.sh
3950 echo start: $? $! $^ERRNAME
3952 echo File: $? $! $^ERRNAME;echo;echo
3954 this is content of reply 1
3956 echo reply 1: $? $! $^ERRNAME;echo;echo
3958 this is content of Reply 1 2
3960 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3961 forward 1 fwdex@am.ple
3962 this is content of forward 1
3964 echo forward 1: $? $! $^ERRNAME;echo;echo
3965 resend 1 2 resendex@am.ple
3966 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3967 Resend 1 2 Resendex@am.ple
3968 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3970 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3971 -Smta=.
/.tsendmail.sh \
3974 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3977 vput vexpr es substr "$1" 0 1
3982 define read_mline_res {
3983 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3984 echo mline_res:$len/$es/$^ERRNAME: $hl
3985 if [ $es -ne $^ERR-NONE ]
3986 xcall bail read_mline_res
3988 \xcall read_mline_res
3992 echo "~^header show $1"; read es;\
3993 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4001 echo t_ocs version $ver
4002 echo "~^header list"; read hl; echo $hl;\
4003 echoerr the header list is $hl;\
4004 call xerr "$hl" "header list"
4005 eval vpospar set $hl
4008 echoerr IT IS WRONG IF YOU SEE THIS
4011 echo on-XY-enter, mailx-command<$mailx-command>
4012 set t_oce autobcc=oce@exam.ple
4013 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4014 echo mailx-subject<$mailx-subject>
4015 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4016 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4017 mailx-raw-bcc<$mailx-raw-bcc>
4018 echo mailx-orig-from<$mailx-orig-from> \
4019 mailx-orig-to<$mailx-orig-to> \
4020 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4023 echo on-XY-leave, mailx-command<$mailx-command>
4024 set t_ocl autocc=ocl@exam.ple
4025 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4026 echo mailx-subject<$mailx-subject>
4027 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4028 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4029 mailx-raw-bcc<$mailx-raw-bcc>
4030 echo mailx-orig-from<$mailx-orig-from> \
4031 mailx-orig-to<$mailx-orig-to> \
4032 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4035 echo on-XY-cleanup, mailx-command<$mailx-command>
4036 set t_occ autocc=occ@exam.ple
4037 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4038 echo mailx-subject<$mailx-subject>
4039 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4040 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4041 mailx-raw-bcc<$mailx-raw-bcc>
4042 echo mailx-orig-from<$mailx-orig-from> \
4043 mailx-orig-to<$mailx-orig-to> \
4044 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4046 wysh set on-compose-splice=t_ocs \
4047 on-compose-enter=t_oce on-compose-leave=t_ocl \
4048 on-compose-cleanup=t_occ \
4049 on-resend-enter=t_oce on-resend-cleanup=t_occ
4051 ex0_test behave
:compose_hooks-4-estat
4052 ${cat} .
/.tnotes
>> "${MBOX}"
4054 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4059 t_behave_C_opt_customhdr
() {
4060 t_prolog t_behave_C_opt_customhdr
4061 TRAP_EXIT_ADDONS
="./.t*"
4063 ${cat} <<-_EOT > ./.tsendmail.sh
4065 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
4069 chmod 0755 .
/.tsendmail.sh
4072 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
4073 -C 'C-One : Custom One Body' \
4074 -C 'C-Two:CustomTwoBody' \
4075 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4076 this-goes@nowhere
>.
/.tall
2>&1
4077 ex0_test behave
:C_opt_customhdr-1-estat
4078 ${cat} .
/.tall
>> "${MBOX}"
4079 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4082 printf 'm this-goes@nowhere\nbody\n!.
4084 m this-goes2@nowhere\nbody2\n!.
4085 set customhdr=%ccustom1 : custom1 body%c
4086 m this-goes2@nowhere\nbody2\n!.
4087 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4088 m this-goes3@nowhere\nbody3\n!.
4090 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
-Sescape=! \
4091 -C 'C-One : Custom One Body' \
4092 -C 'C-Two:CustomTwoBody' \
4093 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4095 ex0_test behave
:C_opt_customhdr-2-estat
4096 ${cat} .
/.tall
>> "${MBOX}"
4097 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4102 t_behave_mass_recipients
() {
4103 t_prolog t_behave_mass_recipients
4104 TRAP_EXIT_ADDONS
="./.t*"
4106 ${cat} <<-_EOT > ./.tsendmail.sh
4108 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4111 chmod 0755 .
/.tsendmail.sh
4113 ${cat} <<'__EOT__' > ./.trc
4115 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4118 wysh set nr=$1 hn=$2
4119 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4121 xcall bail "ins_addr $hn 1-$nr"
4123 vput vexpr nr + $nr 1
4124 if [ "$nr" -le "$maximum" ]
4125 xcall ins_addr $nr $hn
4129 wysh set nr=$1 hn=$2
4130 alternates $hn$nr@$hn
4131 vput vexpr nr + $nr 2
4132 if [ "$nr" -le "$maximum" ]
4133 xcall bld_alter $nr $hn
4143 if [ "$t_remove" != '' ]
4148 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4151 printf 'm this-goes@nowhere\nbody\n!.\n' |
4152 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4153 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4155 ex0_test behave
:mass_recipients-1-estat
4156 ${cat} .
/.tall
>> "${MBOX}"
4157 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4160 printf 'm this-goes@nowhere\nbody\n!.\n' |
4161 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4162 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4164 ex0_test behave
:mass_recipients-2-estat
4165 ${cat} .
/.tall
>> "${MBOX}"
4166 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4171 t_behave_mime_types_load_control
() {
4172 t_prolog t_behave_mime_types_load_control
4173 if have_feat uistrings
; then :; else
4174 echo 'behave:mime_types_load_control: unsupported, skipped'
4177 TRAP_EXIT_ADDONS
="./.t*"
4179 ${cat} <<-_EOT > ./.tmts1
4180 @ application/mathml+xml mathml
4182 ${cat} <<-_EOT > ./.tmts2
4183 @ x-conference/x-cooltalk ice
4185 @ application/aga-aga aga
4188 ${cat} <<-_EOT > ./.tmts1.mathml
4189 <head>nonsense ML</head>
4191 ${cat} <<-_EOT > ./.tmts2.ice
4194 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4195 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4209 ' "${MBOX}" "${MBOX}" |
4211 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4213 ex0_test behave
:mime_types_load_control-1-estat
4214 ${cat} "${MBOX}" >> .
/.tout
4215 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4217 echo type |
${MAILX} ${ARGS} -R \
4218 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4219 -f "${MBOX}" >> .
/.tout
2>&1
4220 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4225 t_behave_lreply_futh_rth_etc
() {
4226 t_prolog t_behave_lreply_futh_rth_etc
4227 TRAP_EXIT_ADDONS
="./.t*"
4229 ${cat} <<-_EOT > ./.tsendmail.sh
4231 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4234 chmod 0755 .
/.tsendmail.sh
4236 ${cat} <<-_EOT > ./.tmbox
4237 From neverneverland Sun Jul 23 13:46:25 2017
4238 Subject: Bugstop: five miles out 1
4239 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4240 From: mister originator <mr@originator>
4241 To: bugstop-commit@five.miles.out, laber@backe.eu
4243 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4244 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4245 Date: Wed, 19 Jul 2017 09:22:57 -0400
4246 Message-Id: <20170719132257.766AF781267@originator>
4249 > |Sorry, I think I misunderstand something. I would think that
4253 From neverneverland Fri Jul 7 22:39:11 2017
4254 Subject: Bugstop: five miles out 2
4255 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4256 Content-Transfer-Encoding: 7bit
4257 From: mister originator <mr@originator>
4258 To: bugstop-commit@five.miles.out
4260 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4261 Date: Fri, 07 Jul 2017 16:33:59 -0400
4264 capable of changing back.
4266 From neverneverland Fri Jul 7 22:42:00 2017
4267 Subject: Bugstop: five miles out 3
4268 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4269 Content-Transfer-Encoding: 7bit
4270 From: mister originator <mr@originator>
4271 To: bugstop-commit@five.miles.out
4273 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4274 Date: Fri, 07 Jul 2017 16:33:59 -0400
4275 List-Post: <mailto:bugstop@five.miles.out>
4278 are you ready, boots?
4280 From neverneverland Sat Aug 19 23:15:00 2017
4281 Subject: Bugstop: five miles out 4
4282 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4283 Content-Transfer-Encoding: 7bit
4284 From: mister originator <mr@originator>
4285 To: bugstop@five.miles.out
4287 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4288 Date: Fri, 07 Jul 2017 16:33:59 -0400
4289 List-Post: <mailto:bugstop@five.miles.out>
4292 are you ready, boots?
4297 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4298 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4300 wysh
set m
="This is text of \"reply ${1}."
4311 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4314 wysh set m="This is text of
\"Reply
${1}.
"
4320 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4329 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4333 # We need two indirections for this test: one for the case that Lreply
4334 # fails because of missing recipients: we need to read EOF next, thus
4335 # place this in _Ls last; and second for the succeeding cases EOF is
4336 # not what these should read, so go over the backside and splice it in!
4338 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4341 localopts call-fixate
yes
4343 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4344 call L
$1 1; call L
$1 2; call L
$1 3
4347 echo;echo '===== CHANGING === '"$*"' =====';echo
4351 set from
=laber@backe.eu
4354 call tweak
set reply-to-honour
4356 call tweak
set followup-to
4358 call tweak
set followup-to-honour
4360 call tweak mlist bugstop@five.miles.out
4362 call tweak mlsubscribe bugstop@five.miles.out
4364 call tweak
set recipients-in-cc
4368 ex0_test behave
:lreply_futh_rth_etc-1-estat
4369 if have_feat uistrings
; then # xxx should not be so, skip??
4370 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '940818845 29373'
4372 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '3917430455 29259'
4377 ${cat} <<-_EOT > ./.tmbox
4378 From tom@i-i.example Thu Oct 26 03:15:55 2017
4379 Date: Wed, 25 Oct 2017 21:15:46 -0400
4380 From: tom <tom@i-i.example>
4381 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4382 Cc: tom <tom@i-i.example>
4383 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4384 Message-ID: <20171026011546.GA11643@i-i.example>
4385 Reply-To: tom@i-i.example
4386 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4387 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4390 The report's useful :-)
4393 printf 'reply 1\nthank you\n!.\n' |
4394 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4395 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4396 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4401 t_behave_mime_if_not_ascii
() {
4402 t_prolog t_behave_mime_if_not_ascii
4404 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4405 check behave:mime_if_not_ascii-1 0 "${MBOX}" '2287855519 110'
4407 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4409 check behave
:mime_if_not_ascii-2
0 "${MBOX}" '70754682 282'
4414 t_behave_xxxheads_rfc2047
() {
4415 t_prolog t_behave_xxxheads_rfc2047
4416 TRAP_EXIT_ADDONS
="./.t*"
4418 ${cat} <<-_EOT > ./.tsendmail.sh
4420 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4423 chmod 0755 .
/.tsendmail.sh
4427 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4428 -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̲' \
4430 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4432 # Single word (overlong line split -- bad standard! Requires injection of
4433 # artificial data!! But can be prevented by using RFC 2047 encoding)
4435 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4436 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4437 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4439 # Combination of encoded words, space and tabs of varying sort
4441 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4442 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4443 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4444 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4445 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4446 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4448 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4450 # Overlong multibyte sequence that must be forcefully split
4451 # todo This works even before v15.0, but only by accident
4453 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4454 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4455 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4456 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4458 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4462 echo | ${MAILX} ${ARGS} \
4463 -s "1-1 B2 B3 B4 B5 B6 B\
4464 1-2 B2 B3 B4 B5 B6 B\
4465 1-3 B2 B3 B4 B5 B6 B\
4466 1-4 B2 B3 B4 B5 B6 B\
4467 1-5 B2 B3 B4 B5 B6 B\
4468 1-6 B2 B3 B4 B5 B6
" \
4470 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4472 # Leading and trailing WS
4474 echo | ${MAILX} ${ARGS} \
4475 -s " 2-1 B2 B3 B4 B5 B6 B\
4476 1-2 B2 B3 B4 B5 B6 B\
4477 1-3 B2 B3 B4 B5 B6 B\
4478 1-4 B2 B3 B4 B5 B6
" \
4480 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4482 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4484 echo "Dat Früchtchen riecht häußlich
" |
4485 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4487 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4488 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4490 # RFC 2047 in an address field, and iconv involved
4491 if have_feat iconv; then
4493 ${cat} > ./.trebox <<_EOT
4494 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4495 Date: Fri, 2 Mar 2018 20:31:45 +0000
4496 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4497 To: dude <dude@exam.ple>
4498 Subject: houston(...)
4499 Message-ID: <abra@1>
4501 Content-Type: text/plain; charset=iso-8859-1
4502 Content-Disposition: inline
4503 Content-Transfer-Encoding: 8bit
4506 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4507 -Sfullnames -Sreply-in-same-charset \
4508 -Smta=./.tsendmail.sh -Rf ./.trebox
4509 check behave:xxxheads_rfc2047-8 0 "${MBOX}" '2821484185 280'
4511 echo 'behave:xxxheads_rfc2047-8: iconv unsupported, skipped'
4517 t_behave_rfc2231() {
4518 t_prolog t_behave_rfc2231
4519 TRAP_EXIT_ADDONS=".
/.t
*"
4522 mkdir ./.ttt || exit 1
4526 : > 'diet\ is \curd.txt'
4527 : > 'diet "is
" curd.txt'
4529 : > 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
4530 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4531 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4532 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4534 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4535 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4536 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4537 -a ./.ttt/höde-tröge.txt \
4538 -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 \
4539 -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 \
4540 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4541 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4543 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4545 # `resend' test, reusing $MBOX
4546 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4547 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4549 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4550 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4555 t_behave_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4556 t_prolog t_behave_iconv_mbyte_base64
4557 TRAP_EXIT_ADDONS=".
/.t
*"
4559 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4560 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4561 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4564 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4568 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4572 ${cat} <<-_EOT > ./.tsendmail.sh
4574 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4577 chmod 0755 ./.tsendmail.sh
4579 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4580 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4581 -Smta=./.tsendmail.sh \
4582 -Sescape=! -Smime-encoding=base64 2>./.terr
4583 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4585 !s Japanese from UTF-8 to ISO-2022-JP
4586 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4588 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4591 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4593 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4596 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4598 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4599 \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
4601 \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
4604 \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
4606 \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
4609 # May not presume iconv output as long as roundtrip possible [489a7122]
4610 ex0_test behave
:iconv_mbyte_base64-1-estat
4611 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4612 < "${MBOX}" > .
/.tcksum
4613 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4614 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4616 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4617 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4618 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4619 -Rf "${MBOX}" >.
/.tlog
2>&1
4620 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4621 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4622 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4623 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4625 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4628 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4629 rm -f "${MBOX}" .
/.twrite
4630 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4631 -Smta=.
/.tsendmail.sh \
4632 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4633 set ttycharset
=utf-8 sendcharsets
=euc-jp
4635 !s Japanese from UTF-8 to EUC-JP
4636 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4638 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4641 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4643 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4646 set ttycharset
=EUC-JP sendcharsets
=utf-8
4648 !s Japanese from EUC-JP to UTF-8
4649 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4651 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4654 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4656 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4659 ex0_test behave
:iconv_mbyte_base64-5-estat
4660 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4661 < "${MBOX}" > .
/.tcksum
4662 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4663 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4665 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4666 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4667 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4668 -Rf "${MBOX}" >.
/.tlog
2>&1
4669 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4670 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4671 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4672 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4674 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4680 t_behave_iconv_mainbody
() {
4681 t_prolog t_behave_iconv_mainbody
4682 TRAP_EXIT_ADDONS
="./.t*"
4684 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4687 echo 'behave:iconv_mainbody: unsupported, skipped'
4691 ${cat} <<-_EOT > ./.tsendmail.sh
4693 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4696 chmod 0755 .
/.tsendmail.sh
4698 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4699 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4700 -s '–' over-the@rain.bow
2>.
/.terr
4701 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4702 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4704 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4705 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4706 -s '–' over-the@rain.bow
2>.
/.terr
4707 exn0_test behave
:iconv_mainbody-3
4708 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4709 if have_feat uistrings
; then
4710 if have_feat docstrings
; then # xxx should not be like that
4711 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4713 check behave
:iconv_mainbody-4
- .
/.terr
'271380835 121'
4716 echo 'behave:iconv_mainbody-4: unsupported, skipped'
4719 # The different iconv(3) implementations use different replacement sequence
4720 # types (character-wise, byte-wise, and the character(s) used differ)
4721 i
="${MAILX_ICONV_MODE}"
4722 if [ -n "${i}" ]; then
4723 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4725 ex0_test behave:iconv_mainbody-5-0 ${j}
4726 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4727 if [ ${i} -eq 13 ]; then
4728 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4729 elif [ ${i} -eq 12 ]; then
4730 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4731 elif [ ${i} -eq 3 ]; then
4732 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4734 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4737 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4743 t_behave_binary_mainbody() {
4744 t_prolog t_behave_binary_mainbody
4745 TRAP_EXIT_ADDONS=".
/.t
*"
4747 printf 'abra\0\nka\r\ndabra' |
4748 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4750 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4751 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4753 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4754 ${MAILX} ${ARGS} -Rf \
4755 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4756 "${MBOX}" >./.tall 2>&1
4757 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4758 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4759 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4764 t_behave_q_t_etc_opts() {
4765 t_prolog t_behave_q_t_etc_opts
4766 TRAP_EXIT_ADDONS=".
/.t
*"
4768 # Three tests for MIME encoding and (a bit) content classification.
4769 # At the same time testing -q FILE, < FILE and -t FILE
4770 t__put_body > ./.tin
4773 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4774 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4775 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4778 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4779 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4780 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4783 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4785 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4786 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4792 have_feat smime || {
4793 echo 'behave:s/mime: unsupported, skipped'
4797 t_prolog t_behave_s_mime
4798 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4799 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4800 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4802 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4803 ${cat} <<-_EOT > ./.t.conf
4806 default_keyfile = keyfile.pem
4807 distinguished_name = req_distinguished_name
4808 attributes = req_attributes
4812 [ req_distinguished_name ]
4819 emailAddress = test@localhost
4824 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4825 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4826 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4829 printf 'behave:s/mime:sign/verify: '
4830 echo bla | ${MAILX} ${ARGS} \
4831 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4832 -Ssmime-sign -Sfrom=test@localhost \
4833 -s 'S/MIME test' ./.VERIFY
4834 if [ $? -eq 0 ]; then
4845 /^Content-Description: /{ skip = 2; print; next }
4846 /^$/{ if(skip) --skip }
4849 < ./.VERIFY > "${MBOX}"
4850 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4852 printf 'behave:s/mime:sign/verify:verify '
4853 printf 'verify\nx\n' |
4855 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4856 -Ssmime-sign -Sfrom=test@localhost \
4858 -f ./.VERIFY >>${ERR} 2>&1
4859 if [ $? -eq 0 ]; then
4868 printf 'behave:s/mime:sign/verify:disproof-1 '
4869 if openssl smime -verify -CAfile ./.tcert.pem \
4870 -in ./.VERIFY >>${ERR} 2>&1; then
4879 # (signing +) encryption / decryption
4880 ${cat} <<-_EOT > ./.tsendmail.sh
4882 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4884 chmod 0755 ./.tsendmail.sh
4886 printf 'behave:s/mime:encrypt+sign: '
4889 -Ssmime-force-encryption \
4890 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4891 -Smta=./.tsendmail.sh \
4892 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4893 -Ssmime-sign -Sfrom=test@localhost \
4894 -s 'S/MIME test' recei@ver.com
4895 if [ $? -eq 0 ]; then
4899 printf 'error: encrypt+sign failed\n'
4902 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4903 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4905 printf 'behave:s/mime:decrypt+verify: '
4906 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4908 -Ssmime-force-encryption \
4909 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4910 -Smta=./.tsendmail.sh \
4911 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4912 -Ssmime-sign -Sfrom=test@localhost \
4914 -f ./.ENCRYPT >>${ERR} 2>&1
4915 if [ $? -eq 0 ]; then
4924 /^Content-Description: /{ skip = 2; print; next }
4925 /^$/{ if(skip) --skip }
4928 < ./.DECRYPT > "${MBOX}"
4929 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4931 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4932 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4933 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1; then
4940 printf "behave
:s
/mime
:encrypt
: "
4941 echo bla | ${MAILX} ${ARGS} \
4942 -Ssmime-force-encryption \
4943 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4944 -Smta=./.tsendmail.sh \
4945 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4946 -Sfrom=test@localhost \
4947 -s 'S/MIME test' recei@ver.com
4948 if [ $? -eq 0 ]; then
4955 # Same as behave:s/mime:encrypt+sign:checksum above
4956 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4957 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4960 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4961 -Ssmime-force-encryption \
4962 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4963 -Smta=./.tsendmail.sh \
4964 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4965 -Sfrom=test@localhost \
4967 -f ./.ENCRYPT >>${ERR} 2>&1
4968 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4970 printf 'behave:s/mime:decrypt:disproof-1: '
4971 if openssl smime -decrypt -inkey ./.tkey.pem \
4972 -in ./.ENCRYPT >>${ERR} 2>&1; then
4983 # xxx Note: t_content() was the first test (series) written. Today many
4984 # xxx aspects are (better) covered by other tests above, some are not.
4985 # xxx At some future date and time, convert the last remains not covered
4986 # xxx elsewhere to a real t_behave_* test and drop t_content()
4990 # Test for [260e19d] (Juergen Daubert)
4992 echo body | ${MAILX} ${ARGS} "${MBOX}"
4993 check content
:004 0 "${MBOX}" '2917662811 98'
4995 # "Test for" [d6f316a] (Gavin Troy)
4997 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4998 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4999 check content:006 0 "${MBOX}" '2099098650 122'
5000 check content:006-1 - "${BODY}" '794542938 174'
5002 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5005 for(i = 0; i < 10000; ++i)
5007 #printf "\xF0\x90\x87\x90"
5008 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5009 check content
:007 0 "${MBOX}" '534262374 61816'
5015 # MIME encoding (QP) stress message subject
5016 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5017 'adadaddsssssssddddddddddddddddddddd'\
5018 'ddddddddddddddddddddddddddddddddddd'\
5019 'ddddddddddddddddddddddddddddddddddd'\
5020 'dddddddddddddddddddd Hallelulja? Od'\
5021 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5022 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5023 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5024 'fffffffffffffffffffffffffffffffffff'\
5025 'fffffffffffffffffffff ggggggggggggg'\
5026 'ggggggggggggggggggggggggggggggggggg'\
5027 'ggggggggggggggggggggggggggggggggggg'\
5028 'ggggggggggggggggggggggggggggggggggg'\
5033 # MIME encoding (QP) stress message body
5035 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5036 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5037 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5038 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5039 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5040 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5041 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5042 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5043 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5044 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5045 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5046 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5047 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5048 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5049 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5050 "auf den zeilen vorher.\r\n"\
5051 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5053 "Die letzte Zeile war nur ein Punkt.\r\n"\
5055 "Das waren deren zwei.\r\n"\
5057 "Die letzte Zeile war ein Leerschritt.\n"\
5058 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5061 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5063 "Das waren deren zwei. ditto.\n"\
5065 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5066 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5067 "auf den zeilen vorher.\n"\
5069 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5070 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5072 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5074 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5076 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5078 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5080 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5082 "QP am Zeilenende über soft-nl hinweg\n"\
5083 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5085 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5087 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5089 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5091 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5093 "Die letzte Zeile war ein Leerschritt.\n"\
5098 # if have_feat devel; then
5099 # ARGS="${ARGS} -Smemdebug"
5103 if [ -n "${UTF8_LOCALE}" ]; then
5104 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5106 printf 'No Unicode locale found, disabling Unicode tests\n'
5114 # Test all configs TODO doesn't cover all *combinations*, stupid!
5118 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5119 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5120 NOTME["OPT_CROSS_BUILD"] = 1
5121 NOTME["OPT_AUTOCC"] = 1
5122 NOTME["OPT_AMALGAMATION"] = 1
5123 NOTME["OPT_DEBUG"] = 1
5124 NOTME["OPT_DEVEL"] = 1
5125 NOTME["OPT_ASAN_ADDRESS"] = 1
5126 NOTME["OPT_ASAN_MEMORY"] = 1
5127 NOTME["OPT_FORCED_STACKPROT"] = 1
5128 NOTME["OPT_NOMEMDBG"] = 1
5129 NOTME["OPT_NYD2"] = 1
5134 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5135 MULVALS["VAL_IDNA"] = 1
5137 #VALKEYS[0] = "VAL_RANDOM"
5138 VALVALS["VAL_RANDOM"] = 1
5141 /^[[:space:]]*OPT_/{
5142 sub(/^[[:space:]]*/, "")
5143 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5144 # does not seem to be a compliant escape for =
5146 $1 = substr($1, 1, index($1, "=") - 1)
5148 OPTVALS[OPTNO++] = $1
5151 /^[[:space:]]*VAL_/{
5152 sub(/^[[:space:]]*/, "")
5153 val = substr($0, index($0, "=") + 1)
5155 val = substr(val, 2)
5156 val = substr(val, 1, length(val) - 1)
5158 $1 = substr($1, 1, index($1, "=") - 1)
5161 else if(VALVALS[$1]){
5162 VALKEYS[VALNO++] = $1
5167 function onepass(addons){
5168 a_onepass__worker(addons, "1", "0")
5169 a_onepass__worker(addons, "0", "1")
5171 function a_onepass__worker(addons, b0, b1){
5172 # Doing this completely sequentially and not doing make distclean in
5173 # between runs should effectively result in lesser compilations.
5174 # It is completely dumb nonetheless... TODO
5175 for(ono = 0; ono < OPTNO; ++ono){
5177 for(i = 0; i < ono; ++i){
5178 myconf = myconf " " OPTVALS[i] "=" b0 " "
5180 j = MULCHOICE[OPTVALS[i]]
5185 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5189 for(i = ono; i < OPTNO; ++i){
5190 myconf = myconf " " OPTVALS[i] "=" b1 " "
5192 j = MULCHOICE[OPTVALS[i]]
5197 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5203 myconf = VALKEYS[i] "=any " myconf
5205 myconf = myconf " " ALWAYS " " addons
5210 i = split(MULVALS[mula], ia)
5214 print mula "=\"" j "\" " myconf
5220 # We cannot test NULL because of missing UI strings, which will end
5221 # up with different checksums
5222 print "CONFIG=NULLI OPT_AUTOCC=1"
5224 j = split(VALVALS[VALKEYS[i]], ia)
5228 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5231 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5232 print "CONFIG=NETSEND OPT_AUTOCC=1"
5233 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5235 j = split(VALVALS[VALKEYS[i]], ia)
5239 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5242 print "CONFIG=DEVEL OPT_AUTOCC=1"
5243 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5245 onepass("OPT_DEBUG=1")
5248 ' |
while read c
; do
5249 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5250 printf "\n\n##########\n$c\n"
5251 printf "\n\n##########\n$c\n" >&2
5252 ${SHELL} -c "${MAKE} ${c} config
"
5253 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5254 printf 'Skipping after config, nothing changed\n'
5255 printf 'Skipping after config, nothing changed\n' >&2
5258 ${SHELL} -c "${MAKE} build
test"
5264 [ -n "${ERR}" ] && echo > ${ERR}
5265 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5267 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5270 while [ ${#} -gt 0 ]; do
5276 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'