2 #@ Synopsis: ./cc-test.sh [--check-only s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ The latter generates output files.
5 #@ TODO _All_ the tests should happen in a temporary subdir.
8 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
9 # such is a compile-time variable
10 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
11 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
12 ADDARG_UNI
=-Sttycharset=UTF-8
17 #UTF8_LOCALE= autodetected unless set
19 # Note valgrind has problems with FDs in forked childs, which causes some tests
20 # to fail (the FD is rewound and thus will be dumped twice)
22 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
24 ## -- (>8 -- 8<) -- ##
26 # For heaven's sake auto-redirect on SunOS/Solaris
27 if [ "x${SHELL}" = x
] ||
[ "${SHELL}" = /bin
/sh
] && \
28 [ -f /usr
/xpg
4/bin
/sh
] && [ -x /usr
/xpg
4/bin
/sh
]; then
29 SHELL
=/usr
/xpg
4/bin
/sh
31 exec /usr
/xpg
4/bin
/sh
"${0}" "${@}"
33 [ -n "${SHELL}" ] || SHELL
=/bin
/sh
36 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
41 printf >&2 -- "${fmt}\\n" "${@}"
44 # which(1) not standardized, command(1) -v may return non-executable: unroll!
45 acmd_test
() { __acmd
"${1}" 1 0 0; }
46 acmd_test_fail
() { __acmd
"${1}" 1 1 0; }
47 acmd_set
() { __acmd
"${2}" 0 0 0 "${1}"; }
48 acmd_set_fail() { __acmd "${2}" 0 1 0 "${1}"; }
49 acmd_testandset
() { __acmd
"${2}" 1 0 0 "${1}"; }
50 acmd_testandset_fail() { __acmd "${2}" 1 1 0 "${1}"; }
51 thecmd_set
() { __acmd
"${2}" 0 0 1 "${1}"; }
52 thecmd_set_fail() { __acmd "${2}" 0 1 1 "${1}"; }
53 thecmd_testandset
() { __acmd
"${2}" 1 0 1 "${1}"; }
54 thecmd_testandset_fail() { __acmd "${2}" 1 1 1 "${1}"; }
56 pname
=${1} dotest=${2} dofail=${3} verbok=${4} varname=${5}
58 if [ "${dotest}" -ne 0 ]; then
59 eval dotest
=\$
${varname}
60 if [ -n "${dotest}" ]; then
61 [ -n "${VERBOSE}" ] && [ ${verbok} -ne 0 ] &&
62 msg
' . ${%s} ... %s' "${pname}" "${dotest}"
68 [ -n "${noglob_shell}" ] && set -o noglob
70 [ -n "${noglob_shell}" ] && set +o noglob
74 if [ -z "${path}" ] || [ "${path}" = . ]; then
75 if [ -d "${PWD}" ]; then
81 if [ -f "${path}/${pname}" ] && [ -x "${path}/${pname}" ]; then
82 [ -n "${VERBOSE}" ] && [ ${verbok} -ne 0 ] &&
83 msg ' .
${%s} ... %s' "${pname}" "${path}/${pname}"
84 [ -n "${varname}" ] && eval ${varname}="${path}/${pname}"
89 # We may have no builtin string functions, we yet have no programs we can
90 # use, try to access once from the root, assuming it is an absolute path if
91 # that finds the executable
92 if ( cd && [ -f "${pname}" ] && [ -x "${pname}" ] ); then
93 [ -n "${VERBOSE}" ] && [ ${verbok} -ne 0 ] &&
94 msg ' . ${%s} ... %s' "${pname}" "${pname}"
95 [ -n "${varname}" ] && eval ${varname}="${pname}"
99 [ ${dofail} -eq 0 ] && return 1
100 msg
'ERROR: no trace of utility '"${pname}"
104 thecmd_testandset_fail
grep grep
106 # Problem: force $SHELL to be a real shell. It seems some testing environments
107 # use nologin(?), but we need a real shell for command execution
108 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
109 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
112 exec /bin
/sh
"${0}" "${@}"
115 thecmd_testandset_fail MAKE
make
116 thecmd_testandset_fail
awk awk
117 thecmd_testandset_fail
cat cat
118 thecmd_testandset_fail
cksum cksum
119 thecmd_testandset_fail
rm rm
120 thecmd_testandset_fail
sed sed
122 # We sometimes "fake" sendmail(1) a.k.a. *mta* with a shell wrapper, and it
123 # happens that /bin/sh is often terribly slow
124 if acmd_set MYSHELL dash || acmd_set MYSHELL mksh
; then
127 thecmd_testandset_fail MYSHELL
"${SHELL}"
132 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
136 # Wed Oct 2 01:50:07 UTC 1996
137 SOURCE_DATE_EPOCH
=844221007
139 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
140 unset POSIXLY_CORRECT
143 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
144 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
148 CHECK_ONLY
= MAE_TEST
= MAILX
=
149 if [ "${1}" = --check-only ]; then
152 [ -x "${MAILX}" ] || usage
154 elif [ "${1}" = --mae-test ]; then
157 [ -x "${MAILX}" ] || usage
159 thecmd_testandset_fail
cp cp
160 thecmd_testandset_fail
tr tr
163 MAILX
="${MEMTESTER}${MAILX}"
164 export RAWMAILX MAILX
166 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
167 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
168 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
170 \if [ "${ttycharset}" @i=% utf ]
175 \wysh set LC_ALL=${1}
177 \eval xcall cset_test "${@}"
181 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
182 en_US.utf8 en_US.UTF-8
184 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
186 if [ -z "${UTF8_LOCALE}" ] && acmd_set i locale
; then
187 UTF8_LOCALE
=`${i} -a | { m=
189 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
191 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
205 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
206 trap "exit 1" HUP INT TERM
209 # Test all configs TODO doesn't cover all *combinations*, stupid!
213 NOTME["OPT_AUTOCC"] = 1
214 NOTME["OPT_DEBUG"] = 1
215 NOTME["OPT_DEVEL"] = 1
216 NOTME["OPT_NOEXTMD5"] = 1
217 NOTME["OPT_ASAN_ADDRESS"] = 1
218 NOTME["OPT_ASAN_MEMORY"] = 1
219 NOTME["OPT_FORCED_STACKPROT"] = 1
220 NOTME["OPT_NOMEMDBG"] = 1
221 NOTME["OPT_NYD2"] = 1
224 /^[[:space:]]*OPT_/ {
225 sub(/^[[:space:]]*/, "")
226 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
227 # does not seem to be a compliant escape for =
229 $1 = substr($1, 1, index($1, "=") - 1)
235 # Doing this completely sequentially and not doing make distclean in
236 # between runs should effectively result in lesser compilations.
237 # It is completely dumb nonetheless... TODO
238 for (j = 1; j < i; ++j) {
239 for (k = 1; k < j; ++k)
241 for (k = j; k < i; ++k)
243 printf "OPT_AUTOCC=1\n"
245 for (j = 1; j < i; ++j) {
246 for (k = 1; k < j; ++k)
248 for (k = j; k < i; ++k)
250 printf "OPT_AUTOCC=1\n"
253 for (j = 1; j < i; ++j) {
254 for (k = 1; k < j; ++k)
256 for (k = j; k < i; ++k)
258 printf "OPT_AUTOCC=1\n"
259 printf "OPT_DEBUG=1\n"
261 for (j = 1; j < i; ++j) {
262 for (k = 1; k < j; ++k)
264 for (k = j; k < i; ++k)
266 printf "OPT_AUTOCC=1\n"
267 printf "OPT_DEBUG=1\n"
270 printf "CONFIG=NULL OPT_AUTOCC=0\n"
271 printf "CONFIG=NULL OPT_AUTOCC=1\n"
272 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
273 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
274 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
275 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
276 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
277 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
278 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
279 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
280 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
281 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
282 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
283 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
286 printf "\n\n##########\n$c\n"
287 printf "\n\n##########\n$c\n" >&2
288 sh
-c "${MAKE} ${c} all test"
294 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
295 ${grep} +${1} ) >/dev
/null
2>&1
299 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
301 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
308 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
309 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
310 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
311 csum
="`${cksum} < ${f}`"
312 if [ "${csum}" = "${s}" ]; then
313 printf '%s: ok\n' "${tid}"
316 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
318 if [ -n "${MAE_TEST}" ]; then
319 x
=`echo ${tid} | ${tr} "/:=" "__-"`
320 ${cp} -f "${f}" ./mae-test-"${x}"
326 printf '%s: error: %s\n' ${1} "${2}"
330 [ $? -ne 0 ] && err $1 'unexpected non-0 exit status'
334 [ $? -eq 0 ] && err $1 'unexpected 0 exit status'
337 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
339 echo "$
((${1} + ${2}))"
341 elif acmd_set expr expr; then
343 echo `${expr} ${1} + ${2}`
347 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
351 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
353 echo "$
((${1} % ${2}))"
355 elif acmd_set modexpr expr; then
357 echo `${modexpr} ${1} % ${2}`
361 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
366 # Basic (easily testable) behaviour tests
368 t_behave_X_opt_input_command_stack
372 t_behave_input_inject_semicolon_seq
373 t_behave_commandalias
376 t_behave_macro_param_shift
388 # FIXME t_behave_mlist
391 t_behave_record_a_resend
394 t_behave_compose_hooks
395 t_behave_message_injections
396 t_behave_mime_types_load_control
401 t_behave_mass_recipients
402 t_behave_lreply_futh_rth_etc
403 t_behave_iconv_mbyte_base64
406 t_behave_X_opt_input_command_stack() {
407 t_prolog t_behave_X_opt_input_command_stack
409 ${cat} <<- '__EOT' > "${BODY}"
417 echo "define mac1
{";\
418 echo " echo mac1-1 via1 \
$0";\
420 echo " echo mac1-2
";\
422 echo " echo mac1-3
";\
425 echo "define mac2
{";\
426 echo " echo mac2-1 via1 \
$0";\
428 echo " echo mac2-2
";\
434 echo echo 1-1-1 via1 \
$0;\
446 # The -X option supports multiline arguments, and those can internally use
447 # reverse solidus newline escaping. And all -X options are joined...
449 < "${BODY}" ${MAILX} ${ARGS} \
464 echo "define mac1 {";\
465 echo " echo mac1-1 via2 \$0";\
467 echo " echo mac1-2";\
469 echo " echo mac1-3";\
472 echo "define mac2 {";\
473 echo " echo mac2-1 via2 \$0";\
475 echo " echo mac2-2";\
481 echo echo 1-1-1 via2 \$0;\
495 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
500 t_behave_X_errexit
() {
501 t_prolog t_behave_X_errexit
503 ${cat} <<- '__EOT' > "${BODY}"
509 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
510 -X'echo one' -X' echos nono ' -X'echo two' \
512 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
514 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
516 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
518 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
520 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
524 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
525 -X'echo one' -X' echos nono ' -X'echo two' \
527 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
529 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
531 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
533 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
535 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
537 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
539 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
541 ## Repeat 4-7 with ignerr set
543 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
545 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
546 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
548 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
550 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
552 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
554 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
556 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
558 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
560 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
565 t_behave_S_freeze() {
566 t_prolog t_behave_S_freeze
570 # Test basic assumption
571 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
572 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
574 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
577 ${cat} <<- '__EOT' > "${BODY}"
582 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
583 -Snoasksub -Sasksub -Snoasksub \
584 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
586 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
588 ${cat} <<- '__EOT' > "${BODY}"
593 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
594 -Snoasksub -Sasksub \
595 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
597 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
600 ${cat} <<- '__EOT' > "${BODY}"
601 echo dietcurd<$dietcurd>
603 echo dietcurd<$dietcurd>
605 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
606 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
607 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
608 -X'echo dietcurd<$dietcurd>' \
610 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
612 ${cat} <<- '__EOT' > "${BODY}"
613 echo dietcurd<$dietcurd>
615 echo dietcurd<$dietcurd>
617 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
618 -Sdietcurd=strawberry
-Snodietcurd \
619 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
620 -X'echo dietcurd<$dietcurd>' \
622 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
624 # TODO once we have a detached one with env=1..
625 if [ -n "`</dev/null ${MAILX} ${ARGS} -:/ -X'!echo $TERM' -Xx`" ]; then
626 echo 'behave:s_freeze-{5,6}: shell sets $TERM, skipped'
628 ${cat} <<- '__EOT' > "${BODY}"
629 !echo "shell says TERM<$TERM>"
631 !echo "shell says TERM<$TERM>"
633 !echo "shell says TERM<$TERM>"
635 !echo "shell says TERM<$TERM>"
637 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
638 -STERM=strawberry
-SnoTERM -STERM=vanilla \
639 -X'echo mail<$TERM>' -X'unset TERM' \
640 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
642 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
644 ${cat} <<- '__EOT' > "${BODY}"
645 !echo "shell says TERM<$TERM>"
647 !echo "shell says TERM<$TERM>"
649 !echo "shell says TERM<$TERM>"
651 !echo "shell says TERM<$TERM>"
653 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
654 -STERM=strawberry
-SnoTERM \
655 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
656 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
658 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
666 t_prolog t_behave_wysh
668 ${cat} <<- '__EOT' > "${BODY}"
687 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
688 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
689 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
691 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
692 echo a$'\u0041\u41\u0C1\U00000041\U41'c
715 echo a$'b\U0000000'dt
716 echo a$'b\U00000000'du
726 if [ -z "${UTF8_LOCALE}" ]; then
727 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
729 < "${BODY}" DIET=CURD TIED= \
730 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
731 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
734 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
735 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
740 t_behave_input_inject_semicolon_seq() {
741 t_prolog t_behave_input_inject_semicolon_seq
743 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
748 echon this_is_mymac;call mydeepmac;echon ';';
750 echon one';';call mymac;echon two";";call mymac;echo three$';';
752 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
754 echon one';';call mymac;echon two";";call mymac;echo three$';';
757 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
762 t_behave_commandalias() {
763 t_prolog t_behave_commandalias
765 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
766 commandalias echo echo hoho
770 commandalias XxX XxXx
771 commandalias XxXx XxXxX
772 commandalias XxXxX XxXxXx
773 commandalias XxXxXx echo huhu
774 commandalias XxXxXxX echo huhu
776 commandalias XxXxXx XxXxXxX
779 commandalias XxXxXx echo huhu
783 check behave:commandalias 0 "${MBOX}" '3694143612 31'
789 t_prolog t_behave_ifelse
791 # Nestable conditions test
792 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
814 if $dietcurd == 'yoho'
819 if $dietcurd @== 'Yoho'
824 if $dietcurd == 'Yoho'
829 if $dietcurd != 'yoho'
834 if $dietcurd @!= 'Yoho'
839 if $dietcurd != 'Yoho'
900 if $dietcurd == 'yohu'
902 elif $dietcurd == 'yoha'
904 elif $dietcurd == 'yohe'
906 elif $dietcurd == 'yoho'
908 if $dietcurd == 'yohu'
910 elif $dietcurd == 'yoha'
912 elif $dietcurd == 'yohe'
914 elif $dietcurd == 'yoho'
916 if $dietcurd == 'yohu'
918 elif $dietcurd == 'yoha'
920 elif $dietcurd == 'yohe'
922 elif $dietcurd == 'yoho'
1026 if $dietcurd @i=% aB
1071 set diet=abc curd=abc
1077 set diet=abc curd=abcd
1083 # 1. Shitty grouping capabilities as of today
1084 unset diet curd ndefined
1085 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1091 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1096 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1101 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1106 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1111 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1112 && [ no ] || [ yes ]
1117 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1122 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1127 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1132 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1137 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1142 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1147 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1152 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1157 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1162 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1168 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1174 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1179 # 2. Shitty grouping capabilities as of today
1180 unset diet curd ndefined
1181 if [ false || false || true ] && [ false || true ] && yes
1186 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1191 if [ 1 || 0 || 0 || 0 ]
1196 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1201 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1206 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1211 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1216 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1221 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1226 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1231 if 1 || 0 || 0 || 0 && 0
1236 if 1 || 0 || 0 || 0 && 1
1241 if 0 || 0 || 0 || 1 && 0
1246 if 0 || 0 || 0 || 1 && 1
1251 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1256 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1262 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1267 if $diet == 'yo' && $curd == 'ho' && $ndefined
1273 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1278 if $diet == 'yo' && $curd == 'ho' && $ndefined
1283 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1288 # Some more en-braced variables
1290 if ${diet} == ${curd}
1295 if ${diet} != ${curd}
1311 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1316 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1321 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1326 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1331 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1336 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1341 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1346 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1351 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1357 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1362 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1367 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1372 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1377 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1382 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1387 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1392 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1397 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1404 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1406 if have_feat regex; then
1407 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1409 if $dietcurd =~ '^yo.*'
1414 if $dietcurd =~ '^Yo.*'
1419 if $dietcurd @=~ '^Yo.*'
1424 if $dietcurd =~ '^yOho.+'
1429 if $dietcurd @!~ '.*Ho$'
1434 if $dietcurd !~ '.+yohO$'
1439 if [ $dietcurd @i!~ '.+yoho$' ]
1444 if ! [ $dietcurd @i=~ '.+yoho$' ]
1449 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1454 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1459 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1464 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1469 if ! ! ! $dietcurd !~ '.+yoho$'
1474 if ! ! ! $dietcurd =~ '.+yoho$'
1479 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1484 set diet=abc curd='^abc$'
1490 set diet=abc curd='^abcd$'
1498 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1500 printf 'behave:if-regex: unsupported, skipped\n'
1506 t_behave_localopts() {
1507 t_prolog t_behave_localopts
1509 # Nestable conditions test
1510 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1525 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1530 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1531 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1540 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1542 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1551 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1558 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1565 echo ----- $1: $2 -> $3 -> $4
1573 call llx
'call off' on on on
1574 call llx
'call off' off on on
1575 call llx
'call off' on off on
1576 call llx
'call off' on off off
1577 localopts call-fixate on
1578 call llx
'call-fixate on' on on on
1579 call llx
'call-fixate on' off on on
1580 call llx
'call-fixate on' on off on
1581 call llx
'call-fixate on' on off off
1582 unset x
;localopts call on
1583 call llx
'call on' on on on
1584 call llx
'call on' off on on
1585 call llx
'call on' on off on
1586 call llx
'call on' on off off
1591 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1596 t_behave_macro_param_shift
() {
1597 t_prolog t_behave_macro_param_shift
1599 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1602 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1607 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1608 if [ $# > 1 ] || [ $ignerr == '' ]
1613 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1615 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1619 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1624 call t2 1 you get four args
1625 echo t1.1: $?';' ignerr ($ignerr) should not exist
1626 call t2 1 you get 'three args'
1627 echo t1.2: $?';' ignerr ($ignerr) should not exist
1628 call t2 1 you 'get two args'
1629 echo t1.3: $?';' ignerr ($ignerr) should not exist
1630 call t2 1 'you get one arg'
1631 echo t1.4: $?';' ignerr ($ignerr) should not exist
1632 ignerr call t2 '' 'you get one arg'
1633 echo t1.5: $?';' ignerr ($ignerr) should not exist
1638 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1643 t_behave_addrcodec() {
1644 t_prolog t_behave_addrcodec
1646 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1647 vput addrcodec res e
1 <doog@def
>
1648 echo $?
/$^ERRNAME
$res
1649 eval vput addrcodec res d
$res
1650 echo $?
/$^ERRNAME
$res
1651 vput addrcodec res e
2 .
<doog@def
>
1652 echo $?
/$^ERRNAME
$res
1653 eval vput addrcodec res d
$res
1654 echo $?
/$^ERRNAME
$res
1655 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1656 echo $?
/$^ERRNAME
$res
1657 eval vput addrcodec res d
$res
1658 echo $?
/$^ERRNAME
$res
1659 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1660 echo $?
/$^ERRNAME
$res
1661 eval vput addrcodec res d
$res
1662 echo $?
/$^ERRNAME
$res
1663 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1664 echo $?
/$^ERRNAME
$res
1665 eval vput addrcodec res d
$res
1666 echo $?
/$^ERRNAME
$res
1668 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1669 echo $?
/$^ERRNAME
$res
1670 eval vput addrcodec res d
$res
1671 echo $?
/$^ERRNAME
$res
1672 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1673 echo $?
/$^ERRNAME
$res
1674 eval vput addrcodec res d
$res
1675 echo $?
/$^ERRNAME
$res
1676 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1677 echo $?
/$^ERRNAME
$res
1678 eval vput addrcodec res d
$res
1679 echo $?
/$^ERRNAME
$res
1680 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1681 echo $?
/$^ERRNAME
$res
1682 eval vput addrcodec res d
$res
1683 echo $?
/$^ERRNAME
$res
1684 vput addrcodec res
+e
8 \
1685 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1686 echo $?
/$^ERRNAME
$res
1687 eval vput addrcodec res d
$res
1688 echo $?
/$^ERRNAME
$res
1689 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1690 echo $?
/$^ERRNAME
$res
1691 eval vput addrcodec res d
$res
1692 echo $?
/$^ERRNAME
$res
1693 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1694 echo $?
/$^ERRNAME
$res
1695 eval vput addrcodec res d
$res
1696 echo $?
/$^ERRNAME
$res
1697 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1698 echo $?
/$^ERRNAME
$res
1699 eval vput addrcodec res d
$res
1700 echo $?
/$^ERRNAME
$res
1701 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1702 echo $?
/$^ERRNAME
$res
1703 eval vput addrcodec res d
$res
1704 echo $?
/$^ERRNAME
$res
1705 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1706 echo $?
/$^ERRNAME
$res
1707 eval vput addrcodec res d
$res
1708 echo $?
/$^ERRNAME
$res
1709 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1710 echo $?
/$^ERRNAME
$res
1711 eval vput addrcodec res d
$res
1712 echo $?
/$^ERRNAME
$res
1713 vput addrcodec res
+e
15 \
1714 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1715 echo $?
/$^ERRNAME
$res
1716 eval vput addrcodec res d
$res
1717 echo $?
/$^ERRNAME
$res
1718 vput addrcodec res
+e
16 \
1719 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1720 echo $?
/$^ERRNAME
$res
1721 eval vput addrcodec res d
$res
1722 echo $?
/$^ERRNAME
$res
1723 vput addrcodec res
+e
17 \
1724 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1725 echo $?
/$^ERRNAME
$res
1726 eval vput addrcodec res d
$res
1727 echo $?
/$^ERRNAME
$res
1728 vput addrcodec res
+e
18 \
1729 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1730 echo $?
/$^ERRNAME
$res
1731 eval vput addrcodec res d
$res
1732 echo $?
/$^ERRNAME
$res
1733 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1734 echo $?
/$^ERRNAME
$res
1735 eval vput addrcodec res d
$res
1736 echo $?
/$^ERRNAME
$res
1738 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1739 echo $?
/$^ERRNAME
$res
1740 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1741 echo $?/$^ERRNAME $res
1742 eval vput addrcodec res d $res
1743 echo $?/$^ERRNAME $res
1745 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1746 echo $?/$^ERRNAME $res
1747 eval vput addrcodec res d $res
1748 echo $?/$^ERRNAME $res
1750 vput addrcodec res s \
1751 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1752 echo $?/$^ERRNAME $res
1755 check behave:addrcodec 0 "${MBOX}" '429099645 2414'
1761 t_prolog t_behave_vexpr
1763 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1764 vput vexpr res
= 9223372036854775807
1765 echo $?
/$^ERRNAME
$res
1766 vput vexpr res
= 9223372036854775808
1767 echo $?
/$^ERRNAME
$res
1768 vput vexpr res
=@
9223372036854775808
1769 echo $?
/$^ERRNAME
$res
1770 vput vexpr res
= -9223372036854775808
1771 echo $?
/$^ERRNAME
$res
1772 vput vexpr res
= -9223372036854775809
1773 echo $?
/$^ERRNAME
$res
1774 vput vexpr res
=@
-9223372036854775809
1775 echo $?
/$^ERRNAME
$res
1778 echo $?
/$^ERRNAME
$res
1780 echo $?
/$^ERRNAME
$res
1782 echo $?
/$^ERRNAME
$res
1784 vput vexpr res
+ 0 0
1785 echo $?
/$^ERRNAME
$res
1786 vput vexpr res
+ 0 1
1787 echo $?
/$^ERRNAME
$res
1788 vput vexpr res
+ 1 1
1789 echo $?
/$^ERRNAME
$res
1791 vput vexpr res
+ 9223372036854775807 0
1792 echo $?
/$^ERRNAME
$res
1793 vput vexpr res
+ 9223372036854775807 1
1794 echo $?
/$^ERRNAME
$res
1795 vput vexpr res
+@
9223372036854775807 1
1796 echo $?
/$^ERRNAME
$res
1797 vput vexpr res
+ 0 9223372036854775807
1798 echo $?
/$^ERRNAME
$res
1799 vput vexpr res
+ 1 9223372036854775807
1800 echo $?
/$^ERRNAME
$res
1801 vput vexpr res
+@
1 9223372036854775807
1802 echo $?
/$^ERRNAME
$res
1804 vput vexpr res
+ -9223372036854775808 0
1805 echo $?
/$^ERRNAME
$res
1806 vput vexpr res
+ -9223372036854775808 -1
1807 echo $?
/$^ERRNAME
$res
1808 vput vexpr res
+@
-9223372036854775808 -1
1809 echo $?
/$^ERRNAME
$res
1810 vput vexpr res
+ 0 -9223372036854775808
1811 echo $?
/$^ERRNAME
$res
1812 vput vexpr res
+ -1 -9223372036854775808
1813 echo $?
/$^ERRNAME
$res
1814 vput vexpr res
+@
-1 -9223372036854775808
1815 echo $?
/$^ERRNAME
$res
1817 vput vexpr res
- 0 0
1818 echo $?
/$^ERRNAME
$res
1819 vput vexpr res
- 0 1
1820 echo $?
/$^ERRNAME
$res
1821 vput vexpr res
- 1 1
1822 echo $?
/$^ERRNAME
$res
1824 vput vexpr res
- 9223372036854775807 0
1825 echo $?
/$^ERRNAME
$res
1826 vput vexpr res
- 9223372036854775807 -1
1827 echo $?
/$^ERRNAME
$res
1828 vput vexpr res
-@
9223372036854775807 -1
1829 echo $?
/$^ERRNAME
$res
1830 vput vexpr res
- 0 9223372036854775807
1831 echo $?
/$^ERRNAME
$res
1832 vput vexpr res
- -1 9223372036854775807
1833 echo $?
/$^ERRNAME
$res
1834 vput vexpr res
- -2 9223372036854775807
1835 echo $?
/$^ERRNAME
$res
1836 vput vexpr res
-@
-2 9223372036854775807
1837 echo $?
/$^ERRNAME
$res
1839 vput vexpr res
- -9223372036854775808 +0
1840 echo $?
/$^ERRNAME
$res
1841 vput vexpr res
- -9223372036854775808 +1
1842 echo $?
/$^ERRNAME
$res
1843 vput vexpr res
-@
-9223372036854775808 +1
1844 echo $?
/$^ERRNAME
$res
1845 vput vexpr res
- 0 -9223372036854775808
1846 echo $?
/$^ERRNAME
$res
1847 vput vexpr res
- +1 -9223372036854775808
1848 echo $?
/$^ERRNAME
$res
1849 vput vexpr res
-@
+1 -9223372036854775808
1850 echo $?
/$^ERRNAME
$res
1852 vput vexpr res
+ -13 -2
1853 echo $?
/$^ERRNAME
$res
1854 vput vexpr res
- 0 0
1855 echo $?
/$^ERRNAME
$res
1856 vput vexpr res
- 0 1
1857 echo $?
/$^ERRNAME
$res
1858 vput vexpr res
- 1 1
1859 echo $?
/$^ERRNAME
$res
1860 vput vexpr res
- -13 -2
1861 echo $?
/$^ERRNAME
$res
1863 vput vexpr res
* 0 0
1864 echo $?
/$^ERRNAME
$res
1865 vput vexpr res
* 0 1
1866 echo $?
/$^ERRNAME
$res
1867 vput vexpr res
* 1 1
1868 echo $?
/$^ERRNAME
$res
1869 vput vexpr res
* -13 -2
1870 echo $?
/$^ERRNAME
$res
1872 vput vexpr res
/ 0 0
1873 echo $?
/$^ERRNAME
$res
1874 vput vexpr res
/ 0 1
1875 echo $?
/$^ERRNAME
$res
1876 vput vexpr res
/ 1 1
1877 echo $?
/$^ERRNAME
$res
1878 vput vexpr res
/ -13 -2
1879 echo $?
/$^ERRNAME
$res
1881 vput vexpr res
% 0 0
1882 echo $?
/$^ERRNAME
$res
1883 vput vexpr res
% 0 1
1884 echo $?
/$^ERRNAME
$res
1885 vput vexpr res
% 1 1
1886 echo $?
/$^ERRNAME
$res
1887 vput vexpr res
% -13 -2
1888 echo $?
/$^ERRNAME
$res
1891 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1893 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1894 vput vexpr res find 'bananarama' 'nana'
1895 echo $?/$^ERRNAME :$res:
1896 vput vexpr res find 'bananarama' 'bana'
1897 echo $?/$^ERRNAME :$res:
1898 vput vexpr res find 'bananarama' 'Bana'
1899 echo $?/$^ERRNAME :$res:
1900 vput vexpr res find 'bananarama' 'rama'
1901 echo $?/$^ERRNAME :$res:
1903 vput vexpr res ifind 'bananarama' 'nana'
1904 echo $?/$^ERRNAME :$res:
1905 vput vexpr res ifind 'bananarama' 'bana'
1906 echo $?/$^ERRNAME :$res:
1907 vput vexpr res ifind 'bananarama' 'Bana'
1908 echo $?/$^ERRNAME :$res:
1909 vput vexpr res ifind 'bananarama' 'rama'
1910 echo $?/$^ERRNAME :$res:
1912 vput vexpr res substring 'bananarama' 1
1913 echo $?/$^ERRNAME :$res:
1914 vput vexpr res substring 'bananarama' 3
1915 echo $?/$^ERRNAME :$res:
1916 vput vexpr res substring 'bananarama' 5
1917 echo $?/$^ERRNAME :$res:
1918 vput vexpr res substring 'bananarama' 7
1919 echo $?/$^ERRNAME :$res:
1920 vput vexpr res substring 'bananarama' 9
1921 echo $?/$^ERRNAME :$res:
1922 vput vexpr res substring 'bananarama' 10
1923 echo $?/$^ERRNAME :$res:
1924 vput vexpr res substring 'bananarama' 1 3
1925 echo $?/$^ERRNAME :$res:
1926 vput vexpr res substring 'bananarama' 3 3
1927 echo $?/$^ERRNAME :$res:
1928 vput vexpr res substring 'bananarama' 5 3
1929 echo $?/$^ERRNAME :$res:
1930 vput vexpr res substring 'bananarama' 7 3
1931 echo $?/$^ERRNAME :$res:
1932 vput vexpr res substring 'bananarama' 9 3
1933 echo $?/$^ERRNAME :$res:
1934 vput vexpr res substring 'bananarama' 10 3
1935 echo $?/$^ERRNAME :$res:
1937 vput vexpr res substring 'bananarama' -1
1938 echo $?/$^ERRNAME :$res:
1939 vput vexpr res substring 'bananarama' -3
1940 echo $?/$^ERRNAME :$res:
1941 vput vexpr res substring 'bananarama' -5
1942 echo $?/$^ERRNAME :$res:
1943 vput vexpr res substring 'bananarama' -7
1944 echo $?/$^ERRNAME :$res:
1945 vput vexpr res substring 'bananarama' -9
1946 echo $?/$^ERRNAME :$res:
1947 vput vexpr res substring 'bananarama' -10
1948 echo $?/$^ERRNAME :$res:
1949 vput vexpr res substring 'bananarama' 1 -3
1950 echo $?/$^ERRNAME :$res:
1951 vput vexpr res substring 'bananarama' 3 -3
1952 echo $?/$^ERRNAME :$res:
1953 vput vexpr res substring 'bananarama' 5 -3
1954 echo $?/$^ERRNAME :$res:
1955 vput vexpr res substring 'bananarama' 7 -3
1956 echo $?/$^ERRNAME :$res:
1957 vput vexpr res substring 'bananarama' 9 -3
1958 echo $?/$^ERRNAME :$res:
1959 vput vexpr res substring 'bananarama' 10 -3
1960 echo $?/$^ERRNAME :$res:
1962 vput vexpr res trim 'Cocoon Cocoon'
1963 echo $?/$^ERRNAME :$res:
1964 vput vexpr res trim ' Cocoon Cocoon '
1965 echo $?/$^ERRNAME :$res:
1966 vput vexpr res trim-front 'Cocoon Cocoon'
1967 echo $?/$^ERRNAME :$res:
1968 vput vexpr res trim-front ' Cocoon Cocoon '
1969 echo $?/$^ERRNAME :$res:
1970 vput vexpr res trim-end 'Cocoon Cocoon'
1971 echo $?/$^ERRNAME :$res:
1972 vput vexpr res trim-end ' Cocoon Cocoon '
1973 echo $?/$^ERRNAME :$res:
1976 check behave:vexpr-string 0 "${MBOX}" '3182004322 601'
1978 if have_feat regex; then
1979 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1980 vput vexpr res regex
'bananarama' 'nana'
1981 echo $?
/$^ERRNAME
:$res:
1982 vput vexpr res regex
'bananarama' 'bana'
1983 echo $?
/$^ERRNAME
:$res:
1984 vput vexpr res regex
'bananarama' 'Bana'
1985 echo $?
/$^ERRNAME
:$res:
1986 vput vexpr res regex
'bananarama' 'rama'
1987 echo $?
/$^ERRNAME
:$res:
1989 vput vexpr res iregex
'bananarama' 'nana'
1990 echo $?
/$^ERRNAME
:$res:
1991 vput vexpr res iregex
'bananarama' 'bana'
1992 echo $?
/$^ERRNAME
:$res:
1993 vput vexpr res iregex
'bananarama' 'Bana'
1994 echo $?
/$^ERRNAME
:$res:
1995 vput vexpr res iregex
'bananarama' 'rama'
1996 echo $?
/$^ERRNAME
:$res:
1998 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1999 echo $?
/$^ERRNAME
:$res:
2000 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2001 echo $?
/$^ERRNAME
:$res:
2002 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2003 echo $?
/$^ERRNAME
:$res:
2004 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2005 echo $?
/$^ERRNAME
:$res:
2007 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2008 echo $?
/$^ERRNAME
:$res:
2009 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2010 echo $?
/$^ERRNAME
:$res:
2011 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2012 echo $?
/$^ERRNAME
:$res:
2013 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2014 echo $?
/$^ERRNAME
:$res:
2018 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
2020 printf 'behave:vexpr-regex: unsupported, skipped\n'
2026 t_behave_call_ret
() {
2027 t_prolog t_behave_call_ret
2029 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2034 vput vexpr j '&' $i 7
2040 vput vexpr j '&' $i 7
2046 echo ! The end for $1
2050 # Transport $?/$! up the call chain
2056 wysh set i=$? j=$! k=$^ERRNAME
2060 echo ! The end for $1
2061 return $i $^ERR-BUSY
2065 # Up and down it goes
2072 vput vexpr k - $1 $2
2076 echo "# <$i/$j> .. "
2080 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2083 echo ! The end
for $1=$i/$2
2087 return $i $^ERR-BUSY
2093 call w1
0; echo ?
=$?
!=$
!; echo -----;
2094 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2095 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2098 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2104 t_prolog t_behave_xcall
2106 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2111 vput vexpr j '&' $i 7
2117 echo ! The end for $1/$2
2119 return $i $^ERR-BUSY
2130 echo ?=$? !=$^ERRNAME
2133 echo ?=$? !=$^ERRNAME
2135 echo ?=$? !=$^ERRNAME
2138 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2142 ${cat} <<- '__EOT' > "${BODY}"
2147 vput vexpr j '&' $i 7
2153 echo ! The end for $1
2156 echo would be err with errexit
2165 echo zwei, ?=$? !=$!
2166 localopts yes; set errexit
2168 echo drei, ?=$? !=$^ERRNAME
2170 echo vier, ?=$? !=$^ERRNAME, this is an error
2173 echo outer 1, ?=$? !=$^ERRNAME
2175 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2177 echo outer 3, ?=$? !=$^ERRNAME
2178 echo this is definitely an error
2181 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2183 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2185 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2187 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2192 t_behave_vpospar() {
2193 t_prolog t_behave_vpospar
2195 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2196 vpospar
set hey
, "'you ", world
!
2197 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2198 vput vpospar x quote
; echo x
<$x>
2199 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2200 vput vpospar y quote
;echo y
<$y>
2201 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2202 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2203 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2206 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2207 vput vpospar z quote
;echo infun2
:z
<$z>
2211 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2212 vput vpospar y quote
;echo infun
:y
<$y>
2213 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2214 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2216 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2217 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2220 call infun This
"in a" fun
2221 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2222 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2224 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2227 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2229 echo ifs<$ifs> ifs-ws<$ifs-ws>
2230 vpospar set hey, "'you ", world!
2231 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2232 vput vpospar x quote; echo x<$x>
2233 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2234 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2237 echo ifs<$ifs> ifs-ws<$ifs-ws>
2238 vpospar set hey, "'you
", world!
2239 echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2240 vput vpospar x quote; echo x<$x>
2241 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2242 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2245 echo ifs<$ifs> ifs-ws<$ifs-ws>
2246 vpospar set hey, "'you ", world!
2247 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2248 vput vpospar x quote; echo x<$x>
2249 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2250 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2252 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2257 t_behave_atxplode() {
2258 t_prolog t_behave_atxplode
2259 TRAP_EXIT_ADDONS="./.t*"
2261 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2264 printf " (1/$#: <$1>)"
2266 if [ $# -gt 0 ]; then
2280 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2281 printf xxx;xxx arg ,b u.
2282 printf xxx;xxx arg , .
2283 printf xxx;xxx arg ,ball.
2289 echon " (1/$#: <$1>)"
2304 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2305 echon xxx;call xxx arg ,b u.
2306 echon xxx;call xxx arg , .
2307 echon xxx;call xxx arg ,ball.
2310 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2311 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2313 #${SHELL} ./.t.sh > ./.tshout 2>&1
2314 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2320 t_prolog t_behave_read
2321 TRAP_EXIT_ADDONS="./.t*"
2323 ${cat} <<- '__EOT
' > .tin
2324 hey1, "'you
", world!
2325 hey2, "'you ", bugs bunny!
2330 ${cat} <<- '__EOT
' |\
2331 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2333 echo $?/$^ERRNAME / <$a><$b><$c>
2335 echo $?/$^ERRNAME / <$a><$b><$c>
2337 echo $?/$^ERRNAME / <$a><$b><$c>
2339 echo $?/$^ERRNAME / <$a><$b><$c>
2340 unset a b c;read a b c
2341 echo $?/$^ERRNAME / <$a><$b><$c>
2342 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2344 check behave:read-1 0 "${MBOX}" '1527910147 173'
2346 ${cat} <<- '__EOT
' > .tin2
2347 hey2.0,:"'you
",:world!:mars.:
2348 hey2.1,:"'you ",:world!
2349 hey2.2,:"'you
",:bugs bunny!
2355 ${cat} <<- '__EOT' |\
2356 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2359 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2361 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2363 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2365 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2367 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2369 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2370 unset a b c
;read a b c
2371 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2373 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2374 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2376 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2378 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2380 readall d; echo $?/$^ERRNAME / <$d>
2381 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2382 readctl create .tin2
2383 readall d; echo $?/$^ERRNAME / <$d>
2384 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2385 readctl remove .tin;echo $?/$^ERRNAME;\
2386 readctl remove .tin2;echo $?/$^ERRNAME
2388 check behave:readall 0 "${MBOX}" '860434889 333'
2394 t_prolog t_behave_mbox
2395 TRAP_EXIT_ADDONS=".
/.t
*"
2399 while [ ${i} -lt 112 ]; do
2400 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2401 "${MBOX}" "${i}" "${i}"
2404 ) | ${MAILX} ${ARGS}
2405 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2407 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2408 ${MAILX} ${ARGS} > .tlst
2409 check behave:mbox-2 0 .tlst '2739893312 9103'
2411 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2412 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} > .tlst
2413 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2415 # only the odd (even)
2417 printf 'File "file://%s"\ncopy ' .tmbox2
2419 while [ ${i} -lt 112 ]; do
2421 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2424 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2425 ) |
${MAILX} ${ARGS} > .tlst
2426 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2427 check behave
:mbox-5
- .tlst
'2960975049 4573'
2430 printf 'file "file://%s"\nmove ' .tmbox2
2432 while [ ${i} -lt 112 ]; do
2434 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2437 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2438 .tmbox3 .tmbox3 .tmbox2
2439 ) | ${MAILX} ${ARGS} > .tlst
2440 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2441 ${sed} 2d < .tlst > .tlstx
2442 check behave:mbox-7 - .tlstx '2729940494 13645'
2447 t_behave_alternates() {
2448 t_prolog t_behave_alternates
2449 TRAP_EXIT_ADDONS=".
/.t
*"
2451 ${cat} <<-_EOT > ./.tsendmail.sh
2453 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2456 chmod 0755 ./.tsendmail.sh
2458 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2462 alternates a1@b1 a2@b2 a3@b3
2467 echo $?/$^ERRNAME <$rv>
2472 echo $?/$^ERRNAME <$rv>
2475 echo $?/$^ERRNAME <$rv>
2478 echo $?/$^ERRNAME <$rv>
2482 alternates a1@b1 a2@b2 a3@b3
2485 echo $?/$^ERRNAME <$rv>
2488 echo $?/$^ERRNAME <$rv>
2491 echo $?/$^ERRNAME <$rv>
2494 alternates a1@b1 a2@b2 a3@b3
2497 echo $?/$^ERRNAME <$rv>
2500 echo $?/$^ERRNAME <$rv>
2503 echo $?/$^ERRNAME <$rv>
2507 alternates a1@b1 a2@b2 a3@b3
2510 echo $?/$^ERRNAME <$rv>
2514 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2516 ~s all alternates, only a1@b1 remains
2518 ~b a3@b3 a3@c3 a3@d3
2527 alternates a1@b1 a1@c1 a2@b2 a3@b3
2529 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2531 ~b a3@b3 a3@c3 a3@d3
2538 alternates a1@b1 a2@b2 a3; set allnet
2540 ~s all alternates via allnet, only a1@b1 remains
2542 ~b a3@b3 a3@c3 a3@d3
2553 echo $?/$^ERRNAME <$rv>
2557 echo $?/$^ERRNAME <$rv>
2561 echo $?/$^ERRNAME <$rv>
2565 echo $?/$^ERRNAME <$rv>
2569 echo $?/$^ERRNAME <$rv>
2573 alternates a1@b1 a2@b2
2576 echo $?/$^ERRNAME <$rv>
2577 alternates a3@b3 a4@b4
2580 echo $?/$^ERRNAME <$rv>
2582 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2583 check behave:alternates-2 - .tall '1878598364 505'
2589 t_prolog t_behave_alias
2590 TRAP_EXIT_ADDONS=".
/.t
*"
2592 ${cat} <<-_EOT > ./.tsendmail.sh
2594 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2597 chmod 0755 ./.tsendmail.sh
2599 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2601 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2603 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2605 alias a4 a5 ex1@a4.ple
2607 alias a6 a7 ex1@a6.ple
2621 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2622 check behave:alias-2 - .tall '3548953204 152'
2624 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2625 # TODO need to somehow provide its contents to the test, then test
2630 t_behave_filetype() {
2631 t_prolog t_behave_filetype
2632 TRAP_EXIT_ADDONS=".
/.t
*"
2634 ${cat} <<-_EOT > ./.tsendmail.sh
2636 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2639 chmod 0755 ./.tsendmail.sh
2641 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2642 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2643 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2645 if acmd_set
gzip gzip; then
2648 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2649 "${MBOX}" | ${MAILX} ${ARGS} \
2650 -X'filetype gz '"${gzip}"'\ -dc '"${gzip}"'\ -c'
2651 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2652 ${MAILX} ${ARGS} -X'filetype gz '"${gzip}"'\ -dc '"${gzip}"'\ -c'
2654 check behave
:filetype-2
- "./.t.mbox" '1594682963 13520'
2655 check behave
:filetype-3
- "./.t.out" '2494681730 102'
2657 echo 'behave:filetype-2: unsupported, skipped'
2658 echo 'behave:filetype-3: unsupported, skipped'
2663 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
2669 -X'filetype gz gzip\ -dc gzip\ -c' \
2670 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
2671 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
2672 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2674 -X'filetype gz gzip\ -dc gzip\ -c' \
2675 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
2677 check behave
:filetype-4
- "./.t.mbox" '2886541147 27060'
2678 check behave
:filetype-5
- "./.t.out" '838452520 172'
2683 t_behave_record_a_resend
() {
2684 t_prolog t_behave_record_a_resend
2685 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2689 m %s\n~s Subject 1.\nHello.\n~.
2690 set record-files add-file-recipients
2691 m %s\n~s Subject 2.\nHello.\n~.
2693 resend 2 ./.t.resent
2694 Resend 1 ./.t.resent
2696 resend 2 ./.t.resent
2697 Resend 1 ./.t.resent
2698 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2701 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2702 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2703 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2708 t_behave_e_H_L_opts
() {
2709 t_prolog t_behave_e_H_L_opts
2710 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2713 ${MAILX} ${ARGS} -ef .
/.t.mbox
2714 echo ${?} > "${MBOX}"
2716 ${cat} <<-_EOT > ./.tsendmail.sh
2718 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2721 chmod 0755 .
/.tsendmail.sh
2722 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2723 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2724 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2725 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2727 ${MAILX} ${ARGS} -ef .
/.t.mbox
2728 echo ${?} >> "${MBOX}"
2729 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2730 echo ${?} >> "${MBOX}"
2731 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2732 echo ${?} >> "${MBOX}"
2733 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2734 echo ${?} >> "${MBOX}"
2735 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2736 echo ${?} >> "${MBOX}"
2737 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2738 echo ${?} >> "${MBOX}"
2739 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2740 echo ${?} >> "${MBOX}"
2742 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2743 echo ${?} >> "${MBOX}"
2744 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2745 echo ${?} >> "${MBOX}"
2746 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2747 echo ${?} >> "${MBOX}"
2748 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2749 echo ${?} >> "${MBOX}"
2750 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2751 echo ${?} >> "${MBOX}"
2752 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2753 echo ${?} >> "${MBOX}"
2754 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2755 echo ${?} >> "${MBOX}"
2757 check behave:e_H_L_opts - "${MBOX}" '1708955574 678'
2762 t_behave_compose_hooks() { # TODO monster
2763 t_prolog t_behave_compose_hooks
2764 TRAP_EXIT_ADDONS=".
/.t
*"
2766 (echo line one&&echo line two&&echo line three) > ./.treadctl
2767 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
2769 ${cat} <<-_EOT > ./.tsendmail.sh
2771 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2774 chmod 0755 ./.tsendmail.sh
2776 ${cat} <<'__EOT__' > ./.trc
2778 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
2781 vput vexpr es substr "$1" 0 1
2786 define read_mline_res {
2787 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2788 echo $len/$es/$^ERRNAME: $hl
2789 if [ $es -ne $^ERR-NONE ]
2790 xcall bail read_mline_res
2792 \xcall read_mline_res
2797 echo "~^header list
"; read hl; echo $hl;\
2798 call xerr "$hl" "in_addr
($xh) 0-1"
2800 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2801 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
2802 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2803 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
2804 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2805 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
2806 echo "~^header list
$xh"; read hl; echo $hl;\
2807 call xerr "$hl" "ins_addr
$xh 1-4"
2808 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
2811 if [ "$t_remove" == "" ]
2815 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
2816 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
2818 xcall bail "ins_addr
$xh 2-2"
2820 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
2822 xcall bail "ins_addr
$xh 2-3"
2824 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
2826 xcall bail "ins_addr
$xh 2-4"
2830 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2831 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
2832 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2833 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
2834 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2835 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
2836 echo "~^header list
$xh"; read hl; echo $hl;\
2837 call xerr "$hl" "ins_addr
$xh 3-4"
2838 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
2841 echo "~^header remove-at
$xh 1"; read es;\
2842 call xerr $es "ins_addr
$xh 3-6"
2843 echo "~^header remove-at
$xh 1"; read es;\
2844 call xerr $es "ins_addr
$xh 3-7"
2845 echo "~^header remove-at
$xh 1"; read es;\
2846 call xerr $es "ins_addr
$xh 3-8"
2847 echo "~^header remove-at
$xh 1"; read es;\
2848 vput vexpr es substr $es 0 3
2850 xcall bail "ins_addr
$xh 3-9"
2852 echo "~^header remove-at
$xh T
"; read es;\
2853 vput vexpr es substr $es 0 3
2855 xcall bail "ins_addr
$xh 3-10"
2857 echo "~^header list
$xh"; read es;\
2858 vput vexpr es substr $es 0 3
2860 xcall bail "ins_addr
$xh 3-11"
2862 echo "~^header show
$xh"; read es;\
2863 vput vexpr es substr $es 0 3
2865 xcall bail "ins_addr
$xh 3-12"
2869 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2870 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
2871 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
2872 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
2873 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2874 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
2875 echo "~^header list
$xh"; read hl; echo $hl;\
2876 call xerr "$hl" "header list
$xh 3-4"
2877 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
2880 echo "~^header remove-at
$xh 3"; read es;\
2881 call xerr $es "ins_addr
$xh 4-6"
2882 echo "~^header remove-at
$xh 2"; read es;\
2883 call xerr $es "ins_addr
$xh 4-7"
2884 echo "~^header remove-at
$xh 1"; read es;\
2885 call xerr $es "ins_addr
$xh 4-8"
2886 echo "~^header remove-at
$xh 1"; read es;\
2887 vput vexpr es substr $es 0 3
2889 xcall bail "ins_addr
$xh 4-9"
2891 echo "~^header remove-at
$xh T
"; read es;\
2892 vput vexpr es substr $es 0 3
2894 xcall bail "ins_addr
$xh 4-10"
2896 echo "~^header list
$xh"; read es;\
2897 vput vexpr es substr $es 0 3
2899 xcall bail "ins_addr
$xh 4-11"
2901 echo "~^header show
$xh"; read es;\
2902 vput vexpr es substr $es 0 3
2904 xcall bail "ins_addr
$xh 4-12"
2908 wysh set xh=$1 mult=$2
2909 echo "~^header list
"; read hl; echo $hl;\
2910 call xerr "$hl" "ins_ref
($xh) 0-1"
2912 echo "~^header insert
$xh <$xh@exam.ple
>";\
2913 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
2915 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2916 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
2917 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2918 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
2920 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
2921 vput vexpr es substr $es 0 3
2923 xcall bail "ins_ref
$xh 1-4"
2927 echo "~^header list
$xh"; read hl; echo $hl;\
2928 call xerr "$hl" "ins_ref
$xh 1-5"
2929 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
2932 if [ "$t_remove" == "" ]
2936 echo "~^header remove
$xh"; read es;\
2937 call xerr $es "ins_ref
$xh 2-1"
2938 echo "~^header remove
$xh"; read es;\
2939 vput vexpr es substr $es 0 3
2941 xcall bail "ins_ref
$xh 2-2"
2943 echo "~^header list
$xh"; read es;\
2944 vput vexpr es substr $es 0 3
2946 xcall bail "$es ins_ref
$xh 2-3"
2948 echo "~^header show
$xh"; read es;\
2949 vput vexpr es substr $es 0 3
2951 xcall bail "ins_ref
$xh 2-4"
2955 echo "~^header insert
$xh <$xh@exam.ple
>";\
2956 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
2958 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2959 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
2960 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2961 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
2963 echo "~^header list
$xh";\
2964 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
2965 echo "~^header show
$xh";\
2966 read es; call xerr $es "ins_ref
$xh 3-5"
2969 echo "~^header remove-at
$xh 1"; read es;\
2970 call xerr $es "ins_ref
$xh 3-6"
2971 if [ $mult -ne 0 ] && [ $xh != subject ]
2972 echo "~^header remove-at
$xh 1"; read es;\
2973 call xerr $es "ins_ref
$xh 3-7"
2974 echo "~^header remove-at
$xh 1"; read es;\
2975 call xerr $es "ins_ref
$xh 3-8"
2977 echo "~^header remove-at
$xh 1"; read es;\
2978 vput vexpr es substr $es 0 3
2980 xcall bail "ins_ref
$xh 3-9"
2982 echo "~^header remove-at
$xh T
"; read es;\
2983 vput vexpr es substr $es 0 3
2985 xcall bail "ins_ref
$xh 3-10"
2987 echo "~^header show
$xh"; read es;\
2988 vput vexpr es substr $es 0 3
2990 xcall bail "ins_ref
$xh 3-11"
2994 echo "~^header insert
$xh <$xh@exam.ple
> ";\
2995 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
2997 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
2998 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
2999 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3000 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
3002 echo "~^header list
$xh"; read hl; echo $hl;\
3003 call xerr "$hl" "ins_ref
$xh 4-4"
3004 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
3007 if [ $mult -ne 0 ] && [ $xh != subject ]
3008 echo "~^header remove-at
$xh 3"; read es;\
3009 call xerr $es "ins_ref
$xh 4-6"
3010 echo "~^header remove-at
$xh 2"; read es;\
3011 call xerr $es "ins_ref
$xh 4-7"
3013 echo "~^header remove-at
$xh 1"; read es;\
3014 call xerr $es "ins_ref
$xh 4-8"
3015 echo "~^header remove-at
$xh 1"; read es;\
3016 vput vexpr es substr $es 0 3
3018 xcall bail "ins_ref
$xh 4-9"
3020 echo "~^header remove-at
$xh T
"; read es;\
3021 vput vexpr es substr $es 0 3
3023 xcall bail "ins_ref
$xh 4-10"
3025 echo "~^header show
$xh"; read es;\
3026 vput vexpr es substr $es 0 3
3028 xcall bail "ins_ref
$xh 4-11"
3033 # In collect.c order
3035 call ins_ref sender 0 # Not a "ref
", but works
3039 call ins_addr reply-To
3040 call ins_addr mail-Followup-to
3041 call ins_ref messAge-id 0
3042 call ins_ref rEfErEncEs 1
3043 call ins_ref in-Reply-to 1
3044 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
3045 call ins_addr freeForm1
3046 call ins_addr freeform2
3048 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
3050 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
3058 echo "~^attachment
";\
3059 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3061 xcall bail "attach
0-1"
3064 echo "~^attach attribute .
/.treadctl
";\
3065 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3067 xcall bail "attach
0-2"
3069 echo "~^attachment attribute-at
1";\
3070 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3072 xcall bail "attach
0-3"
3075 echo "~^attachment insert .
/.treadctl
=ascii
";\
3076 read hl; echo $hl; call xerr "$hl" "attach
1-1"
3077 echo "~^attachment list
";\
3078 read es; echo $es;call xerr "$es" "attach
1-2"
3080 echo "~^attachment attribute .
/.treadctl
";\
3081 read es; echo $es;call xerr "$es" "attach
1-3"
3083 echo "~^attachment attribute .treadctl
";\
3084 read es; echo $es;call xerr "$es" "attach
1-4"
3086 echo "~^attachment attribute-at
1";\
3087 read es; echo $es;call xerr "$es" "attach
1-5"
3090 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
3091 read es; echo $es;call xerr "$es" "attach
1-6"
3092 echo "~^attachment attribute-set .treadctl content-description Au
";\
3093 read es; echo $es;call xerr "$es" "attach
1-7"
3094 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
3095 read es; echo $es;call xerr "$es" "attach
1-8"
3097 echo "~^attachment attribute .
/.treadctl
";\
3098 read es; echo $es;call xerr "$es" "attach
1-9"
3100 echo "~^attachment attribute .treadctl
";\
3101 read es; echo $es;call xerr "$es" "attach
1-10"
3103 echo "~^attachment attribute rctl
";\
3104 read es; echo $es;call xerr "$es" "attach
1-11"
3106 echo "~^attachment attribute-at
1";\
3107 read es; echo $es;call xerr "$es" "attach
1-12"
3111 echo "~^attachment insert .
/.tattach
=latin1
";\
3112 read hl; echo $hl; call xerr "$hl" "attach
2-1"
3113 echo "~^attachment list
";\
3114 read es; echo $es;call xerr "$es" "attach
2-2"
3116 echo "~^attachment attribute .
/.tattach
";\
3117 read es; echo $es;call xerr "$es" "attach
2-3"
3119 echo "~^attachment attribute .tattach
";\
3120 read es; echo $es;call xerr "$es" "attach
2-4"
3122 echo "~^attachment attribute-at
2";\
3123 read es; echo $es;call xerr "$es" "attach
2-5"
3126 echo "~^attachment attribute-set .
/.tattach filename tat
";\
3127 read es; echo $es;call xerr "$es" "attach
2-6"
3129 "~^attachment attribute-set .tattach content-description Au2
";\
3130 read es; echo $es;call xerr "$es" "attach
2-7"
3131 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
3132 read es; echo $es;call xerr "$es" "attach
2-8"
3134 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
3135 read es; echo $es;call xerr "$es" "attach
2-9"
3137 echo "~^attachment attribute .
/.tattach
";\
3138 read es; echo $es;call xerr "$es" "attach
2-10"
3140 echo "~^attachment attribute .tattach
";\
3141 read es; echo $es;call xerr "$es" "attach
2-11"
3143 echo "~^attachment attribute tat
";\
3144 read es; echo $es;call xerr "$es" "attach
2-12"
3146 echo "~^attachment attribute-at
2";\
3147 read es; echo $es;call xerr "$es" "attach
2-13"
3151 if [ "$t_remove" == "" ]
3155 echo "~^attachment remove .
/.treadctl
"; read es;\
3156 call xerr $es "attach
3-1"
3157 echo "~^attachment remove .
/.tattach
"; read es;\
3158 call xerr $es "attach
3-2"
3159 echo "~^ attachment remove .
/.treadctl
"; read es;\
3160 vput vexpr es substr $es 0 3
3162 xcall bail "attach
3-3"
3164 echo "~^ attachment remove .
/.tattach
"; read es;\
3165 vput vexpr es substr $es 0 3
3167 xcall bail "attach
3-4"
3169 echo "~^attachment list
"; read es;\
3170 vput vexpr es substr $es 0 3
3172 xcall bail "attach
3-5"
3176 echo "~^attachment insert .
/.tattach
=latin1
";\
3177 read hl; echo $hl; call xerr "$hl" "attach
4-1"
3178 echo "~^attachment insert .
/.tattach
=latin1
";\
3179 read hl; echo $hl; call xerr "$hl" "attach
4-2"
3180 echo "~^attachment list
";\
3181 read es; echo $es;call xerr "$es" "attach
4-3"
3183 echo "~^ attachment remove .tattach
"; read es;\
3184 vput vexpr es substr $es 0 3
3186 xcall bail "attach
4-4 $es"
3188 echo "~^attachment remove-at T
"; read es;\
3189 vput vexpr es substr $es 0 3
3191 xcall bail "attach
4-5"
3193 echo "~^attachment remove .
/.tattach
"; read es;\
3194 call xerr $es "attach
4-6"
3195 echo "~^attachment remove .
/.tattach
"; read es;\
3196 call xerr $es "attach
4-7"
3197 echo "~^ attachment remove .
/.tattach
"; read es;\
3198 vput vexpr es substr $es 0 3
3200 xcall bail "attach
4-8 $es"
3202 echo "~^attachment list
"; read es;\
3203 vput vexpr es substr $es 0 3
3205 xcall bail "attach
4-9"
3209 echo "~^attachment insert .
/.tattach
=latin1
";\
3210 read hl; echo $hl; call xerr "$hl" "attach
5-1"
3211 echo "~^attachment insert .
/.tattach
=latin1
";\
3212 read hl; echo $hl; call xerr "$hl" "attach
5-2"
3213 echo "~^attachment insert .
/.tattach
=latin1
";\
3214 read hl; echo $hl; call xerr "$hl" "attach
5-3"
3215 echo "~^attachment list
";\
3216 read es; echo $es;call xerr "$es" "attach
5-4"
3219 echo "~^attachment remove-at
3"; read es;\
3220 call xerr $es "attach
5-5"
3221 echo "~^attachment remove-at
3"; read es;\
3222 vput vexpr es substr $es 0 3
3224 xcall bail "attach
5-6"
3226 echo "~^attachment remove-at
2"; read es;\
3227 call xerr $es "attach
5-7"
3228 echo "~^attachment remove-at
2"; read es;\
3229 vput vexpr es substr $es 0 3
3231 xcall bail "attach
5-8"
3233 echo "~^attachment remove-at
1"; read es;\
3234 call xerr $es "attach
5-9"
3235 echo "~^attachment remove-at
1"; read es;\
3236 vput vexpr es substr $es 0 3
3238 xcall bail "attach
5-10"
3241 echo "~^attachment list
"; read es;\
3242 vput vexpr es substr $es 0 3
3244 xcall bail "attach
5-11"
3248 echo "~^attachment insert .
/.tattach
=latin1
";\
3249 read hl; echo $hl; call xerr "$hl" "attach
6-1"
3250 echo "~^attachment insert .
/.tattach
=latin1
";\
3251 read hl; echo $hl; call xerr "$hl" "attach
6-2"
3252 echo "~^attachment insert .
/.tattach
=latin1
";\
3253 read hl; echo $hl; call xerr "$hl" "attach
6-3"
3254 echo "~^attachment list
";\
3255 read es; echo $es;call xerr "$es" "attach
6-4"
3258 echo "~^attachment remove-at
1"; read es;\
3259 call xerr $es "attach
6-5"
3260 echo "~^attachment remove-at
1"; read es;\
3261 call xerr $es "attach
6-6"
3262 echo "~^attachment remove-at
1"; read es;\
3263 call xerr $es "attach
6-7"
3264 echo "~^attachment remove-at
1"; read es;\
3265 vput vexpr es substr $es 0 3
3267 xcall bail "attach
6-8"
3270 echo "~^attachment list
"; read es;\
3271 vput vexpr es substr $es 0 3
3273 xcall bail "attach
6-9"
3285 echo on-compose-enter, mailx-command<$mailx-command>
3286 alternates alter1@exam.ple alter2@exam.ple
3288 set autocc='alter1@exam.ple alter2@exam.ple'
3289 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3290 echo mailx-subject<$mailx-subject>
3291 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3292 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3293 mailx-raw-bcc<$mailx-raw-bcc>
3294 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3295 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3298 echo on-compose-leave, mailx-command<$mailx-command>
3300 eval alternates $al alter3@exam.ple alter4@exam.ple
3302 set autobcc='alter3@exam.ple alter4@exam.ple'
3303 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3304 echo mailx-subject<$mailx-subject>
3305 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3306 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3307 mailx-raw-bcc<$mailx-raw-bcc>
3308 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3309 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3312 echo on-compose-cleanup, mailx-command<$mailx-command>
3315 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3316 echo mailx-subject<$mailx-subject>
3317 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3318 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3319 mailx-raw-bcc<$mailx-raw-bcc>
3320 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3321 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3323 wysh set on-compose-splice=t_ocs \
3324 on-compose-enter=t_oce on-compose-leave=t_ocl \
3325 on-compose-cleanup=t_occ
3329 printf 'm this-goes@nowhere\nbody\n!.\n' |
3330 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3331 -X'source ./.trc' -Smta=./.tsendmail.sh \
3333 ${cat} ./.tall >> "${MBOX}"
3334 check behave:compose_hooks-1 0 "${MBOX}" '522535560 10101'
3337 printf 'm this-goes@nowhere\nbody\n!.\n' |
3338 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3339 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh \
3341 ${cat} ./.tall >> "${MBOX}"
3342 check behave:compose_hooks-2 0 "${MBOX}" '3654000499 12535'
3346 # Some state machine stress, shell compose hook, localopts for hook, etc.
3347 # readctl in child. ~r as HERE document
3349 printf 'm ex@am.ple\nbody\n!.\nvar t_oce t_ocs t_ocs_sh t_ocl t_occ autocc' |
3350 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3351 -Smta=./.tsendmail.sh \
3354 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3357 vput vexpr es substr "$1" 0 1
3362 define read_mline_res {
3363 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3364 echo $len/$es/$^ERRNAME: $hl
3365 if [ $es -ne $^ERR-NONE ]
3366 xcall bail read_mline_res
3368 \xcall read_mline_res
3372 vput vexpr i + 1 "$2"
3374 vput vexpr j % $i 10
3381 eval \\$j _work $1 $i
3384 vput vexpr i + $i "$1"
3388 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3389 echo read:$es/$en: $line
3390 if [ "${es}" -ne -1 ]
3393 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3398 echo "~^header list
"; read hl; echo $hl;\
3399 vput vexpr es substr "$hl" 0 1
3401 xcall bail "header list
"
3404 call _work 1; echo $?
3405 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
3406 read es; echo $es; vput vexpr es substr "$es" 0 1
3408 xcall bail "be diet
"
3410 echo "~^header insert cc
<splice2@exam.ple
>";\
3411 read es; echo $es; vput vexpr es substr "$es" 0 1
3413 xcall bail "be diet2
"
3416 call _work 2; echo $?
3417 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
3418 read es; echo $es;vput vexpr es substr "$es" 0 1
3420 xcall bail "be juicy
"
3422 echo "~^header insert bcc juice2@exam.ple
";\
3423 read es; echo $es;vput vexpr es substr "$es" 0 1
3425 xcall bail "be juicy2
"
3427 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
3428 read es; echo $es;vput vexpr es substr "$es" 0 1
3430 xcall bail "be juicy3
"
3432 echo "~^header insert bcc juice4@exam.ple
";\
3433 read es; echo $es;vput vexpr es substr "$es" 0 1
3435 xcall bail "be juicy4
"
3438 echo "~^header remove-at bcc
3";\
3439 read es; echo $es;vput vexpr es substr "$es" 0 1
3441 xcall bail "remove juicy5
"
3443 echo "~^header remove-at bcc
2";\
3444 read es; echo $es;vput vexpr es substr "$es" 0 1
3446 xcall bail "remove juicy6
"
3448 echo "~^header remove-at bcc
3";\
3449 read es; echo $es;vput vexpr es substr "$es" 0 3
3451 xcall bail "failed to remove-at
"
3453 # Add duplicates which ought to be removed!
3454 echo "~^header insert bcc juice4@exam.ple
";\
3455 read es; echo $es;vput vexpr es substr "$es" 0 1
3457 xcall bail "be juicy4-1
"
3459 echo "~^header insert bcc juice4@exam.ple
";\
3460 read es; echo $es;vput vexpr es substr "$es" 0 1
3462 xcall bail "be juicy4-2
"
3464 echo "~^header insert bcc juice4@exam.ple
";\
3465 read es; echo $es;vput vexpr es substr "$es" 0 1
3467 xcall bail "be juicy4-3
"
3472 call _work 3; echo $?
3474 vput ! i echo just knock if you can hear me;\
3476 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
3478 echon shell-cmd says $?/$^ERRNAME: $i
3479 echo "~x will not become interpreted
, we are reading
until __EOT
"
3481 read r_status; echo "~~r status output
: $r_status"
3482 echo "~
:echo $? $
! $^ERRNAME
"
3484 echo "~~r status from parent
: $r_status"
3487 call _work 4; echo $?
3488 vput cwd cwd;echo cwd:$?
3489 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3493 call _work 5; echo $?
3494 echo "~^header show MAILX-Command
"; read es;\
3495 call xerr $es "t_header
1000"; call read_mline_res
3496 echo "~^header show MAILX-raw-TO
"; read es;\
3497 call xerr $es "t_header
1001"; xcall read_mline_res
3499 echoerr IT IS WRONG IF YOU SEE THIS
3502 echo on-compose-enter, mailx-command<$mailx-command>
3503 set t_oce autobcc=oce@exam.ple
3504 alternates alter1@exam.ple alter2@exam.ple
3506 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3507 echo mailx-subject<$mailx-subject>
3508 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3509 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3510 mailx-raw-bcc<$mailx-raw-bcc>
3511 echo mailx-orig-from<$mailx-orig-from> \
3512 mailx-orig-to<$mailx-orig-to> \
3513 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3516 echo on-compose-leave, mailx-command<$mailx-command>
3517 set t_ocl autocc=ocl@exam.ple
3519 alternates alter3@exam.ple alter4@exam.ple
3521 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3522 echo mailx-subject<$mailx-subject>
3523 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3524 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3525 mailx-raw-bcc<$mailx-raw-bcc>
3526 echo mailx-orig-from<$mailx-orig-from> \
3527 mailx-orig-to<$mailx-orig-to> \
3528 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3531 echo on-compose-cleanup, mailx-command<$mailx-command>
3532 set t_occ autocc=occ@exam.ple
3535 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3536 echo mailx-subject<$mailx-subject>
3537 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3538 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3539 mailx-raw-bcc<$mailx-raw-bcc>
3540 echo mailx-orig-from<$mailx-orig-from> \
3541 mailx-orig-to<$mailx-orig-to> \
3542 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3544 wysh set on-compose-splice=t_ocs \
3545 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
3546 ~t shell@exam.ple
\\n~
:set t_ocs_sh
\\n
\"" \
3547 on-compose-enter=t_oce on-compose-leave=t_ocl \
3548 on-compose-cleanup=t_occ
3550 ex0_test behave:compose_hooks-3
3551 ${cat} ./.tnotes >> "${MBOX}"
3553 check behave:compose_hooks-3 - "${MBOX}" '679526364 2431'
3555 # Reply, forward, resend, Resend
3558 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3559 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3560 -Smta=./.tsendmail.sh
3563 echo start: $? $! $^ERRNAME
3565 echo File: $? $! $^ERRNAME;echo;echo
3567 this is content of reply 1
3569 echo reply 1: $? $! $^ERRNAME;echo;echo
3571 this is content of Reply 1 2
3573 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3574 forward 1 fwdex@am.ple
3575 this is content of forward 1
3577 echo forward 1: $? $! $^ERRNAME;echo;echo
3578 resend 1 2 resendex@am.ple
3579 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3580 Resend 1 2 Resendex@am.ple
3581 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3583 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3584 -Smta=./.tsendmail.sh \
3587 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3590 vput vexpr es substr "$1" 0 1
3595 define read_mline_res {
3596 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3597 echo mline_res:$len/$es/$^ERRNAME: $hl
3598 if [ $es -ne $^ERR-NONE ]
3599 xcall bail read_mline_res
3601 \xcall read_mline_res
3605 echo "~^header show
$1"; read es;\
3606 call xerr $es "work_hl
$1"; echo $1; call read_mline_res
3614 echo t_ocs version $ver
3615 echo "~^header list
"; read hl; echo $hl;\
3616 echoerr the header list is $hl;\
3617 call xerr "$hl" "header list
"
3618 eval vpospar set $hl
3621 echoerr IT IS WRONG IF YOU SEE THIS
3624 echo on-XY-enter, mailx-command<$mailx-command>
3625 set t_oce autobcc=oce@exam.ple
3626 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3627 echo mailx-subject<$mailx-subject>
3628 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3629 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3630 mailx-raw-bcc<$mailx-raw-bcc>
3631 echo mailx-orig-from<$mailx-orig-from> \
3632 mailx-orig-to<$mailx-orig-to> \
3633 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3636 echo on-XY-leave, mailx-command<$mailx-command>
3637 set t_ocl autocc=ocl@exam.ple
3638 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3639 echo mailx-subject<$mailx-subject>
3640 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3641 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3642 mailx-raw-bcc<$mailx-raw-bcc>
3643 echo mailx-orig-from<$mailx-orig-from> \
3644 mailx-orig-to<$mailx-orig-to> \
3645 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3648 echo on-XY-cleanup, mailx-command<$mailx-command>
3649 set t_occ autocc=occ@exam.ple
3650 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3651 echo mailx-subject<$mailx-subject>
3652 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3653 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3654 mailx-raw-bcc<$mailx-raw-bcc>
3655 echo mailx-orig-from<$mailx-orig-from> \
3656 mailx-orig-to<$mailx-orig-to> \
3657 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3659 wysh set on-compose-splice=t_ocs \
3660 on-compose-enter=t_oce on-compose-leave=t_ocl \
3661 on-compose-cleanup=t_occ \
3662 on-resend-enter=t_oce on-resend-cleanup=t_occ
3664 ex0_test behave:compose_hooks-4
3665 ${cat} ./.tnotes >> "${MBOX}"
3667 check behave:compose_hooks-4 - "${MBOX}" '3038884027 7516'
3672 t_behave_message_injections() {
3673 t_prolog t_behave_message_injections
3674 TRAP_EXIT_ADDONS=".
/.t
*"
3676 ${cat} <<-_EOT > ./.tsendmail.sh
3678 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3681 chmod 0755 ./.tsendmail.sh
3683 echo mysig > ./.tmysig
3685 echo some-body | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
3686 -Smessage-inject-head=head-inject \
3687 -Smessage-inject-tail=tail-inject \
3688 -Ssignature=./.tmysig \
3689 ex@am.ple > ./.tall 2>&1
3690 check behave:message_injections-1 0 "${MBOX}" '2434746382 134'
3691 check behave:message_injections-2 - .tall '4294967295 0' # empty file
3693 ${cat} <<-_EOT > ./.template
3697 Subject: This subject is
3699 Body, body, body me.
3701 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tsendmail.sh \
3702 -Smessage-inject-head=head-inject \
3703 -Smessage-inject-tail=tail-inject \
3704 -Ssignature=./.tmysig \
3706 check behave:message_injections-3 0 "${MBOX}" '3114203412 198'
3707 check behave:message_injections-4 - .tall '4294967295 0' # empty file
3712 t_behave_mime_types_load_control() {
3713 t_prolog t_behave_mime_types_load_control
3714 TRAP_EXIT_ADDONS=".
/.t
*"
3716 ${cat} <<-_EOT > ./.tmts1
3717 @ application/mathml+xml mathml
3719 ${cat} <<-_EOT > ./.tmts2
3720 @ x-conference/x-cooltalk ice
3722 @ application/aga-aga aga
3725 ${cat} <<-_EOT > ./.tmts1.mathml
3726 <head>nonsense ML</head>
3728 ${cat} <<-_EOT > ./.tmts2.ice
3731 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.doom
3732 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.aga
3746 ' "${MBOX}" "${MBOX}" |
3748 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
3750 ex0_test behave:mime_types_load_control
3752 ${cat} "${MBOX}" >> ./.tout
3753 check behave:mime_types_load_control-1 - ./.tout '1441260727 2449'
3755 echo type | ${MAILX} ${ARGS} -R \
3756 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
3757 -f "${MBOX}" >> ./.tout 2>&1
3758 check behave:mime_types_load_control-2 0 ./.tout '1441391438 3646'
3764 have_feat smime || {
3765 echo 'behave:s/mime: unsupported, skipped'
3769 t_prolog t_behave_s_mime
3770 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
3771 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
3772 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
3774 printf 'behave:s/mime: .. generating test key and certificate ..\n'
3775 ${cat} <<-_EOT > ./.t.conf
3778 default_keyfile = keyfile.pem
3779 distinguished_name = req_distinguished_name
3780 attributes = req_attributes
3784 [ req_distinguished_name ]
3791 emailAddress = test@localhost
3796 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
3797 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
3798 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
3801 printf 'behave:s/mime:sign/verify: '
3802 echo bla | ${MAILX} ${ARGS} \
3803 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3804 -Ssmime-sign -Sfrom=test@localhost \
3805 -s 'S/MIME test' ./.VERIFY
3806 if [ $? -eq 0 ]; then
3817 /^Content-Description: /{ skip = 2; print; next }
3818 /^$/{ if(skip) --skip }
3821 < ./.VERIFY > "${MBOX}"
3822 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
3824 printf 'behave:s/mime:sign/verify:verify '
3825 printf 'verify\nx\n' |
3827 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3828 -Ssmime-sign -Sfrom=test@localhost \
3830 -f ./.VERIFY >/dev/null 2>&1
3831 if [ $? -eq 0 ]; then
3840 printf 'behave:s/mime:sign/verify:disproof-1 '
3841 if openssl smime -verify -CAfile ./.tcert.pem \
3842 -in ./.VERIFY >/dev/null 2>&1; then
3851 # (signing +) encryption / decryption
3852 ${cat} <<-_EOT > ./.tsendmail.sh
3854 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
3856 chmod 0755 ./.tsendmail.sh
3858 printf 'behave:s/mime:encrypt+sign: '
3861 -Ssmime-force-encryption \
3862 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
3863 -Smta=./.tsendmail.sh \
3864 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3865 -Ssmime-sign -Sfrom=test@localhost \
3866 -s 'S/MIME test' recei@ver.com
3867 if [ $? -eq 0 ]; then
3871 printf 'error: encrypt+sign failed\n'
3874 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
3875 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
3877 printf 'behave:s/mime:decrypt+verify: '
3878 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
3880 -Ssmime-force-encryption \
3881 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
3882 -Smta=./.tsendmail.sh \
3883 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3884 -Ssmime-sign -Sfrom=test@localhost \
3886 -f ./.ENCRYPT >/dev/null 2>&1
3887 if [ $? -eq 0 ]; then
3896 /^Content-Description: /{ skip = 2; print; next }
3897 /^$/{ if(skip) --skip }
3900 < ./.DECRYPT > "${MBOX}"
3901 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
3903 printf 'behave:s/mime:decrypt+verify:disproof-1: '
3904 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
3905 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
3912 printf "behave
:s
/mime
:encrypt
: "
3913 echo bla | ${MAILX} ${ARGS} \
3914 -Ssmime-force-encryption \
3915 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
3916 -Smta=./.tsendmail.sh \
3917 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3918 -Sfrom=test@localhost \
3919 -s 'S/MIME test' recei@ver.com
3920 if [ $? -eq 0 ]; then
3927 # Same as behave:s/mime:encrypt+sign:checksum above
3928 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
3929 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
3932 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
3933 -Ssmime-force-encryption \
3934 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
3935 -Smta=./.tsendmail.sh \
3936 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
3937 -Sfrom=test@localhost \
3939 -f ./.ENCRYPT >/dev/null 2>&1
3940 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
3942 printf 'behave:s/mime:decrypt:disproof-1: '
3943 if openssl smime -decrypt -inkey ./.tkey.pem \
3944 -in ./.ENCRYPT >/dev/null 2>&1; then
3954 t_behave_maildir() {
3955 t_prolog t_behave_maildir
3956 TRAP_EXIT_ADDONS=".
/.t
*"
3960 while [ ${i} -lt 112 ]; do
3961 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
3962 "${MBOX}" "${i}" "${i}"
3965 ) | ${MAILX} ${ARGS}
3966 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
3972 ' "${MBOX}" .tmdir1 .tmdir1 |
3973 ${MAILX} ${ARGS} -Snewfolders=maildir > .tlst
3974 check behave:maildir-2 0 .tlst '1797938753 9103'
3977 copy * "maildir
://%s
"
3980 ' "${MBOX}" .tmdir2 .tmdir2 |
3981 ${MAILX} ${ARGS} > .tlst
3982 check behave:maildir-3 0 .tlst '1155631089 9113'
3984 printf 'File "maildir
://%s
"
3988 ' .tmdir2 .tmbox1 .tmbox1 |
3989 ${MAILX} ${ARGS} > .tlst
3990 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
3991 check behave:maildir-5 - .tlst '3701297796 9110'
3993 # only the odd (even)
3995 printf 'File "maildir
://%s
"
3998 while [ ${i} -lt 112 ]; do
4000 [ ${j} -eq 1 ] && printf '%s ' "${i}"
4007 ) | ${MAILX} ${ARGS} > .tlst
4008 check behave:maildir-6 0 .tmbox2 '142890131 6610'
4009 check behave:maildir-7 - .tlst '960096773 4573'
4012 printf 'file "maildir
://%s
"
4015 while [ ${i} -lt 112 ]; do
4017 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
4025 ' .tmbox2 .tmbox2 .tmdir2
4026 ) |
${MAILX} ${ARGS} > .tlst
4027 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
4028 ${sed} 2d
< .tlst
> .tlstx
4029 check behave
:maildir-9
- .tlstx
'4216815295 13645'
4034 t_behave_mass_recipients
() {
4035 t_prolog t_behave_mass_recipients
4036 TRAP_EXIT_ADDONS
="./.t*"
4038 ${cat} <<-_EOT > ./.tsendmail.sh
4040 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
4043 chmod 0755 .
/.tsendmail.sh
4045 ${cat} <<'__EOT__' > ./.trc
4047 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4050 wysh set nr=$1 hn=$2
4051 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4053 xcall bail "ins_addr $hn 1-$nr"
4055 vput vexpr nr + $nr 1
4056 if [ "$nr" -le "$maximum" ]
4057 xcall ins_addr $nr $hn
4061 wysh set nr=$1 hn=$2
4062 alternates $hn$nr@$hn
4063 vput vexpr nr + $nr 2
4064 if [ "$nr" -le "$maximum" ]
4065 xcall bld_alter $nr $hn
4075 if [ "$t_remove" != '' ]
4080 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4084 printf 'm this-goes@nowhere\nbody\n!.\n' |
4085 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4086 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4088 ${cat} .
/.tall
>> "${MBOX}"
4089 check behave
:mass_recipients-1
0 "${MBOX}" '2912243346 51526'
4092 printf 'm this-goes@nowhere\nbody\n!.\n' |
4093 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4094 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh
-Smaximum=2001 \
4096 ${cat} .
/.tall
>> "${MBOX}"
4097 check behave
:mass_recipients-2
0 "${MBOX}" '4097804632 34394'
4102 t_behave_lreply_futh_rth_etc
() {
4103 t_prolog t_behave_lreply_futh_rth_etc
4104 TRAP_EXIT_ADDONS
="./.t*"
4106 ${cat} <<-_EOT > ./.tsendmail.sh
4108 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4111 chmod 0755 .
/.tsendmail.sh
4113 ${cat} <<-_EOT > ./.tmbox
4114 From neverneverland Sun Jul 23 13:46:25 2017
4115 Subject: Bugstop: five miles out 1
4116 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4117 From: mister originator <mr@originator>
4118 To: bugstop-commit@five.miles.out, laber@backe.eu
4120 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4121 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4122 Date: Wed, 19 Jul 2017 09:22:57 -0400
4123 Message-Id: <20170719132257.766AF781267@originator>
4126 > |Sorry, I think I misunderstand something. I would think that
4130 From neverneverland Fri Jul 7 22:39:11 2017
4131 Subject: Bugstop: five miles out 2
4132 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4133 Content-Transfer-Encoding: 7bit
4134 From: mister originator <mr@originator>
4135 To: bugstop-commit@five.miles.out
4137 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4138 Date: Fri, 07 Jul 2017 16:33:59 -0400
4141 capable of changing back.
4143 From neverneverland Fri Jul 7 22:42:00 2017
4144 Subject: Bugstop: five miles out 3
4145 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4146 Content-Transfer-Encoding: 7bit
4147 From: mister originator <mr@originator>
4148 To: bugstop-commit@five.miles.out
4150 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4151 Date: Fri, 07 Jul 2017 16:33:59 -0400
4152 List-Post: <mailto:bugstop@five.miles.out>
4155 are you ready, boots?
4157 From neverneverland Sat Aug 19 23:15:00 2017
4158 Subject: Bugstop: five miles out 4
4159 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4160 Content-Transfer-Encoding: 7bit
4161 From: mister originator <mr@originator>
4162 To: bugstop@five.miles.out
4164 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4165 Date: Fri, 07 Jul 2017 16:33:59 -0400
4166 List-Post: <mailto:bugstop@five.miles.out>
4169 are you ready, boots?
4174 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4175 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4177 wysh
set m
="This is text of \"reply ${1}."
4188 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4191 wysh set m="This is text of
\"Reply
${1}.
"
4197 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4206 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4210 # We need two indirections for this test: one for the case that Lreply
4211 # fails because of missing recipients: we need to read EOF next, thus
4212 # place this in _Ls last; and second for the succeeding cases EOF is
4213 # not what these should read, so go over the backside and splice it in!
4215 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4218 localopts call-fixate
yes
4220 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4221 call L
$1 1; call L
$1 2; call L
$1 3
4224 echo;echo '===== CHANGING === '"$*"' =====';echo
4228 set from
=laber@backe.eu
4231 call tweak
set reply-to-honour
4233 call tweak
set followup-to
4235 call tweak
set followup-to-honour
4237 call tweak mlist bugstop@five.miles.out
4239 call tweak mlsubscribe bugstop@five.miles.out
4241 call tweak
set recipients-in-cc
4245 check behave
:lreply_futh_rth_etc
0 "${MBOX}" '940818845 29373'
4250 t_behave_iconv_mbyte_base64
() {
4251 t_prolog t_behave_iconv_mbyte_base64
4252 TRAP_EXIT_ADDONS
="./.t*"
4254 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv && acmd_set
iconv iconv &&
4255 ( ${iconv} -l |
${grep} -i -e iso-2022-jp
-e euc-jp
) >/dev
/null
2>&1
4259 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4263 ${cat} <<-_EOT > ./.tsendmail.sh
4265 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4268 chmod 0755 .
/.tsendmail.sh
4270 if ( ${iconv} -l |
${grep} -i iso-2022-jp
) >/dev
/null
2>&1; then
4271 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4272 -Smta=./.tsendmail.sh \
4273 -Sescape=! -Smime-encoding=base64 2>./.terr
4274 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4276 !s Japanese from UTF-8 to ISO-2022-JP
4277 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4279 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4282 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4284 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4287 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4289 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4290 \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
4292 \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
4295 \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
4297 \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
4300 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4301 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4303 printf 'eval f 1; write ./.twrite\n' |
4304 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4305 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4306 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4308 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4311 if ( ${iconv} -l | ${grep} -i euc-jp ) >/dev/null 2>&1; then
4312 rm -f "${MBOX}" ./.twrite
4313 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4314 -Smta=./.tsendmail.sh \
4315 -Sescape=! -Smime-encoding=base64 2>./.terr
4316 set ttycharset=utf-8 sendcharsets=euc-jp
4318 !s Japanese from UTF-8 to EUC-JP
4319 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4321 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4324 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4326 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4329 set ttycharset=EUC-JP sendcharsets=utf-8
4331 !s Japanese from EUC-JP to UTF-8
4332 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4334 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4337 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4339 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4342 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4343 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4345 printf 'eval f 1; write ./.twrite\n' |
4346 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4347 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4348 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4350 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4357 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4358 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4359 # Note we unfortunately need to place some statements without proper
4360 # indentation because of continuation problems
4364 # MIME encoding (QP) stress message body
4366 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4367 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4368 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4369 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4370 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4371 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4372 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4373 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4374 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4375 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4376 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4377 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4378 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4379 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4380 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4381 "auf den zeilen vorher.\r\n"\
4382 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4384 "Die letzte Zeile war nur ein Punkt.\r\n"\
4386 "Das waren deren zwei.\r\n"\
4388 "Die letzte Zeile war ein Leerschritt.\n"\
4389 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4392 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4394 "Das waren deren zwei. ditto.\n"\
4396 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4397 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4398 "auf den zeilen vorher.\n"\
4400 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4401 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4403 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4405 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4407 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4409 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4411 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4413 "QP am Zeilenende über soft-nl hinweg\n"\
4414 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4416 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4418 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4420 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4422 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
4424 "Die letzte Zeile war ein Leerschritt.\n"\
4428 # MIME encoding (QP) stress message subject
4429 SUB
="Äbrä Kä?dä=brö Fü?di=bus? \
4430 adadaddsssssssddddddddddddddddddddd\
4431 ddddddddddddddddddddddddddddddddddd\
4432 ddddddddddddddddddddddddddddddddddd\
4433 dddddddddddddddddddd Hallelulja? Od\
4434 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4435 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4436 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
4437 fffffffffffffffffffffffffffffffffff\
4438 fffffffffffffffffffff ggggggggggggg\
4439 ggggggggggggggggggggggggggggggggggg\
4440 ggggggggggggggggggggggggggggggggggg\
4441 ggggggggggggggggggggggggggggggggggg\
4444 # Three tests for MIME encoding and (a bit) content classification.
4445 # At the same time testing -q FILE, < FILE and -t FILE
4448 < "${BODY}" ${MAILX} ${ARGS} ${ADDARG_UNI} \
4449 -a "${BODY}" -s "${SUB}" "${MBOX}"
4450 check content:001 0 "${MBOX}" '1145066634 6654'
4453 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4454 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
4455 check content:002 0 "${MBOX}" '1145066634 6654'
4458 ( echo "To
: ${MBOX}" && echo "Subject
: ${SUB}" && echo &&
4460 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
4461 check content
:003 0 "${MBOX}" '1145066634 6654'
4463 # Test for [260e19d] (Juergen Daubert)
4465 echo body |
${MAILX} ${ARGS} "${MBOX}"
4466 check content:004 0 "${MBOX}" '2917662811 98'
4468 # Sending of multiple mails in a single invocation
4470 ( printf "m
${MBOX}\n~s subject1
\nE
-Mail Körper
1\n~.
\n" &&
4471 printf "m
${MBOX}\n~s subject2
\nEmail body
2\n~.
\n" &&
4473 ) | ${MAILX} ${ARGS} ${ADDARG_UNI}
4474 check content:005 0 "${MBOX}" '2098659767 358'
4478 # "Test
for" [d6f316a] (Gavin Troy)
4480 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
4481 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4482 check content
:006 0 "${MBOX}" '2099098650 122'
4483 check content
:006-1 - "${BODY}" '794542938 174'
4485 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4488 for(i = 0; i < 10000; ++i)
4490 #printf "\xF0\x90\x87\x90"
4491 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4492 check content:007 0 "${MBOX}" '534262374 61816'
4494 ## Test some more corner cases for header bodies (as good as we can today) ##
4498 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4499 -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̲' \
4501 check content:008 0 "${MBOX}" '3370931614 375'
4503 # Single word (overlong line split -- bad standard! Requires injection of
4504 # artificial data!! But can be prevented by using RFC 2047 encoding)
4506 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
4507 echo | ${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4508 check content
:009 0 "${MBOX}" '489922370 1718'
4510 # Combination of encoded words, space and tabs of varying sort
4512 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4513 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
4514 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
4515 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
4516 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
4517 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
4519 check content
:010 0 "${MBOX}" '1676887734 591'
4521 # Overlong multibyte sequence that must be forcefully split
4522 # todo This works even before v15.0, but only by accident
4524 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4525 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4526 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4527 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
4529 check content
:011 0 "${MBOX}" '3029301775 659'
4533 echo |
${MAILX} ${ARGS} \
4534 -s "1-1 B2 B3 B4 B5 B6 B\
4535 1-2 B2 B3 B4 B5 B6 B\
4536 1-3 B2 B3 B4 B5 B6 B\
4537 1-4 B2 B3 B4 B5 B6 B\
4538 1-5 B2 B3 B4 B5 B6 B\
4539 1-6 B2 B3 B4 B5 B6 " \
4541 check content
:012 0 "${MBOX}" '4126167195 297'
4543 # Leading and trailing WS
4545 echo |
${MAILX} ${ARGS} \
4546 -s " 2-1 B2 B3 B4 B5 B6 B\
4547 1-2 B2 B3 B4 B5 B6 B\
4548 1-3 B2 B3 B4 B5 B6 B\
4549 1-4 B2 B3 B4 B5 B6 " \
4551 check content
:013 0 "${MBOX}" '3600624479 236'
4553 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
4554 # have a (better) test framework materialize a quick shot
4556 TRAP_EXIT_ADDONS
=.
/.ttt
4558 mkdir .
/.ttt ||
exit 1
4562 : > 'diet\ is \curd.txt'
4563 : > 'diet "is" curd.txt'
4565 : > 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
4566 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4567 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4568 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4570 echo bla |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4571 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
4572 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
4573 -a .
/.ttt
/höde-tröge.txt \
4574 -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 \
4575 -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 \
4576 -a .
/.ttt
/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4577 -a .
/.ttt
/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4579 check content
:014-1 0 "${MBOX}" '684985954 3092'
4581 # `resend' test, reusing $MBOX
4583 printf "Resend ${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4584 check content
:014-2 0 "${BODY}" '684985954 3092'
4587 printf "resend ${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4588 check content
:014-3 0 "${BODY}" '3130352658 3148'
4594 # if have_feat devel; then
4595 # ARGS="${ARGS} -Smemdebug"
4599 if [ -n "${UTF8_LOCALE}" ]; then
4600 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
4602 printf 'No Unicode locale found, disabling Unicode tests\n'
4609 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
4611 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
4614 while [ ${#} -gt 0 ]; do
4620 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'