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!
14 if [ -f .
/mk-config.ev
]; then
16 elif [ -f snailmail.jpg
] && [ -f .obj
/mk-config.ev
]; then
20 echo >&2 'S-nail/S-mailx is not configured.'
21 echo >&2 'This test script requires the shell environment that only the'
22 echo >&2 'configuration script can figure out, even if it will be used to'
23 echo >&2 'test a different binary than the one that would be produced!'
24 echo >&2 'Hit RETURN to run "make config CONFIG=null'
26 make config CONFIG
=null
29 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
30 MAILX__CC_TEST_RUNNING
=1
31 export MAILX__CC_TEST_RUNNING
32 exec "${SHELL}" "${i}${0}" "${@}"
35 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
36 # such is a compile-time variable
37 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
38 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
39 ADDARG_UNI
=-Sttycharset=UTF-8
43 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
45 #UTF8_LOCALE= autodetected unless set
47 # Note valgrind has problems with FDs in forked childs, which causes some tests
48 # to fail (the FD is rewound and thus will be dumped twice)
50 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
52 ## -- (>8 -- 8<) -- ##
57 printf >&2 -- "${fmt}\\n" "${@}"
62 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
66 # Wed Oct 2 01:50:07 UTC 1996
67 SOURCE_DATE_EPOCH
=844221007
69 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
70 unset POSIXLY_CORRECT LOGNAME USER
73 echo >&2 'Synopsis: ./cc-test.sh --check-only s-mailx-binary'
74 echo >&2 'Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]'
75 echo >&2 'Synopsis: ./cc-test.sh # (hundreds of compilation tests)'
79 CHECK_ONLY
= MAE_TEST
= MAILX
=
80 if [ "${1}" = --check-only ]; then
83 [ -x "${MAILX}" ] || usage
85 elif [ "${1}" = --mae-test ]; then
88 [ -x "${MAILX}" ] || usage
92 MAILX
="${MEMTESTER}${MAILX}"
95 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
96 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
97 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
98 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
99 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
101 \if [ "${ttycharset}" @i=% utf ]
106 \wysh set LC_ALL=${1}
108 \eval xcall cset_test "${@}"
112 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
113 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
115 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
118 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
119 UTF8_LOCALE
=`locale -a | { m=
122 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
125 ${grep} -e POSIX -e en_EN -e en_US; } >/dev/null 2>&1; then
138 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
139 trap "exit 1" HUP INT TERM
142 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
143 ${grep} +${1} ) >/dev
/null
2>&1
147 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
149 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
156 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
157 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
158 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
159 csum
="`${cksum} < ${f}`"
160 if [ "${csum}" = "${s}" ]; then
162 printf '%s: ok\n' "${tid}"
166 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
169 if [ -n "${MAE_TEST}" ]; then
170 x
=mae-test-
`echo ${tid} | ${tr} "/:=" "__-"`
171 ${cp} -f "${f}" ./"${x}"
173 if [ -n "${maex}" ] && [ -d ../.git ] &&
174 command -v diff >/dev/null 2>&1 &&
175 (git rev-parse --verify test-out) >/dev/null 2>&1 &&
176 git show test-out:"${x}" > ./"${x}".old 2>/dev/null; then
177 diff -ru ./"${x}".old ./"${x}" > "${x}".diff
184 printf '%s: error: %s\n' ${1} "${2}"
188 # $1=test name [$2=status]
190 [ ${#} -gt 1 ] && __qm__=${2}
191 if [ ${__qm__} -ne 0 ]; then
192 err $1 'unexpected non-0 exit status'
194 printf '%s: ok\n' "${1}"
199 # $1=test name [$2=status]
201 [ ${#} -gt 1 ] && __qm__=${2}
202 if [ ${__qm__} -eq 0 ]; then
203 err $1 'unexpected 0 exit status'
205 printf '%s: ok\n' "${1}"
209 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
211 echo "$
((${1} + ${2}))"
215 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
219 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
221 echo "$
((${1} % ${2}))"
225 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
230 # Basic behaviour tests
232 t_behave_X_opt_input_command_stack
236 t_behave_input_inject_semicolon_seq
237 t_behave_commandalias
241 t_behave_macro_param_shift
252 t_behave_record_a_resend
257 # FIXME t_behave_mlist
260 t_behave_message_injections
262 t_behave_compose_hooks
263 t_behave_C_opt_customhdr
265 t_behave_mass_recipients
266 t_behave_mime_types_load_control
267 t_behave_lreply_futh_rth_etc
269 t_behave_mime_if_not_ascii
270 t_behave_xxxheads_rfc2047
272 t_behave_iconv_mbyte_base64
273 t_behave_iconv_mainbody
274 t_behave_binary_mainbody
275 t_behave_q_t_etc_opts
280 t_behave_X_opt_input_command_stack() {
281 t_prolog t_behave_X_opt_input_command_stack
283 ${cat} <<- '__EOT' > "${BODY}"
291 echo "define mac1
{";\
292 echo " echo mac1-1 via1 \
$0";\
294 echo " echo mac1-2
";\
296 echo " echo mac1-3
";\
299 echo "define mac2
{";\
300 echo " echo mac2-1 via1 \
$0";\
302 echo " echo mac2-2
";\
308 echo echo 1-1-1 via1 \
$0;\
320 # The -X option supports multiline arguments, and those can internally use
321 # reverse solidus newline escaping. And all -X options are joined...
323 < "${BODY}" ${MAILX} ${ARGS} \
338 echo "define mac1 {";\
339 echo " echo mac1-1 via2 \$0";\
341 echo " echo mac1-2";\
343 echo " echo mac1-3";\
346 echo "define mac2 {";\
347 echo " echo mac2-1 via2 \$0";\
349 echo " echo mac2-2";\
355 echo echo 1-1-1 via2 \$0;\
369 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
374 t_behave_X_errexit
() {
375 t_prolog t_behave_X_errexit
376 if have_feat uistrings
; then :; else
377 echo 'behave:x_errexit: unsupported, skipped'
381 ${cat} <<- '__EOT' > "${BODY}"
387 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
388 -X'echo one' -X' echos nono ' -X'echo two' \
390 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
392 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
394 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
396 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
398 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
402 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
403 -X'echo one' -X' echos nono ' -X'echo two' \
405 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
407 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
409 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
411 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
413 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
415 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
417 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
419 ## Repeat 4-7 with ignerr set
421 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
423 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
424 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
426 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
428 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
430 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
432 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
434 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
436 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
438 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
443 t_behave_S_freeze() {
444 t_prolog t_behave_S_freeze
448 # Test basic assumption
449 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
450 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
452 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
455 ${cat} <<- '__EOT' > "${BODY}"
460 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
461 -Snoasksub -Sasksub -Snoasksub \
462 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
464 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
466 ${cat} <<- '__EOT' > "${BODY}"
471 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
472 -Snoasksub -Sasksub \
473 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
475 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
478 ${cat} <<- '__EOT' > "${BODY}"
479 echo dietcurd<$dietcurd>
481 echo dietcurd<$dietcurd>
483 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
484 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
485 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
486 -X'echo dietcurd<$dietcurd>' \
488 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
490 ${cat} <<- '__EOT' > "${BODY}"
491 echo dietcurd<$dietcurd>
493 echo dietcurd<$dietcurd>
495 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
496 -Sdietcurd=strawberry
-Snodietcurd \
497 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
498 -X'echo dietcurd<$dietcurd>' \
500 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
502 # TODO once we have a detached one with env=1..
503 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
504 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
506 ${cat} <<- '__EOT' > "${BODY}"
507 !echo "shell says TERM<$TERM>"
509 !echo "shell says TERM<$TERM>"
511 !echo "shell says TERM<$TERM>"
513 !echo "shell says TERM<$TERM>"
515 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
516 -STERM=strawberry
-SnoTERM -STERM=vanilla \
517 -X'echo mail<$TERM>' -X'unset TERM' \
518 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
520 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
522 ${cat} <<- '__EOT' > "${BODY}"
523 !echo "shell says TERM<$TERM>"
525 !echo "shell says TERM<$TERM>"
527 !echo "shell says TERM<$TERM>"
529 !echo "shell says TERM<$TERM>"
531 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
532 -STERM=strawberry
-SnoTERM \
533 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
534 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
536 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
544 t_prolog t_behave_wysh
546 ${cat} <<- '__EOT' > "${BODY}"
565 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
566 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
567 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
569 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
570 echo a$'\u0041\u41\u0C1\U00000041\U41'c
593 echo a$'b\U0000000'dt
594 echo a$'b\U00000000'du
604 if [ -z "${UTF8_LOCALE}" ]; then
605 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
607 < "${BODY}" DIET=CURD TIED= \
608 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
609 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
612 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
613 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
615 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
616 wysh set mager='\hey\'
618 wysh set mager="\hey\\"
620 wysh set mager=$'\hey\\'
623 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
628 t_behave_input_inject_semicolon_seq() {
629 t_prolog t_behave_input_inject_semicolon_seq
631 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
636 echon this_is_mymac;call mydeepmac;echon ';';
638 echon one';';call mymac;echon two";";call mymac;echo three$';';
640 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
642 echon one';';call mymac;echon two";";call mymac;echo three$';';
645 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
650 t_behave_commandalias() {
651 t_prolog t_behave_commandalias
653 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
654 commandalias echo echo hoho
658 commandalias XxX XxXx
659 commandalias XxXx XxXxX
660 commandalias XxXxX XxXxXx
661 commandalias XxXxXx echo huhu
662 commandalias XxXxXxX echo huhu
664 commandalias XxXxXx XxXxXxX
667 commandalias XxXxXx echo huhu
671 check behave:commandalias 0 "${MBOX}" '1638809585 36'
677 t_prolog t_behave_ifelse
679 # Nestable conditions test
680 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
702 if $dietcurd == 'yoho'
707 if $dietcurd @== 'Yoho'
712 if $dietcurd == 'Yoho'
717 if $dietcurd != 'yoho'
722 if $dietcurd @!= 'Yoho'
727 if $dietcurd != 'Yoho'
788 if $dietcurd == 'yohu'
790 elif $dietcurd == 'yoha'
792 elif $dietcurd == 'yohe'
794 elif $dietcurd == 'yoho'
796 if $dietcurd == 'yohu'
798 elif $dietcurd == 'yoha'
800 elif $dietcurd == 'yohe'
802 elif $dietcurd == 'yoho'
804 if $dietcurd == 'yohu'
806 elif $dietcurd == 'yoha'
808 elif $dietcurd == 'yohe'
810 elif $dietcurd == 'yoho'
959 set diet=abc curd=abc
965 set diet=abc curd=abcd
971 # 1. Shitty grouping capabilities as of today
972 unset diet curd ndefined
973 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
979 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
984 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
989 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
994 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
999 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1000 && [ no ] || [ yes ]
1005 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1010 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1015 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1020 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1025 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1030 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1035 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1040 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1045 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1050 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1056 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1062 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1067 # 2. Shitty grouping capabilities as of today
1068 unset diet curd ndefined
1069 if [ false || false || true ] && [ false || true ] && yes
1074 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1079 if [ 1 || 0 || 0 || 0 ]
1084 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1089 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1094 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1099 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1104 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1109 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1114 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1119 if 1 || 0 || 0 || 0 && 0
1124 if 1 || 0 || 0 || 0 && 1
1129 if 0 || 0 || 0 || 1 && 0
1134 if 0 || 0 || 0 || 1 && 1
1139 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1144 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1150 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1155 if $diet == 'yo' && $curd == 'ho' && $ndefined
1161 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1166 if $diet == 'yo' && $curd == 'ho' && $ndefined
1171 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1176 # Some more en-braced variables
1178 if ${diet} == ${curd}
1183 if ${diet} != ${curd}
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 ] ] ] ] ] || 3
1239 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
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 ] ] ] ] ] || 3
1285 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1292 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1294 if have_feat regex; then
1295 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1297 if $dietcurd =~ '^yo.*'
1302 if $dietcurd =~ '^Yo.*'
1307 if $dietcurd @=~ '^Yo.*'
1312 if $dietcurd =~ '^yOho.+'
1317 if $dietcurd @!~ '.*Ho$'
1322 if $dietcurd !~ '.+yohO$'
1327 if [ $dietcurd @i!~ '.+yoho$' ]
1332 if ! [ $dietcurd @i=~ '.+yoho$' ]
1337 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1342 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1347 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1352 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1357 if ! ! ! $dietcurd !~ '.+yoho$'
1362 if ! ! ! $dietcurd =~ '.+yoho$'
1367 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1372 set diet=abc curd='^abc$'
1378 set diet=abc curd='^abcd$'
1386 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1388 printf 'behave:if-regex: unsupported, skipped\n'
1394 t_behave_localopts() {
1395 t_prolog t_behave_localopts
1397 # Nestable conditions test
1398 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1413 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1418 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1419 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1428 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1430 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1439 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1446 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1453 echo ----- $1: $2 -> $3 -> $4
1461 call llx
'call off' on on on
1462 call llx
'call off' off on on
1463 call llx
'call off' on off on
1464 call llx
'call off' on off off
1465 localopts call-fixate on
1466 call llx
'call-fixate on' on on on
1467 call llx
'call-fixate on' off on on
1468 call llx
'call-fixate on' on off on
1469 call llx
'call-fixate on' on off off
1470 unset x
;localopts call on
1471 call llx
'call on' on on on
1472 call llx
'call on' off on on
1473 call llx
'call on' on off on
1474 call llx
'call on' on off off
1479 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1485 t_prolog t_behave_local
1487 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1515 echo ------- global-1 du=$du
1517 echo ------- global-2 du=$du
1520 echo ------- global-3 du=$du
1522 echo ------- global-4 du=$du
1524 echo ------- global-5 du=$du
1527 check behave:local-1 0 "${MBOX}" '2411598140 641'
1532 t_behave_macro_param_shift() {
1533 t_prolog t_behave_macro_param_shift
1535 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1538 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1543 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1544 if [ $# > 1 ] || [ $ignerr == '' ]
1549 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1551 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1555 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1560 call t2 1 you get four args
1561 echo t1.1: $?';' ignerr ($ignerr) should not exist
1562 call t2 1 you get 'three args'
1563 echo t1.2: $?';' ignerr ($ignerr) should not exist
1564 call t2 1 you 'get two args'
1565 echo t1.3: $?';' ignerr ($ignerr) should not exist
1566 call t2 1 'you get one arg'
1567 echo t1.4: $?';' ignerr ($ignerr) should not exist
1568 ignerr call t2 '' 'you get one arg'
1569 echo t1.5: $?';' ignerr ($ignerr) should not exist
1574 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1579 t_behave_addrcodec() {
1580 t_prolog t_behave_addrcodec
1582 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1583 vput addrcodec res e
1 <doog@def
>
1584 echo $?
/$^ERRNAME
$res
1585 eval vput addrcodec res d
$res
1586 echo $?
/$^ERRNAME
$res
1587 vput addrcodec res e
2 .
<doog@def
>
1588 echo $?
/$^ERRNAME
$res
1589 eval vput addrcodec res d
$res
1590 echo $?
/$^ERRNAME
$res
1591 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1592 echo $?
/$^ERRNAME
$res
1593 eval vput addrcodec res d
$res
1594 echo $?
/$^ERRNAME
$res
1595 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1596 echo $?
/$^ERRNAME
$res
1597 eval vput addrcodec res d
$res
1598 echo $?
/$^ERRNAME
$res
1599 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1600 echo $?
/$^ERRNAME
$res
1601 eval vput addrcodec res d
$res
1602 echo $?
/$^ERRNAME
$res
1604 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1605 echo $?
/$^ERRNAME
$res
1606 eval vput addrcodec res d
$res
1607 echo $?
/$^ERRNAME
$res
1608 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1609 echo $?
/$^ERRNAME
$res
1610 eval vput addrcodec res d
$res
1611 echo $?
/$^ERRNAME
$res
1612 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1613 echo $?
/$^ERRNAME
$res
1614 eval vput addrcodec res d
$res
1615 echo $?
/$^ERRNAME
$res
1616 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1617 echo $?
/$^ERRNAME
$res
1618 eval vput addrcodec res d
$res
1619 echo $?
/$^ERRNAME
$res
1620 vput addrcodec res
+e
8 \
1621 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1622 echo $?
/$^ERRNAME
$res
1623 eval vput addrcodec res d
$res
1624 echo $?
/$^ERRNAME
$res
1625 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1626 echo $?
/$^ERRNAME
$res
1627 eval vput addrcodec res d
$res
1628 echo $?
/$^ERRNAME
$res
1629 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1630 echo $?
/$^ERRNAME
$res
1631 eval vput addrcodec res d
$res
1632 echo $?
/$^ERRNAME
$res
1633 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1634 echo $?
/$^ERRNAME
$res
1635 eval vput addrcodec res d
$res
1636 echo $?
/$^ERRNAME
$res
1637 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1638 echo $?
/$^ERRNAME
$res
1639 eval vput addrcodec res d
$res
1640 echo $?
/$^ERRNAME
$res
1641 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1642 echo $?
/$^ERRNAME
$res
1643 eval vput addrcodec res d
$res
1644 echo $?
/$^ERRNAME
$res
1645 vput addrcodec res
+e
14 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
15 \
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
16 \
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
17 \
1660 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1661 echo $?
/$^ERRNAME
$res
1662 eval vput addrcodec res d
$res
1663 echo $?
/$^ERRNAME
$res
1664 vput addrcodec res
+e
18 \
1665 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1666 echo $?
/$^ERRNAME
$res
1667 eval vput addrcodec res d
$res
1668 echo $?
/$^ERRNAME
$res
1669 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1670 echo $?
/$^ERRNAME
$res
1671 eval vput addrcodec res d
$res
1672 echo $?
/$^ERRNAME
$res
1674 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1675 echo $?
/$^ERRNAME
$res
1676 vput addrcodec res
++e
21 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 +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1682 echo $?/$^ERRNAME $res
1683 eval vput addrcodec res d $res
1684 echo $?/$^ERRNAME $res
1686 vput addrcodec res s \
1687 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1688 echo $?/$^ERRNAME $res
1690 # Fix for [f3852f88]
1691 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1692 echo $?/$^ERRNAME $res
1693 eval vput addrcodec res d $res
1694 echo $?/$^ERRNAME $res
1695 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1696 echo $?/$^ERRNAME $res
1697 eval vput addrcodec res d $res
1698 echo $?/$^ERRNAME $res
1701 check behave:addrcodec-1 0 "${MBOX}" '1047317989 2612'
1703 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1705 mlsubscribe isa2@list
1707 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1708 echo $?
/$^ERRNAME
$res
1709 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1710 echo $?
/$^ERRNAME
$res
1711 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1712 echo $?
/$^ERRNAME
$res
1713 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1714 echo $?
/$^ERRNAME
$res
1715 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1716 echo $?
/$^ERRNAME
$res
1717 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1718 echo $?
/$^ERRNAME
$res
1721 check behave
:addrcodec-2
0 "${MBOX}" '1391779299 104'
1723 if have_feat idna
; then
1724 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1725 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
1726 echo $?/$^ERRNAME $res
1727 eval vput addrcodec res d $res
1728 echo $?/$^ERRNAME $res
1729 vput addrcodec res e <du@blödiän> du
1730 echo $?/$^ERRNAME $res
1731 eval vput addrcodec res d $res
1732 echo $?/$^ERRNAME $res
1733 vput addrcodec res e du <du@blödiän>
1734 echo $?/$^ERRNAME $res
1735 eval vput addrcodec res d $res
1736 echo $?/$^ERRNAME $res
1737 vput addrcodec res e <du@blödiän>
1738 echo $?/$^ERRNAME $res
1739 eval vput addrcodec res d $res
1740 echo $?/$^ERRNAME $res
1741 vput addrcodec res e du@blödiän
1742 echo $?/$^ERRNAME $res
1743 eval vput addrcodec res d $res
1744 echo $?/$^ERRNAME $res
1747 check behave:addrcodec-idna 0 "${MBOX}" '498775983 326'
1749 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1756 t_prolog t_behave_vexpr
1758 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1760 vput vexpr res = 9223372036854775807
1761 echo $?/$^ERRNAME $res
1762 vput vexpr res = 9223372036854775808
1763 echo $?/$^ERRNAME $res
1764 vput vexpr res = u9223372036854775808
1765 echo $?/$^ERRNAME $res
1766 vput vexpr res @= 9223372036854775808
1767 echo $?/$^ERRNAME $res
1768 vput vexpr res = -9223372036854775808
1769 echo $?/$^ERRNAME $res
1770 vput vexpr res = -9223372036854775809
1771 echo $?/$^ERRNAME $res
1772 vput vexpr res @= -9223372036854775809
1773 echo $?/$^ERRNAME $res
1774 vput vexpr res = U9223372036854775809
1775 echo $?/$^ERRNAME $res
1778 0b0111111111111111111111111111111111111111111111111111111111111111
1779 echo $?/$^ERRNAME $res
1781 S0b1000000000000000000000000000000000000000000000000000000000000000
1782 echo $?/$^ERRNAME $res
1784 S0b1000000000000000000000000000000000000000000000000000000000000000
1785 echo $?/$^ERRNAME $res
1787 U0b1000000000000000000000000000000000000000000000000000000000000000
1788 echo $?/$^ERRNAME $res
1790 0b1000000000000000000000000000000000000000000000000000000000000000
1791 echo $?/$^ERRNAME $res
1793 0b1000000000000000000000000000000000000000000000000000000000000000
1794 echo $?/$^ERRNAME $res
1796 -0b1000000000000000000000000000000000000000000000000000000000000000
1797 echo $?/$^ERRNAME $res
1799 S0b1000000000000000000000000000000000000000000000000000000000000001
1800 echo $?/$^ERRNAME $res
1802 S0b1000000000000000000000000000000000000000000000000000000000000001
1803 echo $?/$^ERRNAME $res
1805 -0b1000000000000000000000000000000000000000000000000000000000000001
1806 echo $?/$^ERRNAME $res
1808 U0b1000000000000000000000000000000000000000000000000000000000000001
1809 echo $?/$^ERRNAME $res
1811 vput vexpr res = 0777777777777777777777
1812 echo $?/$^ERRNAME $res
1813 vput vexpr res = S01000000000000000000000
1814 echo $?/$^ERRNAME $res
1815 vput vexpr res @= S01000000000000000000000
1816 echo $?/$^ERRNAME $res
1817 vput vexpr res = U01000000000000000000000
1818 echo $?/$^ERRNAME $res
1819 vput vexpr res = 01000000000000000000000
1820 echo $?/$^ERRNAME $res
1821 vput vexpr res @= 01000000000000000000000
1822 echo $?/$^ERRNAME $res
1823 vput vexpr res = -01000000000000000000000
1824 echo $?/$^ERRNAME $res
1825 vput vexpr res = S01000000000000000000001
1826 echo $?/$^ERRNAME $res
1827 vput vexpr res @= S01000000000000000000001
1828 echo $?/$^ERRNAME $res
1829 vput vexpr res @= -01000000000000000000001
1830 echo $?/$^ERRNAME $res
1831 vput vexpr res = U01000000000000000000001
1832 echo $?/$^ERRNAME $res
1834 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1835 echo $?/$^ERRNAME $res
1836 vput vexpr res = S0x8000000000000000
1837 echo $?/$^ERRNAME $res
1838 vput vexpr res @= S0x8000000000000000
1839 echo $?/$^ERRNAME $res
1840 vput vexpr res = U0x8000000000000000
1841 echo $?/$^ERRNAME $res
1842 vput vexpr res = 0x8000000000000000
1843 echo $?/$^ERRNAME $res
1844 vput vexpr res @= 0x8000000000000000
1845 echo $?/$^ERRNAME $res
1846 vput vexpr res = -0x8000000000000000
1847 echo $?/$^ERRNAME $res
1848 vput vexpr res = S0x8000000000000001
1849 echo $?/$^ERRNAME $res
1850 vput vexpr res @= S0x8000000000000001
1851 echo $?/$^ERRNAME $res
1852 vput vexpr res @= -0x8000000000000001
1853 echo $?/$^ERRNAME $res
1854 vput vexpr res = u0x8000000000000001
1855 echo $?/$^ERRNAME $res
1858 echo $?/$^ERRNAME $res
1860 echo $?/$^ERRNAME $res
1862 echo $?/$^ERRNAME $res
1864 vput vexpr res + 0 0
1865 echo $?/$^ERRNAME $res
1866 vput vexpr res + 0 1
1867 echo $?/$^ERRNAME $res
1868 vput vexpr res + 1 1
1869 echo $?/$^ERRNAME $res
1871 vput vexpr res + 9223372036854775807 0
1872 echo $?/$^ERRNAME $res
1873 vput vexpr res + 9223372036854775807 1
1874 echo $?/$^ERRNAME $res
1875 vput vexpr res @+ 9223372036854775807 1
1876 echo $?/$^ERRNAME $res
1877 vput vexpr res + 0 9223372036854775807
1878 echo $?/$^ERRNAME $res
1879 vput vexpr res + 1 9223372036854775807
1880 echo $?/$^ERRNAME $res
1881 vput vexpr res @+ 1 9223372036854775807
1882 echo $?/$^ERRNAME $res
1884 vput vexpr res + -9223372036854775808 0
1885 echo $?/$^ERRNAME $res
1886 vput vexpr res + -9223372036854775808 -1
1887 echo $?/$^ERRNAME $res
1888 vput vexpr res @+ -9223372036854775808 -1
1889 echo $?/$^ERRNAME $res
1890 vput vexpr res + 0 -9223372036854775808
1891 echo $?/$^ERRNAME $res
1892 vput vexpr res + -1 -9223372036854775808
1893 echo $?/$^ERRNAME $res
1894 vput vexpr res @+ -1 -9223372036854775808
1895 echo $?/$^ERRNAME $res
1897 vput vexpr res - 0 0
1898 echo $?/$^ERRNAME $res
1899 vput vexpr res - 0 1
1900 echo $?/$^ERRNAME $res
1901 vput vexpr res - 1 1
1902 echo $?/$^ERRNAME $res
1904 vput vexpr res - 9223372036854775807 0
1905 echo $?/$^ERRNAME $res
1906 vput vexpr res - 9223372036854775807 -1
1907 echo $?/$^ERRNAME $res
1908 vput vexpr res @- 9223372036854775807 -1
1909 echo $?/$^ERRNAME $res
1910 vput vexpr res - 0 9223372036854775807
1911 echo $?/$^ERRNAME $res
1912 vput vexpr res - -1 9223372036854775807
1913 echo $?/$^ERRNAME $res
1914 vput vexpr res - -2 9223372036854775807
1915 echo $?/$^ERRNAME $res
1916 vput vexpr res @- -2 9223372036854775807
1917 echo $?/$^ERRNAME $res
1919 vput vexpr res - -9223372036854775808 +0
1920 echo $?/$^ERRNAME $res
1921 vput vexpr res - -9223372036854775808 +1
1922 echo $?/$^ERRNAME $res
1923 vput vexpr res @- -9223372036854775808 +1
1924 echo $?/$^ERRNAME $res
1925 vput vexpr res - 0 -9223372036854775808
1926 echo $?/$^ERRNAME $res
1927 vput vexpr res - +1 -9223372036854775808
1928 echo $?/$^ERRNAME $res
1929 vput vexpr res @- +1 -9223372036854775808
1930 echo $?/$^ERRNAME $res
1932 vput vexpr res + -13 -2
1933 echo $?/$^ERRNAME $res
1934 vput vexpr res - 0 0
1935 echo $?/$^ERRNAME $res
1936 vput vexpr res - 0 1
1937 echo $?/$^ERRNAME $res
1938 vput vexpr res - 1 1
1939 echo $?/$^ERRNAME $res
1940 vput vexpr res - -13 -2
1941 echo $?/$^ERRNAME $res
1943 vput vexpr res * 0 0
1944 echo $?/$^ERRNAME $res
1945 vput vexpr res * 0 1
1946 echo $?/$^ERRNAME $res
1947 vput vexpr res * 1 1
1948 echo $?/$^ERRNAME $res
1949 vput vexpr res * -13 -2
1950 echo $?/$^ERRNAME $res
1952 vput vexpr res / 0 0
1953 echo $?/$^ERRNAME $res
1954 vput vexpr res / 0 1
1955 echo $?/$^ERRNAME $res
1956 vput vexpr res / 1 1
1957 echo $?/$^ERRNAME $res
1958 vput vexpr res / -13 -2
1959 echo $?/$^ERRNAME $res
1961 vput vexpr res % 0 0
1962 echo $?/$^ERRNAME $res
1963 vput vexpr res % 0 1
1964 echo $?/$^ERRNAME $res
1965 vput vexpr res % 1 1
1966 echo $?/$^ERRNAME $res
1967 vput vexpr res % -13 -2
1968 echo $?/$^ERRNAME $res
1971 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
1973 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1974 vput vexpr res
find 'bananarama' 'nana'
1975 echo $?
/$^ERRNAME
:$res:
1976 vput vexpr res
find 'bananarama' 'bana'
1977 echo $?
/$^ERRNAME
:$res:
1978 vput vexpr res
find 'bananarama' 'Bana'
1979 echo $?
/$^ERRNAME
:$res:
1980 vput vexpr res
find 'bananarama' 'rama'
1981 echo $?
/$^ERRNAME
:$res:
1983 vput vexpr res ifind
'bananarama' 'nana'
1984 echo $?
/$^ERRNAME
:$res:
1985 vput vexpr res ifind
'bananarama' 'bana'
1986 echo $?
/$^ERRNAME
:$res:
1987 vput vexpr res ifind
'bananarama' 'Bana'
1988 echo $?
/$^ERRNAME
:$res:
1989 vput vexpr res ifind
'bananarama' 'rama'
1990 echo $?
/$^ERRNAME
:$res:
1992 vput vexpr res substring
'bananarama' 1
1993 echo $?
/$^ERRNAME
:$res:
1994 vput vexpr res substring
'bananarama' 3
1995 echo $?
/$^ERRNAME
:$res:
1996 vput vexpr res substring
'bananarama' 5
1997 echo $?
/$^ERRNAME
:$res:
1998 vput vexpr res substring
'bananarama' 7
1999 echo $?
/$^ERRNAME
:$res:
2000 vput vexpr res substring
'bananarama' 9
2001 echo $?
/$^ERRNAME
:$res:
2002 vput vexpr res substring
'bananarama' 10
2003 echo $?
/$^ERRNAME
:$res:
2004 vput vexpr res substring
'bananarama' 1 3
2005 echo $?
/$^ERRNAME
:$res:
2006 vput vexpr res substring
'bananarama' 3 3
2007 echo $?
/$^ERRNAME
:$res:
2008 vput vexpr res substring
'bananarama' 5 3
2009 echo $?
/$^ERRNAME
:$res:
2010 vput vexpr res substring
'bananarama' 7 3
2011 echo $?
/$^ERRNAME
:$res:
2012 vput vexpr res substring
'bananarama' 9 3
2013 echo $?
/$^ERRNAME
:$res:
2014 vput vexpr res substring
'bananarama' 10 3
2015 echo $?
/$^ERRNAME
:$res:
2017 vput vexpr res substring
'bananarama' -1
2018 echo $?
/$^ERRNAME
:$res:
2019 vput vexpr res substring
'bananarama' -3
2020 echo $?
/$^ERRNAME
:$res:
2021 vput vexpr res substring
'bananarama' -5
2022 echo $?
/$^ERRNAME
:$res:
2023 vput vexpr res substring
'bananarama' -7
2024 echo $?
/$^ERRNAME
:$res:
2025 vput vexpr res substring
'bananarama' -9
2026 echo $?
/$^ERRNAME
:$res:
2027 vput vexpr res substring
'bananarama' -10
2028 echo $?
/$^ERRNAME
:$res:
2029 vput vexpr res substring
'bananarama' 1 -3
2030 echo $?
/$^ERRNAME
:$res:
2031 vput vexpr res substring
'bananarama' 3 -3
2032 echo $?
/$^ERRNAME
:$res:
2033 vput vexpr res substring
'bananarama' 5 -3
2034 echo $?
/$^ERRNAME
:$res:
2035 vput vexpr res substring
'bananarama' 7 -3
2036 echo $?
/$^ERRNAME
:$res:
2037 vput vexpr res substring
'bananarama' 9 -3
2038 echo $?
/$^ERRNAME
:$res:
2039 vput vexpr res substring
'bananarama' 10 -3
2040 echo $?
/$^ERRNAME
:$res:
2042 vput vexpr res trim
'Cocoon Cocoon'
2043 echo $?
/$^ERRNAME
:$res:
2044 vput vexpr res trim
' Cocoon Cocoon '
2045 echo $?
/$^ERRNAME
:$res:
2046 vput vexpr res trim-front
'Cocoon Cocoon'
2047 echo $?
/$^ERRNAME
:$res:
2048 vput vexpr res trim-front
' Cocoon Cocoon '
2049 echo $?
/$^ERRNAME
:$res:
2050 vput vexpr res trim-end
'Cocoon Cocoon'
2051 echo $?
/$^ERRNAME
:$res:
2052 vput vexpr res trim-end
' Cocoon Cocoon '
2053 echo $?
/$^ERRNAME
:$res:
2056 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2058 if have_feat regex
; then
2059 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2060 vput vexpr res regex 'bananarama' 'nana'
2061 echo $?/$^ERRNAME :$res:
2062 vput vexpr res regex 'bananarama' 'bana'
2063 echo $?/$^ERRNAME :$res:
2064 vput vexpr res regex 'bananarama' 'Bana'
2065 echo $?/$^ERRNAME :$res:
2066 vput vexpr res regex 'bananarama' 'rama'
2067 echo $?/$^ERRNAME :$res:
2069 vput vexpr res iregex 'bananarama' 'nana'
2070 echo $?/$^ERRNAME :$res:
2071 vput vexpr res iregex 'bananarama' 'bana'
2072 echo $?/$^ERRNAME :$res:
2073 vput vexpr res iregex 'bananarama' 'Bana'
2074 echo $?/$^ERRNAME :$res:
2075 vput vexpr res iregex 'bananarama' 'rama'
2076 echo $?/$^ERRNAME :$res:
2078 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2079 echo $?/$^ERRNAME :$res:
2080 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2081 echo $?/$^ERRNAME :$res:
2082 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2083 echo $?/$^ERRNAME :$res:
2084 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2085 echo $?/$^ERRNAME :$res:
2087 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2088 echo $?/$^ERRNAME :$res:
2089 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2090 echo $?/$^ERRNAME :$res:
2091 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2092 echo $?/$^ERRNAME :$res:
2093 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2094 echo $?/$^ERRNAME :$res:
2098 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2100 printf 'behave:vexpr-regex: unsupported, skipped\n'
2106 t_behave_call_ret() {
2107 t_prolog t_behave_call_ret
2109 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2114 vput vexpr j
'&' $i 7
2120 vput vexpr j
'&' $i 7
2126 echo ! The end
for $1
2130 # Transport $?/$! up the call chain
2136 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2140 echo ! The end
for $1
2141 return $i $^ERR-BUSY
2145 # Up and down it goes
2152 vput vexpr k
- $1 $2
2156 echo "# <$i/$j> .. "
2160 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2163 echo ! The end
for $1=$i/$2
2167 return $i $^ERR-BUSY
2173 call w1
0; echo ?
=$?
!=$
!; echo -----;
2174 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2175 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2178 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2184 t_prolog t_behave_xcall
2186 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2191 vput vexpr j '&' $i 7
2197 echo ! The end for $1/$2
2199 return $i $^ERR-BUSY
2210 echo ?=$? !=$^ERRNAME
2213 echo ?=$? !=$^ERRNAME
2215 echo ?=$? !=$^ERRNAME
2218 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2222 if have_feat uistrings; then
2223 ${cat} <<- '__EOT' > "${BODY}"
2228 vput vexpr j '&' $i 7
2234 echo ! The end for $1
2237 echo would be err with errexit
2246 echo zwei, ?=$? !=$!
2247 localopts yes; set errexit
2249 echo drei, ?=$? !=$^ERRNAME
2251 echo vier, ?=$? !=$^ERRNAME, this is an error
2254 echo outer 1, ?=$? !=$^ERRNAME
2256 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2258 echo outer 3, ?=$? !=$^ERRNAME
2259 echo this is definitely an error
2262 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2263 -Snomemdebug > "${MBOX}" 2>&1
2264 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2266 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2267 -Snomemdebug > "${MBOX}" 2>&1
2268 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2270 echo 'behave:xcall-2: unsupported, skipped'
2271 echo 'behave:xcall-3: unsupported, skipped'
2277 t_behave_vpospar() {
2278 t_prolog t_behave_vpospar
2280 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2281 vpospar
set hey
, "'you ", world
!
2282 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2283 vput vpospar x quote
; echo x
<$x>
2284 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2285 vput vpospar y quote
;echo y
<$y>
2286 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2287 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2288 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2291 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2292 vput vpospar z quote
;echo infun2
:z
<$z>
2296 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2297 vput vpospar y quote
;echo infun
:y
<$y>
2298 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2299 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2301 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2302 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2305 call infun This
"in a" fun
2306 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2307 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2309 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2312 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2314 echo ifs<$ifs> ifs-ws<$ifs-ws>
2315 vpospar set hey, "'you ", world!
2316 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2317 vput vpospar x quote; echo x<$x>
2318 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2319 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2322 echo ifs<$ifs> ifs-ws<$ifs-ws>
2323 vpospar set hey, "'you
", world!
2324 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2326 vput vpospar x quote; echo x<$x>
2327 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2328 eval vpospar set ${x};\
2329 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2332 echo ifs<$ifs> ifs-ws<$ifs-ws>
2333 vpospar set hey, "'you ", world!
2334 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2336 vput vpospar x quote; echo x<$x>
2337 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2338 eval vpospar set ${x};\
2339 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2341 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2346 t_behave_atxplode() {
2347 t_prolog t_behave_atxplode
2348 TRAP_EXIT_ADDONS="./.t*"
2350 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2353 printf " (1/$#: <$1>)"
2355 if [ $# -gt 0 ]; then
2369 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2370 printf xxx;xxx arg ,b u.
2371 printf xxx;xxx arg , .
2372 printf xxx;xxx arg ,ball.
2378 echon " (1/$#: <$1>)"
2393 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2394 echon xxx;call xxx arg ,b u.
2395 echon xxx;call xxx arg , .
2396 echon xxx;call xxx arg ,ball.
2399 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2400 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2402 #${SHELL} ./.t.sh > ./.tshout 2>&1
2403 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2409 t_prolog t_behave_read
2410 TRAP_EXIT_ADDONS="./.t*"
2412 ${cat} <<- '__EOT
' > .tin
2413 hey1, "'you
", world!
2414 hey2, "'you ", bugs bunny!
2419 ${cat} <<- '__EOT
' |\
2420 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2422 echo $?/$^ERRNAME / <$a><$b><$c>
2424 echo $?/$^ERRNAME / <$a><$b><$c>
2426 echo $?/$^ERRNAME / <$a><$b><$c>
2428 echo $?/$^ERRNAME / <$a><$b><$c>
2429 unset a b c;read a b c
2430 echo $?/$^ERRNAME / <$a><$b><$c>
2431 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2433 check behave:read-1 0 "${MBOX}" '1527910147 173'
2435 ${cat} <<- '__EOT
' > .tin2
2436 hey2.0,:"'you
",:world!:mars.:
2437 hey2.1,:"'you ",:world!
2438 hey2.2,:"'you
",:bugs bunny!
2444 ${cat} <<- '__EOT' |\
2445 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2448 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2450 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2452 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2454 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2456 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2458 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2459 unset a b c
;read a b c
2460 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2462 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2463 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2465 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2467 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2469 readall d; echo $?/$^ERRNAME / <$d>
2470 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2471 readctl create .tin2
2472 readall d; echo $?/$^ERRNAME / <$d>
2473 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2474 readctl remove .tin;echo $?/$^ERRNAME;\
2475 readctl remove .tin2;echo $?/$^ERRNAME
2476 echo '### now with empty lines'
2477 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2478 readctl create .temptynl;echo $?/$^ERRNAME
2479 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2480 readctl remove .temptynl;echo $?/$^ERRNAME
2482 check readall 0 "${MBOX}" '4113506527 405'
2488 t_prolog t_behave_mbox
2489 TRAP_EXIT_ADDONS=".
/.t
*"
2493 while [ ${i} -lt 113 ]; do
2494 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2495 "${MBOX}" "${i}" "${i}"
2498 ) | ${MAILX} ${ARGS} > .tall 2>&1
2499 check behave:mbox-1 0 "${MBOX}" '1872102723 13784'
2500 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2502 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2503 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2504 check behave:mbox-2 0 .tall '3498373999 9103'
2506 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2507 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2508 check behave
:mbox-3
0 .tall
'381610797 9110'
2510 # copy only the odd (but the first), move the even
2512 printf 'File "file://%s"\ncopy ' .tmbox2
2514 while [ ${i} -lt 113 ]; do
2518 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2519 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2520 check behave
:mbox-4
0 .tmbox3
'4145104131 6890'
2521 check behave
:mbox-5
- .tall
'361127721 4573'
2524 printf 'file "file://%s"\nmove ' .tmbox2
2526 while [ ${i} -lt 113 ]; do
2530 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2531 .tmbox3 .tmbox3 .tmbox2
2532 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2533 check behave
:mbox-6
0 .tmbox3
'3249991493 13784'
2534 if have_feat uistrings
; then
2535 ${sed} 2d
< .tall
> .tallx
2539 check behave
:mbox-7
- .tallx
'1584413080 13645'
2541 # Invalid MBOXes (after [f4db93b3])
2543 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2544 check behave:mbox-8 0 .tinvmbox '896415941 122'
2545 check behave:mbox-9 - ./.tall '3146754194 33'
2547 echo ' ' > .tinvmbox
2548 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2549 check behave
:mbox-10
0 .tinvmbox
'4011310616 124'
2550 check behave
:mbox-11
- .
/.tall
'3146754194 33'
2552 { echo; echo; } > .tinvmbox
# (not invalid)
2553 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2554 check behave:mbox-12 0 .tinvmbox '287409579 123'
2555 check behave:mbox-13 - ./.tall '3146754194 33'
2557 # *mbox-rfc4155*, plus
2558 ${cat} <<-_EOT > ./.tinv1
2561 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2562 Date: Wed, 02 Oct 1996 01:50:07 +0000
2564 Subject: Bad bad message 1
2566 From me to you, blinde Kuh!
2568 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2569 Date: Wed, 02 Oct 1996 01:50:07 +0000
2571 Subject: Bad bad message 2
2573 From me to you, blindes Kalb!
2575 ${cp} ./.tinv1 ./.tinv2
2579 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2580 \\eval copy * "${2}"
2582 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2583 ex0_test behave:mbox-14-estat
2584 ${cat} ./.tinv1 ./.tok >> .tall
2585 check behave:mbox-14 - ./.tall '739301109 616'
2588 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2589 wysh File ./.tok # Just move away to nowhere
2591 wysh file ./.tinv2 # Fully repaired
2592 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2593 ex0_test behave:mbox-15-estat
2594 check behave:mbox-15-1 - ./.tinv1 '3178048820 332'
2595 check behave:mbox-15-2 - ./.tinv2 '4151504442 314'
2600 t_behave_maildir() {
2601 t_prolog t_behave_maildir
2602 TRAP_EXIT_ADDONS=".
/.t
*"
2606 while [ ${i} -lt 112 ]; do
2607 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2608 "${MBOX}" "${i}" "${i}"
2611 ) | ${MAILX} ${ARGS}
2612 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2618 ' "${MBOX}" .tmdir1 .tmdir1 |
2619 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2620 check behave:maildir-2 0 .tlst '1797938753 9103'
2623 copy * "maildir
://%s
"
2626 ' "${MBOX}" .tmdir2 .tmdir2 |
2627 ${MAILX} ${ARGS} -Sshowlast > .tlst
2628 check behave:maildir-3 0 .tlst '1155631089 9113'
2630 printf 'File "maildir
://%s
"
2634 ' .tmdir2 .tmbox1 .tmbox1 |
2635 ${MAILX} ${ARGS} -Sshowlast > .tlst
2636 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2637 check behave:maildir-5 - .tlst '3701297796 9110'
2639 # only the odd (even)
2641 printf 'File "maildir
://%s
"
2644 while [ ${i} -lt 112 ]; do
2646 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2653 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2654 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2655 check behave:maildir-7 - .tlst '960096773 4573'
2658 printf 'file "maildir
://%s
"
2661 while [ ${i} -lt 112 ]; do
2663 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2671 ' .tmbox2 .tmbox2 .tmdir2
2672 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2673 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2674 ${sed} 2d
< .tlst
> .tlstx
2675 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2680 t_behave_record_a_resend
() {
2681 t_prolog t_behave_record_a_resend
2682 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2686 m %s\n~s Subject 1.\nHello.\n~.
2687 set record-files add-file-recipients
2688 m %s\n~s Subject 2.\nHello.\n~.
2690 resend 2 ./.t.resent
2691 Resend 1 ./.t.resent
2693 resend 2 ./.t.resent
2694 Resend 1 ./.t.resent
2695 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2698 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2699 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2700 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2705 t_behave_e_H_L_opts
() {
2706 t_prolog t_behave_e_H_L_opts
2707 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2710 ${MAILX} ${ARGS} -ef .
/.t.mbox
2711 echo ${?} > "${MBOX}"
2713 ${cat} <<-_EOT > ./.tsendmail.sh
2715 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2718 chmod 0755 .
/.tsendmail.sh
2719 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2720 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2721 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2722 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2724 ${MAILX} ${ARGS} -ef .
/.t.mbox
2725 echo ${?} >> "${MBOX}"
2726 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2727 echo ${?} >> "${MBOX}"
2728 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2729 echo ${?} >> "${MBOX}"
2730 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2731 echo ${?} >> "${MBOX}"
2732 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2733 echo ${?} >> "${MBOX}"
2734 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2735 echo ${?} >> "${MBOX}"
2736 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2737 echo ${?} >> "${MBOX}"
2739 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2740 echo ${?} >> "${MBOX}"
2741 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2742 echo ${?} >> "${MBOX}"
2743 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2744 echo ${?} >> "${MBOX}"
2745 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2746 echo ${?} >> "${MBOX}"
2747 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2748 echo ${?} >> "${MBOX}"
2749 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2750 echo ${?} >> "${MBOX}"
2751 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2752 echo ${?} >> "${MBOX}"
2754 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2759 t_behave_alternates
() {
2760 t_prolog t_behave_alternates
2761 TRAP_EXIT_ADDONS
="./.t*"
2763 ${cat} <<-_EOT > ./.tsendmail.sh
2765 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2768 chmod 0755 .
/.tsendmail.sh
2770 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2774 alternates a1@b1 a2@b2 a3@b3
2779 echo $?
/$^ERRNAME
<$rv>
2784 echo $?
/$^ERRNAME
<$rv>
2787 echo $?
/$^ERRNAME
<$rv>
2790 echo $?
/$^ERRNAME
<$rv>
2794 alternates a1@b1 a2@b2 a3@b3
2797 echo $?
/$^ERRNAME
<$rv>
2800 echo $?
/$^ERRNAME
<$rv>
2803 echo $?
/$^ERRNAME
<$rv>
2806 alternates a1@b1 a2@b2 a3@b3
2809 echo $?
/$^ERRNAME
<$rv>
2812 echo $?
/$^ERRNAME
<$rv>
2815 echo $?
/$^ERRNAME
<$rv>
2819 alternates a1@b1 a2@b2 a3@b3
2822 echo $?
/$^ERRNAME
<$rv>
2826 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2828 ~s all alternates
, only a1@b1 remains
2830 ~b a3@b3 a3@c3 a3@d3
2839 alternates a1@b1 a1@c1 a2@b2 a3@b3
2841 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2843 ~b a3@b3 a3@c3 a3@d3
2850 alternates a1@b1 a2@b2 a3
; set allnet
2852 ~s all alternates via allnet
, only a1@b1 remains
2854 ~b a3@b3 a3@c3 a3@d3
2865 echo $?
/$^ERRNAME
<$rv>
2869 echo $?
/$^ERRNAME
<$rv>
2873 echo $?
/$^ERRNAME
<$rv>
2877 echo $?
/$^ERRNAME
<$rv>
2881 echo $?
/$^ERRNAME
<$rv>
2885 alternates a1@b1 a2@b2
2888 echo $?
/$^ERRNAME
<$rv>
2889 alternates a3@b3 a4@b4
2892 echo $?
/$^ERRNAME
<$rv>
2895 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2896 if have_feat uistrings
; then
2897 check behave
:alternates-2
- .tall
'1878598364 505'
2899 echo 'behave:alternates-2: unsupported, skipped'
2906 t_prolog t_behave_alias
2907 TRAP_EXIT_ADDONS
="./.t*"
2909 ${cat} <<-_EOT > ./.tsendmail.sh
2911 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2914 chmod 0755 .
/.tsendmail.sh
2916 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2918 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2920 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2922 alias a4 a5 ex1@a4.ple
2924 alias a6 a7 ex1@a6.ple
2938 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2939 check behave
:alias-2
- .tall
'3548953204 152'
2941 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2942 # TODO need to somehow provide its contents to the test, then test
2947 t_behave_filetype
() {
2948 t_prolog t_behave_filetype
2949 TRAP_EXIT_ADDONS
="./.t*"
2951 ${cat} <<-_EOT > ./.tsendmail.sh
2953 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2956 chmod 0755 .
/.tsendmail.sh
2958 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2959 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2960 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2962 if (echo | gzip -c) >/dev/null 2>&1; then
2965 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2966 "${MBOX}" | ${MAILX} ${ARGS} \
2967 -X'filetype gz gzip\ -dc gzip\ -c'
2968 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2969 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2971 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2972 check behave
:filetype-3
- "./.t.out" '2392348396 102'
2974 echo 'behave:filetype-2: unsupported, skipped'
2975 echo 'behave:filetype-3: unsupported, skipped'
2980 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2986 -X'filetype gz gzip\ -dc gzip\ -c' \
2987 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2988 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2989 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2991 -X'filetype gz gzip\ -dc gzip\ -c' \
2992 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2994 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2995 check behave
:filetype-5
- "./.t.out" '852335377 172'
3000 t_behave_message_injections
() {
3001 t_prolog t_behave_message_injections
3002 TRAP_EXIT_ADDONS
="./.t*"
3004 ${cat} <<-_EOT > ./.tsendmail.sh
3006 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3009 chmod 0755 .
/.tsendmail.sh
3011 echo mysig
> .
/.tmysig
3013 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3014 -Smessage-inject-head=head-inject \
3015 -Smessage-inject-tail=tail-inject \
3016 -Ssignature=.
/.tmysig \
3017 ex@am.ple
> .
/.tall
2>&1
3018 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3019 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3021 ${cat} <<-_EOT > ./.template
3025 Subject: This subject is
3027 Body, body, body me.
3029 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3030 -Smessage-inject-head=head-inject \
3031 -Smessage-inject-tail=tail-inject \
3032 -Ssignature=.
/.tmysig \
3034 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3035 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3040 t_behave_attachments
() {
3041 t_prolog t_behave_attachments
3042 TRAP_EXIT_ADDONS
="./.t*"
3044 ${cat} <<-_EOT > ./.tsendmail.sh
3046 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3049 chmod 0755 .
/.tsendmail.sh
3051 ${cat} <<-_EOT > ./.tx
3052 From steffen Sun Feb 18 02:48:40 2018
3053 Date: Sun, 18 Feb 2018 02:48:40 +0100
3056 User-Agent: s-nail v14.9.7
3059 From steffen Sun Feb 18 02:48:42 2018
3060 Date: Sun, 18 Feb 2018 02:48:42 +0100
3063 User-Agent: s-nail v14.9.7
3068 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3069 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3070 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3073 '!@ ./.t3 "./.t 4" ""
3081 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
3082 -a .
/.t1
-a './.t 2' \
3083 -s attachment-test \
3084 ex@am.ple
> .
/.tall
2>&1
3085 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3086 if have_feat uistrings
; then
3087 check behave
:attachments-2
- .tall
'1928331872 720'
3089 echo 'behave:attachments-2: unsupported, skipped'
3095 !s This the subject is
3096 !@ ./.t3 "#2" "./.t 4" "#1" ""
3106 !@ ./.t3 "#2" "./.t 4" "#1" ""
3114 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3123 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3137 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Rf .
/.tx \
3139 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3140 if have_feat uistrings
; then
3141 check behave
:attachments-4
- .tall
'2526106274 1910'
3143 echo 'behave:attachments-4: unsupported, skipped'
3149 t_behave_compose_hooks
() { # TODO monster
3150 t_prolog t_behave_compose_hooks
3151 if have_feat uistrings
; then :; else
3152 echo 'behave:compose_hooks: unsupported, skipped'
3155 TRAP_EXIT_ADDONS
="./.t*"
3157 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3158 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3160 ${cat} <<-_EOT > ./.tsendmail.sh
3162 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3165 chmod 0755 .
/.tsendmail.sh
3167 ${cat} <<'__EOT__' > ./.trc
3169 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3172 vput vexpr es substr "$1" 0 1
3177 define read_mline_res {
3178 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3179 echo $len/$es/$^ERRNAME: $hl
3180 if [ $es -ne $^ERR-NONE ]
3181 xcall bail read_mline_res
3183 \xcall read_mline_res
3188 echo "~^header list"; read hl; echo $hl;\
3189 call xerr "$hl" "in_addr ($xh) 0-1"
3191 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3192 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3193 echo "~^header insert $xh <${xh}2@exam.ple>";\
3194 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3195 echo "~^header insert $xh ${xh}3@exam.ple";\
3196 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3197 echo "~^header list $xh"; read hl; echo $hl;\
3198 call xerr "$hl" "ins_addr $xh 1-4"
3199 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3202 if [ "$t_remove" == "" ]
3206 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3207 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3209 xcall bail "ins_addr $xh 2-2"
3211 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3213 xcall bail "ins_addr $xh 2-3"
3215 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3217 xcall bail "ins_addr $xh 2-4"
3221 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3222 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3223 echo "~^header insert $xh <${xh}2@exam.ple>";\
3224 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3225 echo "~^header insert $xh ${xh}3@exam.ple";\
3226 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3227 echo "~^header list $xh"; read hl; echo $hl;\
3228 call xerr "$hl" "ins_addr $xh 3-4"
3229 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3232 echo "~^header remove-at $xh 1"; read es;\
3233 call xerr $es "ins_addr $xh 3-6"
3234 echo "~^header remove-at $xh 1"; read es;\
3235 call xerr $es "ins_addr $xh 3-7"
3236 echo "~^header remove-at $xh 1"; read es;\
3237 call xerr $es "ins_addr $xh 3-8"
3238 echo "~^header remove-at $xh 1"; read es;\
3239 vput vexpr es substr $es 0 3
3241 xcall bail "ins_addr $xh 3-9"
3243 echo "~^header remove-at $xh T"; read es;\
3244 vput vexpr es substr $es 0 3
3246 xcall bail "ins_addr $xh 3-10"
3248 echo "~^header list $xh"; read es;\
3249 vput vexpr es substr $es 0 3
3251 xcall bail "ins_addr $xh 3-11"
3253 echo "~^header show $xh"; read es;\
3254 vput vexpr es substr $es 0 3
3256 xcall bail "ins_addr $xh 3-12"
3260 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3261 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3262 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3263 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3264 echo "~^header insert $xh ${xh}3@exam.ple";\
3265 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3266 echo "~^header list $xh"; read hl; echo $hl;\
3267 call xerr "$hl" "header list $xh 3-4"
3268 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3271 echo "~^header remove-at $xh 3"; read es;\
3272 call xerr $es "ins_addr $xh 4-6"
3273 echo "~^header remove-at $xh 2"; read es;\
3274 call xerr $es "ins_addr $xh 4-7"
3275 echo "~^header remove-at $xh 1"; read es;\
3276 call xerr $es "ins_addr $xh 4-8"
3277 echo "~^header remove-at $xh 1"; read es;\
3278 vput vexpr es substr $es 0 3
3280 xcall bail "ins_addr $xh 4-9"
3282 echo "~^header remove-at $xh T"; read es;\
3283 vput vexpr es substr $es 0 3
3285 xcall bail "ins_addr $xh 4-10"
3287 echo "~^header list $xh"; read es;\
3288 vput vexpr es substr $es 0 3
3290 xcall bail "ins_addr $xh 4-11"
3292 echo "~^header show $xh"; read es;\
3293 vput vexpr es substr $es 0 3
3295 xcall bail "ins_addr $xh 4-12"
3299 wysh set xh=$1 mult=$2
3300 echo "~^header list"; read hl; echo $hl;\
3301 call xerr "$hl" "ins_ref ($xh) 0-1"
3303 echo "~^header insert $xh <$xh@exam.ple>";\
3304 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3306 echo "~^header insert $xh <${xh}2@exam.ple>";\
3307 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3308 echo "~^header insert $xh ${xh}3@exam.ple";\
3309 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3311 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3312 vput vexpr es substr $es 0 3
3314 xcall bail "ins_ref $xh 1-4"
3318 echo "~^header list $xh"; read hl; echo $hl;\
3319 call xerr "$hl" "ins_ref $xh 1-5"
3320 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3323 if [ "$t_remove" == "" ]
3327 echo "~^header remove $xh"; read es;\
3328 call xerr $es "ins_ref $xh 2-1"
3329 echo "~^header remove $xh"; read es;\
3330 vput vexpr es substr $es 0 3
3332 xcall bail "ins_ref $xh 2-2"
3334 echo "~^header list $xh"; read es;\
3335 vput vexpr es substr $es 0 3
3337 xcall bail "$es ins_ref $xh 2-3"
3339 echo "~^header show $xh"; read es;\
3340 vput vexpr es substr $es 0 3
3342 xcall bail "ins_ref $xh 2-4"
3346 echo "~^header insert $xh <$xh@exam.ple>";\
3347 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3349 echo "~^header insert $xh <${xh}2@exam.ple>";\
3350 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3351 echo "~^header insert $xh ${xh}3@exam.ple";\
3352 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3354 echo "~^header list $xh";\
3355 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3356 echo "~^header show $xh";\
3357 read es; call xerr $es "ins_ref $xh 3-5"
3360 echo "~^header remove-at $xh 1"; read es;\
3361 call xerr $es "ins_ref $xh 3-6"
3362 if [ $mult -ne 0 ] && [ $xh != subject ]
3363 echo "~^header remove-at $xh 1"; read es;\
3364 call xerr $es "ins_ref $xh 3-7"
3365 echo "~^header remove-at $xh 1"; read es;\
3366 call xerr $es "ins_ref $xh 3-8"
3368 echo "~^header remove-at $xh 1"; read es;\
3369 vput vexpr es substr $es 0 3
3371 xcall bail "ins_ref $xh 3-9"
3373 echo "~^header remove-at $xh T"; read es;\
3374 vput vexpr es substr $es 0 3
3376 xcall bail "ins_ref $xh 3-10"
3378 echo "~^header show $xh"; read es;\
3379 vput vexpr es substr $es 0 3
3381 xcall bail "ins_ref $xh 3-11"
3385 echo "~^header insert $xh <$xh@exam.ple> ";\
3386 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3388 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3389 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3390 echo "~^header insert $xh ${xh}3@exam.ple";\
3391 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3393 echo "~^header list $xh"; read hl; echo $hl;\
3394 call xerr "$hl" "ins_ref $xh 4-4"
3395 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3398 if [ $mult -ne 0 ] && [ $xh != subject ]
3399 echo "~^header remove-at $xh 3"; read es;\
3400 call xerr $es "ins_ref $xh 4-6"
3401 echo "~^header remove-at $xh 2"; read es;\
3402 call xerr $es "ins_ref $xh 4-7"
3404 echo "~^header remove-at $xh 1"; read es;\
3405 call xerr $es "ins_ref $xh 4-8"
3406 echo "~^header remove-at $xh 1"; read es;\
3407 vput vexpr es substr $es 0 3
3409 xcall bail "ins_ref $xh 4-9"
3411 echo "~^header remove-at $xh T"; read es;\
3412 vput vexpr es substr $es 0 3
3414 xcall bail "ins_ref $xh 4-10"
3416 echo "~^header show $xh"; read es;\
3417 vput vexpr es substr $es 0 3
3419 xcall bail "ins_ref $xh 4-11"
3424 # In collect.c order
3426 call ins_ref sender 0 # Not a "ref", but works
3430 call ins_addr reply-To
3431 call ins_addr mail-Followup-to
3432 call ins_ref messAge-id 0
3433 call ins_ref rEfErEncEs 1
3434 call ins_ref in-Reply-to 1
3435 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3436 call ins_addr freeForm1
3437 call ins_addr freeform2
3439 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3441 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3449 echo "~^attachment";\
3450 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3452 xcall bail "attach 0-1"
3455 echo "~^attach attribute ./.treadctl";\
3456 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3458 xcall bail "attach 0-2"
3460 echo "~^attachment attribute-at 1";\
3461 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3463 xcall bail "attach 0-3"
3466 echo "~^attachment insert ./.treadctl=ascii";\
3467 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3468 echo "~^attachment list";\
3469 read es; echo $es;call xerr "$es" "attach 1-2"
3471 echo "~^attachment attribute ./.treadctl";\
3472 read es; echo $es;call xerr "$es" "attach 1-3"
3474 echo "~^attachment attribute .treadctl";\
3475 read es; echo $es;call xerr "$es" "attach 1-4"
3477 echo "~^attachment attribute-at 1";\
3478 read es; echo $es;call xerr "$es" "attach 1-5"
3481 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3482 read es; echo $es;call xerr "$es" "attach 1-6"
3483 echo "~^attachment attribute-set .treadctl content-description Au";\
3484 read es; echo $es;call xerr "$es" "attach 1-7"
3485 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3486 read es; echo $es;call xerr "$es" "attach 1-8"
3488 echo "~^attachment attribute ./.treadctl";\
3489 read es; echo $es;call xerr "$es" "attach 1-9"
3491 echo "~^attachment attribute .treadctl";\
3492 read es; echo $es;call xerr "$es" "attach 1-10"
3494 echo "~^attachment attribute rctl";\
3495 read es; echo $es;call xerr "$es" "attach 1-11"
3497 echo "~^attachment attribute-at 1";\
3498 read es; echo $es;call xerr "$es" "attach 1-12"
3502 echo "~^attachment insert ./.tattach=latin1";\
3503 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3504 echo "~^attachment list";\
3505 read es; echo $es;call xerr "$es" "attach 2-2"
3507 echo "~^attachment attribute ./.tattach";\
3508 read es; echo $es;call xerr "$es" "attach 2-3"
3510 echo "~^attachment attribute .tattach";\
3511 read es; echo $es;call xerr "$es" "attach 2-4"
3513 echo "~^attachment attribute-at 2";\
3514 read es; echo $es;call xerr "$es" "attach 2-5"
3517 echo "~^attachment attribute-set ./.tattach filename tat";\
3518 read es; echo $es;call xerr "$es" "attach 2-6"
3520 "~^attachment attribute-set .tattach content-description Au2";\
3521 read es; echo $es;call xerr "$es" "attach 2-7"
3522 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3523 read es; echo $es;call xerr "$es" "attach 2-8"
3525 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3526 read es; echo $es;call xerr "$es" "attach 2-9"
3528 echo "~^attachment attribute ./.tattach";\
3529 read es; echo $es;call xerr "$es" "attach 2-10"
3531 echo "~^attachment attribute .tattach";\
3532 read es; echo $es;call xerr "$es" "attach 2-11"
3534 echo "~^attachment attribute tat";\
3535 read es; echo $es;call xerr "$es" "attach 2-12"
3537 echo "~^attachment attribute-at 2";\
3538 read es; echo $es;call xerr "$es" "attach 2-13"
3542 if [ "$t_remove" == "" ]
3546 echo "~^attachment remove ./.treadctl"; read es;\
3547 call xerr $es "attach 3-1"
3548 echo "~^attachment remove ./.tattach"; read es;\
3549 call xerr $es "attach 3-2"
3550 echo "~^ attachment remove ./.treadctl"; read es;\
3551 vput vexpr es substr $es 0 3
3553 xcall bail "attach 3-3"
3555 echo "~^ attachment remove ./.tattach"; read es;\
3556 vput vexpr es substr $es 0 3
3558 xcall bail "attach 3-4"
3560 echo "~^attachment list"; read es;\
3561 vput vexpr es substr $es 0 3
3563 xcall bail "attach 3-5"
3567 echo "~^attachment insert ./.tattach=latin1";\
3568 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3569 echo "~^attachment insert ./.tattach=latin1";\
3570 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3571 echo "~^attachment list";\
3572 read es; echo $es;call xerr "$es" "attach 4-3"
3574 echo "~^ attachment remove .tattach"; read es;\
3575 vput vexpr es substr $es 0 3
3577 xcall bail "attach 4-4 $es"
3579 echo "~^attachment remove-at T"; read es;\
3580 vput vexpr es substr $es 0 3
3582 xcall bail "attach 4-5"
3584 echo "~^attachment remove ./.tattach"; read es;\
3585 call xerr $es "attach 4-6"
3586 echo "~^attachment remove ./.tattach"; read es;\
3587 call xerr $es "attach 4-7"
3588 echo "~^ attachment remove ./.tattach"; read es;\
3589 vput vexpr es substr $es 0 3
3591 xcall bail "attach 4-8 $es"
3593 echo "~^attachment list"; read es;\
3594 vput vexpr es substr $es 0 3
3596 xcall bail "attach 4-9"
3600 echo "~^attachment insert ./.tattach=latin1";\
3601 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3602 echo "~^attachment insert ./.tattach=latin1";\
3603 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3604 echo "~^attachment insert ./.tattach=latin1";\
3605 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3606 echo "~^attachment list";\
3607 read es; echo $es;call xerr "$es" "attach 5-4"
3610 echo "~^attachment remove-at 3"; read es;\
3611 call xerr $es "attach 5-5"
3612 echo "~^attachment remove-at 3"; read es;\
3613 vput vexpr es substr $es 0 3
3615 xcall bail "attach 5-6"
3617 echo "~^attachment remove-at 2"; read es;\
3618 call xerr $es "attach 5-7"
3619 echo "~^attachment remove-at 2"; read es;\
3620 vput vexpr es substr $es 0 3
3622 xcall bail "attach 5-8"
3624 echo "~^attachment remove-at 1"; read es;\
3625 call xerr $es "attach 5-9"
3626 echo "~^attachment remove-at 1"; read es;\
3627 vput vexpr es substr $es 0 3
3629 xcall bail "attach 5-10"
3632 echo "~^attachment list"; read es;\
3633 vput vexpr es substr $es 0 3
3635 xcall bail "attach 5-11"
3639 echo "~^attachment insert ./.tattach=latin1";\
3640 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3641 echo "~^attachment insert ./.tattach=latin1";\
3642 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3643 echo "~^attachment insert ./.tattach=latin1";\
3644 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3645 echo "~^attachment list";\
3646 read es; echo $es;call xerr "$es" "attach 6-4"
3649 echo "~^attachment remove-at 1"; read es;\
3650 call xerr $es "attach 6-5"
3651 echo "~^attachment remove-at 1"; read es;\
3652 call xerr $es "attach 6-6"
3653 echo "~^attachment remove-at 1"; read es;\
3654 call xerr $es "attach 6-7"
3655 echo "~^attachment remove-at 1"; read es;\
3656 vput vexpr es substr $es 0 3
3658 xcall bail "attach 6-8"
3661 echo "~^attachment list"; read es;\
3662 vput vexpr es substr $es 0 3
3664 xcall bail "attach 6-9"
3676 echo on-compose-enter, mailx-command<$mailx-command>
3677 alternates alter1@exam.ple alter2@exam.ple
3679 set autocc='alter1@exam.ple alter2@exam.ple'
3680 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3681 echo mailx-subject<$mailx-subject>
3682 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3683 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3684 mailx-raw-bcc<$mailx-raw-bcc>
3685 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3686 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3689 echo on-compose-leave, mailx-command<$mailx-command>
3691 eval alternates $al alter3@exam.ple alter4@exam.ple
3693 set autobcc='alter3@exam.ple alter4@exam.ple'
3694 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3695 echo mailx-subject<$mailx-subject>
3696 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3697 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3698 mailx-raw-bcc<$mailx-raw-bcc>
3699 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3700 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3703 echo on-compose-cleanup, mailx-command<$mailx-command>
3706 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3707 echo mailx-subject<$mailx-subject>
3708 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3709 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3710 mailx-raw-bcc<$mailx-raw-bcc>
3711 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3712 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3714 wysh set on-compose-splice=t_ocs \
3715 on-compose-enter=t_oce on-compose-leave=t_ocl \
3716 on-compose-cleanup=t_occ
3720 printf 'm this-goes@nowhere\nbody\n!.\n' |
3721 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3722 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3724 ${cat} .
/.tall
>> "${MBOX}"
3725 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3728 printf 'm this-goes@nowhere\nbody\n!.\n' |
3729 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3730 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3732 ${cat} .
/.tall
>> "${MBOX}"
3733 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3737 # Some state machine stress, shell compose hook, localopts for hook, etc.
3738 # readctl in child. ~r as HERE document
3740 printf 'm ex@am.ple\nbody\n!.
3741 echon ${mailx-command}${mailx-subject}
3742 echon ${mailx-from}${mailx-sender}
3743 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3744 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3745 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3746 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3747 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3748 -Smta=.
/.tsendmail.sh \
3751 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3754 vput vexpr es substr "$1" 0 1
3759 define read_mline_res {
3760 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3761 echo $len/$es/$^ERRNAME: $hl
3762 if [ $es -ne $^ERR-NONE ]
3763 xcall bail read_mline_res
3765 \xcall read_mline_res
3769 vput vexpr i + 1 "$2"
3771 vput vexpr j % $i 10
3778 eval \\$j _work $1 $i
3781 vput vexpr i + $i "$1"
3785 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3786 echo read:$es/$en: $line
3787 if [ "${es}" -ne -1 ]
3790 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3795 echo "~^header list"; read hl; echo $hl;\
3796 vput vexpr es substr "$hl" 0 1
3798 xcall bail "header list"
3801 call _work 1; echo $?
3802 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3803 read es; echo $es; vput vexpr es substr "$es" 0 1
3805 xcall bail "be diet"
3807 echo "~^header insert cc <splice2@exam.ple>";\
3808 read es; echo $es; vput vexpr es substr "$es" 0 1
3810 xcall bail "be diet2"
3813 call _work 2; echo $?
3814 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3815 read es; echo $es;vput vexpr es substr "$es" 0 1
3817 xcall bail "be juicy"
3819 echo "~^header insert bcc juice2@exam.ple";\
3820 read es; echo $es;vput vexpr es substr "$es" 0 1
3822 xcall bail "be juicy2"
3824 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3825 read es; echo $es;vput vexpr es substr "$es" 0 1
3827 xcall bail "be juicy3"
3829 echo "~^header insert bcc juice4@exam.ple";\
3830 read es; echo $es;vput vexpr es substr "$es" 0 1
3832 xcall bail "be juicy4"
3835 echo "~^header remove-at bcc 3";\
3836 read es; echo $es;vput vexpr es substr "$es" 0 1
3838 xcall bail "remove juicy5"
3840 echo "~^header remove-at bcc 2";\
3841 read es; echo $es;vput vexpr es substr "$es" 0 1
3843 xcall bail "remove juicy6"
3845 echo "~^header remove-at bcc 3";\
3846 read es; echo $es;vput vexpr es substr "$es" 0 3
3848 xcall bail "failed to remove-at"
3850 # Add duplicates which ought to be removed!
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-1"
3856 echo "~^header insert bcc juice4@exam.ple";\
3857 read es; echo $es;vput vexpr es substr "$es" 0 1
3859 xcall bail "be juicy4-2"
3861 echo "~^header insert bcc juice4@exam.ple";\
3862 read es; echo $es;vput vexpr es substr "$es" 0 1
3864 xcall bail "be juicy4-3"
3869 call _work 3; echo $?
3871 vput ! i echo just knock if you can hear me;\
3873 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3875 echon shell-cmd says $?/$^ERRNAME: $i
3876 echo "~x will not become interpreted, we are reading until __EOT"
3878 read r_status; echo "~~r status output: $r_status"
3879 echo "~:echo $? $! $^ERRNAME"
3881 echo "~~r status from parent: $r_status"
3884 call _work 4; echo $?
3885 vput cwd cwd;echo cwd:$?
3886 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3890 call _work 5; echo $?
3891 echo "~^header show MAILX-Command"; read es;\
3892 call xerr $es "t_header 1000"; call read_mline_res
3893 echo "~^header show MAILX-raw-TO"; read es;\
3894 call xerr $es "t_header 1001"; xcall read_mline_res
3896 echoerr IT IS WRONG IF YOU SEE THIS
3899 echo on-compose-enter, mailx-command<$mailx-command>
3900 set t_oce autobcc=oce@exam.ple
3901 alternates alter1@exam.ple alter2@exam.ple
3903 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3904 echo mailx-subject<$mailx-subject>
3905 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3906 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3907 mailx-raw-bcc<$mailx-raw-bcc>
3908 echo mailx-orig-from<$mailx-orig-from> \
3909 mailx-orig-to<$mailx-orig-to> \
3910 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3913 echo on-compose-leave, mailx-command<$mailx-command>
3914 set t_ocl autocc=ocl@exam.ple
3916 alternates alter3@exam.ple alter4@exam.ple
3918 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3919 echo mailx-subject<$mailx-subject>
3920 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3921 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3922 mailx-raw-bcc<$mailx-raw-bcc>
3923 echo mailx-orig-from<$mailx-orig-from> \
3924 mailx-orig-to<$mailx-orig-to> \
3925 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3928 echo on-compose-cleanup, mailx-command<$mailx-command>
3929 set t_occ autocc=occ@exam.ple
3932 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3933 echo mailx-subject<$mailx-subject>
3934 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3935 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3936 mailx-raw-bcc<$mailx-raw-bcc>
3937 echo mailx-orig-from<$mailx-orig-from> \
3938 mailx-orig-to<$mailx-orig-to> \
3939 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3941 wysh set on-compose-splice=t_ocs \
3942 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3943 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3944 on-compose-enter=t_oce on-compose-leave=t_ocl \
3945 on-compose-cleanup=t_occ
3947 ex0_test behave
:compose_hooks-3-estat
3948 ${cat} .
/.tnotes
>> "${MBOX}"
3950 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3952 # Reply, forward, resend, Resend
3955 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3956 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3957 -Smta=.
/.tsendmail.sh
3960 echo start: $? $! $^ERRNAME
3962 echo File: $? $! $^ERRNAME;echo;echo
3964 this is content of reply 1
3966 echo reply 1: $? $! $^ERRNAME;echo;echo
3968 this is content of Reply 1 2
3970 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3971 forward 1 fwdex@am.ple
3972 this is content of forward 1
3974 echo forward 1: $? $! $^ERRNAME;echo;echo
3975 resend 1 2 resendex@am.ple
3976 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3977 Resend 1 2 Resendex@am.ple
3978 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3980 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3981 -Smta=.
/.tsendmail.sh \
3984 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3987 vput vexpr es substr "$1" 0 1
3992 define read_mline_res {
3993 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3994 echo mline_res:$len/$es/$^ERRNAME: $hl
3995 if [ $es -ne $^ERR-NONE ]
3996 xcall bail read_mline_res
3998 \xcall read_mline_res
4002 echo "~^header show $1"; read es;\
4003 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4011 echo t_ocs version $ver
4012 echo "~^header list"; read hl; echo $hl;\
4013 echoerr the header list is $hl;\
4014 call xerr "$hl" "header list"
4015 eval vpospar set $hl
4018 echoerr IT IS WRONG IF YOU SEE THIS
4021 echo on-XY-enter, mailx-command<$mailx-command>
4022 set t_oce autobcc=oce@exam.ple
4023 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4024 echo mailx-subject<$mailx-subject>
4025 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4026 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4027 mailx-raw-bcc<$mailx-raw-bcc>
4028 echo mailx-orig-from<$mailx-orig-from> \
4029 mailx-orig-to<$mailx-orig-to> \
4030 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4033 echo on-XY-leave, mailx-command<$mailx-command>
4034 set t_ocl autocc=ocl@exam.ple
4035 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4036 echo mailx-subject<$mailx-subject>
4037 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4038 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4039 mailx-raw-bcc<$mailx-raw-bcc>
4040 echo mailx-orig-from<$mailx-orig-from> \
4041 mailx-orig-to<$mailx-orig-to> \
4042 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4045 echo on-XY-cleanup, mailx-command<$mailx-command>
4046 set t_occ autocc=occ@exam.ple
4047 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4048 echo mailx-subject<$mailx-subject>
4049 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4050 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4051 mailx-raw-bcc<$mailx-raw-bcc>
4052 echo mailx-orig-from<$mailx-orig-from> \
4053 mailx-orig-to<$mailx-orig-to> \
4054 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4056 wysh set on-compose-splice=t_ocs \
4057 on-compose-enter=t_oce on-compose-leave=t_ocl \
4058 on-compose-cleanup=t_occ \
4059 on-resend-enter=t_oce on-resend-cleanup=t_occ
4061 ex0_test behave
:compose_hooks-4-estat
4062 ${cat} .
/.tnotes
>> "${MBOX}"
4064 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4069 t_behave_C_opt_customhdr
() {
4070 t_prolog t_behave_C_opt_customhdr
4071 TRAP_EXIT_ADDONS
="./.t*"
4073 ${cat} <<-_EOT > ./.tsendmail.sh
4075 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
4079 chmod 0755 .
/.tsendmail.sh
4082 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
4083 -C 'C-One : Custom One Body' \
4084 -C 'C-Two:CustomTwoBody' \
4085 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4086 this-goes@nowhere
>.
/.tall
2>&1
4087 ex0_test behave
:C_opt_customhdr-1-estat
4088 ${cat} .
/.tall
>> "${MBOX}"
4089 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4092 printf 'm this-goes@nowhere\nbody\n!.
4094 m this-goes2@nowhere\nbody2\n!.
4095 set customhdr=%ccustom1 : custom1 body%c
4096 m this-goes2@nowhere\nbody2\n!.
4097 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4098 m this-goes3@nowhere\nbody3\n!.
4100 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
-Sescape=! \
4101 -C 'C-One : Custom One Body' \
4102 -C 'C-Two:CustomTwoBody' \
4103 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4105 ex0_test behave
:C_opt_customhdr-2-estat
4106 ${cat} .
/.tall
>> "${MBOX}"
4107 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4112 t_behave_mass_recipients
() {
4113 t_prolog t_behave_mass_recipients
4114 TRAP_EXIT_ADDONS
="./.t*"
4116 ${cat} <<-_EOT > ./.tsendmail.sh
4118 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4121 chmod 0755 .
/.tsendmail.sh
4123 ${cat} <<'__EOT__' > ./.trc
4125 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4128 wysh set nr=$1 hn=$2
4129 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4131 xcall bail "ins_addr $hn 1-$nr"
4133 vput vexpr nr + $nr 1
4134 if [ "$nr" -le "$maximum" ]
4135 xcall ins_addr $nr $hn
4139 wysh set nr=$1 hn=$2
4140 alternates $hn$nr@$hn
4141 vput vexpr nr + $nr 2
4142 if [ "$nr" -le "$maximum" ]
4143 xcall bld_alter $nr $hn
4153 if [ "$t_remove" != '' ]
4158 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4161 printf 'm this-goes@nowhere\nbody\n!.\n' |
4162 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4163 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4165 ex0_test behave
:mass_recipients-1-estat
4166 ${cat} .
/.tall
>> "${MBOX}"
4167 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4170 printf 'm this-goes@nowhere\nbody\n!.\n' |
4171 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4172 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4174 ex0_test behave
:mass_recipients-2-estat
4175 ${cat} .
/.tall
>> "${MBOX}"
4176 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4181 t_behave_mime_types_load_control
() {
4182 t_prolog t_behave_mime_types_load_control
4183 if have_feat uistrings
; then :; else
4184 echo 'behave:mime_types_load_control: unsupported, skipped'
4187 TRAP_EXIT_ADDONS
="./.t*"
4189 ${cat} <<-_EOT > ./.tmts1
4190 @ application/mathml+xml mathml
4192 ${cat} <<-_EOT > ./.tmts2
4193 @ x-conference/x-cooltalk ice
4195 @ application/aga-aga aga
4198 ${cat} <<-_EOT > ./.tmts1.mathml
4199 <head>nonsense ML</head>
4201 ${cat} <<-_EOT > ./.tmts2.ice
4204 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4205 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4219 ' "${MBOX}" "${MBOX}" |
4221 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4223 ex0_test behave
:mime_types_load_control-1-estat
4224 ${cat} "${MBOX}" >> .
/.tout
4225 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4227 echo type |
${MAILX} ${ARGS} -R \
4228 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4229 -f "${MBOX}" >> .
/.tout
2>&1
4230 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4235 t_behave_lreply_futh_rth_etc
() {
4236 t_prolog t_behave_lreply_futh_rth_etc
4237 TRAP_EXIT_ADDONS
="./.t*"
4239 ${cat} <<-_EOT > ./.tsendmail.sh
4241 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4244 chmod 0755 .
/.tsendmail.sh
4246 ${cat} <<-_EOT > ./.tmbox
4247 From neverneverland Sun Jul 23 13:46:25 2017
4248 Subject: Bugstop: five miles out 1
4249 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4250 From: mister originator <mr@originator>
4251 To: bugstop-commit@five.miles.out, laber@backe.eu
4253 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4254 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4255 Date: Wed, 19 Jul 2017 09:22:57 -0400
4256 Message-Id: <20170719132257.766AF781267@originator>
4259 > |Sorry, I think I misunderstand something. I would think that
4263 From neverneverland Fri Jul 7 22:39:11 2017
4264 Subject: Bugstop: five miles out 2
4265 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4266 Content-Transfer-Encoding: 7bit
4267 From: mister originator <mr@originator>
4268 To: bugstop-commit@five.miles.out
4270 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4271 Date: Fri, 07 Jul 2017 16:33:59 -0400
4274 capable of changing back.
4276 From neverneverland Fri Jul 7 22:42:00 2017
4277 Subject: Bugstop: five miles out 3
4278 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4279 Content-Transfer-Encoding: 7bit
4280 From: mister originator <mr@originator>
4281 To: bugstop-commit@five.miles.out
4283 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4284 Date: Fri, 07 Jul 2017 16:33:59 -0400
4285 List-Post: <mailto:bugstop@five.miles.out>
4288 are you ready, boots?
4290 From neverneverland Sat Aug 19 23:15:00 2017
4291 Subject: Bugstop: five miles out 4
4292 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4293 Content-Transfer-Encoding: 7bit
4294 From: mister originator <mr@originator>
4295 To: bugstop@five.miles.out
4297 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4298 Date: Fri, 07 Jul 2017 16:33:59 -0400
4299 List-Post: <mailto:bugstop@five.miles.out>
4302 are you ready, boots?
4307 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4308 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4310 wysh
set m
="This is text of \"reply ${1}."
4321 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4324 wysh set m="This is text of
\"Reply
${1}.
"
4330 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4339 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4343 # We need two indirections for this test: one for the case that Lreply
4344 # fails because of missing recipients: we need to read EOF next, thus
4345 # place this in _Ls last; and second for the succeeding cases EOF is
4346 # not what these should read, so go over the backside and splice it in!
4348 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4351 localopts call-fixate
yes
4353 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4354 call L
$1 1; call L
$1 2; call L
$1 3
4357 echo;echo '===== CHANGING === '"$*"' =====';echo
4361 set from
=laber@backe.eu
4364 call tweak
set reply-to-honour
4366 call tweak
set followup-to
4368 call tweak
set followup-to-honour
4370 call tweak mlist bugstop@five.miles.out
4372 call tweak mlsubscribe bugstop@five.miles.out
4374 call tweak
set recipients-in-cc
4378 ex0_test behave
:lreply_futh_rth_etc-1-estat
4379 if have_feat uistrings
; then # xxx should not be so, skip??
4380 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '940818845 29373'
4382 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '3917430455 29259'
4387 ${cat} <<-_EOT > ./.tmbox
4388 From tom@i-i.example Thu Oct 26 03:15:55 2017
4389 Date: Wed, 25 Oct 2017 21:15:46 -0400
4390 From: tom <tom@i-i.example>
4391 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4392 Cc: tom <tom@i-i.example>
4393 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4394 Message-ID: <20171026011546.GA11643@i-i.example>
4395 Reply-To: tom@i-i.example
4396 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4397 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4400 The report's useful :-)
4403 printf 'reply 1\nthank you\n!.\n' |
4404 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4405 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4406 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4411 t_behave_mime_if_not_ascii
() {
4412 t_prolog t_behave_mime_if_not_ascii
4414 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4415 check behave:mime_if_not_ascii-1 0 "${MBOX}" '2287855519 110'
4417 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4419 check behave
:mime_if_not_ascii-2
0 "${MBOX}" '70754682 282'
4424 t_behave_xxxheads_rfc2047
() {
4425 t_prolog t_behave_xxxheads_rfc2047
4426 TRAP_EXIT_ADDONS
="./.t*"
4428 ${cat} <<-_EOT > ./.tsendmail.sh
4430 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4433 chmod 0755 .
/.tsendmail.sh
4437 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4438 -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̲' \
4440 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4442 # Single word (overlong line split -- bad standard! Requires injection of
4443 # artificial data!! But can be prevented by using RFC 2047 encoding)
4445 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4446 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4447 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4449 # Combination of encoded words, space and tabs of varying sort
4451 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4452 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4453 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4454 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4455 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4456 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4458 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4460 # Overlong multibyte sequence that must be forcefully split
4461 # todo This works even before v15.0, but only by accident
4463 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4464 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4465 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4466 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4468 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4472 echo | ${MAILX} ${ARGS} \
4473 -s "1-1 B2 B3 B4 B5 B6 B\
4474 1-2 B2 B3 B4 B5 B6 B\
4475 1-3 B2 B3 B4 B5 B6 B\
4476 1-4 B2 B3 B4 B5 B6 B\
4477 1-5 B2 B3 B4 B5 B6 B\
4478 1-6 B2 B3 B4 B5 B6
" \
4480 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4482 # Leading and trailing WS
4484 echo | ${MAILX} ${ARGS} \
4485 -s " 2-1 B2 B3 B4 B5 B6 B\
4486 1-2 B2 B3 B4 B5 B6 B\
4487 1-3 B2 B3 B4 B5 B6 B\
4488 1-4 B2 B3 B4 B5 B6
" \
4490 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4492 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4494 echo "Dat Früchtchen riecht häußlich
" |
4495 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4497 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4498 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4500 # RFC 2047 in an address field, and iconv involved
4501 if have_feat iconv; then
4503 ${cat} > ./.trebox <<_EOT
4504 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4505 Date: Fri, 2 Mar 2018 20:31:45 +0000
4506 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4507 To: dude <dude@exam.ple>
4508 Subject: houston(...)
4509 Message-ID: <abra@1>
4511 Content-Type: text/plain; charset=iso-8859-1
4512 Content-Disposition: inline
4513 Content-Transfer-Encoding: 8bit
4516 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4517 -Sfullnames -Sreply-in-same-charset \
4518 -Smta=./.tsendmail.sh -Rf ./.trebox
4519 check behave:xxxheads_rfc2047-8 0 "${MBOX}" '2821484185 280'
4521 echo 'behave:xxxheads_rfc2047-8: iconv unsupported, skipped'
4527 t_behave_rfc2231() {
4528 t_prolog t_behave_rfc2231
4529 TRAP_EXIT_ADDONS=".
/.t
*"
4532 mkdir ./.ttt || exit 1
4536 : > 'diet\ is \curd.txt'
4537 : > 'diet "is
" curd.txt'
4539 : > 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
4540 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4541 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4542 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4544 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4545 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4546 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4547 -a ./.ttt/höde-tröge.txt \
4548 -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 \
4549 -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 \
4550 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4551 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4553 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4555 # `resend' test, reusing $MBOX
4556 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4557 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4559 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4560 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4565 t_behave_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4566 t_prolog t_behave_iconv_mbyte_base64
4567 TRAP_EXIT_ADDONS=".
/.t
*"
4569 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4570 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4571 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4574 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4578 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4582 ${cat} <<-_EOT > ./.tsendmail.sh
4584 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4587 chmod 0755 ./.tsendmail.sh
4589 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4590 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4591 -Smta=./.tsendmail.sh \
4592 -Sescape=! -Smime-encoding=base64 2>./.terr
4593 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4595 !s Japanese from UTF-8 to ISO-2022-JP
4596 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4598 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4601 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4603 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4606 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4608 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4609 \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
4611 \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
4614 \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
4616 \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
4619 # May not presume iconv output as long as roundtrip possible [489a7122]
4620 ex0_test behave
:iconv_mbyte_base64-1-estat
4621 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4622 < "${MBOX}" > .
/.tcksum
4623 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4624 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4626 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4627 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4628 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4629 -Rf "${MBOX}" >.
/.tlog
2>&1
4630 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4631 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4632 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4633 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4635 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4638 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4639 rm -f "${MBOX}" .
/.twrite
4640 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4641 -Smta=.
/.tsendmail.sh \
4642 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4643 set ttycharset
=utf-8 sendcharsets
=euc-jp
4645 !s Japanese from UTF-8 to EUC-JP
4646 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4648 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4651 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4653 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4656 set ttycharset
=EUC-JP sendcharsets
=utf-8
4658 !s Japanese from EUC-JP to UTF-8
4659 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4661 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4664 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4666 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4669 ex0_test behave
:iconv_mbyte_base64-5-estat
4670 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4671 < "${MBOX}" > .
/.tcksum
4672 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4673 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4675 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4676 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4677 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4678 -Rf "${MBOX}" >.
/.tlog
2>&1
4679 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4680 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4681 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4682 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4684 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4690 t_behave_iconv_mainbody
() {
4691 t_prolog t_behave_iconv_mainbody
4692 TRAP_EXIT_ADDONS
="./.t*"
4694 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4697 echo 'behave:iconv_mainbody: unsupported, skipped'
4701 ${cat} <<-_EOT > ./.tsendmail.sh
4703 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4706 chmod 0755 .
/.tsendmail.sh
4708 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4709 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4710 -s '–' over-the@rain.bow
2>.
/.terr
4711 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4712 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4714 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4715 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4716 -s '–' over-the@rain.bow
2>.
/.terr
4717 exn0_test behave
:iconv_mainbody-3
4718 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4719 if have_feat uistrings
; then
4720 if have_feat docstrings
; then # xxx should not be like that
4721 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4723 check behave
:iconv_mainbody-4
- .
/.terr
'271380835 121'
4726 echo 'behave:iconv_mainbody-4: unsupported, skipped'
4729 # The different iconv(3) implementations use different replacement sequence
4730 # types (character-wise, byte-wise, and the character(s) used differ)
4731 i
="${MAILX_ICONV_MODE}"
4732 if [ -n "${i}" ]; then
4733 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4735 ex0_test behave:iconv_mainbody-5-0 ${j}
4736 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4737 if [ ${i} -eq 13 ]; then
4738 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4739 elif [ ${i} -eq 12 ]; then
4740 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4741 elif [ ${i} -eq 3 ]; then
4742 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4744 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4747 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4753 t_behave_binary_mainbody() {
4754 t_prolog t_behave_binary_mainbody
4755 TRAP_EXIT_ADDONS=".
/.t
*"
4757 printf 'abra\0\nka\r\ndabra' |
4758 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4760 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4761 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4763 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4764 ${MAILX} ${ARGS} -Rf \
4765 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4766 "${MBOX}" >./.tall 2>&1
4767 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4768 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4769 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4774 t_behave_q_t_etc_opts() {
4775 t_prolog t_behave_q_t_etc_opts
4776 TRAP_EXIT_ADDONS=".
/.t
*"
4778 # Three tests for MIME encoding and (a bit) content classification.
4779 # At the same time testing -q FILE, < FILE and -t FILE
4780 t__put_body > ./.tin
4783 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4784 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4785 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4788 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4789 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4790 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4793 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4795 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4796 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4802 have_feat smime || {
4803 echo 'behave:s/mime: unsupported, skipped'
4807 t_prolog t_behave_s_mime
4808 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4809 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4810 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4812 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4813 ${cat} <<-_EOT > ./.t.conf
4816 default_keyfile = keyfile.pem
4817 distinguished_name = req_distinguished_name
4818 attributes = req_attributes
4822 [ req_distinguished_name ]
4829 emailAddress = test@localhost
4834 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4835 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4836 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4839 printf 'behave:s/mime:sign/verify: '
4840 echo bla | ${MAILX} ${ARGS} \
4841 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4842 -Ssmime-sign -Sfrom=test@localhost \
4843 -s 'S/MIME test' ./.VERIFY
4844 if [ $? -eq 0 ]; then
4855 /^Content-Description: /{ skip = 2; print; next }
4856 /^$/{ if(skip) --skip }
4859 < ./.VERIFY > "${MBOX}"
4860 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4862 printf 'behave:s/mime:sign/verify:verify '
4863 printf 'verify\nx\n' |
4865 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4866 -Ssmime-sign -Sfrom=test@localhost \
4868 -f ./.VERIFY >>${ERR} 2>&1
4869 if [ $? -eq 0 ]; then
4878 printf 'behave:s/mime:sign/verify:disproof-1 '
4879 if openssl smime -verify -CAfile ./.tcert.pem \
4880 -in ./.VERIFY >>${ERR} 2>&1; then
4889 # (signing +) encryption / decryption
4890 ${cat} <<-_EOT > ./.tsendmail.sh
4892 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4894 chmod 0755 ./.tsendmail.sh
4896 printf 'behave:s/mime:encrypt+sign: '
4899 -Ssmime-force-encryption \
4900 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4901 -Smta=./.tsendmail.sh \
4902 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4903 -Ssmime-sign -Sfrom=test@localhost \
4904 -s 'S/MIME test' recei@ver.com
4905 if [ $? -eq 0 ]; then
4909 printf 'error: encrypt+sign failed\n'
4912 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4913 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4915 printf 'behave:s/mime:decrypt+verify: '
4916 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4918 -Ssmime-force-encryption \
4919 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4920 -Smta=./.tsendmail.sh \
4921 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4922 -Ssmime-sign -Sfrom=test@localhost \
4924 -f ./.ENCRYPT >>${ERR} 2>&1
4925 if [ $? -eq 0 ]; then
4934 /^Content-Description: /{ skip = 2; print; next }
4935 /^$/{ if(skip) --skip }
4938 < ./.DECRYPT > "${MBOX}"
4939 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4941 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4942 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4943 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1; then
4950 printf "behave
:s
/mime
:encrypt
: "
4951 echo bla | ${MAILX} ${ARGS} \
4952 -Ssmime-force-encryption \
4953 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4954 -Smta=./.tsendmail.sh \
4955 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4956 -Sfrom=test@localhost \
4957 -s 'S/MIME test' recei@ver.com
4958 if [ $? -eq 0 ]; then
4965 # Same as behave:s/mime:encrypt+sign:checksum above
4966 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4967 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4970 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4971 -Ssmime-force-encryption \
4972 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4973 -Smta=./.tsendmail.sh \
4974 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4975 -Sfrom=test@localhost \
4977 -f ./.ENCRYPT >>${ERR} 2>&1
4978 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4980 printf 'behave:s/mime:decrypt:disproof-1: '
4981 if openssl smime -decrypt -inkey ./.tkey.pem \
4982 -in ./.ENCRYPT >>${ERR} 2>&1; then
4993 # xxx Note: t_content() was the first test (series) written. Today many
4994 # xxx aspects are (better) covered by other tests above, some are not.
4995 # xxx At some future date and time, convert the last remains not covered
4996 # xxx elsewhere to a real t_behave_* test and drop t_content()
5000 # Test for [260e19d] (Juergen Daubert)
5002 echo body | ${MAILX} ${ARGS} "${MBOX}"
5003 check content
:004 0 "${MBOX}" '2917662811 98'
5005 # "Test for" [d6f316a] (Gavin Troy)
5007 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
5008 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5009 check content:006 0 "${MBOX}" '2099098650 122'
5010 check content:006-1 - "${BODY}" '794542938 174'
5012 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5015 for(i = 0; i < 10000; ++i)
5017 #printf "\xF0\x90\x87\x90"
5018 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5019 check content
:007 0 "${MBOX}" '534262374 61816'
5025 # MIME encoding (QP) stress message subject
5026 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5027 'adadaddsssssssddddddddddddddddddddd'\
5028 'ddddddddddddddddddddddddddddddddddd'\
5029 'ddddddddddddddddddddddddddddddddddd'\
5030 'dddddddddddddddddddd Hallelulja? Od'\
5031 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5032 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5033 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5034 'fffffffffffffffffffffffffffffffffff'\
5035 'fffffffffffffffffffff ggggggggggggg'\
5036 'ggggggggggggggggggggggggggggggggggg'\
5037 'ggggggggggggggggggggggggggggggggggg'\
5038 'ggggggggggggggggggggggggggggggggggg'\
5043 # MIME encoding (QP) stress message body
5045 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5046 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5047 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5048 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5049 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5050 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5051 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5052 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5053 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5054 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5055 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5056 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5057 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5058 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5059 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5060 "auf den zeilen vorher.\r\n"\
5061 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5063 "Die letzte Zeile war nur ein Punkt.\r\n"\
5065 "Das waren deren zwei.\r\n"\
5067 "Die letzte Zeile war ein Leerschritt.\n"\
5068 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5071 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5073 "Das waren deren zwei. ditto.\n"\
5075 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5076 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5077 "auf den zeilen vorher.\n"\
5079 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5080 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5082 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5084 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5086 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5088 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5090 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5092 "QP am Zeilenende über soft-nl hinweg\n"\
5093 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5095 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5097 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5099 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5101 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5103 "Die letzte Zeile war ein Leerschritt.\n"\
5108 # if have_feat devel; then
5109 # ARGS="${ARGS} -Smemdebug"
5113 if [ -n "${UTF8_LOCALE}" ]; then
5114 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5116 printf 'No Unicode locale found, disabling Unicode tests\n'
5124 # Test all configs TODO doesn't cover all *combinations*, stupid!
5128 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5129 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5130 NOTME["OPT_CROSS_BUILD"] = 1
5131 NOTME["OPT_AUTOCC"] = 1
5132 NOTME["OPT_AMALGAMATION"] = 1
5133 NOTME["OPT_DEBUG"] = 1
5134 NOTME["OPT_DEVEL"] = 1
5135 NOTME["OPT_ASAN_ADDRESS"] = 1
5136 NOTME["OPT_ASAN_MEMORY"] = 1
5137 NOTME["OPT_FORCED_STACKPROT"] = 1
5138 NOTME["OPT_NOMEMDBG"] = 1
5139 NOTME["OPT_NYD2"] = 1
5144 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5145 MULVALS["VAL_IDNA"] = 1
5147 #VALKEYS[0] = "VAL_RANDOM"
5148 VALVALS["VAL_RANDOM"] = 1
5151 /^[[:space:]]*OPT_/{
5152 sub(/^[[:space:]]*/, "")
5153 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5154 # does not seem to be a compliant escape for =
5156 $1 = substr($1, 1, index($1, "=") - 1)
5158 OPTVALS[OPTNO++] = $1
5161 /^[[:space:]]*VAL_/{
5162 sub(/^[[:space:]]*/, "")
5163 val = substr($0, index($0, "=") + 1)
5165 val = substr(val, 2)
5166 val = substr(val, 1, length(val) - 1)
5168 $1 = substr($1, 1, index($1, "=") - 1)
5171 else if(VALVALS[$1]){
5172 VALKEYS[VALNO++] = $1
5177 function onepass(addons){
5178 a_onepass__worker(addons, "1", "0")
5179 a_onepass__worker(addons, "0", "1")
5181 function a_onepass__worker(addons, b0, b1){
5182 # Doing this completely sequentially and not doing make distclean in
5183 # between runs should effectively result in lesser compilations.
5184 # It is completely dumb nonetheless... TODO
5185 for(ono = 0; ono < OPTNO; ++ono){
5187 for(i = 0; i < ono; ++i){
5188 myconf = myconf " " OPTVALS[i] "=" b0 " "
5190 j = MULCHOICE[OPTVALS[i]]
5195 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5199 for(i = ono; i < OPTNO; ++i){
5200 myconf = myconf " " OPTVALS[i] "=" b1 " "
5202 j = MULCHOICE[OPTVALS[i]]
5207 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5213 myconf = VALKEYS[i] "=any " myconf
5215 myconf = myconf " " ALWAYS " " addons
5220 i = split(MULVALS[mula], ia)
5224 print mula "=\"" j "\" " myconf
5230 # We cannot test NULL because of missing UI strings, which will end
5231 # up with different checksums
5232 print "CONFIG=NULLI OPT_AUTOCC=1"
5234 j = split(VALVALS[VALKEYS[i]], ia)
5238 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5241 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5242 print "CONFIG=NETSEND OPT_AUTOCC=1"
5243 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5245 j = split(VALVALS[VALKEYS[i]], ia)
5249 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5252 print "CONFIG=DEVEL OPT_AUTOCC=1"
5253 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5255 onepass("OPT_DEBUG=1")
5258 ' |
while read c
; do
5259 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5260 printf "\n\n##########\n$c\n"
5261 printf "\n\n##########\n$c\n" >&2
5262 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5263 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5264 printf 'Skipping after config, nothing changed\n'
5265 printf 'Skipping after config, nothing changed\n' >&2
5268 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5271 cd .. && ${MAKE} distclean
5274 [ -n "${ERR}" ] && echo > ${ERR}
5275 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5277 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5280 while [ ${#} -gt 0 ]; do
5286 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'