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<) -- ##
54 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
59 printf >&2 -- "${fmt}\\n" "${@}"
64 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
68 # Wed Oct 2 01:50:07 UTC 1996
69 SOURCE_DATE_EPOCH
=844221007
71 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
72 unset POSIXLY_CORRECT LOGNAME USER
75 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
76 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
80 CHECK_ONLY
= MAE_TEST
= MAILX
=
81 if [ "${1}" = --check-only ]; then
84 [ -x "${MAILX}" ] || usage
86 elif [ "${1}" = --mae-test ]; then
89 [ -x "${MAILX}" ] || usage
93 MAILX
="${MEMTESTER}${MAILX}"
96 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
97 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
98 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
99 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
100 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
102 \if [ "${ttycharset}" @i=% utf ]
107 \wysh set LC_ALL=${1}
109 \eval xcall cset_test "${@}"
113 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
114 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
116 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
119 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
120 UTF8_LOCALE
=`locale -a | { m=
123 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
126 ${grep} -e POSIX -e en_EN -e en_US; } >/dev/null 2>&1; then
139 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
140 trap "exit 1" HUP INT TERM
143 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
144 ${grep} +${1} ) >/dev
/null
2>&1
148 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
150 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
157 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
158 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
159 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
160 csum
="`${cksum} < ${f}`"
161 if [ "${csum}" = "${s}" ]; then
163 printf '%s: ok\n' "${tid}"
167 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
170 if [ -n "${MAE_TEST}" ]; then
171 x
=mae-test-
`echo ${tid} | ${tr} "/:=" "__-"`
172 ${cp} -f "${f}" ./"${x}"
174 if [ -n "${maex}" ] && [ -d ../.git ] &&
175 command -v diff >/dev/null 2>&1 &&
176 (git rev-parse --verify test-out) >/dev/null 2>&1 &&
177 git show test-out:"${x}" > ./"${x}".old 2>/dev/null; then
178 diff -ru ./"${x}".old ./"${x}" > "${x}".diff
185 printf '%s: error: %s\n' ${1} "${2}"
189 # $1=test name [$2=status]
191 [ ${#} -gt 1 ] && __qm__=${2}
192 if [ ${__qm__} -ne 0 ]; then
193 err $1 'unexpected non-0 exit status'
195 printf '%s: ok\n' "${1}"
200 # $1=test name [$2=status]
202 [ ${#} -gt 1 ] && __qm__=${2}
203 if [ ${__qm__} -eq 0 ]; then
204 err $1 'unexpected 0 exit status'
206 printf '%s: ok\n' "${1}"
210 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
212 echo "$
((${1} + ${2}))"
216 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
220 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
222 echo "$
((${1} % ${2}))"
226 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
231 # Basic (easily testable) behaviour tests
233 t_behave_X_opt_input_command_stack
237 t_behave_input_inject_semicolon_seq
238 t_behave_commandalias
242 t_behave_macro_param_shift
253 t_behave_record_a_resend
258 # FIXME t_behave_mlist
261 t_behave_message_injections
263 t_behave_compose_hooks
264 t_behave_C_opt_customhdr
266 t_behave_mass_recipients
267 t_behave_mime_types_load_control
268 t_behave_lreply_futh_rth_etc
270 t_behave_mime_if_not_ascii
271 t_behave_xxxheads_rfc2047
273 t_behave_iconv_mbyte_base64
274 t_behave_iconv_mainbody
275 t_behave_binary_mainbody
276 t_behave_q_t_etc_opts
281 t_behave_X_opt_input_command_stack() {
282 t_prolog t_behave_X_opt_input_command_stack
284 ${cat} <<- '__EOT' > "${BODY}"
292 echo "define mac1
{";\
293 echo " echo mac1-1 via1 \
$0";\
295 echo " echo mac1-2
";\
297 echo " echo mac1-3
";\
300 echo "define mac2
{";\
301 echo " echo mac2-1 via1 \
$0";\
303 echo " echo mac2-2
";\
309 echo echo 1-1-1 via1 \
$0;\
321 # The -X option supports multiline arguments, and those can internally use
322 # reverse solidus newline escaping. And all -X options are joined...
324 < "${BODY}" ${MAILX} ${ARGS} \
339 echo "define mac1 {";\
340 echo " echo mac1-1 via2 \$0";\
342 echo " echo mac1-2";\
344 echo " echo mac1-3";\
347 echo "define mac2 {";\
348 echo " echo mac2-1 via2 \$0";\
350 echo " echo mac2-2";\
356 echo echo 1-1-1 via2 \$0;\
370 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
375 t_behave_X_errexit
() {
376 t_prolog t_behave_X_errexit
377 if have_feat uistrings
; then :; else
378 echo 'behave:x_errexit: unsupported, skipped'
382 ${cat} <<- '__EOT' > "${BODY}"
388 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
389 -X'echo one' -X' echos nono ' -X'echo two' \
391 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
393 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
395 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
397 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
399 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
403 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
404 -X'echo one' -X' echos nono ' -X'echo two' \
406 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
408 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
410 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
412 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
414 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
416 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
418 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
420 ## Repeat 4-7 with ignerr set
422 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
424 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
425 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
427 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
429 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
431 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
433 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
435 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
437 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
439 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
444 t_behave_S_freeze() {
445 t_prolog t_behave_S_freeze
449 # Test basic assumption
450 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
451 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
453 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
456 ${cat} <<- '__EOT' > "${BODY}"
461 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
462 -Snoasksub -Sasksub -Snoasksub \
463 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
465 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
467 ${cat} <<- '__EOT' > "${BODY}"
472 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
473 -Snoasksub -Sasksub \
474 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
476 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
479 ${cat} <<- '__EOT' > "${BODY}"
480 echo dietcurd<$dietcurd>
482 echo dietcurd<$dietcurd>
484 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
485 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
486 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
487 -X'echo dietcurd<$dietcurd>' \
489 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
491 ${cat} <<- '__EOT' > "${BODY}"
492 echo dietcurd<$dietcurd>
494 echo dietcurd<$dietcurd>
496 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
497 -Sdietcurd=strawberry
-Snodietcurd \
498 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
499 -X'echo dietcurd<$dietcurd>' \
501 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
503 # TODO once we have a detached one with env=1..
504 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
505 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
507 ${cat} <<- '__EOT' > "${BODY}"
508 !echo "shell says TERM<$TERM>"
510 !echo "shell says TERM<$TERM>"
512 !echo "shell says TERM<$TERM>"
514 !echo "shell says TERM<$TERM>"
516 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
517 -STERM=strawberry
-SnoTERM -STERM=vanilla \
518 -X'echo mail<$TERM>' -X'unset TERM' \
519 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
521 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
523 ${cat} <<- '__EOT' > "${BODY}"
524 !echo "shell says TERM<$TERM>"
526 !echo "shell says TERM<$TERM>"
528 !echo "shell says TERM<$TERM>"
530 !echo "shell says TERM<$TERM>"
532 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
533 -STERM=strawberry
-SnoTERM \
534 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
535 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
537 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
545 t_prolog t_behave_wysh
547 ${cat} <<- '__EOT' > "${BODY}"
566 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
567 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
568 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
570 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
571 echo a$'\u0041\u41\u0C1\U00000041\U41'c
594 echo a$'b\U0000000'dt
595 echo a$'b\U00000000'du
605 if [ -z "${UTF8_LOCALE}" ]; then
606 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
608 < "${BODY}" DIET=CURD TIED= \
609 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
610 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
613 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
614 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
616 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
617 wysh set mager='\hey\'
619 wysh set mager="\hey\\"
621 wysh set mager=$'\hey\\'
624 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
629 t_behave_input_inject_semicolon_seq() {
630 t_prolog t_behave_input_inject_semicolon_seq
632 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
637 echon this_is_mymac;call mydeepmac;echon ';';
639 echon one';';call mymac;echon two";";call mymac;echo three$';';
641 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
643 echon one';';call mymac;echon two";";call mymac;echo three$';';
646 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
651 t_behave_commandalias() {
652 t_prolog t_behave_commandalias
654 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
655 commandalias echo echo hoho
659 commandalias XxX XxXx
660 commandalias XxXx XxXxX
661 commandalias XxXxX XxXxXx
662 commandalias XxXxXx echo huhu
663 commandalias XxXxXxX echo huhu
665 commandalias XxXxXx XxXxXxX
668 commandalias XxXxXx echo huhu
672 check behave:commandalias 0 "${MBOX}" '1638809585 36'
678 t_prolog t_behave_ifelse
680 # Nestable conditions test
681 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
703 if $dietcurd == 'yoho'
708 if $dietcurd @== 'Yoho'
713 if $dietcurd == 'Yoho'
718 if $dietcurd != 'yoho'
723 if $dietcurd @!= 'Yoho'
728 if $dietcurd != 'Yoho'
789 if $dietcurd == 'yohu'
791 elif $dietcurd == 'yoha'
793 elif $dietcurd == 'yohe'
795 elif $dietcurd == 'yoho'
797 if $dietcurd == 'yohu'
799 elif $dietcurd == 'yoha'
801 elif $dietcurd == 'yohe'
803 elif $dietcurd == 'yoho'
805 if $dietcurd == 'yohu'
807 elif $dietcurd == 'yoha'
809 elif $dietcurd == 'yohe'
811 elif $dietcurd == 'yoho'
960 set diet=abc curd=abc
966 set diet=abc curd=abcd
972 # 1. Shitty grouping capabilities as of today
973 unset diet curd ndefined
974 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
980 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
985 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
990 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
995 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1000 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1001 && [ no ] || [ yes ]
1006 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1011 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1016 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1021 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1026 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1031 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1036 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1041 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1046 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1051 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1057 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1063 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1068 # 2. Shitty grouping capabilities as of today
1069 unset diet curd ndefined
1070 if [ false || false || true ] && [ false || true ] && yes
1075 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1080 if [ 1 || 0 || 0 || 0 ]
1085 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1090 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1095 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1100 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1105 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1110 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1115 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1120 if 1 || 0 || 0 || 0 && 0
1125 if 1 || 0 || 0 || 0 && 1
1130 if 0 || 0 || 0 || 1 && 0
1135 if 0 || 0 || 0 || 1 && 1
1140 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1145 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1151 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1156 if $diet == 'yo' && $curd == 'ho' && $ndefined
1162 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1167 if $diet == 'yo' && $curd == 'ho' && $ndefined
1172 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1177 # Some more en-braced variables
1179 if ${diet} == ${curd}
1184 if ${diet} != ${curd}
1200 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1205 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1210 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1215 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1220 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1225 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1230 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1235 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1240 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1246 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1251 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1256 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1261 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1266 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1271 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1276 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1281 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1286 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1293 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1295 if have_feat regex; then
1296 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1298 if $dietcurd =~ '^yo.*'
1303 if $dietcurd =~ '^Yo.*'
1308 if $dietcurd @=~ '^Yo.*'
1313 if $dietcurd =~ '^yOho.+'
1318 if $dietcurd @!~ '.*Ho$'
1323 if $dietcurd !~ '.+yohO$'
1328 if [ $dietcurd @i!~ '.+yoho$' ]
1333 if ! [ $dietcurd @i=~ '.+yoho$' ]
1338 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1343 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1348 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1353 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1358 if ! ! ! $dietcurd !~ '.+yoho$'
1363 if ! ! ! $dietcurd =~ '.+yoho$'
1368 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1373 set diet=abc curd='^abc$'
1379 set diet=abc curd='^abcd$'
1387 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1389 printf 'behave:if-regex: unsupported, skipped\n'
1395 t_behave_localopts() {
1396 t_prolog t_behave_localopts
1398 # Nestable conditions test
1399 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1414 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1419 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1420 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1429 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1431 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1440 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1447 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1454 echo ----- $1: $2 -> $3 -> $4
1462 call llx
'call off' on on on
1463 call llx
'call off' off on on
1464 call llx
'call off' on off on
1465 call llx
'call off' on off off
1466 localopts call-fixate on
1467 call llx
'call-fixate on' on on on
1468 call llx
'call-fixate on' off on on
1469 call llx
'call-fixate on' on off on
1470 call llx
'call-fixate on' on off off
1471 unset x
;localopts call on
1472 call llx
'call on' on on on
1473 call llx
'call on' off on on
1474 call llx
'call on' on off on
1475 call llx
'call on' on off off
1480 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1486 t_prolog t_behave_local
1488 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1516 echo ------- global-1 du=$du
1518 echo ------- global-2 du=$du
1521 echo ------- global-3 du=$du
1523 echo ------- global-4 du=$du
1525 echo ------- global-5 du=$du
1528 check behave:local-1 0 "${MBOX}" '2411598140 641'
1533 t_behave_macro_param_shift() {
1534 t_prolog t_behave_macro_param_shift
1536 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1539 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1544 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1545 if [ $# > 1 ] || [ $ignerr == '' ]
1550 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1552 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1556 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1561 call t2 1 you get four args
1562 echo t1.1: $?';' ignerr ($ignerr) should not exist
1563 call t2 1 you get 'three args'
1564 echo t1.2: $?';' ignerr ($ignerr) should not exist
1565 call t2 1 you 'get two args'
1566 echo t1.3: $?';' ignerr ($ignerr) should not exist
1567 call t2 1 'you get one arg'
1568 echo t1.4: $?';' ignerr ($ignerr) should not exist
1569 ignerr call t2 '' 'you get one arg'
1570 echo t1.5: $?';' ignerr ($ignerr) should not exist
1575 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1580 t_behave_addrcodec() {
1581 t_prolog t_behave_addrcodec
1583 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1584 vput addrcodec res e
1 <doog@def
>
1585 echo $?
/$^ERRNAME
$res
1586 eval vput addrcodec res d
$res
1587 echo $?
/$^ERRNAME
$res
1588 vput addrcodec res e
2 .
<doog@def
>
1589 echo $?
/$^ERRNAME
$res
1590 eval vput addrcodec res d
$res
1591 echo $?
/$^ERRNAME
$res
1592 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1593 echo $?
/$^ERRNAME
$res
1594 eval vput addrcodec res d
$res
1595 echo $?
/$^ERRNAME
$res
1596 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1597 echo $?
/$^ERRNAME
$res
1598 eval vput addrcodec res d
$res
1599 echo $?
/$^ERRNAME
$res
1600 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1601 echo $?
/$^ERRNAME
$res
1602 eval vput addrcodec res d
$res
1603 echo $?
/$^ERRNAME
$res
1605 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1606 echo $?
/$^ERRNAME
$res
1607 eval vput addrcodec res d
$res
1608 echo $?
/$^ERRNAME
$res
1609 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1610 echo $?
/$^ERRNAME
$res
1611 eval vput addrcodec res d
$res
1612 echo $?
/$^ERRNAME
$res
1613 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1614 echo $?
/$^ERRNAME
$res
1615 eval vput addrcodec res d
$res
1616 echo $?
/$^ERRNAME
$res
1617 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1618 echo $?
/$^ERRNAME
$res
1619 eval vput addrcodec res d
$res
1620 echo $?
/$^ERRNAME
$res
1621 vput addrcodec res
+e
8 \
1622 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1623 echo $?
/$^ERRNAME
$res
1624 eval vput addrcodec res d
$res
1625 echo $?
/$^ERRNAME
$res
1626 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1627 echo $?
/$^ERRNAME
$res
1628 eval vput addrcodec res d
$res
1629 echo $?
/$^ERRNAME
$res
1630 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1631 echo $?
/$^ERRNAME
$res
1632 eval vput addrcodec res d
$res
1633 echo $?
/$^ERRNAME
$res
1634 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1635 echo $?
/$^ERRNAME
$res
1636 eval vput addrcodec res d
$res
1637 echo $?
/$^ERRNAME
$res
1638 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1639 echo $?
/$^ERRNAME
$res
1640 eval vput addrcodec res d
$res
1641 echo $?
/$^ERRNAME
$res
1642 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1643 echo $?
/$^ERRNAME
$res
1644 eval vput addrcodec res d
$res
1645 echo $?
/$^ERRNAME
$res
1646 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1647 echo $?
/$^ERRNAME
$res
1648 eval vput addrcodec res d
$res
1649 echo $?
/$^ERRNAME
$res
1650 vput addrcodec res
+e
15 \
1651 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1652 echo $?
/$^ERRNAME
$res
1653 eval vput addrcodec res d
$res
1654 echo $?
/$^ERRNAME
$res
1655 vput addrcodec res
+e
16 \
1656 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1657 echo $?
/$^ERRNAME
$res
1658 eval vput addrcodec res d
$res
1659 echo $?
/$^ERRNAME
$res
1660 vput addrcodec res
+e
17 \
1661 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1662 echo $?
/$^ERRNAME
$res
1663 eval vput addrcodec res d
$res
1664 echo $?
/$^ERRNAME
$res
1665 vput addrcodec res
+e
18 \
1666 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1667 echo $?
/$^ERRNAME
$res
1668 eval vput addrcodec res d
$res
1669 echo $?
/$^ERRNAME
$res
1670 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1671 echo $?
/$^ERRNAME
$res
1672 eval vput addrcodec res d
$res
1673 echo $?
/$^ERRNAME
$res
1675 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1676 echo $?
/$^ERRNAME
$res
1677 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1678 echo $?/$^ERRNAME $res
1679 eval vput addrcodec res d $res
1680 echo $?/$^ERRNAME $res
1682 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1683 echo $?/$^ERRNAME $res
1684 eval vput addrcodec res d $res
1685 echo $?/$^ERRNAME $res
1687 vput addrcodec res s \
1688 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1689 echo $?/$^ERRNAME $res
1691 # Fix for [f3852f88]
1692 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1693 echo $?/$^ERRNAME $res
1694 eval vput addrcodec res d $res
1695 echo $?/$^ERRNAME $res
1696 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1697 echo $?/$^ERRNAME $res
1698 eval vput addrcodec res d $res
1699 echo $?/$^ERRNAME $res
1702 check behave:addrcodec-1 0 "${MBOX}" '1047317989 2612'
1704 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1706 mlsubscribe isa2@list
1708 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1709 echo $?
/$^ERRNAME
$res
1710 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1711 echo $?
/$^ERRNAME
$res
1712 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1713 echo $?
/$^ERRNAME
$res
1714 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1715 echo $?
/$^ERRNAME
$res
1716 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1717 echo $?
/$^ERRNAME
$res
1718 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1719 echo $?
/$^ERRNAME
$res
1722 check behave
:addrcodec-2
0 "${MBOX}" '1391779299 104'
1724 if have_feat idna
; then
1725 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1726 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
1727 echo $?/$^ERRNAME $res
1728 eval vput addrcodec res d $res
1729 echo $?/$^ERRNAME $res
1730 vput addrcodec res e <du@blödiän> du
1731 echo $?/$^ERRNAME $res
1732 eval vput addrcodec res d $res
1733 echo $?/$^ERRNAME $res
1734 vput addrcodec res e du <du@blödiän>
1735 echo $?/$^ERRNAME $res
1736 eval vput addrcodec res d $res
1737 echo $?/$^ERRNAME $res
1738 vput addrcodec res e <du@blödiän>
1739 echo $?/$^ERRNAME $res
1740 eval vput addrcodec res d $res
1741 echo $?/$^ERRNAME $res
1742 vput addrcodec res e du@blödiän
1743 echo $?/$^ERRNAME $res
1744 eval vput addrcodec res d $res
1745 echo $?/$^ERRNAME $res
1748 check behave:addrcodec-idna 0 "${MBOX}" '498775983 326'
1750 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1757 t_prolog t_behave_vexpr
1759 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1761 vput vexpr res = 9223372036854775807
1762 echo $?/$^ERRNAME $res
1763 vput vexpr res = 9223372036854775808
1764 echo $?/$^ERRNAME $res
1765 vput vexpr res = u9223372036854775808
1766 echo $?/$^ERRNAME $res
1767 vput vexpr res @= 9223372036854775808
1768 echo $?/$^ERRNAME $res
1769 vput vexpr res = -9223372036854775808
1770 echo $?/$^ERRNAME $res
1771 vput vexpr res = -9223372036854775809
1772 echo $?/$^ERRNAME $res
1773 vput vexpr res @= -9223372036854775809
1774 echo $?/$^ERRNAME $res
1775 vput vexpr res = U9223372036854775809
1776 echo $?/$^ERRNAME $res
1779 0b0111111111111111111111111111111111111111111111111111111111111111
1780 echo $?/$^ERRNAME $res
1782 S0b1000000000000000000000000000000000000000000000000000000000000000
1783 echo $?/$^ERRNAME $res
1785 S0b1000000000000000000000000000000000000000000000000000000000000000
1786 echo $?/$^ERRNAME $res
1788 U0b1000000000000000000000000000000000000000000000000000000000000000
1789 echo $?/$^ERRNAME $res
1791 0b1000000000000000000000000000000000000000000000000000000000000000
1792 echo $?/$^ERRNAME $res
1794 0b1000000000000000000000000000000000000000000000000000000000000000
1795 echo $?/$^ERRNAME $res
1797 -0b1000000000000000000000000000000000000000000000000000000000000000
1798 echo $?/$^ERRNAME $res
1800 S0b1000000000000000000000000000000000000000000000000000000000000001
1801 echo $?/$^ERRNAME $res
1803 S0b1000000000000000000000000000000000000000000000000000000000000001
1804 echo $?/$^ERRNAME $res
1806 -0b1000000000000000000000000000000000000000000000000000000000000001
1807 echo $?/$^ERRNAME $res
1809 U0b1000000000000000000000000000000000000000000000000000000000000001
1810 echo $?/$^ERRNAME $res
1812 vput vexpr res = 0777777777777777777777
1813 echo $?/$^ERRNAME $res
1814 vput vexpr res = S01000000000000000000000
1815 echo $?/$^ERRNAME $res
1816 vput vexpr res @= S01000000000000000000000
1817 echo $?/$^ERRNAME $res
1818 vput vexpr res = U01000000000000000000000
1819 echo $?/$^ERRNAME $res
1820 vput vexpr res = 01000000000000000000000
1821 echo $?/$^ERRNAME $res
1822 vput vexpr res @= 01000000000000000000000
1823 echo $?/$^ERRNAME $res
1824 vput vexpr res = -01000000000000000000000
1825 echo $?/$^ERRNAME $res
1826 vput vexpr res = S01000000000000000000001
1827 echo $?/$^ERRNAME $res
1828 vput vexpr res @= S01000000000000000000001
1829 echo $?/$^ERRNAME $res
1830 vput vexpr res @= -01000000000000000000001
1831 echo $?/$^ERRNAME $res
1832 vput vexpr res = U01000000000000000000001
1833 echo $?/$^ERRNAME $res
1835 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1836 echo $?/$^ERRNAME $res
1837 vput vexpr res = S0x8000000000000000
1838 echo $?/$^ERRNAME $res
1839 vput vexpr res @= S0x8000000000000000
1840 echo $?/$^ERRNAME $res
1841 vput vexpr res = U0x8000000000000000
1842 echo $?/$^ERRNAME $res
1843 vput vexpr res = 0x8000000000000000
1844 echo $?/$^ERRNAME $res
1845 vput vexpr res @= 0x8000000000000000
1846 echo $?/$^ERRNAME $res
1847 vput vexpr res = -0x8000000000000000
1848 echo $?/$^ERRNAME $res
1849 vput vexpr res = S0x8000000000000001
1850 echo $?/$^ERRNAME $res
1851 vput vexpr res @= S0x8000000000000001
1852 echo $?/$^ERRNAME $res
1853 vput vexpr res @= -0x8000000000000001
1854 echo $?/$^ERRNAME $res
1855 vput vexpr res = u0x8000000000000001
1856 echo $?/$^ERRNAME $res
1859 echo $?/$^ERRNAME $res
1861 echo $?/$^ERRNAME $res
1863 echo $?/$^ERRNAME $res
1865 vput vexpr res + 0 0
1866 echo $?/$^ERRNAME $res
1867 vput vexpr res + 0 1
1868 echo $?/$^ERRNAME $res
1869 vput vexpr res + 1 1
1870 echo $?/$^ERRNAME $res
1872 vput vexpr res + 9223372036854775807 0
1873 echo $?/$^ERRNAME $res
1874 vput vexpr res + 9223372036854775807 1
1875 echo $?/$^ERRNAME $res
1876 vput vexpr res @+ 9223372036854775807 1
1877 echo $?/$^ERRNAME $res
1878 vput vexpr res + 0 9223372036854775807
1879 echo $?/$^ERRNAME $res
1880 vput vexpr res + 1 9223372036854775807
1881 echo $?/$^ERRNAME $res
1882 vput vexpr res @+ 1 9223372036854775807
1883 echo $?/$^ERRNAME $res
1885 vput vexpr res + -9223372036854775808 0
1886 echo $?/$^ERRNAME $res
1887 vput vexpr res + -9223372036854775808 -1
1888 echo $?/$^ERRNAME $res
1889 vput vexpr res @+ -9223372036854775808 -1
1890 echo $?/$^ERRNAME $res
1891 vput vexpr res + 0 -9223372036854775808
1892 echo $?/$^ERRNAME $res
1893 vput vexpr res + -1 -9223372036854775808
1894 echo $?/$^ERRNAME $res
1895 vput vexpr res @+ -1 -9223372036854775808
1896 echo $?/$^ERRNAME $res
1898 vput vexpr res - 0 0
1899 echo $?/$^ERRNAME $res
1900 vput vexpr res - 0 1
1901 echo $?/$^ERRNAME $res
1902 vput vexpr res - 1 1
1903 echo $?/$^ERRNAME $res
1905 vput vexpr res - 9223372036854775807 0
1906 echo $?/$^ERRNAME $res
1907 vput vexpr res - 9223372036854775807 -1
1908 echo $?/$^ERRNAME $res
1909 vput vexpr res @- 9223372036854775807 -1
1910 echo $?/$^ERRNAME $res
1911 vput vexpr res - 0 9223372036854775807
1912 echo $?/$^ERRNAME $res
1913 vput vexpr res - -1 9223372036854775807
1914 echo $?/$^ERRNAME $res
1915 vput vexpr res - -2 9223372036854775807
1916 echo $?/$^ERRNAME $res
1917 vput vexpr res @- -2 9223372036854775807
1918 echo $?/$^ERRNAME $res
1920 vput vexpr res - -9223372036854775808 +0
1921 echo $?/$^ERRNAME $res
1922 vput vexpr res - -9223372036854775808 +1
1923 echo $?/$^ERRNAME $res
1924 vput vexpr res @- -9223372036854775808 +1
1925 echo $?/$^ERRNAME $res
1926 vput vexpr res - 0 -9223372036854775808
1927 echo $?/$^ERRNAME $res
1928 vput vexpr res - +1 -9223372036854775808
1929 echo $?/$^ERRNAME $res
1930 vput vexpr res @- +1 -9223372036854775808
1931 echo $?/$^ERRNAME $res
1933 vput vexpr res + -13 -2
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res - 0 0
1936 echo $?/$^ERRNAME $res
1937 vput vexpr res - 0 1
1938 echo $?/$^ERRNAME $res
1939 vput vexpr res - 1 1
1940 echo $?/$^ERRNAME $res
1941 vput vexpr res - -13 -2
1942 echo $?/$^ERRNAME $res
1944 vput vexpr res * 0 0
1945 echo $?/$^ERRNAME $res
1946 vput vexpr res * 0 1
1947 echo $?/$^ERRNAME $res
1948 vput vexpr res * 1 1
1949 echo $?/$^ERRNAME $res
1950 vput vexpr res * -13 -2
1951 echo $?/$^ERRNAME $res
1953 vput vexpr res / 0 0
1954 echo $?/$^ERRNAME $res
1955 vput vexpr res / 0 1
1956 echo $?/$^ERRNAME $res
1957 vput vexpr res / 1 1
1958 echo $?/$^ERRNAME $res
1959 vput vexpr res / -13 -2
1960 echo $?/$^ERRNAME $res
1962 vput vexpr res % 0 0
1963 echo $?/$^ERRNAME $res
1964 vput vexpr res % 0 1
1965 echo $?/$^ERRNAME $res
1966 vput vexpr res % 1 1
1967 echo $?/$^ERRNAME $res
1968 vput vexpr res % -13 -2
1969 echo $?/$^ERRNAME $res
1972 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
1974 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1975 vput vexpr res
find 'bananarama' 'nana'
1976 echo $?
/$^ERRNAME
:$res:
1977 vput vexpr res
find 'bananarama' 'bana'
1978 echo $?
/$^ERRNAME
:$res:
1979 vput vexpr res
find 'bananarama' 'Bana'
1980 echo $?
/$^ERRNAME
:$res:
1981 vput vexpr res
find 'bananarama' 'rama'
1982 echo $?
/$^ERRNAME
:$res:
1984 vput vexpr res ifind
'bananarama' 'nana'
1985 echo $?
/$^ERRNAME
:$res:
1986 vput vexpr res ifind
'bananarama' 'bana'
1987 echo $?
/$^ERRNAME
:$res:
1988 vput vexpr res ifind
'bananarama' 'Bana'
1989 echo $?
/$^ERRNAME
:$res:
1990 vput vexpr res ifind
'bananarama' 'rama'
1991 echo $?
/$^ERRNAME
:$res:
1993 vput vexpr res substring
'bananarama' 1
1994 echo $?
/$^ERRNAME
:$res:
1995 vput vexpr res substring
'bananarama' 3
1996 echo $?
/$^ERRNAME
:$res:
1997 vput vexpr res substring
'bananarama' 5
1998 echo $?
/$^ERRNAME
:$res:
1999 vput vexpr res substring
'bananarama' 7
2000 echo $?
/$^ERRNAME
:$res:
2001 vput vexpr res substring
'bananarama' 9
2002 echo $?
/$^ERRNAME
:$res:
2003 vput vexpr res substring
'bananarama' 10
2004 echo $?
/$^ERRNAME
:$res:
2005 vput vexpr res substring
'bananarama' 1 3
2006 echo $?
/$^ERRNAME
:$res:
2007 vput vexpr res substring
'bananarama' 3 3
2008 echo $?
/$^ERRNAME
:$res:
2009 vput vexpr res substring
'bananarama' 5 3
2010 echo $?
/$^ERRNAME
:$res:
2011 vput vexpr res substring
'bananarama' 7 3
2012 echo $?
/$^ERRNAME
:$res:
2013 vput vexpr res substring
'bananarama' 9 3
2014 echo $?
/$^ERRNAME
:$res:
2015 vput vexpr res substring
'bananarama' 10 3
2016 echo $?
/$^ERRNAME
:$res:
2018 vput vexpr res substring
'bananarama' -1
2019 echo $?
/$^ERRNAME
:$res:
2020 vput vexpr res substring
'bananarama' -3
2021 echo $?
/$^ERRNAME
:$res:
2022 vput vexpr res substring
'bananarama' -5
2023 echo $?
/$^ERRNAME
:$res:
2024 vput vexpr res substring
'bananarama' -7
2025 echo $?
/$^ERRNAME
:$res:
2026 vput vexpr res substring
'bananarama' -9
2027 echo $?
/$^ERRNAME
:$res:
2028 vput vexpr res substring
'bananarama' -10
2029 echo $?
/$^ERRNAME
:$res:
2030 vput vexpr res substring
'bananarama' 1 -3
2031 echo $?
/$^ERRNAME
:$res:
2032 vput vexpr res substring
'bananarama' 3 -3
2033 echo $?
/$^ERRNAME
:$res:
2034 vput vexpr res substring
'bananarama' 5 -3
2035 echo $?
/$^ERRNAME
:$res:
2036 vput vexpr res substring
'bananarama' 7 -3
2037 echo $?
/$^ERRNAME
:$res:
2038 vput vexpr res substring
'bananarama' 9 -3
2039 echo $?
/$^ERRNAME
:$res:
2040 vput vexpr res substring
'bananarama' 10 -3
2041 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res trim
'Cocoon Cocoon'
2044 echo $?
/$^ERRNAME
:$res:
2045 vput vexpr res trim
' Cocoon Cocoon '
2046 echo $?
/$^ERRNAME
:$res:
2047 vput vexpr res trim-front
'Cocoon Cocoon'
2048 echo $?
/$^ERRNAME
:$res:
2049 vput vexpr res trim-front
' Cocoon Cocoon '
2050 echo $?
/$^ERRNAME
:$res:
2051 vput vexpr res trim-end
'Cocoon Cocoon'
2052 echo $?
/$^ERRNAME
:$res:
2053 vput vexpr res trim-end
' Cocoon Cocoon '
2054 echo $?
/$^ERRNAME
:$res:
2057 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2059 if have_feat regex
; then
2060 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2061 vput vexpr res regex 'bananarama' 'nana'
2062 echo $?/$^ERRNAME :$res:
2063 vput vexpr res regex 'bananarama' 'bana'
2064 echo $?/$^ERRNAME :$res:
2065 vput vexpr res regex 'bananarama' 'Bana'
2066 echo $?/$^ERRNAME :$res:
2067 vput vexpr res regex 'bananarama' 'rama'
2068 echo $?/$^ERRNAME :$res:
2070 vput vexpr res iregex 'bananarama' 'nana'
2071 echo $?/$^ERRNAME :$res:
2072 vput vexpr res iregex 'bananarama' 'bana'
2073 echo $?/$^ERRNAME :$res:
2074 vput vexpr res iregex 'bananarama' 'Bana'
2075 echo $?/$^ERRNAME :$res:
2076 vput vexpr res iregex 'bananarama' 'rama'
2077 echo $?/$^ERRNAME :$res:
2079 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2080 echo $?/$^ERRNAME :$res:
2081 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2082 echo $?/$^ERRNAME :$res:
2083 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2084 echo $?/$^ERRNAME :$res:
2085 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2086 echo $?/$^ERRNAME :$res:
2088 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2089 echo $?/$^ERRNAME :$res:
2090 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2091 echo $?/$^ERRNAME :$res:
2092 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2093 echo $?/$^ERRNAME :$res:
2094 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2095 echo $?/$^ERRNAME :$res:
2099 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2101 printf 'behave:vexpr-regex: unsupported, skipped\n'
2107 t_behave_call_ret() {
2108 t_prolog t_behave_call_ret
2110 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2115 vput vexpr j
'&' $i 7
2121 vput vexpr j
'&' $i 7
2127 echo ! The end
for $1
2131 # Transport $?/$! up the call chain
2137 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2141 echo ! The end
for $1
2142 return $i $^ERR-BUSY
2146 # Up and down it goes
2153 vput vexpr k
- $1 $2
2157 echo "# <$i/$j> .. "
2161 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2164 echo ! The end
for $1=$i/$2
2168 return $i $^ERR-BUSY
2174 call w1
0; echo ?
=$?
!=$
!; echo -----;
2175 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2176 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2179 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2185 t_prolog t_behave_xcall
2187 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2192 vput vexpr j '&' $i 7
2198 echo ! The end for $1/$2
2200 return $i $^ERR-BUSY
2211 echo ?=$? !=$^ERRNAME
2214 echo ?=$? !=$^ERRNAME
2216 echo ?=$? !=$^ERRNAME
2219 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2223 if have_feat uistrings; then
2224 ${cat} <<- '__EOT' > "${BODY}"
2229 vput vexpr j '&' $i 7
2235 echo ! The end for $1
2238 echo would be err with errexit
2247 echo zwei, ?=$? !=$!
2248 localopts yes; set errexit
2250 echo drei, ?=$? !=$^ERRNAME
2252 echo vier, ?=$? !=$^ERRNAME, this is an error
2255 echo outer 1, ?=$? !=$^ERRNAME
2257 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2259 echo outer 3, ?=$? !=$^ERRNAME
2260 echo this is definitely an error
2263 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2264 -Snomemdebug > "${MBOX}" 2>&1
2265 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2267 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2268 -Snomemdebug > "${MBOX}" 2>&1
2269 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2271 echo 'behave:xcall-2: unsupported, skipped'
2272 echo 'behave:xcall-3: unsupported, skipped'
2278 t_behave_vpospar() {
2279 t_prolog t_behave_vpospar
2281 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2282 vpospar
set hey
, "'you ", world
!
2283 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2284 vput vpospar x quote
; echo x
<$x>
2285 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2286 vput vpospar y quote
;echo y
<$y>
2287 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2288 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2289 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2292 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2293 vput vpospar z quote
;echo infun2
:z
<$z>
2297 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2298 vput vpospar y quote
;echo infun
:y
<$y>
2299 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2300 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2302 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2303 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2306 call infun This
"in a" fun
2307 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2308 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2310 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2313 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2315 echo ifs<$ifs> ifs-ws<$ifs-ws>
2316 vpospar set hey, "'you ", world!
2317 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2318 vput vpospar x quote; echo x<$x>
2319 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2320 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2323 echo ifs<$ifs> ifs-ws<$ifs-ws>
2324 vpospar set hey, "'you
", world!
2325 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2327 vput vpospar x quote; echo x<$x>
2328 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2329 eval vpospar set ${x};\
2330 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2333 echo ifs<$ifs> ifs-ws<$ifs-ws>
2334 vpospar set hey, "'you ", world!
2335 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2337 vput vpospar x quote; echo x<$x>
2338 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2339 eval vpospar set ${x};\
2340 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2342 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2347 t_behave_atxplode() {
2348 t_prolog t_behave_atxplode
2349 TRAP_EXIT_ADDONS="./.t*"
2351 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2354 printf " (1/$#: <$1>)"
2356 if [ $# -gt 0 ]; then
2370 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2371 printf xxx;xxx arg ,b u.
2372 printf xxx;xxx arg , .
2373 printf xxx;xxx arg ,ball.
2379 echon " (1/$#: <$1>)"
2394 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2395 echon xxx;call xxx arg ,b u.
2396 echon xxx;call xxx arg , .
2397 echon xxx;call xxx arg ,ball.
2400 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2401 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2403 #${SHELL} ./.t.sh > ./.tshout 2>&1
2404 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2410 t_prolog t_behave_read
2411 TRAP_EXIT_ADDONS="./.t*"
2413 ${cat} <<- '__EOT
' > .tin
2414 hey1, "'you
", world!
2415 hey2, "'you ", bugs bunny!
2420 ${cat} <<- '__EOT
' |\
2421 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2423 echo $?/$^ERRNAME / <$a><$b><$c>
2425 echo $?/$^ERRNAME / <$a><$b><$c>
2427 echo $?/$^ERRNAME / <$a><$b><$c>
2429 echo $?/$^ERRNAME / <$a><$b><$c>
2430 unset a b c;read a b c
2431 echo $?/$^ERRNAME / <$a><$b><$c>
2432 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2434 check behave:read-1 0 "${MBOX}" '1527910147 173'
2436 ${cat} <<- '__EOT
' > .tin2
2437 hey2.0,:"'you
",:world!:mars.:
2438 hey2.1,:"'you ",:world!
2439 hey2.2,:"'you
",:bugs bunny!
2445 ${cat} <<- '__EOT' |\
2446 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2449 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2451 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2453 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2455 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2457 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2459 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2460 unset a b c
;read a b c
2461 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2463 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2464 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2466 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2468 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2470 readall d; echo $?/$^ERRNAME / <$d>
2471 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2472 readctl create .tin2
2473 readall d; echo $?/$^ERRNAME / <$d>
2474 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2475 readctl remove .tin;echo $?/$^ERRNAME;\
2476 readctl remove .tin2;echo $?/$^ERRNAME
2477 echo '### now with empty lines'
2478 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2479 readctl create .temptynl;echo $?/$^ERRNAME
2480 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2481 readctl remove .temptynl;echo $?/$^ERRNAME
2483 check readall 0 "${MBOX}" '4113506527 405'
2489 t_prolog t_behave_mbox
2490 TRAP_EXIT_ADDONS=".
/.t
*"
2494 while [ ${i} -lt 113 ]; do
2495 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2496 "${MBOX}" "${i}" "${i}"
2499 ) | ${MAILX} ${ARGS} > .tall 2>&1
2500 check behave:mbox-1 0 "${MBOX}" '1872102723 13784'
2501 check behave:mbox-1-outerr - ./.tall '4294967295 0' # empty file
2503 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2504 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2505 check behave:mbox-2 0 .tall '3498373999 9103'
2507 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2508 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2509 check behave
:mbox-3
0 .tall
'381610797 9110'
2511 # copy only the odd (but the first), move the even
2513 printf 'File "file://%s"\ncopy ' .tmbox2
2515 while [ ${i} -lt 113 ]; do
2519 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2520 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2521 check behave
:mbox-4
0 .tmbox3
'4145104131 6890'
2522 check behave
:mbox-5
- .tall
'361127721 4573'
2525 printf 'file "file://%s"\nmove ' .tmbox2
2527 while [ ${i} -lt 113 ]; do
2531 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2532 .tmbox3 .tmbox3 .tmbox2
2533 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2534 check behave
:mbox-6
0 .tmbox3
'3249991493 13784'
2535 if have_feat uistrings
; then
2536 ${sed} 2d
< .tall
> .tallx
2540 check behave
:mbox-7
- .tallx
'1584413080 13645'
2542 # Invalid MBOXes (after [f4db93b3])
2544 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2545 check behave:mbox-8 0 .tinvmbox '896415941 122'
2546 check behave:mbox-9 - ./.tall '3146754194 33'
2548 echo ' ' > .tinvmbox
2549 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2550 check behave
:mbox-10
0 .tinvmbox
'4011310616 124'
2551 check behave
:mbox-11
- .
/.tall
'3146754194 33'
2553 { echo; echo; } > .tinvmbox
# (not invalid)
2554 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2555 check behave:mbox-12 0 .tinvmbox '287409579 123'
2556 check behave:mbox-13 - ./.tall '3146754194 33'
2558 # *mbox-rfc4155*, plus
2559 ${cat} <<-_EOT > ./.tinv1
2562 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2563 Date: Wed, 02 Oct 1996 01:50:07 +0000
2565 Subject: Bad bad message 1
2567 From me to you, blinde Kuh!
2569 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2570 Date: Wed, 02 Oct 1996 01:50:07 +0000
2572 Subject: Bad bad message 2
2574 From me to you, blindes Kalb!
2576 ${cp} ./.tinv1 ./.tinv2
2580 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2581 \\eval copy * "${2}"
2583 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2584 ex0_test behave:mbox-14-estat
2585 ${cat} ./.tinv1 ./.tok >> .tall
2586 check behave:mbox-14 - ./.tall '739301109 616'
2589 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2590 wysh File ./.tok # Just move away to nowhere
2592 wysh file ./.tinv2 # Fully repaired
2593 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2594 ex0_test behave:mbox-15-estat
2595 check behave:mbox-15-1 - ./.tinv1 '3178048820 332'
2596 check behave:mbox-15-2 - ./.tinv2 '4151504442 314'
2601 t_behave_maildir() {
2602 t_prolog t_behave_maildir
2603 TRAP_EXIT_ADDONS=".
/.t
*"
2607 while [ ${i} -lt 112 ]; do
2608 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2609 "${MBOX}" "${i}" "${i}"
2612 ) | ${MAILX} ${ARGS}
2613 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2619 ' "${MBOX}" .tmdir1 .tmdir1 |
2620 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2621 check behave:maildir-2 0 .tlst '1797938753 9103'
2624 copy * "maildir
://%s
"
2627 ' "${MBOX}" .tmdir2 .tmdir2 |
2628 ${MAILX} ${ARGS} -Sshowlast > .tlst
2629 check behave:maildir-3 0 .tlst '1155631089 9113'
2631 printf 'File "maildir
://%s
"
2635 ' .tmdir2 .tmbox1 .tmbox1 |
2636 ${MAILX} ${ARGS} -Sshowlast > .tlst
2637 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2638 check behave:maildir-5 - .tlst '3701297796 9110'
2640 # only the odd (even)
2642 printf 'File "maildir
://%s
"
2645 while [ ${i} -lt 112 ]; do
2647 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2654 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2655 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2656 check behave:maildir-7 - .tlst '960096773 4573'
2659 printf 'file "maildir
://%s
"
2662 while [ ${i} -lt 112 ]; do
2664 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2672 ' .tmbox2 .tmbox2 .tmdir2
2673 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2674 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2675 ${sed} 2d
< .tlst
> .tlstx
2676 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2681 t_behave_record_a_resend
() {
2682 t_prolog t_behave_record_a_resend
2683 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2687 m %s\n~s Subject 1.\nHello.\n~.
2688 set record-files add-file-recipients
2689 m %s\n~s Subject 2.\nHello.\n~.
2691 resend 2 ./.t.resent
2692 Resend 1 ./.t.resent
2694 resend 2 ./.t.resent
2695 Resend 1 ./.t.resent
2696 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2699 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2700 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2701 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2706 t_behave_e_H_L_opts
() {
2707 t_prolog t_behave_e_H_L_opts
2708 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2711 ${MAILX} ${ARGS} -ef .
/.t.mbox
2712 echo ${?} > "${MBOX}"
2714 ${cat} <<-_EOT > ./.tsendmail.sh
2716 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2719 chmod 0755 .
/.tsendmail.sh
2720 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2721 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2722 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2723 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2725 ${MAILX} ${ARGS} -ef .
/.t.mbox
2726 echo ${?} >> "${MBOX}"
2727 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2728 echo ${?} >> "${MBOX}"
2729 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2730 echo ${?} >> "${MBOX}"
2731 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2732 echo ${?} >> "${MBOX}"
2733 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2734 echo ${?} >> "${MBOX}"
2735 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2736 echo ${?} >> "${MBOX}"
2737 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2738 echo ${?} >> "${MBOX}"
2740 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2741 echo ${?} >> "${MBOX}"
2742 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2743 echo ${?} >> "${MBOX}"
2744 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2745 echo ${?} >> "${MBOX}"
2746 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2747 echo ${?} >> "${MBOX}"
2748 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2749 echo ${?} >> "${MBOX}"
2750 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2751 echo ${?} >> "${MBOX}"
2752 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2753 echo ${?} >> "${MBOX}"
2755 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2760 t_behave_alternates
() {
2761 t_prolog t_behave_alternates
2762 TRAP_EXIT_ADDONS
="./.t*"
2764 ${cat} <<-_EOT > ./.tsendmail.sh
2766 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2769 chmod 0755 .
/.tsendmail.sh
2771 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2775 alternates a1@b1 a2@b2 a3@b3
2780 echo $?
/$^ERRNAME
<$rv>
2785 echo $?
/$^ERRNAME
<$rv>
2788 echo $?
/$^ERRNAME
<$rv>
2791 echo $?
/$^ERRNAME
<$rv>
2795 alternates a1@b1 a2@b2 a3@b3
2798 echo $?
/$^ERRNAME
<$rv>
2801 echo $?
/$^ERRNAME
<$rv>
2804 echo $?
/$^ERRNAME
<$rv>
2807 alternates a1@b1 a2@b2 a3@b3
2810 echo $?
/$^ERRNAME
<$rv>
2813 echo $?
/$^ERRNAME
<$rv>
2816 echo $?
/$^ERRNAME
<$rv>
2820 alternates a1@b1 a2@b2 a3@b3
2823 echo $?
/$^ERRNAME
<$rv>
2827 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2829 ~s all alternates
, only a1@b1 remains
2831 ~b a3@b3 a3@c3 a3@d3
2840 alternates a1@b1 a1@c1 a2@b2 a3@b3
2842 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2844 ~b a3@b3 a3@c3 a3@d3
2851 alternates a1@b1 a2@b2 a3
; set allnet
2853 ~s all alternates via allnet
, only a1@b1 remains
2855 ~b a3@b3 a3@c3 a3@d3
2866 echo $?
/$^ERRNAME
<$rv>
2870 echo $?
/$^ERRNAME
<$rv>
2874 echo $?
/$^ERRNAME
<$rv>
2878 echo $?
/$^ERRNAME
<$rv>
2882 echo $?
/$^ERRNAME
<$rv>
2886 alternates a1@b1 a2@b2
2889 echo $?
/$^ERRNAME
<$rv>
2890 alternates a3@b3 a4@b4
2893 echo $?
/$^ERRNAME
<$rv>
2896 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2897 if have_feat uistrings
; then
2898 check behave
:alternates-2
- .tall
'1878598364 505'
2900 echo 'behave:alternates-2: unsupported, skipped'
2907 t_prolog t_behave_alias
2908 TRAP_EXIT_ADDONS
="./.t*"
2910 ${cat} <<-_EOT > ./.tsendmail.sh
2912 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2915 chmod 0755 .
/.tsendmail.sh
2917 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2919 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2921 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2923 alias a4 a5 ex1@a4.ple
2925 alias a6 a7 ex1@a6.ple
2939 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2940 check behave
:alias-2
- .tall
'3548953204 152'
2942 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2943 # TODO need to somehow provide its contents to the test, then test
2948 t_behave_filetype
() {
2949 t_prolog t_behave_filetype
2950 TRAP_EXIT_ADDONS
="./.t*"
2952 ${cat} <<-_EOT > ./.tsendmail.sh
2954 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2957 chmod 0755 .
/.tsendmail.sh
2959 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2960 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2961 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2963 if (echo | gzip -c) >/dev/null 2>&1; then
2966 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2967 "${MBOX}" | ${MAILX} ${ARGS} \
2968 -X'filetype gz gzip\ -dc gzip\ -c'
2969 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2970 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2972 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2973 check behave
:filetype-3
- "./.t.out" '2392348396 102'
2975 echo 'behave:filetype-2: unsupported, skipped'
2976 echo 'behave:filetype-3: unsupported, skipped'
2981 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2987 -X'filetype gz gzip\ -dc gzip\ -c' \
2988 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2989 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2990 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2992 -X'filetype gz gzip\ -dc gzip\ -c' \
2993 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2995 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2996 check behave
:filetype-5
- "./.t.out" '852335377 172'
3001 t_behave_message_injections
() {
3002 t_prolog t_behave_message_injections
3003 TRAP_EXIT_ADDONS
="./.t*"
3005 ${cat} <<-_EOT > ./.tsendmail.sh
3007 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3010 chmod 0755 .
/.tsendmail.sh
3012 echo mysig
> .
/.tmysig
3014 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3015 -Smessage-inject-head=head-inject \
3016 -Smessage-inject-tail=tail-inject \
3017 -Ssignature=.
/.tmysig \
3018 ex@am.ple
> .
/.tall
2>&1
3019 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3020 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3022 ${cat} <<-_EOT > ./.template
3026 Subject: This subject is
3028 Body, body, body me.
3030 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3031 -Smessage-inject-head=head-inject \
3032 -Smessage-inject-tail=tail-inject \
3033 -Ssignature=.
/.tmysig \
3035 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3036 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3041 t_behave_attachments
() {
3042 t_prolog t_behave_attachments
3043 TRAP_EXIT_ADDONS
="./.t*"
3045 ${cat} <<-_EOT > ./.tsendmail.sh
3047 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3050 chmod 0755 .
/.tsendmail.sh
3052 ${cat} <<-_EOT > ./.tx
3053 From steffen Sun Feb 18 02:48:40 2018
3054 Date: Sun, 18 Feb 2018 02:48:40 +0100
3057 User-Agent: s-nail v14.9.7
3060 From steffen Sun Feb 18 02:48:42 2018
3061 Date: Sun, 18 Feb 2018 02:48:42 +0100
3064 User-Agent: s-nail v14.9.7
3069 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3070 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3071 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3074 '!@ ./.t3 "./.t 4" ""
3082 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
3083 -a .
/.t1
-a './.t 2' \
3084 -s attachment-test \
3085 ex@am.ple
> .
/.tall
2>&1
3086 check behave
:attachments-1
0 "${MBOX}" '4107062253 634'
3087 if have_feat uistrings
; then
3088 check behave
:attachments-2
- .tall
'1928331872 720'
3090 echo 'behave:attachments-2: unsupported, skipped'
3096 !s This the subject is
3097 !@ ./.t3 "#2" "./.t 4" "#1" ""
3107 !@ ./.t3 "#2" "./.t 4" "#1" ""
3115 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3124 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3138 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Rf .
/.tx \
3140 check behave
:attachments-3
0 "${MBOX}" '798122412 2285'
3141 if have_feat uistrings
; then
3142 check behave
:attachments-4
- .tall
'2526106274 1910'
3144 echo 'behave:attachments-4: unsupported, skipped'
3150 t_behave_compose_hooks
() { # TODO monster
3151 t_prolog t_behave_compose_hooks
3152 if have_feat uistrings
; then :; else
3153 echo 'behave:compose_hooks: unsupported, skipped'
3156 TRAP_EXIT_ADDONS
="./.t*"
3158 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3159 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3161 ${cat} <<-_EOT > ./.tsendmail.sh
3163 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3166 chmod 0755 .
/.tsendmail.sh
3168 ${cat} <<'__EOT__' > ./.trc
3170 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3173 vput vexpr es substr "$1" 0 1
3178 define read_mline_res {
3179 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3180 echo $len/$es/$^ERRNAME: $hl
3181 if [ $es -ne $^ERR-NONE ]
3182 xcall bail read_mline_res
3184 \xcall read_mline_res
3189 echo "~^header list"; read hl; echo $hl;\
3190 call xerr "$hl" "in_addr ($xh) 0-1"
3192 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3193 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3194 echo "~^header insert $xh <${xh}2@exam.ple>";\
3195 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3196 echo "~^header insert $xh ${xh}3@exam.ple";\
3197 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3198 echo "~^header list $xh"; read hl; echo $hl;\
3199 call xerr "$hl" "ins_addr $xh 1-4"
3200 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3203 if [ "$t_remove" == "" ]
3207 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3208 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3210 xcall bail "ins_addr $xh 2-2"
3212 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3214 xcall bail "ins_addr $xh 2-3"
3216 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3218 xcall bail "ins_addr $xh 2-4"
3222 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3223 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3224 echo "~^header insert $xh <${xh}2@exam.ple>";\
3225 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3226 echo "~^header insert $xh ${xh}3@exam.ple";\
3227 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3228 echo "~^header list $xh"; read hl; echo $hl;\
3229 call xerr "$hl" "ins_addr $xh 3-4"
3230 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3233 echo "~^header remove-at $xh 1"; read es;\
3234 call xerr $es "ins_addr $xh 3-6"
3235 echo "~^header remove-at $xh 1"; read es;\
3236 call xerr $es "ins_addr $xh 3-7"
3237 echo "~^header remove-at $xh 1"; read es;\
3238 call xerr $es "ins_addr $xh 3-8"
3239 echo "~^header remove-at $xh 1"; read es;\
3240 vput vexpr es substr $es 0 3
3242 xcall bail "ins_addr $xh 3-9"
3244 echo "~^header remove-at $xh T"; read es;\
3245 vput vexpr es substr $es 0 3
3247 xcall bail "ins_addr $xh 3-10"
3249 echo "~^header list $xh"; read es;\
3250 vput vexpr es substr $es 0 3
3252 xcall bail "ins_addr $xh 3-11"
3254 echo "~^header show $xh"; read es;\
3255 vput vexpr es substr $es 0 3
3257 xcall bail "ins_addr $xh 3-12"
3261 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3262 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3263 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3264 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3265 echo "~^header insert $xh ${xh}3@exam.ple";\
3266 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3267 echo "~^header list $xh"; read hl; echo $hl;\
3268 call xerr "$hl" "header list $xh 3-4"
3269 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3272 echo "~^header remove-at $xh 3"; read es;\
3273 call xerr $es "ins_addr $xh 4-6"
3274 echo "~^header remove-at $xh 2"; read es;\
3275 call xerr $es "ins_addr $xh 4-7"
3276 echo "~^header remove-at $xh 1"; read es;\
3277 call xerr $es "ins_addr $xh 4-8"
3278 echo "~^header remove-at $xh 1"; read es;\
3279 vput vexpr es substr $es 0 3
3281 xcall bail "ins_addr $xh 4-9"
3283 echo "~^header remove-at $xh T"; read es;\
3284 vput vexpr es substr $es 0 3
3286 xcall bail "ins_addr $xh 4-10"
3288 echo "~^header list $xh"; read es;\
3289 vput vexpr es substr $es 0 3
3291 xcall bail "ins_addr $xh 4-11"
3293 echo "~^header show $xh"; read es;\
3294 vput vexpr es substr $es 0 3
3296 xcall bail "ins_addr $xh 4-12"
3300 wysh set xh=$1 mult=$2
3301 echo "~^header list"; read hl; echo $hl;\
3302 call xerr "$hl" "ins_ref ($xh) 0-1"
3304 echo "~^header insert $xh <$xh@exam.ple>";\
3305 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3307 echo "~^header insert $xh <${xh}2@exam.ple>";\
3308 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3309 echo "~^header insert $xh ${xh}3@exam.ple";\
3310 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3312 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3313 vput vexpr es substr $es 0 3
3315 xcall bail "ins_ref $xh 1-4"
3319 echo "~^header list $xh"; read hl; echo $hl;\
3320 call xerr "$hl" "ins_ref $xh 1-5"
3321 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3324 if [ "$t_remove" == "" ]
3328 echo "~^header remove $xh"; read es;\
3329 call xerr $es "ins_ref $xh 2-1"
3330 echo "~^header remove $xh"; read es;\
3331 vput vexpr es substr $es 0 3
3333 xcall bail "ins_ref $xh 2-2"
3335 echo "~^header list $xh"; read es;\
3336 vput vexpr es substr $es 0 3
3338 xcall bail "$es ins_ref $xh 2-3"
3340 echo "~^header show $xh"; read es;\
3341 vput vexpr es substr $es 0 3
3343 xcall bail "ins_ref $xh 2-4"
3347 echo "~^header insert $xh <$xh@exam.ple>";\
3348 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3350 echo "~^header insert $xh <${xh}2@exam.ple>";\
3351 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3352 echo "~^header insert $xh ${xh}3@exam.ple";\
3353 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3355 echo "~^header list $xh";\
3356 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3357 echo "~^header show $xh";\
3358 read es; call xerr $es "ins_ref $xh 3-5"
3361 echo "~^header remove-at $xh 1"; read es;\
3362 call xerr $es "ins_ref $xh 3-6"
3363 if [ $mult -ne 0 ] && [ $xh != subject ]
3364 echo "~^header remove-at $xh 1"; read es;\
3365 call xerr $es "ins_ref $xh 3-7"
3366 echo "~^header remove-at $xh 1"; read es;\
3367 call xerr $es "ins_ref $xh 3-8"
3369 echo "~^header remove-at $xh 1"; read es;\
3370 vput vexpr es substr $es 0 3
3372 xcall bail "ins_ref $xh 3-9"
3374 echo "~^header remove-at $xh T"; read es;\
3375 vput vexpr es substr $es 0 3
3377 xcall bail "ins_ref $xh 3-10"
3379 echo "~^header show $xh"; read es;\
3380 vput vexpr es substr $es 0 3
3382 xcall bail "ins_ref $xh 3-11"
3386 echo "~^header insert $xh <$xh@exam.ple> ";\
3387 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3389 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3390 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3391 echo "~^header insert $xh ${xh}3@exam.ple";\
3392 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3394 echo "~^header list $xh"; read hl; echo $hl;\
3395 call xerr "$hl" "ins_ref $xh 4-4"
3396 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3399 if [ $mult -ne 0 ] && [ $xh != subject ]
3400 echo "~^header remove-at $xh 3"; read es;\
3401 call xerr $es "ins_ref $xh 4-6"
3402 echo "~^header remove-at $xh 2"; read es;\
3403 call xerr $es "ins_ref $xh 4-7"
3405 echo "~^header remove-at $xh 1"; read es;\
3406 call xerr $es "ins_ref $xh 4-8"
3407 echo "~^header remove-at $xh 1"; read es;\
3408 vput vexpr es substr $es 0 3
3410 xcall bail "ins_ref $xh 4-9"
3412 echo "~^header remove-at $xh T"; read es;\
3413 vput vexpr es substr $es 0 3
3415 xcall bail "ins_ref $xh 4-10"
3417 echo "~^header show $xh"; read es;\
3418 vput vexpr es substr $es 0 3
3420 xcall bail "ins_ref $xh 4-11"
3425 # In collect.c order
3427 call ins_ref sender 0 # Not a "ref", but works
3431 call ins_addr reply-To
3432 call ins_addr mail-Followup-to
3433 call ins_ref messAge-id 0
3434 call ins_ref rEfErEncEs 1
3435 call ins_ref in-Reply-to 1
3436 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3437 call ins_addr freeForm1
3438 call ins_addr freeform2
3440 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3442 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3450 echo "~^attachment";\
3451 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3453 xcall bail "attach 0-1"
3456 echo "~^attach attribute ./.treadctl";\
3457 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3459 xcall bail "attach 0-2"
3461 echo "~^attachment attribute-at 1";\
3462 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3464 xcall bail "attach 0-3"
3467 echo "~^attachment insert ./.treadctl=ascii";\
3468 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3469 echo "~^attachment list";\
3470 read es; echo $es;call xerr "$es" "attach 1-2"
3472 echo "~^attachment attribute ./.treadctl";\
3473 read es; echo $es;call xerr "$es" "attach 1-3"
3475 echo "~^attachment attribute .treadctl";\
3476 read es; echo $es;call xerr "$es" "attach 1-4"
3478 echo "~^attachment attribute-at 1";\
3479 read es; echo $es;call xerr "$es" "attach 1-5"
3482 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3483 read es; echo $es;call xerr "$es" "attach 1-6"
3484 echo "~^attachment attribute-set .treadctl content-description Au";\
3485 read es; echo $es;call xerr "$es" "attach 1-7"
3486 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3487 read es; echo $es;call xerr "$es" "attach 1-8"
3489 echo "~^attachment attribute ./.treadctl";\
3490 read es; echo $es;call xerr "$es" "attach 1-9"
3492 echo "~^attachment attribute .treadctl";\
3493 read es; echo $es;call xerr "$es" "attach 1-10"
3495 echo "~^attachment attribute rctl";\
3496 read es; echo $es;call xerr "$es" "attach 1-11"
3498 echo "~^attachment attribute-at 1";\
3499 read es; echo $es;call xerr "$es" "attach 1-12"
3503 echo "~^attachment insert ./.tattach=latin1";\
3504 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3505 echo "~^attachment list";\
3506 read es; echo $es;call xerr "$es" "attach 2-2"
3508 echo "~^attachment attribute ./.tattach";\
3509 read es; echo $es;call xerr "$es" "attach 2-3"
3511 echo "~^attachment attribute .tattach";\
3512 read es; echo $es;call xerr "$es" "attach 2-4"
3514 echo "~^attachment attribute-at 2";\
3515 read es; echo $es;call xerr "$es" "attach 2-5"
3518 echo "~^attachment attribute-set ./.tattach filename tat";\
3519 read es; echo $es;call xerr "$es" "attach 2-6"
3521 "~^attachment attribute-set .tattach content-description Au2";\
3522 read es; echo $es;call xerr "$es" "attach 2-7"
3523 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3524 read es; echo $es;call xerr "$es" "attach 2-8"
3526 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3527 read es; echo $es;call xerr "$es" "attach 2-9"
3529 echo "~^attachment attribute ./.tattach";\
3530 read es; echo $es;call xerr "$es" "attach 2-10"
3532 echo "~^attachment attribute .tattach";\
3533 read es; echo $es;call xerr "$es" "attach 2-11"
3535 echo "~^attachment attribute tat";\
3536 read es; echo $es;call xerr "$es" "attach 2-12"
3538 echo "~^attachment attribute-at 2";\
3539 read es; echo $es;call xerr "$es" "attach 2-13"
3543 if [ "$t_remove" == "" ]
3547 echo "~^attachment remove ./.treadctl"; read es;\
3548 call xerr $es "attach 3-1"
3549 echo "~^attachment remove ./.tattach"; read es;\
3550 call xerr $es "attach 3-2"
3551 echo "~^ attachment remove ./.treadctl"; read es;\
3552 vput vexpr es substr $es 0 3
3554 xcall bail "attach 3-3"
3556 echo "~^ attachment remove ./.tattach"; read es;\
3557 vput vexpr es substr $es 0 3
3559 xcall bail "attach 3-4"
3561 echo "~^attachment list"; read es;\
3562 vput vexpr es substr $es 0 3
3564 xcall bail "attach 3-5"
3568 echo "~^attachment insert ./.tattach=latin1";\
3569 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3570 echo "~^attachment insert ./.tattach=latin1";\
3571 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3572 echo "~^attachment list";\
3573 read es; echo $es;call xerr "$es" "attach 4-3"
3575 echo "~^ attachment remove .tattach"; read es;\
3576 vput vexpr es substr $es 0 3
3578 xcall bail "attach 4-4 $es"
3580 echo "~^attachment remove-at T"; read es;\
3581 vput vexpr es substr $es 0 3
3583 xcall bail "attach 4-5"
3585 echo "~^attachment remove ./.tattach"; read es;\
3586 call xerr $es "attach 4-6"
3587 echo "~^attachment remove ./.tattach"; read es;\
3588 call xerr $es "attach 4-7"
3589 echo "~^ attachment remove ./.tattach"; read es;\
3590 vput vexpr es substr $es 0 3
3592 xcall bail "attach 4-8 $es"
3594 echo "~^attachment list"; read es;\
3595 vput vexpr es substr $es 0 3
3597 xcall bail "attach 4-9"
3601 echo "~^attachment insert ./.tattach=latin1";\
3602 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3603 echo "~^attachment insert ./.tattach=latin1";\
3604 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3605 echo "~^attachment insert ./.tattach=latin1";\
3606 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3607 echo "~^attachment list";\
3608 read es; echo $es;call xerr "$es" "attach 5-4"
3611 echo "~^attachment remove-at 3"; read es;\
3612 call xerr $es "attach 5-5"
3613 echo "~^attachment remove-at 3"; read es;\
3614 vput vexpr es substr $es 0 3
3616 xcall bail "attach 5-6"
3618 echo "~^attachment remove-at 2"; read es;\
3619 call xerr $es "attach 5-7"
3620 echo "~^attachment remove-at 2"; read es;\
3621 vput vexpr es substr $es 0 3
3623 xcall bail "attach 5-8"
3625 echo "~^attachment remove-at 1"; read es;\
3626 call xerr $es "attach 5-9"
3627 echo "~^attachment remove-at 1"; read es;\
3628 vput vexpr es substr $es 0 3
3630 xcall bail "attach 5-10"
3633 echo "~^attachment list"; read es;\
3634 vput vexpr es substr $es 0 3
3636 xcall bail "attach 5-11"
3640 echo "~^attachment insert ./.tattach=latin1";\
3641 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3642 echo "~^attachment insert ./.tattach=latin1";\
3643 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3644 echo "~^attachment insert ./.tattach=latin1";\
3645 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3646 echo "~^attachment list";\
3647 read es; echo $es;call xerr "$es" "attach 6-4"
3650 echo "~^attachment remove-at 1"; read es;\
3651 call xerr $es "attach 6-5"
3652 echo "~^attachment remove-at 1"; read es;\
3653 call xerr $es "attach 6-6"
3654 echo "~^attachment remove-at 1"; read es;\
3655 call xerr $es "attach 6-7"
3656 echo "~^attachment remove-at 1"; read es;\
3657 vput vexpr es substr $es 0 3
3659 xcall bail "attach 6-8"
3662 echo "~^attachment list"; read es;\
3663 vput vexpr es substr $es 0 3
3665 xcall bail "attach 6-9"
3677 echo on-compose-enter, mailx-command<$mailx-command>
3678 alternates alter1@exam.ple alter2@exam.ple
3680 set autocc='alter1@exam.ple alter2@exam.ple'
3681 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3682 echo mailx-subject<$mailx-subject>
3683 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3684 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3685 mailx-raw-bcc<$mailx-raw-bcc>
3686 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3687 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3690 echo on-compose-leave, mailx-command<$mailx-command>
3692 eval alternates $al alter3@exam.ple alter4@exam.ple
3694 set autobcc='alter3@exam.ple alter4@exam.ple'
3695 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3696 echo mailx-subject<$mailx-subject>
3697 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3698 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3699 mailx-raw-bcc<$mailx-raw-bcc>
3700 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3701 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3704 echo on-compose-cleanup, mailx-command<$mailx-command>
3707 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3708 echo mailx-subject<$mailx-subject>
3709 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3710 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3711 mailx-raw-bcc<$mailx-raw-bcc>
3712 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3713 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3715 wysh set on-compose-splice=t_ocs \
3716 on-compose-enter=t_oce on-compose-leave=t_ocl \
3717 on-compose-cleanup=t_occ
3721 printf 'm this-goes@nowhere\nbody\n!.\n' |
3722 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3723 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3725 ${cat} .
/.tall
>> "${MBOX}"
3726 check behave
:compose_hooks-1
0 "${MBOX}" '522535560 10101'
3729 printf 'm this-goes@nowhere\nbody\n!.\n' |
3730 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3731 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3733 ${cat} .
/.tall
>> "${MBOX}"
3734 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3738 # Some state machine stress, shell compose hook, localopts for hook, etc.
3739 # readctl in child. ~r as HERE document
3741 printf 'm ex@am.ple\nbody\n!.
3742 echon ${mailx-command}${mailx-subject}
3743 echon ${mailx-from}${mailx-sender}
3744 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3745 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3746 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3747 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3748 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3749 -Smta=.
/.tsendmail.sh \
3752 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3755 vput vexpr es substr "$1" 0 1
3760 define read_mline_res {
3761 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3762 echo $len/$es/$^ERRNAME: $hl
3763 if [ $es -ne $^ERR-NONE ]
3764 xcall bail read_mline_res
3766 \xcall read_mline_res
3770 vput vexpr i + 1 "$2"
3772 vput vexpr j % $i 10
3779 eval \\$j _work $1 $i
3782 vput vexpr i + $i "$1"
3786 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3787 echo read:$es/$en: $line
3788 if [ "${es}" -ne -1 ]
3791 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3796 echo "~^header list"; read hl; echo $hl;\
3797 vput vexpr es substr "$hl" 0 1
3799 xcall bail "header list"
3802 call _work 1; echo $?
3803 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3804 read es; echo $es; vput vexpr es substr "$es" 0 1
3806 xcall bail "be diet"
3808 echo "~^header insert cc <splice2@exam.ple>";\
3809 read es; echo $es; vput vexpr es substr "$es" 0 1
3811 xcall bail "be diet2"
3814 call _work 2; echo $?
3815 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3816 read es; echo $es;vput vexpr es substr "$es" 0 1
3818 xcall bail "be juicy"
3820 echo "~^header insert bcc juice2@exam.ple";\
3821 read es; echo $es;vput vexpr es substr "$es" 0 1
3823 xcall bail "be juicy2"
3825 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3826 read es; echo $es;vput vexpr es substr "$es" 0 1
3828 xcall bail "be juicy3"
3830 echo "~^header insert bcc juice4@exam.ple";\
3831 read es; echo $es;vput vexpr es substr "$es" 0 1
3833 xcall bail "be juicy4"
3836 echo "~^header remove-at bcc 3";\
3837 read es; echo $es;vput vexpr es substr "$es" 0 1
3839 xcall bail "remove juicy5"
3841 echo "~^header remove-at bcc 2";\
3842 read es; echo $es;vput vexpr es substr "$es" 0 1
3844 xcall bail "remove juicy6"
3846 echo "~^header remove-at bcc 3";\
3847 read es; echo $es;vput vexpr es substr "$es" 0 3
3849 xcall bail "failed to remove-at"
3851 # Add duplicates which ought to be removed!
3852 echo "~^header insert bcc juice4@exam.ple";\
3853 read es; echo $es;vput vexpr es substr "$es" 0 1
3855 xcall bail "be juicy4-1"
3857 echo "~^header insert bcc juice4@exam.ple";\
3858 read es; echo $es;vput vexpr es substr "$es" 0 1
3860 xcall bail "be juicy4-2"
3862 echo "~^header insert bcc juice4@exam.ple";\
3863 read es; echo $es;vput vexpr es substr "$es" 0 1
3865 xcall bail "be juicy4-3"
3870 call _work 3; echo $?
3872 vput ! i echo just knock if you can hear me;\
3874 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3876 echon shell-cmd says $?/$^ERRNAME: $i
3877 echo "~x will not become interpreted, we are reading until __EOT"
3879 read r_status; echo "~~r status output: $r_status"
3880 echo "~:echo $? $! $^ERRNAME"
3882 echo "~~r status from parent: $r_status"
3885 call _work 4; echo $?
3886 vput cwd cwd;echo cwd:$?
3887 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3891 call _work 5; echo $?
3892 echo "~^header show MAILX-Command"; read es;\
3893 call xerr $es "t_header 1000"; call read_mline_res
3894 echo "~^header show MAILX-raw-TO"; read es;\
3895 call xerr $es "t_header 1001"; xcall read_mline_res
3897 echoerr IT IS WRONG IF YOU SEE THIS
3900 echo on-compose-enter, mailx-command<$mailx-command>
3901 set t_oce autobcc=oce@exam.ple
3902 alternates alter1@exam.ple alter2@exam.ple
3904 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3905 echo mailx-subject<$mailx-subject>
3906 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3907 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3908 mailx-raw-bcc<$mailx-raw-bcc>
3909 echo mailx-orig-from<$mailx-orig-from> \
3910 mailx-orig-to<$mailx-orig-to> \
3911 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3914 echo on-compose-leave, mailx-command<$mailx-command>
3915 set t_ocl autocc=ocl@exam.ple
3917 alternates alter3@exam.ple alter4@exam.ple
3919 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3920 echo mailx-subject<$mailx-subject>
3921 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3922 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3923 mailx-raw-bcc<$mailx-raw-bcc>
3924 echo mailx-orig-from<$mailx-orig-from> \
3925 mailx-orig-to<$mailx-orig-to> \
3926 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3929 echo on-compose-cleanup, mailx-command<$mailx-command>
3930 set t_occ autocc=occ@exam.ple
3933 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3934 echo mailx-subject<$mailx-subject>
3935 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3936 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3937 mailx-raw-bcc<$mailx-raw-bcc>
3938 echo mailx-orig-from<$mailx-orig-from> \
3939 mailx-orig-to<$mailx-orig-to> \
3940 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3942 wysh set on-compose-splice=t_ocs \
3943 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3944 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3945 on-compose-enter=t_oce on-compose-leave=t_ocl \
3946 on-compose-cleanup=t_occ
3948 ex0_test behave
:compose_hooks-3-estat
3949 ${cat} .
/.tnotes
>> "${MBOX}"
3951 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3953 # Reply, forward, resend, Resend
3956 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3957 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3958 -Smta=.
/.tsendmail.sh
3961 echo start: $? $! $^ERRNAME
3963 echo File: $? $! $^ERRNAME;echo;echo
3965 this is content of reply 1
3967 echo reply 1: $? $! $^ERRNAME;echo;echo
3969 this is content of Reply 1 2
3971 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3972 forward 1 fwdex@am.ple
3973 this is content of forward 1
3975 echo forward 1: $? $! $^ERRNAME;echo;echo
3976 resend 1 2 resendex@am.ple
3977 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3978 Resend 1 2 Resendex@am.ple
3979 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3981 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3982 -Smta=.
/.tsendmail.sh \
3985 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3988 vput vexpr es substr "$1" 0 1
3993 define read_mline_res {
3994 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3995 echo mline_res:$len/$es/$^ERRNAME: $hl
3996 if [ $es -ne $^ERR-NONE ]
3997 xcall bail read_mline_res
3999 \xcall read_mline_res
4003 echo "~^header show $1"; read es;\
4004 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4012 echo t_ocs version $ver
4013 echo "~^header list"; read hl; echo $hl;\
4014 echoerr the header list is $hl;\
4015 call xerr "$hl" "header list"
4016 eval vpospar set $hl
4019 echoerr IT IS WRONG IF YOU SEE THIS
4022 echo on-XY-enter, mailx-command<$mailx-command>
4023 set t_oce autobcc=oce@exam.ple
4024 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4025 echo mailx-subject<$mailx-subject>
4026 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4027 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4028 mailx-raw-bcc<$mailx-raw-bcc>
4029 echo mailx-orig-from<$mailx-orig-from> \
4030 mailx-orig-to<$mailx-orig-to> \
4031 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4034 echo on-XY-leave, mailx-command<$mailx-command>
4035 set t_ocl autocc=ocl@exam.ple
4036 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4037 echo mailx-subject<$mailx-subject>
4038 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4039 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4040 mailx-raw-bcc<$mailx-raw-bcc>
4041 echo mailx-orig-from<$mailx-orig-from> \
4042 mailx-orig-to<$mailx-orig-to> \
4043 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4046 echo on-XY-cleanup, mailx-command<$mailx-command>
4047 set t_occ autocc=occ@exam.ple
4048 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4049 echo mailx-subject<$mailx-subject>
4050 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4051 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4052 mailx-raw-bcc<$mailx-raw-bcc>
4053 echo mailx-orig-from<$mailx-orig-from> \
4054 mailx-orig-to<$mailx-orig-to> \
4055 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4057 wysh set on-compose-splice=t_ocs \
4058 on-compose-enter=t_oce on-compose-leave=t_ocl \
4059 on-compose-cleanup=t_occ \
4060 on-resend-enter=t_oce on-resend-cleanup=t_occ
4062 ex0_test behave
:compose_hooks-4-estat
4063 ${cat} .
/.tnotes
>> "${MBOX}"
4065 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
4070 t_behave_C_opt_customhdr
() {
4071 t_prolog t_behave_C_opt_customhdr
4072 TRAP_EXIT_ADDONS
="./.t*"
4074 ${cat} <<-_EOT > ./.tsendmail.sh
4076 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
4080 chmod 0755 .
/.tsendmail.sh
4083 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
4084 -C 'C-One : Custom One Body' \
4085 -C 'C-Two:CustomTwoBody' \
4086 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4087 this-goes@nowhere
>.
/.tall
2>&1
4088 ex0_test behave
:C_opt_customhdr-1-estat
4089 ${cat} .
/.tall
>> "${MBOX}"
4090 check behave
:C_opt_customhdr-1
0 "${MBOX}" '2400078426 195'
4093 printf 'm this-goes@nowhere\nbody\n!.
4095 m this-goes2@nowhere\nbody2\n!.
4096 set customhdr=%ccustom1 : custom1 body%c
4097 m this-goes2@nowhere\nbody2\n!.
4098 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4099 m this-goes3@nowhere\nbody3\n!.
4101 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
-Sescape=! \
4102 -C 'C-One : Custom One Body' \
4103 -C 'C-Two:CustomTwoBody' \
4104 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4106 ex0_test behave
:C_opt_customhdr-2-estat
4107 ${cat} .
/.tall
>> "${MBOX}"
4108 check behave
:C_opt_customhdr-2
0 "${MBOX}" '3546878678 752'
4113 t_behave_mass_recipients
() {
4114 t_prolog t_behave_mass_recipients
4115 TRAP_EXIT_ADDONS
="./.t*"
4117 ${cat} <<-_EOT > ./.tsendmail.sh
4119 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4122 chmod 0755 .
/.tsendmail.sh
4124 ${cat} <<'__EOT__' > ./.trc
4126 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4129 wysh set nr=$1 hn=$2
4130 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4132 xcall bail "ins_addr $hn 1-$nr"
4134 vput vexpr nr + $nr 1
4135 if [ "$nr" -le "$maximum" ]
4136 xcall ins_addr $nr $hn
4140 wysh set nr=$1 hn=$2
4141 alternates $hn$nr@$hn
4142 vput vexpr nr + $nr 2
4143 if [ "$nr" -le "$maximum" ]
4144 xcall bld_alter $nr $hn
4154 if [ "$t_remove" != '' ]
4159 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4162 printf 'm this-goes@nowhere\nbody\n!.\n' |
4163 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4164 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4166 ex0_test behave
:mass_recipients-1-estat
4167 ${cat} .
/.tall
>> "${MBOX}"
4168 check behave
:mass_recipients-1
- "${MBOX}" '2912243346 51526'
4171 printf 'm this-goes@nowhere\nbody\n!.\n' |
4172 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4173 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4175 ex0_test behave
:mass_recipients-2-estat
4176 ${cat} .
/.tall
>> "${MBOX}"
4177 check behave
:mass_recipients-2
- "${MBOX}" '4097804632 34394'
4182 t_behave_mime_types_load_control
() {
4183 t_prolog t_behave_mime_types_load_control
4184 if have_feat uistrings
; then :; else
4185 echo 'behave:mime_types_load_control: unsupported, skipped'
4188 TRAP_EXIT_ADDONS
="./.t*"
4190 ${cat} <<-_EOT > ./.tmts1
4191 @ application/mathml+xml mathml
4193 ${cat} <<-_EOT > ./.tmts2
4194 @ x-conference/x-cooltalk ice
4196 @ application/aga-aga aga
4199 ${cat} <<-_EOT > ./.tmts1.mathml
4200 <head>nonsense ML</head>
4202 ${cat} <<-_EOT > ./.tmts2.ice
4205 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4206 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4220 ' "${MBOX}" "${MBOX}" |
4222 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4224 ex0_test behave
:mime_types_load_control-1-estat
4225 ${cat} "${MBOX}" >> .
/.tout
4226 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
4228 echo type |
${MAILX} ${ARGS} -R \
4229 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4230 -f "${MBOX}" >> .
/.tout
2>&1
4231 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
4236 t_behave_lreply_futh_rth_etc
() {
4237 t_prolog t_behave_lreply_futh_rth_etc
4238 TRAP_EXIT_ADDONS
="./.t*"
4240 ${cat} <<-_EOT > ./.tsendmail.sh
4242 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4245 chmod 0755 .
/.tsendmail.sh
4247 ${cat} <<-_EOT > ./.tmbox
4248 From neverneverland Sun Jul 23 13:46:25 2017
4249 Subject: Bugstop: five miles out 1
4250 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4251 From: mister originator <mr@originator>
4252 To: bugstop-commit@five.miles.out, laber@backe.eu
4254 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4255 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4256 Date: Wed, 19 Jul 2017 09:22:57 -0400
4257 Message-Id: <20170719132257.766AF781267@originator>
4260 > |Sorry, I think I misunderstand something. I would think that
4264 From neverneverland Fri Jul 7 22:39:11 2017
4265 Subject: Bugstop: five miles out 2
4266 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4267 Content-Transfer-Encoding: 7bit
4268 From: mister originator <mr@originator>
4269 To: bugstop-commit@five.miles.out
4271 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4272 Date: Fri, 07 Jul 2017 16:33:59 -0400
4275 capable of changing back.
4277 From neverneverland Fri Jul 7 22:42:00 2017
4278 Subject: Bugstop: five miles out 3
4279 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4280 Content-Transfer-Encoding: 7bit
4281 From: mister originator <mr@originator>
4282 To: bugstop-commit@five.miles.out
4284 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4285 Date: Fri, 07 Jul 2017 16:33:59 -0400
4286 List-Post: <mailto:bugstop@five.miles.out>
4289 are you ready, boots?
4291 From neverneverland Sat Aug 19 23:15:00 2017
4292 Subject: Bugstop: five miles out 4
4293 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4294 Content-Transfer-Encoding: 7bit
4295 From: mister originator <mr@originator>
4296 To: bugstop@five.miles.out
4298 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4299 Date: Fri, 07 Jul 2017 16:33:59 -0400
4300 List-Post: <mailto:bugstop@five.miles.out>
4303 are you ready, boots?
4308 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4309 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4311 wysh
set m
="This is text of \"reply ${1}."
4322 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4325 wysh set m="This is text of
\"Reply
${1}.
"
4331 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4340 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4344 # We need two indirections for this test: one for the case that Lreply
4345 # fails because of missing recipients: we need to read EOF next, thus
4346 # place this in _Ls last; and second for the succeeding cases EOF is
4347 # not what these should read, so go over the backside and splice it in!
4349 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4352 localopts call-fixate
yes
4354 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4355 call L
$1 1; call L
$1 2; call L
$1 3
4358 echo;echo '===== CHANGING === '"$*"' =====';echo
4362 set from
=laber@backe.eu
4365 call tweak
set reply-to-honour
4367 call tweak
set followup-to
4369 call tweak
set followup-to-honour
4371 call tweak mlist bugstop@five.miles.out
4373 call tweak mlsubscribe bugstop@five.miles.out
4375 call tweak
set recipients-in-cc
4379 ex0_test behave
:lreply_futh_rth_etc-1-estat
4380 if have_feat uistrings
; then # xxx should not be so, skip??
4381 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '940818845 29373'
4383 check behave
:lreply_futh_rth_etc-1
- "${MBOX}" '3917430455 29259'
4388 ${cat} <<-_EOT > ./.tmbox
4389 From tom@i-i.example Thu Oct 26 03:15:55 2017
4390 Date: Wed, 25 Oct 2017 21:15:46 -0400
4391 From: tom <tom@i-i.example>
4392 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4393 Cc: tom <tom@i-i.example>
4394 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4395 Message-ID: <20171026011546.GA11643@i-i.example>
4396 Reply-To: tom@i-i.example
4397 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4398 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4401 The report's useful :-)
4404 printf 'reply 1\nthank you\n!.\n' |
4405 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4406 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4407 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4412 t_behave_mime_if_not_ascii
() {
4413 t_prolog t_behave_mime_if_not_ascii
4415 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4416 check behave:mime_if_not_ascii-1 0 "${MBOX}" '2287855519 110'
4418 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4420 check behave
:mime_if_not_ascii-2
0 "${MBOX}" '70754682 282'
4425 t_behave_xxxheads_rfc2047
() {
4426 t_prolog t_behave_xxxheads_rfc2047
4427 TRAP_EXIT_ADDONS
="./.t*"
4429 ${cat} <<-_EOT > ./.tsendmail.sh
4431 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4434 chmod 0755 .
/.tsendmail.sh
4438 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4439 -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̲' \
4441 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4443 # Single word (overlong line split -- bad standard! Requires injection of
4444 # artificial data!! But can be prevented by using RFC 2047 encoding)
4446 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4447 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4448 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4450 # Combination of encoded words, space and tabs of varying sort
4452 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4453 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4454 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4455 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4456 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4457 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4459 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4461 # Overlong multibyte sequence that must be forcefully split
4462 # todo This works even before v15.0, but only by accident
4464 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4465 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4466 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4467 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4469 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4473 echo | ${MAILX} ${ARGS} \
4474 -s "1-1 B2 B3 B4 B5 B6 B\
4475 1-2 B2 B3 B4 B5 B6 B\
4476 1-3 B2 B3 B4 B5 B6 B\
4477 1-4 B2 B3 B4 B5 B6 B\
4478 1-5 B2 B3 B4 B5 B6 B\
4479 1-6 B2 B3 B4 B5 B6
" \
4481 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4483 # Leading and trailing WS
4485 echo | ${MAILX} ${ARGS} \
4486 -s " 2-1 B2 B3 B4 B5 B6 B\
4487 1-2 B2 B3 B4 B5 B6 B\
4488 1-3 B2 B3 B4 B5 B6 B\
4489 1-4 B2 B3 B4 B5 B6
" \
4491 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4493 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4495 echo "Dat Früchtchen riecht häußlich
" |
4496 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4498 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4499 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4501 # RFC 2047 in an address field, and iconv involved
4502 if have_feat iconv; then
4504 ${cat} > ./.trebox <<_EOT
4505 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4506 Date: Fri, 2 Mar 2018 20:31:45 +0000
4507 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4508 To: dude <dude@exam.ple>
4509 Subject: houston(...)
4510 Message-ID: <abra@1>
4512 Content-Type: text/plain; charset=iso-8859-1
4513 Content-Disposition: inline
4514 Content-Transfer-Encoding: 8bit
4517 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4518 -Sfullnames -Sreply-in-same-charset \
4519 -Smta=./.tsendmail.sh -Rf ./.trebox
4520 check behave:xxxheads_rfc2047-8 0 "${MBOX}" '2821484185 280'
4522 echo 'behave:xxxheads_rfc2047-8: iconv unsupported, skipped'
4528 t_behave_rfc2231() {
4529 t_prolog t_behave_rfc2231
4530 TRAP_EXIT_ADDONS=".
/.t
*"
4533 mkdir ./.ttt || exit 1
4537 : > 'diet\ is \curd.txt'
4538 : > 'diet "is
" curd.txt'
4540 : > 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
4541 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4542 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4543 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4545 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4546 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4547 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4548 -a ./.ttt/höde-tröge.txt \
4549 -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 \
4550 -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 \
4551 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4552 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4554 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4556 # `resend' test, reusing $MBOX
4557 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4558 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4560 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4561 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4566 t_behave_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4567 t_prolog t_behave_iconv_mbyte_base64
4568 TRAP_EXIT_ADDONS=".
/.t
*"
4570 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4571 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4572 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4575 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4579 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4583 ${cat} <<-_EOT > ./.tsendmail.sh
4585 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4588 chmod 0755 ./.tsendmail.sh
4590 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4591 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4592 -Smta=./.tsendmail.sh \
4593 -Sescape=! -Smime-encoding=base64 2>./.terr
4594 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4596 !s Japanese from UTF-8 to ISO-2022-JP
4597 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4599 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4602 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4604 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4607 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4609 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4610 \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
4612 \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
4615 \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
4617 \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
4620 # May not presume iconv output as long as roundtrip possible [489a7122]
4621 ex0_test behave
:iconv_mbyte_base64-1-estat
4622 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4623 < "${MBOX}" > .
/.tcksum
4624 check behave
:iconv_mbyte_base64-1
- .
/.tcksum
'2694609714 520'
4625 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4627 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4628 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4629 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4630 -Rf "${MBOX}" >.
/.tlog
2>&1
4631 check behave
:iconv_mbyte_base64-3
0 .
/.twrite
'1259742080 686'
4632 #check behave:iconv_mbyte_base64-4 - ./.tlog '3214068822 2123'
4633 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4634 check behave
:iconv_mbyte_base64-4
- .
/.txlog
'3659773472 2035'
4636 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4639 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4640 rm -f "${MBOX}" .
/.twrite
4641 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4642 -Smta=.
/.tsendmail.sh \
4643 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4644 set ttycharset
=utf-8 sendcharsets
=euc-jp
4646 !s Japanese from UTF-8 to EUC-JP
4647 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4649 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4652 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4654 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4657 set ttycharset
=EUC-JP sendcharsets
=utf-8
4659 !s Japanese from EUC-JP to UTF-8
4660 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4662 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4665 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4667 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4670 ex0_test behave
:iconv_mbyte_base64-5-estat
4671 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4672 < "${MBOX}" > .
/.tcksum
4673 check behave
:iconv_mbyte_base64-5
- .
/.tcksum
'2870183985 473'
4674 check behave
:iconv_mbyte_base64-6
- .
/.terr
'4294967295 0'
4676 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4677 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4678 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4679 -Rf "${MBOX}" >.
/.tlog
2>&1
4680 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4681 #check behave:iconv_mbyte_base64-8 - ./.tlog '2506063395 2075'
4682 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4683 check behave
:iconv_mbyte_base64-8
- .
/.txlog
'2528199891 1988'
4685 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4691 t_behave_iconv_mainbody
() {
4692 t_prolog t_behave_iconv_mainbody
4693 TRAP_EXIT_ADDONS
="./.t*"
4695 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4698 echo 'behave:iconv_mainbody: unsupported, skipped'
4702 ${cat} <<-_EOT > ./.tsendmail.sh
4704 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4707 chmod 0755 .
/.tsendmail.sh
4709 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4710 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4711 -s '–' over-the@rain.bow
2>.
/.terr
4712 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4713 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4715 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4716 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4717 -s '–' over-the@rain.bow
2>.
/.terr
4718 exn0_test behave
:iconv_mainbody-3
4719 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4720 if have_feat uistrings
; then
4721 if have_feat docstrings
; then # xxx should not be like that
4722 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4724 check behave
:iconv_mainbody-4
- .
/.terr
'271380835 121'
4727 echo 'behave:iconv_mainbody-4: unsupported, skipped'
4730 # The different iconv(3) implementations use different replacement sequence
4731 # types (character-wise, byte-wise, and the character(s) used differ)
4732 i
="${MAILX_ICONV_MODE}"
4733 if [ -n "${i}" ]; then
4734 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4736 ex0_test behave:iconv_mainbody-5-0 ${j}
4737 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4738 if [ ${i} -eq 13 ]; then
4739 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4740 elif [ ${i} -eq 12 ]; then
4741 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4742 elif [ ${i} -eq 3 ]; then
4743 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4745 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4748 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4754 t_behave_binary_mainbody() {
4755 t_prolog t_behave_binary_mainbody
4756 TRAP_EXIT_ADDONS=".
/.t
*"
4758 printf 'abra\0\nka\r\ndabra' |
4759 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4761 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4762 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4764 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4765 ${MAILX} ${ARGS} -Rf \
4766 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4767 "${MBOX}" >./.tall 2>&1
4768 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4769 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4770 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4775 t_behave_q_t_etc_opts() {
4776 t_prolog t_behave_q_t_etc_opts
4777 TRAP_EXIT_ADDONS=".
/.t
*"
4779 # Three tests for MIME encoding and (a bit) content classification.
4780 # At the same time testing -q FILE, < FILE and -t FILE
4781 t__put_body > ./.tin
4784 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4785 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4786 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4789 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4790 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4791 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4794 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4796 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4797 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4803 have_feat smime || {
4804 echo 'behave:s/mime: unsupported, skipped'
4808 t_prolog t_behave_s_mime
4809 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4810 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4811 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4813 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4814 ${cat} <<-_EOT > ./.t.conf
4817 default_keyfile = keyfile.pem
4818 distinguished_name = req_distinguished_name
4819 attributes = req_attributes
4823 [ req_distinguished_name ]
4830 emailAddress = test@localhost
4835 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4836 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4837 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4840 printf 'behave:s/mime:sign/verify: '
4841 echo bla | ${MAILX} ${ARGS} \
4842 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4843 -Ssmime-sign -Sfrom=test@localhost \
4844 -s 'S/MIME test' ./.VERIFY
4845 if [ $? -eq 0 ]; then
4856 /^Content-Description: /{ skip = 2; print; next }
4857 /^$/{ if(skip) --skip }
4860 < ./.VERIFY > "${MBOX}"
4861 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4863 printf 'behave:s/mime:sign/verify:verify '
4864 printf 'verify\nx\n' |
4866 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4867 -Ssmime-sign -Sfrom=test@localhost \
4869 -f ./.VERIFY >>${ERR} 2>&1
4870 if [ $? -eq 0 ]; then
4879 printf 'behave:s/mime:sign/verify:disproof-1 '
4880 if openssl smime -verify -CAfile ./.tcert.pem \
4881 -in ./.VERIFY >>${ERR} 2>&1; then
4890 # (signing +) encryption / decryption
4891 ${cat} <<-_EOT > ./.tsendmail.sh
4893 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4895 chmod 0755 ./.tsendmail.sh
4897 printf 'behave:s/mime:encrypt+sign: '
4900 -Ssmime-force-encryption \
4901 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4902 -Smta=./.tsendmail.sh \
4903 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4904 -Ssmime-sign -Sfrom=test@localhost \
4905 -s 'S/MIME test' recei@ver.com
4906 if [ $? -eq 0 ]; then
4910 printf 'error: encrypt+sign failed\n'
4913 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4914 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4916 printf 'behave:s/mime:decrypt+verify: '
4917 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4919 -Ssmime-force-encryption \
4920 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4921 -Smta=./.tsendmail.sh \
4922 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4923 -Ssmime-sign -Sfrom=test@localhost \
4925 -f ./.ENCRYPT >>${ERR} 2>&1
4926 if [ $? -eq 0 ]; then
4935 /^Content-Description: /{ skip = 2; print; next }
4936 /^$/{ if(skip) --skip }
4939 < ./.DECRYPT > "${MBOX}"
4940 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4942 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4943 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4944 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1; then
4951 printf "behave
:s
/mime
:encrypt
: "
4952 echo bla | ${MAILX} ${ARGS} \
4953 -Ssmime-force-encryption \
4954 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4955 -Smta=./.tsendmail.sh \
4956 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4957 -Sfrom=test@localhost \
4958 -s 'S/MIME test' recei@ver.com
4959 if [ $? -eq 0 ]; then
4966 # Same as behave:s/mime:encrypt+sign:checksum above
4967 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4968 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4971 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4972 -Ssmime-force-encryption \
4973 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4974 -Smta=./.tsendmail.sh \
4975 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4976 -Sfrom=test@localhost \
4978 -f ./.ENCRYPT >>${ERR} 2>&1
4979 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4981 printf 'behave:s/mime:decrypt:disproof-1: '
4982 if openssl smime -decrypt -inkey ./.tkey.pem \
4983 -in ./.ENCRYPT >>${ERR} 2>&1; then
4994 # xxx Note: t_content() was the first test (series) written. Today many
4995 # xxx aspects are (better) covered by other tests above, some are not.
4996 # xxx At some future date and time, convert the last remains not covered
4997 # xxx elsewhere to a real t_behave_* test and drop t_content()
5001 # Test for [260e19d] (Juergen Daubert)
5003 echo body | ${MAILX} ${ARGS} "${MBOX}"
5004 check content
:004 0 "${MBOX}" '2917662811 98'
5006 # "Test for" [d6f316a] (Gavin Troy)
5008 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
5009 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5010 check content:006 0 "${MBOX}" '2099098650 122'
5011 check content:006-1 - "${BODY}" '794542938 174'
5013 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5016 for(i = 0; i < 10000; ++i)
5018 #printf "\xF0\x90\x87\x90"
5019 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5020 check content
:007 0 "${MBOX}" '534262374 61816'
5026 # MIME encoding (QP) stress message subject
5027 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5028 'adadaddsssssssddddddddddddddddddddd'\
5029 'ddddddddddddddddddddddddddddddddddd'\
5030 'ddddddddddddddddddddddddddddddddddd'\
5031 'dddddddddddddddddddd Hallelulja? Od'\
5032 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5033 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5034 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5035 'fffffffffffffffffffffffffffffffffff'\
5036 'fffffffffffffffffffff ggggggggggggg'\
5037 'ggggggggggggggggggggggggggggggggggg'\
5038 'ggggggggggggggggggggggggggggggggggg'\
5039 'ggggggggggggggggggggggggggggggggggg'\
5044 # MIME encoding (QP) stress message body
5046 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5047 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5048 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5049 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5050 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5051 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5052 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5053 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5054 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5055 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5056 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5057 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5058 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5059 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5060 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5061 "auf den zeilen vorher.\r\n"\
5062 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5064 "Die letzte Zeile war nur ein Punkt.\r\n"\
5066 "Das waren deren zwei.\r\n"\
5068 "Die letzte Zeile war ein Leerschritt.\n"\
5069 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5072 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5074 "Das waren deren zwei. ditto.\n"\
5076 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5077 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5078 "auf den zeilen vorher.\n"\
5080 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5081 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5083 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5085 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5087 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5089 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5091 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5093 "QP am Zeilenende über soft-nl hinweg\n"\
5094 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5096 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5098 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5100 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5102 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5104 "Die letzte Zeile war ein Leerschritt.\n"\
5109 # if have_feat devel; then
5110 # ARGS="${ARGS} -Smemdebug"
5114 if [ -n "${UTF8_LOCALE}" ]; then
5115 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5117 printf 'No Unicode locale found, disabling Unicode tests\n'
5125 # Test all configs TODO doesn't cover all *combinations*, stupid!
5129 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5130 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5131 NOTME["OPT_CROSS_BUILD"] = 1
5132 NOTME["OPT_AUTOCC"] = 1
5133 NOTME["OPT_AMALGAMATION"] = 1
5134 NOTME["OPT_DEBUG"] = 1
5135 NOTME["OPT_DEVEL"] = 1
5136 NOTME["OPT_ASAN_ADDRESS"] = 1
5137 NOTME["OPT_ASAN_MEMORY"] = 1
5138 NOTME["OPT_FORCED_STACKPROT"] = 1
5139 NOTME["OPT_NOMEMDBG"] = 1
5140 NOTME["OPT_NYD2"] = 1
5145 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5146 MULVALS["VAL_IDNA"] = 1
5148 #VALKEYS[0] = "VAL_RANDOM"
5149 VALVALS["VAL_RANDOM"] = 1
5152 /^[[:space:]]*OPT_/{
5153 sub(/^[[:space:]]*/, "")
5154 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5155 # does not seem to be a compliant escape for =
5157 $1 = substr($1, 1, index($1, "=") - 1)
5159 OPTVALS[OPTNO++] = $1
5162 /^[[:space:]]*VAL_/{
5163 sub(/^[[:space:]]*/, "")
5164 val = substr($0, index($0, "=") + 1)
5166 val = substr(val, 2)
5167 val = substr(val, 1, length(val) - 1)
5169 $1 = substr($1, 1, index($1, "=") - 1)
5172 else if(VALVALS[$1]){
5173 VALKEYS[VALNO++] = $1
5178 function onepass(addons){
5179 a_onepass__worker(addons, "1", "0")
5180 a_onepass__worker(addons, "0", "1")
5182 function a_onepass__worker(addons, b0, b1){
5183 # Doing this completely sequentially and not doing make distclean in
5184 # between runs should effectively result in lesser compilations.
5185 # It is completely dumb nonetheless... TODO
5186 for(ono = 0; ono < OPTNO; ++ono){
5188 for(i = 0; i < ono; ++i){
5189 myconf = myconf " " OPTVALS[i] "=" b0 " "
5191 j = MULCHOICE[OPTVALS[i]]
5196 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5200 for(i = ono; i < OPTNO; ++i){
5201 myconf = myconf " " OPTVALS[i] "=" b1 " "
5203 j = MULCHOICE[OPTVALS[i]]
5208 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5214 myconf = VALKEYS[i] "=any " myconf
5216 myconf = myconf " " ALWAYS " " addons
5221 i = split(MULVALS[mula], ia)
5225 print mula "=\"" j "\" " myconf
5231 # We cannot test NULL because of missing UI strings, which will end
5232 # up with different checksums
5233 print "CONFIG=NULLI OPT_AUTOCC=1"
5235 j = split(VALVALS[VALKEYS[i]], ia)
5239 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5242 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5243 print "CONFIG=NETSEND OPT_AUTOCC=1"
5244 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5246 j = split(VALVALS[VALKEYS[i]], ia)
5250 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5253 print "CONFIG=DEVEL OPT_AUTOCC=1"
5254 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5256 onepass("OPT_DEBUG=1")
5259 ' |
while read c
; do
5260 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5261 printf "\n\n##########\n$c\n"
5262 printf "\n\n##########\n$c\n" >&2
5263 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5264 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5265 printf 'Skipping after config, nothing changed\n'
5266 printf 'Skipping after config, nothing changed\n' >&2
5269 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5272 cd .. && ${MAKE} distclean
5275 [ -n "${ERR}" ] && echo > ${ERR}
5276 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5278 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5281 while [ ${#} -gt 0 ]; do
5287 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'