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 ex0_test should say TESTNUMBER-estat instead of having own numbers
6 #@ TODO _All_ the tests should happen in a temporary subdir.
9 # Instead of figuring out the environment in here, require a configured build
10 # system and include that! Our makefile and configure ensure that this test
11 # does not run in the configured, but the user environment nonetheless!
12 if [ -f .
/mk-config.ev
]; then
14 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
15 MAILX__CC_TEST_RUNNING
=1
16 export MAILX__CC_TEST_RUNNING
17 exec "${SHELL}" "${0}" "${@}"
20 echo >&2 'S-nail/S-mailx is not configured.'
21 echo >&2 'This test script requires the shell environment that only the'
22 echo >&2 'configuration script can figure out, even if it will be used to'
23 echo >&2 'test a different binary than the one that would be produced!'
27 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
28 # such is a compile-time variable
29 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
30 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
31 ADDARG_UNI
=-Sttycharset=UTF-8
36 #UTF8_LOCALE= autodetected unless set
38 # Note valgrind has problems with FDs in forked childs, which causes some tests
39 # to fail (the FD is rewound and thus will be dumped twice)
41 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
43 ## -- (>8 -- 8<) -- ##
45 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
50 printf >&2 -- "${fmt}\\n" "${@}"
55 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
59 # Wed Oct 2 01:50:07 UTC 1996
60 SOURCE_DATE_EPOCH
=844221007
62 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
63 unset POSIXLY_CORRECT LOGNAME USER
66 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
67 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
71 CHECK_ONLY
= MAE_TEST
= MAILX
=
72 if [ "${1}" = --check-only ]; then
75 [ -x "${MAILX}" ] || usage
77 elif [ "${1}" = --mae-test ]; then
80 [ -x "${MAILX}" ] || usage
84 MAILX
="${MEMTESTER}${MAILX}"
87 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
88 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
89 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
91 \if [ "${ttycharset}" @i=% utf ]
98 \eval xcall cset_test "${@}"
102 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
103 en_US.utf8 en_US.UTF-8
105 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
107 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
108 UTF8_LOCALE
=`locale -a | { m=
110 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
112 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
126 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
127 trap "exit 1" HUP INT TERM
130 # Test all configs TODO doesn't cover all *combinations*, stupid!
134 NOTME["OPT_AUTOCC"] = 1
135 NOTME["OPT_DEBUG"] = 1
136 NOTME["OPT_DEVEL"] = 1
137 NOTME["OPT_NOEXTMD5"] = 1
138 NOTME["OPT_ASAN_ADDRESS"] = 1
139 NOTME["OPT_ASAN_MEMORY"] = 1
140 NOTME["OPT_FORCED_STACKPROT"] = 1
141 NOTME["OPT_NOMEMDBG"] = 1
142 NOTME["OPT_NYD2"] = 1
145 /^[[:space:]]*OPT_/ {
146 sub(/^[[:space:]]*/, "")
147 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
148 # does not seem to be a compliant escape for =
150 $1 = substr($1, 1, index($1, "=") - 1)
156 # Doing this completely sequentially and not doing make distclean in
157 # between runs should effectively result in lesser compilations.
158 # It is completely dumb nonetheless... TODO
159 for (j = 1; j < i; ++j) {
160 for (k = 1; k < j; ++k)
162 for (k = j; k < i; ++k)
164 printf "OPT_AUTOCC=1\n"
166 for (j = 1; j < i; ++j) {
167 for (k = 1; k < j; ++k)
169 for (k = j; k < i; ++k)
171 printf "OPT_AUTOCC=1\n"
174 for (j = 1; j < i; ++j) {
175 for (k = 1; k < j; ++k)
177 for (k = j; k < i; ++k)
179 printf "OPT_AUTOCC=1\n"
180 printf "OPT_DEBUG=1\n"
182 for (j = 1; j < i; ++j) {
183 for (k = 1; k < j; ++k)
185 for (k = j; k < i; ++k)
187 printf "OPT_AUTOCC=1\n"
188 printf "OPT_DEBUG=1\n"
191 printf "CONFIG=NULL OPT_AUTOCC=0\n"
192 printf "CONFIG=NULL OPT_AUTOCC=1\n"
193 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
194 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
195 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
196 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
197 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
198 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
199 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
200 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
201 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
202 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
203 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
204 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
207 printf "\n\n##########\n$c\n"
208 printf "\n\n##########\n$c\n" >&2
209 sh
-c "${MAKE} ${c} all test"
215 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
216 ${grep} +${1} ) >/dev
/null
2>&1
220 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
222 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
229 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
230 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
231 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
232 csum
="`${cksum} < ${f}`"
233 if [ "${csum}" = "${s}" ]; then
234 printf '%s: ok\n' "${tid}"
237 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
239 if [ -n "${MAE_TEST}" ]; then
240 x
=`echo ${tid} | ${tr} "/:=" "__-"`
241 ${cp} -f "${f}" ./mae-test-"${x}"
247 printf '%s: error: %s\n' ${1} "${2}"
251 # $1=test name [$2=status]
253 [ ${#} -gt 1 ] && __qm__=${2}
254 if [ ${__qm__} -ne 0 ]; then
255 err $1 'unexpected non-0 exit status'
257 printf '%s: ok\n' "${1}"
262 # $1=test name [$2=status]
264 [ ${#} -gt 1 ] && __qm__=${2}
265 if [ ${__qm__} -eq 0 ]; then
266 err $1 'unexpected 0 exit status'
268 printf '%s: ok\n' "${1}"
272 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
274 echo "$
((${1} + ${2}))"
278 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
282 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
284 echo "$
((${1} % ${2}))"
288 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
293 # Basic (easily testable) behaviour tests
295 t_behave_X_opt_input_command_stack
299 t_behave_input_inject_semicolon_seq
300 t_behave_commandalias
304 t_behave_macro_param_shift
315 t_behave_record_a_resend
320 # FIXME t_behave_mlist
323 t_behave_message_injections
324 t_behave_compose_hooks
325 t_behave_C_opt_customhdr
327 t_behave_mass_recipients
328 t_behave_mime_types_load_control
329 t_behave_lreply_futh_rth_etc
331 t_behave_xxxheads_rfc2047
333 t_behave_iconv_mbyte_base64
334 t_behave_iconv_mainbody
335 t_behave_q_t_etc_opts
340 t_behave_X_opt_input_command_stack() {
341 t_prolog t_behave_X_opt_input_command_stack
343 ${cat} <<- '__EOT' > "${BODY}"
351 echo "define mac1
{";\
352 echo " echo mac1-1 via1 \
$0";\
354 echo " echo mac1-2
";\
356 echo " echo mac1-3
";\
359 echo "define mac2
{";\
360 echo " echo mac2-1 via1 \
$0";\
362 echo " echo mac2-2
";\
368 echo echo 1-1-1 via1 \
$0;\
380 # The -X option supports multiline arguments, and those can internally use
381 # reverse solidus newline escaping. And all -X options are joined...
383 < "${BODY}" ${MAILX} ${ARGS} \
398 echo "define mac1 {";\
399 echo " echo mac1-1 via2 \$0";\
401 echo " echo mac1-2";\
403 echo " echo mac1-3";\
406 echo "define mac2 {";\
407 echo " echo mac2-1 via2 \$0";\
409 echo " echo mac2-2";\
415 echo echo 1-1-1 via2 \$0;\
429 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
434 t_behave_X_errexit
() {
435 t_prolog t_behave_X_errexit
437 ${cat} <<- '__EOT' > "${BODY}"
443 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
444 -X'echo one' -X' echos nono ' -X'echo two' \
446 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
448 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
450 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
452 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
454 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
458 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
459 -X'echo one' -X' echos nono ' -X'echo two' \
461 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
463 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
465 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
467 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
469 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
471 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
473 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
475 ## Repeat 4-7 with ignerr set
477 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
479 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
480 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
482 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
484 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
486 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
488 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
490 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
492 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
494 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
499 t_behave_S_freeze() {
500 t_prolog t_behave_S_freeze
504 # Test basic assumption
505 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
506 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
508 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
511 ${cat} <<- '__EOT' > "${BODY}"
516 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
517 -Snoasksub -Sasksub -Snoasksub \
518 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
520 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
522 ${cat} <<- '__EOT' > "${BODY}"
527 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
528 -Snoasksub -Sasksub \
529 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
531 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
534 ${cat} <<- '__EOT' > "${BODY}"
535 echo dietcurd<$dietcurd>
537 echo dietcurd<$dietcurd>
539 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
540 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
541 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
542 -X'echo dietcurd<$dietcurd>' \
544 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
546 ${cat} <<- '__EOT' > "${BODY}"
547 echo dietcurd<$dietcurd>
549 echo dietcurd<$dietcurd>
551 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
552 -Sdietcurd=strawberry
-Snodietcurd \
553 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
554 -X'echo dietcurd<$dietcurd>' \
556 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
558 # TODO once we have a detached one with env=1..
559 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
560 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
562 ${cat} <<- '__EOT' > "${BODY}"
563 !echo "shell says TERM<$TERM>"
565 !echo "shell says TERM<$TERM>"
567 !echo "shell says TERM<$TERM>"
569 !echo "shell says TERM<$TERM>"
571 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
572 -STERM=strawberry
-SnoTERM -STERM=vanilla \
573 -X'echo mail<$TERM>' -X'unset TERM' \
574 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
576 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
578 ${cat} <<- '__EOT' > "${BODY}"
579 !echo "shell says TERM<$TERM>"
581 !echo "shell says TERM<$TERM>"
583 !echo "shell says TERM<$TERM>"
585 !echo "shell says TERM<$TERM>"
587 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
588 -STERM=strawberry
-SnoTERM \
589 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
590 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
592 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
600 t_prolog t_behave_wysh
602 ${cat} <<- '__EOT' > "${BODY}"
621 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
622 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
623 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
625 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
626 echo a$'\u0041\u41\u0C1\U00000041\U41'c
649 echo a$'b\U0000000'dt
650 echo a$'b\U00000000'du
660 if [ -z "${UTF8_LOCALE}" ]; then
661 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
663 < "${BODY}" DIET=CURD TIED= \
664 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
665 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
668 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
669 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
671 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
672 wysh set mager='\hey\'
674 wysh set mager="\hey\\"
676 wysh set mager=$'\hey\\'
679 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
684 t_behave_input_inject_semicolon_seq() {
685 t_prolog t_behave_input_inject_semicolon_seq
687 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
692 echon this_is_mymac;call mydeepmac;echon ';';
694 echon one';';call mymac;echon two";";call mymac;echo three$';';
696 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
698 echon one';';call mymac;echon two";";call mymac;echo three$';';
701 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
706 t_behave_commandalias() {
707 t_prolog t_behave_commandalias
709 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
710 commandalias echo echo hoho
714 commandalias XxX XxXx
715 commandalias XxXx XxXxX
716 commandalias XxXxX XxXxXx
717 commandalias XxXxXx echo huhu
718 commandalias XxXxXxX echo huhu
720 commandalias XxXxXx XxXxXxX
723 commandalias XxXxXx echo huhu
727 check behave:commandalias 0 "${MBOX}" '3694143612 31'
733 t_prolog t_behave_ifelse
735 # Nestable conditions test
736 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
758 if $dietcurd == 'yoho'
763 if $dietcurd @== 'Yoho'
768 if $dietcurd == 'Yoho'
773 if $dietcurd != 'yoho'
778 if $dietcurd @!= 'Yoho'
783 if $dietcurd != 'Yoho'
844 if $dietcurd == 'yohu'
846 elif $dietcurd == 'yoha'
848 elif $dietcurd == 'yohe'
850 elif $dietcurd == 'yoho'
852 if $dietcurd == 'yohu'
854 elif $dietcurd == 'yoha'
856 elif $dietcurd == 'yohe'
858 elif $dietcurd == 'yoho'
860 if $dietcurd == 'yohu'
862 elif $dietcurd == 'yoha'
864 elif $dietcurd == 'yohe'
866 elif $dietcurd == 'yoho'
1015 set diet=abc curd=abc
1021 set diet=abc curd=abcd
1027 # 1. Shitty grouping capabilities as of today
1028 unset diet curd ndefined
1029 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1035 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1040 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1045 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1050 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1055 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1056 && [ no ] || [ yes ]
1061 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1066 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1071 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1076 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1081 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1086 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1091 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1096 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1101 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1106 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1112 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1118 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1123 # 2. Shitty grouping capabilities as of today
1124 unset diet curd ndefined
1125 if [ false || false || true ] && [ false || true ] && yes
1130 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1135 if [ 1 || 0 || 0 || 0 ]
1140 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1145 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1150 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1155 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1160 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1165 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1170 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1175 if 1 || 0 || 0 || 0 && 0
1180 if 1 || 0 || 0 || 0 && 1
1185 if 0 || 0 || 0 || 1 && 0
1190 if 0 || 0 || 0 || 1 && 1
1195 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1200 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1206 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1211 if $diet == 'yo' && $curd == 'ho' && $ndefined
1217 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1222 if $diet == 'yo' && $curd == 'ho' && $ndefined
1227 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1232 # Some more en-braced variables
1234 if ${diet} == ${curd}
1239 if ${diet} != ${curd}
1255 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1260 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1265 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1270 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1275 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1280 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1285 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1290 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1295 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1301 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1306 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1311 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1316 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1321 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1326 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1331 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1336 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1341 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1348 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1350 if have_feat regex; then
1351 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1353 if $dietcurd =~ '^yo.*'
1358 if $dietcurd =~ '^Yo.*'
1363 if $dietcurd @=~ '^Yo.*'
1368 if $dietcurd =~ '^yOho.+'
1373 if $dietcurd @!~ '.*Ho$'
1378 if $dietcurd !~ '.+yohO$'
1383 if [ $dietcurd @i!~ '.+yoho$' ]
1388 if ! [ $dietcurd @i=~ '.+yoho$' ]
1393 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1398 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1403 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1408 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1413 if ! ! ! $dietcurd !~ '.+yoho$'
1418 if ! ! ! $dietcurd =~ '.+yoho$'
1423 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1428 set diet=abc curd='^abc$'
1434 set diet=abc curd='^abcd$'
1442 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1444 printf 'behave:if-regex: unsupported, skipped\n'
1450 t_behave_localopts() {
1451 t_prolog t_behave_localopts
1453 # Nestable conditions test
1454 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1469 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1474 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1475 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1484 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1486 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1495 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1502 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1509 echo ----- $1: $2 -> $3 -> $4
1517 call llx
'call off' on on on
1518 call llx
'call off' off on on
1519 call llx
'call off' on off on
1520 call llx
'call off' on off off
1521 localopts call-fixate on
1522 call llx
'call-fixate on' on on on
1523 call llx
'call-fixate on' off on on
1524 call llx
'call-fixate on' on off on
1525 call llx
'call-fixate on' on off off
1526 unset x
;localopts call on
1527 call llx
'call on' on on on
1528 call llx
'call on' off on on
1529 call llx
'call on' on off on
1530 call llx
'call on' on off off
1535 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1541 t_prolog t_behave_local
1543 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1571 echo ------- global-1 du=$du
1573 echo ------- global-2 du=$du
1576 echo ------- global-3 du=$du
1578 echo ------- global-4 du=$du
1580 echo ------- global-5 du=$du
1583 check behave:local-1 0 "${MBOX}" '2411598140 641'
1588 t_behave_macro_param_shift() {
1589 t_prolog t_behave_macro_param_shift
1591 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1594 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1599 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1600 if [ $# > 1 ] ||
[ $ignerr == '' ]
1605 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1607 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1611 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1616 call t2
1 you get four args
1617 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1618 call t2
1 you get
'three args'
1619 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1620 call t2
1 you
'get two args'
1621 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1622 call t2
1 'you get one arg'
1623 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1624 ignerr call t2
'' 'you get one arg'
1625 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1630 check behave
:macro_param_shift
0 "${MBOX}" '1402489146 1682'
1635 t_behave_addrcodec
() {
1636 t_prolog t_behave_addrcodec
1638 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1639 vput addrcodec res e 1 <doog@def>
1640 echo $?/$^ERRNAME $res
1641 eval vput addrcodec res d $res
1642 echo $?/$^ERRNAME $res
1643 vput addrcodec res e 2 . <doog@def>
1644 echo $?/$^ERRNAME $res
1645 eval vput addrcodec res d $res
1646 echo $?/$^ERRNAME $res
1647 vput addrcodec res e 3 Sauer Dr. <doog@def>
1648 echo $?/$^ERRNAME $res
1649 eval vput addrcodec res d $res
1650 echo $?/$^ERRNAME $res
1651 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1652 echo $?/$^ERRNAME $res
1653 eval vput addrcodec res d $res
1654 echo $?/$^ERRNAME $res
1655 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1656 echo $?/$^ERRNAME $res
1657 eval vput addrcodec res d $res
1658 echo $?/$^ERRNAME $res
1660 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1661 echo $?/$^ERRNAME $res
1662 eval vput addrcodec res d $res
1663 echo $?/$^ERRNAME $res
1664 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1665 echo $?/$^ERRNAME $res
1666 eval vput addrcodec res d $res
1667 echo $?/$^ERRNAME $res
1668 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1669 echo $?/$^ERRNAME $res
1670 eval vput addrcodec res d $res
1671 echo $?/$^ERRNAME $res
1672 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1673 echo $?/$^ERRNAME $res
1674 eval vput addrcodec res d $res
1675 echo $?/$^ERRNAME $res
1676 vput addrcodec res +e 8 \
1677 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1678 echo $?/$^ERRNAME $res
1679 eval vput addrcodec res d $res
1680 echo $?/$^ERRNAME $res
1681 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1682 echo $?/$^ERRNAME $res
1683 eval vput addrcodec res d $res
1684 echo $?/$^ERRNAME $res
1685 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1686 echo $?/$^ERRNAME $res
1687 eval vput addrcodec res d $res
1688 echo $?/$^ERRNAME $res
1689 vput addrcodec res +e 11 (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 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1694 echo $?/$^ERRNAME $res
1695 eval vput addrcodec res d $res
1696 echo $?/$^ERRNAME $res
1697 vput addrcodec res +e 13(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 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1702 echo $?/$^ERRNAME $res
1703 eval vput addrcodec res d $res
1704 echo $?/$^ERRNAME $res
1705 vput addrcodec res +e 15 \
1706 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1707 echo $?/$^ERRNAME $res
1708 eval vput addrcodec res d $res
1709 echo $?/$^ERRNAME $res
1710 vput addrcodec res +e 16 \
1711 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1712 echo $?/$^ERRNAME $res
1713 eval vput addrcodec res d $res
1714 echo $?/$^ERRNAME $res
1715 vput addrcodec res +e 17 \
1716 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1717 echo $?/$^ERRNAME $res
1718 eval vput addrcodec res d $res
1719 echo $?/$^ERRNAME $res
1720 vput addrcodec res +e 18 \
1721 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1722 echo $?/$^ERRNAME $res
1723 eval vput addrcodec res d $res
1724 echo $?/$^ERRNAME $res
1725 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1726 echo $?/$^ERRNAME $res
1727 eval vput addrcodec res d $res
1728 echo $?/$^ERRNAME $res
1730 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1731 echo $?/$^ERRNAME $res
1732 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1733 echo $?
/$^ERRNAME
$res
1734 eval vput addrcodec res d
$res
1735 echo $?
/$^ERRNAME
$res
1737 vput addrcodec res
+++e
22 Hey
\\,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1738 echo $?
/$^ERRNAME
$res
1739 eval vput addrcodec res d
$res
1740 echo $?
/$^ERRNAME
$res
1742 vput addrcodec res s \
1743 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1744 echo $?
/$^ERRNAME
$res
1746 # Fix for [f3852f88]
1747 vput addrcodec res
++e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1748 echo $?
/$^ERRNAME
$res
1749 eval vput addrcodec res d
$res
1750 echo $?
/$^ERRNAME
$res
1751 vput addrcodec res e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1752 echo $?
/$^ERRNAME
$res
1753 eval vput addrcodec res d
$res
1754 echo $?
/$^ERRNAME
$res
1757 check behave
:addrcodec-1
0 "${MBOX}" '1047317989 2612'
1759 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1761 mlsubscribe isa2@list
1763 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1764 echo $?/$^ERRNAME $res
1765 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1766 echo $?/$^ERRNAME $res
1767 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1768 echo $?/$^ERRNAME $res
1769 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1770 echo $?/$^ERRNAME $res
1771 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1772 echo $?/$^ERRNAME $res
1773 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1774 echo $?/$^ERRNAME $res
1777 check behave:addrcodec-2 0 "${MBOX}" '1391779299 104'
1779 if have_feat idna; then
1780 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1781 vput addrcodec res e
(heu
) <du@blödiän
> "stroh" du
1782 echo $?
/$^ERRNAME
$res
1783 eval vput addrcodec res d
$res
1784 echo $?
/$^ERRNAME
$res
1785 vput addrcodec res e
<du@blödiän
> du
1786 echo $?
/$^ERRNAME
$res
1787 eval vput addrcodec res d
$res
1788 echo $?
/$^ERRNAME
$res
1789 vput addrcodec res e du
<du@blödiän
>
1790 echo $?
/$^ERRNAME
$res
1791 eval vput addrcodec res d
$res
1792 echo $?
/$^ERRNAME
$res
1793 vput addrcodec res e
<du@blödiän
>
1794 echo $?
/$^ERRNAME
$res
1795 eval vput addrcodec res d
$res
1796 echo $?
/$^ERRNAME
$res
1797 vput addrcodec res e du@blödiän
1798 echo $?
/$^ERRNAME
$res
1799 eval vput addrcodec res d
$res
1800 echo $?
/$^ERRNAME
$res
1803 check behave
:addrcodec-idna
0 "${MBOX}" '498775983 326'
1805 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1812 t_prolog t_behave_vexpr
1814 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1816 vput vexpr res = 9223372036854775807
1817 echo $?/$^ERRNAME $res
1818 vput vexpr res = 9223372036854775808
1819 echo $?/$^ERRNAME $res
1820 vput vexpr res = u9223372036854775808
1821 echo $?/$^ERRNAME $res
1822 vput vexpr res @= 9223372036854775808
1823 echo $?/$^ERRNAME $res
1824 vput vexpr res = -9223372036854775808
1825 echo $?/$^ERRNAME $res
1826 vput vexpr res = -9223372036854775809
1827 echo $?/$^ERRNAME $res
1828 vput vexpr res @= -9223372036854775809
1829 echo $?/$^ERRNAME $res
1830 vput vexpr res = U9223372036854775809
1831 echo $?/$^ERRNAME $res
1834 0b0111111111111111111111111111111111111111111111111111111111111111
1835 echo $?/$^ERRNAME $res
1837 S0b1000000000000000000000000000000000000000000000000000000000000000
1838 echo $?/$^ERRNAME $res
1840 S0b1000000000000000000000000000000000000000000000000000000000000000
1841 echo $?/$^ERRNAME $res
1843 U0b1000000000000000000000000000000000000000000000000000000000000000
1844 echo $?/$^ERRNAME $res
1846 0b1000000000000000000000000000000000000000000000000000000000000000
1847 echo $?/$^ERRNAME $res
1849 0b1000000000000000000000000000000000000000000000000000000000000000
1850 echo $?/$^ERRNAME $res
1852 -0b1000000000000000000000000000000000000000000000000000000000000000
1853 echo $?/$^ERRNAME $res
1855 S0b1000000000000000000000000000000000000000000000000000000000000001
1856 echo $?/$^ERRNAME $res
1858 S0b1000000000000000000000000000000000000000000000000000000000000001
1859 echo $?/$^ERRNAME $res
1861 -0b1000000000000000000000000000000000000000000000000000000000000001
1862 echo $?/$^ERRNAME $res
1864 U0b1000000000000000000000000000000000000000000000000000000000000001
1865 echo $?/$^ERRNAME $res
1867 vput vexpr res = 0777777777777777777777
1868 echo $?/$^ERRNAME $res
1869 vput vexpr res = S01000000000000000000000
1870 echo $?/$^ERRNAME $res
1871 vput vexpr res @= S01000000000000000000000
1872 echo $?/$^ERRNAME $res
1873 vput vexpr res = U01000000000000000000000
1874 echo $?/$^ERRNAME $res
1875 vput vexpr res = 01000000000000000000000
1876 echo $?/$^ERRNAME $res
1877 vput vexpr res @= 01000000000000000000000
1878 echo $?/$^ERRNAME $res
1879 vput vexpr res = -01000000000000000000000
1880 echo $?/$^ERRNAME $res
1881 vput vexpr res = S01000000000000000000001
1882 echo $?/$^ERRNAME $res
1883 vput vexpr res @= S01000000000000000000001
1884 echo $?/$^ERRNAME $res
1885 vput vexpr res @= -01000000000000000000001
1886 echo $?/$^ERRNAME $res
1887 vput vexpr res = U01000000000000000000001
1888 echo $?/$^ERRNAME $res
1890 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1891 echo $?/$^ERRNAME $res
1892 vput vexpr res = S0x8000000000000000
1893 echo $?/$^ERRNAME $res
1894 vput vexpr res @= S0x8000000000000000
1895 echo $?/$^ERRNAME $res
1896 vput vexpr res = U0x8000000000000000
1897 echo $?/$^ERRNAME $res
1898 vput vexpr res = 0x8000000000000000
1899 echo $?/$^ERRNAME $res
1900 vput vexpr res @= 0x8000000000000000
1901 echo $?/$^ERRNAME $res
1902 vput vexpr res = -0x8000000000000000
1903 echo $?/$^ERRNAME $res
1904 vput vexpr res = S0x8000000000000001
1905 echo $?/$^ERRNAME $res
1906 vput vexpr res @= S0x8000000000000001
1907 echo $?/$^ERRNAME $res
1908 vput vexpr res @= -0x8000000000000001
1909 echo $?/$^ERRNAME $res
1910 vput vexpr res = u0x8000000000000001
1911 echo $?/$^ERRNAME $res
1914 echo $?/$^ERRNAME $res
1916 echo $?/$^ERRNAME $res
1918 echo $?/$^ERRNAME $res
1920 vput vexpr res + 0 0
1921 echo $?/$^ERRNAME $res
1922 vput vexpr res + 0 1
1923 echo $?/$^ERRNAME $res
1924 vput vexpr res + 1 1
1925 echo $?/$^ERRNAME $res
1927 vput vexpr res + 9223372036854775807 0
1928 echo $?/$^ERRNAME $res
1929 vput vexpr res + 9223372036854775807 1
1930 echo $?/$^ERRNAME $res
1931 vput vexpr res @+ 9223372036854775807 1
1932 echo $?/$^ERRNAME $res
1933 vput vexpr res + 0 9223372036854775807
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res + 1 9223372036854775807
1936 echo $?/$^ERRNAME $res
1937 vput vexpr res @+ 1 9223372036854775807
1938 echo $?/$^ERRNAME $res
1940 vput vexpr res + -9223372036854775808 0
1941 echo $?/$^ERRNAME $res
1942 vput vexpr res + -9223372036854775808 -1
1943 echo $?/$^ERRNAME $res
1944 vput vexpr res @+ -9223372036854775808 -1
1945 echo $?/$^ERRNAME $res
1946 vput vexpr res + 0 -9223372036854775808
1947 echo $?/$^ERRNAME $res
1948 vput vexpr res + -1 -9223372036854775808
1949 echo $?/$^ERRNAME $res
1950 vput vexpr res @+ -1 -9223372036854775808
1951 echo $?/$^ERRNAME $res
1953 vput vexpr res - 0 0
1954 echo $?/$^ERRNAME $res
1955 vput vexpr res - 0 1
1956 echo $?/$^ERRNAME $res
1957 vput vexpr res - 1 1
1958 echo $?/$^ERRNAME $res
1960 vput vexpr res - 9223372036854775807 0
1961 echo $?/$^ERRNAME $res
1962 vput vexpr res - 9223372036854775807 -1
1963 echo $?/$^ERRNAME $res
1964 vput vexpr res @- 9223372036854775807 -1
1965 echo $?/$^ERRNAME $res
1966 vput vexpr res - 0 9223372036854775807
1967 echo $?/$^ERRNAME $res
1968 vput vexpr res - -1 9223372036854775807
1969 echo $?/$^ERRNAME $res
1970 vput vexpr res - -2 9223372036854775807
1971 echo $?/$^ERRNAME $res
1972 vput vexpr res @- -2 9223372036854775807
1973 echo $?/$^ERRNAME $res
1975 vput vexpr res - -9223372036854775808 +0
1976 echo $?/$^ERRNAME $res
1977 vput vexpr res - -9223372036854775808 +1
1978 echo $?/$^ERRNAME $res
1979 vput vexpr res @- -9223372036854775808 +1
1980 echo $?/$^ERRNAME $res
1981 vput vexpr res - 0 -9223372036854775808
1982 echo $?/$^ERRNAME $res
1983 vput vexpr res - +1 -9223372036854775808
1984 echo $?/$^ERRNAME $res
1985 vput vexpr res @- +1 -9223372036854775808
1986 echo $?/$^ERRNAME $res
1988 vput vexpr res + -13 -2
1989 echo $?/$^ERRNAME $res
1990 vput vexpr res - 0 0
1991 echo $?/$^ERRNAME $res
1992 vput vexpr res - 0 1
1993 echo $?/$^ERRNAME $res
1994 vput vexpr res - 1 1
1995 echo $?/$^ERRNAME $res
1996 vput vexpr res - -13 -2
1997 echo $?/$^ERRNAME $res
1999 vput vexpr res * 0 0
2000 echo $?/$^ERRNAME $res
2001 vput vexpr res * 0 1
2002 echo $?/$^ERRNAME $res
2003 vput vexpr res * 1 1
2004 echo $?/$^ERRNAME $res
2005 vput vexpr res * -13 -2
2006 echo $?/$^ERRNAME $res
2008 vput vexpr res / 0 0
2009 echo $?/$^ERRNAME $res
2010 vput vexpr res / 0 1
2011 echo $?/$^ERRNAME $res
2012 vput vexpr res / 1 1
2013 echo $?/$^ERRNAME $res
2014 vput vexpr res / -13 -2
2015 echo $?/$^ERRNAME $res
2017 vput vexpr res % 0 0
2018 echo $?/$^ERRNAME $res
2019 vput vexpr res % 0 1
2020 echo $?/$^ERRNAME $res
2021 vput vexpr res % 1 1
2022 echo $?/$^ERRNAME $res
2023 vput vexpr res % -13 -2
2024 echo $?/$^ERRNAME $res
2027 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
2029 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2030 vput vexpr res
find 'bananarama' 'nana'
2031 echo $?
/$^ERRNAME
:$res:
2032 vput vexpr res
find 'bananarama' 'bana'
2033 echo $?
/$^ERRNAME
:$res:
2034 vput vexpr res
find 'bananarama' 'Bana'
2035 echo $?
/$^ERRNAME
:$res:
2036 vput vexpr res
find 'bananarama' 'rama'
2037 echo $?
/$^ERRNAME
:$res:
2039 vput vexpr res ifind
'bananarama' 'nana'
2040 echo $?
/$^ERRNAME
:$res:
2041 vput vexpr res ifind
'bananarama' 'bana'
2042 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res ifind
'bananarama' 'Bana'
2044 echo $?
/$^ERRNAME
:$res:
2045 vput vexpr res ifind
'bananarama' 'rama'
2046 echo $?
/$^ERRNAME
:$res:
2048 vput vexpr res substring
'bananarama' 1
2049 echo $?
/$^ERRNAME
:$res:
2050 vput vexpr res substring
'bananarama' 3
2051 echo $?
/$^ERRNAME
:$res:
2052 vput vexpr res substring
'bananarama' 5
2053 echo $?
/$^ERRNAME
:$res:
2054 vput vexpr res substring
'bananarama' 7
2055 echo $?
/$^ERRNAME
:$res:
2056 vput vexpr res substring
'bananarama' 9
2057 echo $?
/$^ERRNAME
:$res:
2058 vput vexpr res substring
'bananarama' 10
2059 echo $?
/$^ERRNAME
:$res:
2060 vput vexpr res substring
'bananarama' 1 3
2061 echo $?
/$^ERRNAME
:$res:
2062 vput vexpr res substring
'bananarama' 3 3
2063 echo $?
/$^ERRNAME
:$res:
2064 vput vexpr res substring
'bananarama' 5 3
2065 echo $?
/$^ERRNAME
:$res:
2066 vput vexpr res substring
'bananarama' 7 3
2067 echo $?
/$^ERRNAME
:$res:
2068 vput vexpr res substring
'bananarama' 9 3
2069 echo $?
/$^ERRNAME
:$res:
2070 vput vexpr res substring
'bananarama' 10 3
2071 echo $?
/$^ERRNAME
:$res:
2073 vput vexpr res substring
'bananarama' -1
2074 echo $?
/$^ERRNAME
:$res:
2075 vput vexpr res substring
'bananarama' -3
2076 echo $?
/$^ERRNAME
:$res:
2077 vput vexpr res substring
'bananarama' -5
2078 echo $?
/$^ERRNAME
:$res:
2079 vput vexpr res substring
'bananarama' -7
2080 echo $?
/$^ERRNAME
:$res:
2081 vput vexpr res substring
'bananarama' -9
2082 echo $?
/$^ERRNAME
:$res:
2083 vput vexpr res substring
'bananarama' -10
2084 echo $?
/$^ERRNAME
:$res:
2085 vput vexpr res substring
'bananarama' 1 -3
2086 echo $?
/$^ERRNAME
:$res:
2087 vput vexpr res substring
'bananarama' 3 -3
2088 echo $?
/$^ERRNAME
:$res:
2089 vput vexpr res substring
'bananarama' 5 -3
2090 echo $?
/$^ERRNAME
:$res:
2091 vput vexpr res substring
'bananarama' 7 -3
2092 echo $?
/$^ERRNAME
:$res:
2093 vput vexpr res substring
'bananarama' 9 -3
2094 echo $?
/$^ERRNAME
:$res:
2095 vput vexpr res substring
'bananarama' 10 -3
2096 echo $?
/$^ERRNAME
:$res:
2098 vput vexpr res trim
'Cocoon Cocoon'
2099 echo $?
/$^ERRNAME
:$res:
2100 vput vexpr res trim
' Cocoon Cocoon '
2101 echo $?
/$^ERRNAME
:$res:
2102 vput vexpr res trim-front
'Cocoon Cocoon'
2103 echo $?
/$^ERRNAME
:$res:
2104 vput vexpr res trim-front
' Cocoon Cocoon '
2105 echo $?
/$^ERRNAME
:$res:
2106 vput vexpr res trim-end
'Cocoon Cocoon'
2107 echo $?
/$^ERRNAME
:$res:
2108 vput vexpr res trim-end
' Cocoon Cocoon '
2109 echo $?
/$^ERRNAME
:$res:
2112 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2114 if have_feat regex
; then
2115 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2116 vput vexpr res regex 'bananarama' 'nana'
2117 echo $?/$^ERRNAME :$res:
2118 vput vexpr res regex 'bananarama' 'bana'
2119 echo $?/$^ERRNAME :$res:
2120 vput vexpr res regex 'bananarama' 'Bana'
2121 echo $?/$^ERRNAME :$res:
2122 vput vexpr res regex 'bananarama' 'rama'
2123 echo $?/$^ERRNAME :$res:
2125 vput vexpr res iregex 'bananarama' 'nana'
2126 echo $?/$^ERRNAME :$res:
2127 vput vexpr res iregex 'bananarama' 'bana'
2128 echo $?/$^ERRNAME :$res:
2129 vput vexpr res iregex 'bananarama' 'Bana'
2130 echo $?/$^ERRNAME :$res:
2131 vput vexpr res iregex 'bananarama' 'rama'
2132 echo $?/$^ERRNAME :$res:
2134 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2135 echo $?/$^ERRNAME :$res:
2136 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2137 echo $?/$^ERRNAME :$res:
2138 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2139 echo $?/$^ERRNAME :$res:
2140 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2141 echo $?/$^ERRNAME :$res:
2143 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2144 echo $?/$^ERRNAME :$res:
2145 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2146 echo $?/$^ERRNAME :$res:
2147 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2148 echo $?/$^ERRNAME :$res:
2149 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2150 echo $?/$^ERRNAME :$res:
2154 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2156 printf 'behave:vexpr-regex: unsupported, skipped\n'
2162 t_behave_call_ret() {
2163 t_prolog t_behave_call_ret
2165 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2170 vput vexpr j
'&' $i 7
2176 vput vexpr j
'&' $i 7
2182 echo ! The end
for $1
2186 # Transport $?/$! up the call chain
2192 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2196 echo ! The end
for $1
2197 return $i $^ERR-BUSY
2201 # Up and down it goes
2208 vput vexpr k
- $1 $2
2212 echo "# <$i/$j> .. "
2216 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2219 echo ! The end
for $1=$i/$2
2223 return $i $^ERR-BUSY
2229 call w1
0; echo ?
=$?
!=$
!; echo -----;
2230 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2231 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2234 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2240 t_prolog t_behave_xcall
2242 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2247 vput vexpr j '&' $i 7
2253 echo ! The end for $1/$2
2255 return $i $^ERR-BUSY
2266 echo ?=$? !=$^ERRNAME
2269 echo ?=$? !=$^ERRNAME
2271 echo ?=$? !=$^ERRNAME
2274 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2278 ${cat} <<- '__EOT' > "${BODY}"
2283 vput vexpr j '&' $i 7
2289 echo ! The end for $1
2292 echo would be err with errexit
2301 echo zwei, ?=$? !=$!
2302 localopts yes; set errexit
2304 echo drei, ?=$? !=$^ERRNAME
2306 echo vier, ?=$? !=$^ERRNAME, this is an error
2309 echo outer 1, ?=$? !=$^ERRNAME
2311 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2313 echo outer 3, ?=$? !=$^ERRNAME
2314 echo this is definitely an error
2317 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2319 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2321 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2323 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2328 t_behave_vpospar() {
2329 t_prolog t_behave_vpospar
2331 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2332 vpospar
set hey
, "'you ", world
!
2333 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2334 vput vpospar x quote
; echo x
<$x>
2335 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2336 vput vpospar y quote
;echo y
<$y>
2337 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2338 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2339 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2342 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2343 vput vpospar z quote
;echo infun2
:z
<$z>
2347 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2348 vput vpospar y quote
;echo infun
:y
<$y>
2349 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2350 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2352 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2353 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2356 call infun This
"in a" fun
2357 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2358 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2360 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2363 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2365 echo ifs<$ifs> ifs-ws<$ifs-ws>
2366 vpospar set hey, "'you ", world!
2367 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2368 vput vpospar x quote; echo x<$x>
2369 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2370 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2373 echo ifs<$ifs> ifs-ws<$ifs-ws>
2374 vpospar set hey, "'you
", world!
2375 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2377 vput vpospar x quote; echo x<$x>
2378 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2379 eval vpospar set ${x};\
2380 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2383 echo ifs<$ifs> ifs-ws<$ifs-ws>
2384 vpospar set hey, "'you ", world!
2385 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2387 vput vpospar x quote; echo x<$x>
2388 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2389 eval vpospar set ${x};\
2390 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2392 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2397 t_behave_atxplode() {
2398 t_prolog t_behave_atxplode
2399 TRAP_EXIT_ADDONS="./.t*"
2401 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2404 printf " (1/$#: <$1>)"
2406 if [ $# -gt 0 ]; then
2420 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2421 printf xxx;xxx arg ,b u.
2422 printf xxx;xxx arg , .
2423 printf xxx;xxx arg ,ball.
2429 echon " (1/$#: <$1>)"
2444 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2445 echon xxx;call xxx arg ,b u.
2446 echon xxx;call xxx arg , .
2447 echon xxx;call xxx arg ,ball.
2450 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2451 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2453 #${SHELL} ./.t.sh > ./.tshout 2>&1
2454 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2460 t_prolog t_behave_read
2461 TRAP_EXIT_ADDONS="./.t*"
2463 ${cat} <<- '__EOT
' > .tin
2464 hey1, "'you
", world!
2465 hey2, "'you ", bugs bunny!
2470 ${cat} <<- '__EOT
' |\
2471 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2473 echo $?/$^ERRNAME / <$a><$b><$c>
2475 echo $?/$^ERRNAME / <$a><$b><$c>
2477 echo $?/$^ERRNAME / <$a><$b><$c>
2479 echo $?/$^ERRNAME / <$a><$b><$c>
2480 unset a b c;read a b c
2481 echo $?/$^ERRNAME / <$a><$b><$c>
2482 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2484 check behave:read-1 0 "${MBOX}" '1527910147 173'
2486 ${cat} <<- '__EOT
' > .tin2
2487 hey2.0,:"'you
",:world!:mars.:
2488 hey2.1,:"'you ",:world!
2489 hey2.2,:"'you
",:bugs bunny!
2495 ${cat} <<- '__EOT' |\
2496 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2499 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2501 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2503 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2505 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2507 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2509 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2510 unset a b c
;read a b c
2511 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2513 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2514 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2516 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2518 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2520 readall d; echo $?/$^ERRNAME / <$d>
2521 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2522 readctl create .tin2
2523 readall d; echo $?/$^ERRNAME / <$d>
2524 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2525 readctl remove .tin;echo $?/$^ERRNAME;\
2526 readctl remove .tin2;echo $?/$^ERRNAME
2528 check behave:readall 0 "${MBOX}" '860434889 333'
2534 t_prolog t_behave_mbox
2535 TRAP_EXIT_ADDONS=".
/.t
*"
2539 while [ ${i} -lt 112 ]; do
2540 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2541 "${MBOX}" "${i}" "${i}"
2544 ) | ${MAILX} ${ARGS}
2545 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2547 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2548 ${MAILX} ${ARGS} > .tlst
2549 check behave:mbox-2 0 .tlst '2739893312 9103'
2551 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2552 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} > .tlst
2553 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2555 # only the odd (even)
2557 printf 'File "file://%s"\ncopy ' .tmbox2
2559 while [ ${i} -lt 112 ]; do
2561 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2564 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2565 ) |
${MAILX} ${ARGS} > .tlst
2566 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2567 check behave
:mbox-5
- .tlst
'2960975049 4573'
2570 printf 'file "file://%s"\nmove ' .tmbox2
2572 while [ ${i} -lt 112 ]; do
2574 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2577 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2578 .tmbox3 .tmbox3 .tmbox2
2579 ) | ${MAILX} ${ARGS} > .tlst
2580 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2581 ${sed} 2d < .tlst > .tlstx
2582 check behave:mbox-7 - .tlstx '2729940494 13645'
2587 t_behave_maildir() {
2588 t_prolog t_behave_maildir
2589 TRAP_EXIT_ADDONS=".
/.t
*"
2593 while [ ${i} -lt 112 ]; do
2594 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2595 "${MBOX}" "${i}" "${i}"
2598 ) | ${MAILX} ${ARGS}
2599 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2605 ' "${MBOX}" .tmdir1 .tmdir1 |
2606 ${MAILX} ${ARGS} -Snewfolders=maildir > .tlst
2607 check behave:maildir-2 0 .tlst '1797938753 9103'
2610 copy * "maildir
://%s
"
2613 ' "${MBOX}" .tmdir2 .tmdir2 |
2614 ${MAILX} ${ARGS} > .tlst
2615 check behave:maildir-3 0 .tlst '1155631089 9113'
2617 printf 'File "maildir
://%s
"
2621 ' .tmdir2 .tmbox1 .tmbox1 |
2622 ${MAILX} ${ARGS} > .tlst
2623 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2624 check behave:maildir-5 - .tlst '3701297796 9110'
2626 # only the odd (even)
2628 printf 'File "maildir
://%s
"
2631 while [ ${i} -lt 112 ]; do
2633 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2640 ) | ${MAILX} ${ARGS} > .tlst
2641 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2642 check behave:maildir-7 - .tlst '960096773 4573'
2645 printf 'file "maildir
://%s
"
2648 while [ ${i} -lt 112 ]; do
2650 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2658 ' .tmbox2 .tmbox2 .tmdir2
2659 ) |
${MAILX} ${ARGS} > .tlst
2660 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2661 ${sed} 2d
< .tlst
> .tlstx
2662 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2667 t_behave_record_a_resend
() {
2668 t_prolog t_behave_record_a_resend
2669 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2673 m %s\n~s Subject 1.\nHello.\n~.
2674 set record-files add-file-recipients
2675 m %s\n~s Subject 2.\nHello.\n~.
2677 resend 2 ./.t.resent
2678 Resend 1 ./.t.resent
2680 resend 2 ./.t.resent
2681 Resend 1 ./.t.resent
2682 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2685 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2686 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2687 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2692 t_behave_e_H_L_opts
() {
2693 t_prolog t_behave_e_H_L_opts
2694 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2697 ${MAILX} ${ARGS} -ef .
/.t.mbox
2698 echo ${?} > "${MBOX}"
2700 ${cat} <<-_EOT > ./.tsendmail.sh
2702 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2705 chmod 0755 .
/.tsendmail.sh
2706 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2707 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2708 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2709 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2711 ${MAILX} ${ARGS} -ef .
/.t.mbox
2712 echo ${?} >> "${MBOX}"
2713 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2714 echo ${?} >> "${MBOX}"
2715 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2716 echo ${?} >> "${MBOX}"
2717 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2718 echo ${?} >> "${MBOX}"
2719 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2720 echo ${?} >> "${MBOX}"
2721 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2722 echo ${?} >> "${MBOX}"
2723 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2724 echo ${?} >> "${MBOX}"
2726 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2727 echo ${?} >> "${MBOX}"
2728 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2729 echo ${?} >> "${MBOX}"
2730 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2731 echo ${?} >> "${MBOX}"
2732 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2733 echo ${?} >> "${MBOX}"
2734 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2735 echo ${?} >> "${MBOX}"
2736 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2737 echo ${?} >> "${MBOX}"
2738 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2739 echo ${?} >> "${MBOX}"
2741 check behave:e_H_L_opts - "${MBOX}" '1708955574 678'
2746 t_behave_alternates() {
2747 t_prolog t_behave_alternates
2748 TRAP_EXIT_ADDONS=".
/.t
*"
2750 ${cat} <<-_EOT > ./.tsendmail.sh
2752 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2755 chmod 0755 ./.tsendmail.sh
2757 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2761 alternates a1@b1 a2@b2 a3@b3
2766 echo $?/$^ERRNAME <$rv>
2771 echo $?/$^ERRNAME <$rv>
2774 echo $?/$^ERRNAME <$rv>
2777 echo $?/$^ERRNAME <$rv>
2781 alternates a1@b1 a2@b2 a3@b3
2784 echo $?/$^ERRNAME <$rv>
2787 echo $?/$^ERRNAME <$rv>
2790 echo $?/$^ERRNAME <$rv>
2793 alternates a1@b1 a2@b2 a3@b3
2796 echo $?/$^ERRNAME <$rv>
2799 echo $?/$^ERRNAME <$rv>
2802 echo $?/$^ERRNAME <$rv>
2806 alternates a1@b1 a2@b2 a3@b3
2809 echo $?/$^ERRNAME <$rv>
2813 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2815 ~s all alternates, only a1@b1 remains
2817 ~b a3@b3 a3@c3 a3@d3
2826 alternates a1@b1 a1@c1 a2@b2 a3@b3
2828 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2830 ~b a3@b3 a3@c3 a3@d3
2837 alternates a1@b1 a2@b2 a3; set allnet
2839 ~s all alternates via allnet, only a1@b1 remains
2841 ~b a3@b3 a3@c3 a3@d3
2852 echo $?/$^ERRNAME <$rv>
2856 echo $?/$^ERRNAME <$rv>
2860 echo $?/$^ERRNAME <$rv>
2864 echo $?/$^ERRNAME <$rv>
2868 echo $?/$^ERRNAME <$rv>
2872 alternates a1@b1 a2@b2
2875 echo $?/$^ERRNAME <$rv>
2876 alternates a3@b3 a4@b4
2879 echo $?/$^ERRNAME <$rv>
2881 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2882 check behave:alternates-2 - .tall '1878598364 505'
2888 t_prolog t_behave_alias
2889 TRAP_EXIT_ADDONS=".
/.t
*"
2891 ${cat} <<-_EOT > ./.tsendmail.sh
2893 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2896 chmod 0755 ./.tsendmail.sh
2898 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2900 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2902 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2904 alias a4 a5 ex1@a4.ple
2906 alias a6 a7 ex1@a6.ple
2920 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2921 check behave:alias-2 - .tall '3548953204 152'
2923 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2924 # TODO need to somehow provide its contents to the test, then test
2929 t_behave_filetype() {
2930 t_prolog t_behave_filetype
2931 TRAP_EXIT_ADDONS=".
/.t
*"
2933 ${cat} <<-_EOT > ./.tsendmail.sh
2935 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2938 chmod 0755 ./.tsendmail.sh
2940 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2941 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2942 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2944 if (echo |
gzip -c) >/dev
/null
2>&1; then
2947 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2948 "${MBOX}" | ${MAILX} ${ARGS} \
2949 -X'filetype gz gzip\ -dc gzip\ -c'
2950 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2951 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2953 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2954 check behave:filetype-3 - ".
/.t.out
" '2392348396 102'
2956 echo 'behave:filetype-2: unsupported, skipped'
2957 echo 'behave:filetype-3: unsupported, skipped'
2962 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2968 -X'filetype gz gzip\ -dc gzip\ -c' \
2969 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2970 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2971 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2973 -X'filetype gz gzip\ -dc gzip\ -c' \
2974 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2976 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2977 check behave:filetype-5 - ".
/.t.out
" '852335377 172'
2982 t_behave_message_injections() {
2983 t_prolog t_behave_message_injections
2984 TRAP_EXIT_ADDONS=".
/.t
*"
2986 ${cat} <<-_EOT > ./.tsendmail.sh
2988 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
2991 chmod 0755 ./.tsendmail.sh
2993 echo mysig > ./.tmysig
2995 echo some-body | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
2996 -Smessage-inject-head=head-inject \
2997 -Smessage-inject-tail=tail-inject \
2998 -Ssignature=./.tmysig \
2999 ex@am.ple > ./.tall 2>&1
3000 check behave:message_injections-1 0 "${MBOX}" '2434746382 134'
3001 check behave:message_injections-2 - .tall '4294967295 0' # empty file
3003 ${cat} <<-_EOT > ./.template
3007 Subject: This subject is
3009 Body, body, body me.
3011 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tsendmail.sh \
3012 -Smessage-inject-head=head-inject \
3013 -Smessage-inject-tail=tail-inject \
3014 -Ssignature=./.tmysig \
3016 check behave:message_injections-3 0 "${MBOX}" '3114203412 198'
3017 check behave:message_injections-4 - .tall '4294967295 0' # empty file
3022 t_behave_compose_hooks() { # TODO monster
3023 t_prolog t_behave_compose_hooks
3024 TRAP_EXIT_ADDONS=".
/.t
*"
3026 (echo line one&&echo line two&&echo line three) > ./.treadctl
3027 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
3029 ${cat} <<-_EOT > ./.tsendmail.sh
3031 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
3034 chmod 0755 ./.tsendmail.sh
3036 ${cat} <<'__EOT__' > ./.trc
3038 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3041 vput vexpr es substr "$1" 0 1
3046 define read_mline_res {
3047 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3048 echo $len/$es/$^ERRNAME: $hl
3049 if [ $es -ne $^ERR-NONE ]
3050 xcall bail read_mline_res
3052 \xcall read_mline_res
3057 echo "~^header list
"; read hl; echo $hl;\
3058 call xerr "$hl" "in_addr
($xh) 0-1"
3060 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
3061 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
3062 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3063 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
3064 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3065 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
3066 echo "~^header list
$xh"; read hl; echo $hl;\
3067 call xerr "$hl" "ins_addr
$xh 1-4"
3068 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
3071 if [ "$t_remove" == "" ]
3075 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
3076 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
3078 xcall bail "ins_addr
$xh 2-2"
3080 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
3082 xcall bail "ins_addr
$xh 2-3"
3084 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
3086 xcall bail "ins_addr
$xh 2-4"
3090 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
3091 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
3092 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3093 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
3094 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3095 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
3096 echo "~^header list
$xh"; read hl; echo $hl;\
3097 call xerr "$hl" "ins_addr
$xh 3-4"
3098 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
3101 echo "~^header remove-at
$xh 1"; read es;\
3102 call xerr $es "ins_addr
$xh 3-6"
3103 echo "~^header remove-at
$xh 1"; read es;\
3104 call xerr $es "ins_addr
$xh 3-7"
3105 echo "~^header remove-at
$xh 1"; read es;\
3106 call xerr $es "ins_addr
$xh 3-8"
3107 echo "~^header remove-at
$xh 1"; read es;\
3108 vput vexpr es substr $es 0 3
3110 xcall bail "ins_addr
$xh 3-9"
3112 echo "~^header remove-at
$xh T
"; read es;\
3113 vput vexpr es substr $es 0 3
3115 xcall bail "ins_addr
$xh 3-10"
3117 echo "~^header list
$xh"; read es;\
3118 vput vexpr es substr $es 0 3
3120 xcall bail "ins_addr
$xh 3-11"
3122 echo "~^header show
$xh"; read es;\
3123 vput vexpr es substr $es 0 3
3125 xcall bail "ins_addr
$xh 3-12"
3129 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
3130 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
3131 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
3132 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
3133 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3134 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
3135 echo "~^header list
$xh"; read hl; echo $hl;\
3136 call xerr "$hl" "header list
$xh 3-4"
3137 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
3140 echo "~^header remove-at
$xh 3"; read es;\
3141 call xerr $es "ins_addr
$xh 4-6"
3142 echo "~^header remove-at
$xh 2"; read es;\
3143 call xerr $es "ins_addr
$xh 4-7"
3144 echo "~^header remove-at
$xh 1"; read es;\
3145 call xerr $es "ins_addr
$xh 4-8"
3146 echo "~^header remove-at
$xh 1"; read es;\
3147 vput vexpr es substr $es 0 3
3149 xcall bail "ins_addr
$xh 4-9"
3151 echo "~^header remove-at
$xh T
"; read es;\
3152 vput vexpr es substr $es 0 3
3154 xcall bail "ins_addr
$xh 4-10"
3156 echo "~^header list
$xh"; read es;\
3157 vput vexpr es substr $es 0 3
3159 xcall bail "ins_addr
$xh 4-11"
3161 echo "~^header show
$xh"; read es;\
3162 vput vexpr es substr $es 0 3
3164 xcall bail "ins_addr
$xh 4-12"
3168 wysh set xh=$1 mult=$2
3169 echo "~^header list
"; read hl; echo $hl;\
3170 call xerr "$hl" "ins_ref
($xh) 0-1"
3172 echo "~^header insert
$xh <$xh@exam.ple
>";\
3173 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
3175 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3176 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
3177 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3178 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
3180 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
3181 vput vexpr es substr $es 0 3
3183 xcall bail "ins_ref
$xh 1-4"
3187 echo "~^header list
$xh"; read hl; echo $hl;\
3188 call xerr "$hl" "ins_ref
$xh 1-5"
3189 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
3192 if [ "$t_remove" == "" ]
3196 echo "~^header remove
$xh"; read es;\
3197 call xerr $es "ins_ref
$xh 2-1"
3198 echo "~^header remove
$xh"; read es;\
3199 vput vexpr es substr $es 0 3
3201 xcall bail "ins_ref
$xh 2-2"
3203 echo "~^header list
$xh"; read es;\
3204 vput vexpr es substr $es 0 3
3206 xcall bail "$es ins_ref
$xh 2-3"
3208 echo "~^header show
$xh"; read es;\
3209 vput vexpr es substr $es 0 3
3211 xcall bail "ins_ref
$xh 2-4"
3215 echo "~^header insert
$xh <$xh@exam.ple
>";\
3216 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
3218 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3219 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
3220 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3221 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
3223 echo "~^header list
$xh";\
3224 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
3225 echo "~^header show
$xh";\
3226 read es; call xerr $es "ins_ref
$xh 3-5"
3229 echo "~^header remove-at
$xh 1"; read es;\
3230 call xerr $es "ins_ref
$xh 3-6"
3231 if [ $mult -ne 0 ] && [ $xh != subject ]
3232 echo "~^header remove-at
$xh 1"; read es;\
3233 call xerr $es "ins_ref
$xh 3-7"
3234 echo "~^header remove-at
$xh 1"; read es;\
3235 call xerr $es "ins_ref
$xh 3-8"
3237 echo "~^header remove-at
$xh 1"; read es;\
3238 vput vexpr es substr $es 0 3
3240 xcall bail "ins_ref
$xh 3-9"
3242 echo "~^header remove-at
$xh T
"; read es;\
3243 vput vexpr es substr $es 0 3
3245 xcall bail "ins_ref
$xh 3-10"
3247 echo "~^header show
$xh"; read es;\
3248 vput vexpr es substr $es 0 3
3250 xcall bail "ins_ref
$xh 3-11"
3254 echo "~^header insert
$xh <$xh@exam.ple
> ";\
3255 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
3257 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
3258 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
3259 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3260 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
3262 echo "~^header list
$xh"; read hl; echo $hl;\
3263 call xerr "$hl" "ins_ref
$xh 4-4"
3264 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
3267 if [ $mult -ne 0 ] && [ $xh != subject ]
3268 echo "~^header remove-at
$xh 3"; read es;\
3269 call xerr $es "ins_ref
$xh 4-6"
3270 echo "~^header remove-at
$xh 2"; read es;\
3271 call xerr $es "ins_ref
$xh 4-7"
3273 echo "~^header remove-at
$xh 1"; read es;\
3274 call xerr $es "ins_ref
$xh 4-8"
3275 echo "~^header remove-at
$xh 1"; read es;\
3276 vput vexpr es substr $es 0 3
3278 xcall bail "ins_ref
$xh 4-9"
3280 echo "~^header remove-at
$xh T
"; read es;\
3281 vput vexpr es substr $es 0 3
3283 xcall bail "ins_ref
$xh 4-10"
3285 echo "~^header show
$xh"; read es;\
3286 vput vexpr es substr $es 0 3
3288 xcall bail "ins_ref
$xh 4-11"
3293 # In collect.c order
3295 call ins_ref sender 0 # Not a "ref
", but works
3299 call ins_addr reply-To
3300 call ins_addr mail-Followup-to
3301 call ins_ref messAge-id 0
3302 call ins_ref rEfErEncEs 1
3303 call ins_ref in-Reply-to 1
3304 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
3305 call ins_addr freeForm1
3306 call ins_addr freeform2
3308 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
3310 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
3318 echo "~^attachment
";\
3319 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3321 xcall bail "attach
0-1"
3324 echo "~^attach attribute .
/.treadctl
";\
3325 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3327 xcall bail "attach
0-2"
3329 echo "~^attachment attribute-at
1";\
3330 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3332 xcall bail "attach
0-3"
3335 echo "~^attachment insert .
/.treadctl
=ascii
";\
3336 read hl; echo $hl; call xerr "$hl" "attach
1-1"
3337 echo "~^attachment list
";\
3338 read es; echo $es;call xerr "$es" "attach
1-2"
3340 echo "~^attachment attribute .
/.treadctl
";\
3341 read es; echo $es;call xerr "$es" "attach
1-3"
3343 echo "~^attachment attribute .treadctl
";\
3344 read es; echo $es;call xerr "$es" "attach
1-4"
3346 echo "~^attachment attribute-at
1";\
3347 read es; echo $es;call xerr "$es" "attach
1-5"
3350 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
3351 read es; echo $es;call xerr "$es" "attach
1-6"
3352 echo "~^attachment attribute-set .treadctl content-description Au
";\
3353 read es; echo $es;call xerr "$es" "attach
1-7"
3354 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
3355 read es; echo $es;call xerr "$es" "attach
1-8"
3357 echo "~^attachment attribute .
/.treadctl
";\
3358 read es; echo $es;call xerr "$es" "attach
1-9"
3360 echo "~^attachment attribute .treadctl
";\
3361 read es; echo $es;call xerr "$es" "attach
1-10"
3363 echo "~^attachment attribute rctl
";\
3364 read es; echo $es;call xerr "$es" "attach
1-11"
3366 echo "~^attachment attribute-at
1";\
3367 read es; echo $es;call xerr "$es" "attach
1-12"
3371 echo "~^attachment insert .
/.tattach
=latin1
";\
3372 read hl; echo $hl; call xerr "$hl" "attach
2-1"
3373 echo "~^attachment list
";\
3374 read es; echo $es;call xerr "$es" "attach
2-2"
3376 echo "~^attachment attribute .
/.tattach
";\
3377 read es; echo $es;call xerr "$es" "attach
2-3"
3379 echo "~^attachment attribute .tattach
";\
3380 read es; echo $es;call xerr "$es" "attach
2-4"
3382 echo "~^attachment attribute-at
2";\
3383 read es; echo $es;call xerr "$es" "attach
2-5"
3386 echo "~^attachment attribute-set .
/.tattach filename tat
";\
3387 read es; echo $es;call xerr "$es" "attach
2-6"
3389 "~^attachment attribute-set .tattach content-description Au2
";\
3390 read es; echo $es;call xerr "$es" "attach
2-7"
3391 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
3392 read es; echo $es;call xerr "$es" "attach
2-8"
3394 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
3395 read es; echo $es;call xerr "$es" "attach
2-9"
3397 echo "~^attachment attribute .
/.tattach
";\
3398 read es; echo $es;call xerr "$es" "attach
2-10"
3400 echo "~^attachment attribute .tattach
";\
3401 read es; echo $es;call xerr "$es" "attach
2-11"
3403 echo "~^attachment attribute tat
";\
3404 read es; echo $es;call xerr "$es" "attach
2-12"
3406 echo "~^attachment attribute-at
2";\
3407 read es; echo $es;call xerr "$es" "attach
2-13"
3411 if [ "$t_remove" == "" ]
3415 echo "~^attachment remove .
/.treadctl
"; read es;\
3416 call xerr $es "attach
3-1"
3417 echo "~^attachment remove .
/.tattach
"; read es;\
3418 call xerr $es "attach
3-2"
3419 echo "~^ attachment remove .
/.treadctl
"; read es;\
3420 vput vexpr es substr $es 0 3
3422 xcall bail "attach
3-3"
3424 echo "~^ attachment remove .
/.tattach
"; read es;\
3425 vput vexpr es substr $es 0 3
3427 xcall bail "attach
3-4"
3429 echo "~^attachment list
"; read es;\
3430 vput vexpr es substr $es 0 3
3432 xcall bail "attach
3-5"
3436 echo "~^attachment insert .
/.tattach
=latin1
";\
3437 read hl; echo $hl; call xerr "$hl" "attach
4-1"
3438 echo "~^attachment insert .
/.tattach
=latin1
";\
3439 read hl; echo $hl; call xerr "$hl" "attach
4-2"
3440 echo "~^attachment list
";\
3441 read es; echo $es;call xerr "$es" "attach
4-3"
3443 echo "~^ attachment remove .tattach
"; read es;\
3444 vput vexpr es substr $es 0 3
3446 xcall bail "attach
4-4 $es"
3448 echo "~^attachment remove-at T
"; read es;\
3449 vput vexpr es substr $es 0 3
3451 xcall bail "attach
4-5"
3453 echo "~^attachment remove .
/.tattach
"; read es;\
3454 call xerr $es "attach
4-6"
3455 echo "~^attachment remove .
/.tattach
"; read es;\
3456 call xerr $es "attach
4-7"
3457 echo "~^ attachment remove .
/.tattach
"; read es;\
3458 vput vexpr es substr $es 0 3
3460 xcall bail "attach
4-8 $es"
3462 echo "~^attachment list
"; read es;\
3463 vput vexpr es substr $es 0 3
3465 xcall bail "attach
4-9"
3469 echo "~^attachment insert .
/.tattach
=latin1
";\
3470 read hl; echo $hl; call xerr "$hl" "attach
5-1"
3471 echo "~^attachment insert .
/.tattach
=latin1
";\
3472 read hl; echo $hl; call xerr "$hl" "attach
5-2"
3473 echo "~^attachment insert .
/.tattach
=latin1
";\
3474 read hl; echo $hl; call xerr "$hl" "attach
5-3"
3475 echo "~^attachment list
";\
3476 read es; echo $es;call xerr "$es" "attach
5-4"
3479 echo "~^attachment remove-at
3"; read es;\
3480 call xerr $es "attach
5-5"
3481 echo "~^attachment remove-at
3"; read es;\
3482 vput vexpr es substr $es 0 3
3484 xcall bail "attach
5-6"
3486 echo "~^attachment remove-at
2"; read es;\
3487 call xerr $es "attach
5-7"
3488 echo "~^attachment remove-at
2"; read es;\
3489 vput vexpr es substr $es 0 3
3491 xcall bail "attach
5-8"
3493 echo "~^attachment remove-at
1"; read es;\
3494 call xerr $es "attach
5-9"
3495 echo "~^attachment remove-at
1"; read es;\
3496 vput vexpr es substr $es 0 3
3498 xcall bail "attach
5-10"
3501 echo "~^attachment list
"; read es;\
3502 vput vexpr es substr $es 0 3
3504 xcall bail "attach
5-11"
3508 echo "~^attachment insert .
/.tattach
=latin1
";\
3509 read hl; echo $hl; call xerr "$hl" "attach
6-1"
3510 echo "~^attachment insert .
/.tattach
=latin1
";\
3511 read hl; echo $hl; call xerr "$hl" "attach
6-2"
3512 echo "~^attachment insert .
/.tattach
=latin1
";\
3513 read hl; echo $hl; call xerr "$hl" "attach
6-3"
3514 echo "~^attachment list
";\
3515 read es; echo $es;call xerr "$es" "attach
6-4"
3518 echo "~^attachment remove-at
1"; read es;\
3519 call xerr $es "attach
6-5"
3520 echo "~^attachment remove-at
1"; read es;\
3521 call xerr $es "attach
6-6"
3522 echo "~^attachment remove-at
1"; read es;\
3523 call xerr $es "attach
6-7"
3524 echo "~^attachment remove-at
1"; read es;\
3525 vput vexpr es substr $es 0 3
3527 xcall bail "attach
6-8"
3530 echo "~^attachment list
"; read es;\
3531 vput vexpr es substr $es 0 3
3533 xcall bail "attach
6-9"
3545 echo on-compose-enter, mailx-command<$mailx-command>
3546 alternates alter1@exam.ple alter2@exam.ple
3548 set autocc='alter1@exam.ple alter2@exam.ple'
3549 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3550 echo mailx-subject<$mailx-subject>
3551 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3552 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3553 mailx-raw-bcc<$mailx-raw-bcc>
3554 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3555 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3558 echo on-compose-leave, mailx-command<$mailx-command>
3560 eval alternates $al alter3@exam.ple alter4@exam.ple
3562 set autobcc='alter3@exam.ple alter4@exam.ple'
3563 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3564 echo mailx-subject<$mailx-subject>
3565 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3566 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3567 mailx-raw-bcc<$mailx-raw-bcc>
3568 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3569 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3572 echo on-compose-cleanup, mailx-command<$mailx-command>
3575 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3576 echo mailx-subject<$mailx-subject>
3577 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3578 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3579 mailx-raw-bcc<$mailx-raw-bcc>
3580 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3581 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3583 wysh set on-compose-splice=t_ocs \
3584 on-compose-enter=t_oce on-compose-leave=t_ocl \
3585 on-compose-cleanup=t_occ
3589 printf 'm this-goes@nowhere\nbody\n!.\n' |
3590 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3591 -X'source ./.trc' -Smta=./.tsendmail.sh \
3593 ${cat} ./.tall >> "${MBOX}"
3594 check behave:compose_hooks-1 0 "${MBOX}" '522535560 10101'
3597 printf 'm this-goes@nowhere\nbody\n!.\n' |
3598 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3599 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh \
3601 ${cat} ./.tall >> "${MBOX}"
3602 check behave:compose_hooks-2 0 "${MBOX}" '3654000499 12535'
3606 # Some state machine stress, shell compose hook, localopts for hook, etc.
3607 # readctl in child. ~r as HERE document
3609 printf 'm ex@am.ple\nbody\n!.
3610 echon ${mailx-command}${mailx-subject}
3611 echon ${mailx-from}${mailx-sender}
3612 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3613 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3614 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3615 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3616 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3617 -Smta=./.tsendmail.sh \
3620 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3623 vput vexpr es substr "$1" 0 1
3628 define read_mline_res {
3629 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3630 echo $len/$es/$^ERRNAME: $hl
3631 if [ $es -ne $^ERR-NONE ]
3632 xcall bail read_mline_res
3634 \xcall read_mline_res
3638 vput vexpr i + 1 "$2"
3640 vput vexpr j % $i 10
3647 eval \\$j _work $1 $i
3650 vput vexpr i + $i "$1"
3654 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3655 echo read:$es/$en: $line
3656 if [ "${es}" -ne -1 ]
3659 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3664 echo "~^header list
"; read hl; echo $hl;\
3665 vput vexpr es substr "$hl" 0 1
3667 xcall bail "header list
"
3670 call _work 1; echo $?
3671 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
3672 read es; echo $es; vput vexpr es substr "$es" 0 1
3674 xcall bail "be diet
"
3676 echo "~^header insert cc
<splice2@exam.ple
>";\
3677 read es; echo $es; vput vexpr es substr "$es" 0 1
3679 xcall bail "be diet2
"
3682 call _work 2; echo $?
3683 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
3684 read es; echo $es;vput vexpr es substr "$es" 0 1
3686 xcall bail "be juicy
"
3688 echo "~^header insert bcc juice2@exam.ple
";\
3689 read es; echo $es;vput vexpr es substr "$es" 0 1
3691 xcall bail "be juicy2
"
3693 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
3694 read es; echo $es;vput vexpr es substr "$es" 0 1
3696 xcall bail "be juicy3
"
3698 echo "~^header insert bcc juice4@exam.ple
";\
3699 read es; echo $es;vput vexpr es substr "$es" 0 1
3701 xcall bail "be juicy4
"
3704 echo "~^header remove-at bcc
3";\
3705 read es; echo $es;vput vexpr es substr "$es" 0 1
3707 xcall bail "remove juicy5
"
3709 echo "~^header remove-at bcc
2";\
3710 read es; echo $es;vput vexpr es substr "$es" 0 1
3712 xcall bail "remove juicy6
"
3714 echo "~^header remove-at bcc
3";\
3715 read es; echo $es;vput vexpr es substr "$es" 0 3
3717 xcall bail "failed to remove-at
"
3719 # Add duplicates which ought to be removed!
3720 echo "~^header insert bcc juice4@exam.ple
";\
3721 read es; echo $es;vput vexpr es substr "$es" 0 1
3723 xcall bail "be juicy4-1
"
3725 echo "~^header insert bcc juice4@exam.ple
";\
3726 read es; echo $es;vput vexpr es substr "$es" 0 1
3728 xcall bail "be juicy4-2
"
3730 echo "~^header insert bcc juice4@exam.ple
";\
3731 read es; echo $es;vput vexpr es substr "$es" 0 1
3733 xcall bail "be juicy4-3
"
3738 call _work 3; echo $?
3740 vput ! i echo just knock if you can hear me;\
3742 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
3744 echon shell-cmd says $?/$^ERRNAME: $i
3745 echo "~x will not become interpreted
, we are reading
until __EOT
"
3747 read r_status; echo "~~r status output
: $r_status"
3748 echo "~
:echo $? $
! $^ERRNAME
"
3750 echo "~~r status from parent
: $r_status"
3753 call _work 4; echo $?
3754 vput cwd cwd;echo cwd:$?
3755 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3759 call _work 5; echo $?
3760 echo "~^header show MAILX-Command
"; read es;\
3761 call xerr $es "t_header
1000"; call read_mline_res
3762 echo "~^header show MAILX-raw-TO
"; read es;\
3763 call xerr $es "t_header
1001"; xcall read_mline_res
3765 echoerr IT IS WRONG IF YOU SEE THIS
3768 echo on-compose-enter, mailx-command<$mailx-command>
3769 set t_oce autobcc=oce@exam.ple
3770 alternates alter1@exam.ple alter2@exam.ple
3772 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3773 echo mailx-subject<$mailx-subject>
3774 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3775 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3776 mailx-raw-bcc<$mailx-raw-bcc>
3777 echo mailx-orig-from<$mailx-orig-from> \
3778 mailx-orig-to<$mailx-orig-to> \
3779 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3782 echo on-compose-leave, mailx-command<$mailx-command>
3783 set t_ocl autocc=ocl@exam.ple
3785 alternates alter3@exam.ple alter4@exam.ple
3787 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3788 echo mailx-subject<$mailx-subject>
3789 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3790 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3791 mailx-raw-bcc<$mailx-raw-bcc>
3792 echo mailx-orig-from<$mailx-orig-from> \
3793 mailx-orig-to<$mailx-orig-to> \
3794 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3797 echo on-compose-cleanup, mailx-command<$mailx-command>
3798 set t_occ autocc=occ@exam.ple
3801 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3802 echo mailx-subject<$mailx-subject>
3803 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3804 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3805 mailx-raw-bcc<$mailx-raw-bcc>
3806 echo mailx-orig-from<$mailx-orig-from> \
3807 mailx-orig-to<$mailx-orig-to> \
3808 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3810 wysh set on-compose-splice=t_ocs \
3811 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
3812 ~t shell@exam.ple
\\n~
:set t_ocs_sh
\\n
\"" \
3813 on-compose-enter=t_oce on-compose-leave=t_ocl \
3814 on-compose-cleanup=t_occ
3816 ex0_test behave:compose_hooks-3-estat
3817 ${cat} ./.tnotes >> "${MBOX}"
3819 check behave:compose_hooks-3 - "${MBOX}" '679526364 2431'
3821 # Reply, forward, resend, Resend
3824 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3825 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3826 -Smta=./.tsendmail.sh
3829 echo start: $? $! $^ERRNAME
3831 echo File: $? $! $^ERRNAME;echo;echo
3833 this is content of reply 1
3835 echo reply 1: $? $! $^ERRNAME;echo;echo
3837 this is content of Reply 1 2
3839 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3840 forward 1 fwdex@am.ple
3841 this is content of forward 1
3843 echo forward 1: $? $! $^ERRNAME;echo;echo
3844 resend 1 2 resendex@am.ple
3845 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3846 Resend 1 2 Resendex@am.ple
3847 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3849 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3850 -Smta=./.tsendmail.sh \
3853 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3856 vput vexpr es substr "$1" 0 1
3861 define read_mline_res {
3862 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3863 echo mline_res:$len/$es/$^ERRNAME: $hl
3864 if [ $es -ne $^ERR-NONE ]
3865 xcall bail read_mline_res
3867 \xcall read_mline_res
3871 echo "~^header show
$1"; read es;\
3872 call xerr $es "work_hl
$1"; echo $1; call read_mline_res
3880 echo t_ocs version $ver
3881 echo "~^header list
"; read hl; echo $hl;\
3882 echoerr the header list is $hl;\
3883 call xerr "$hl" "header list
"
3884 eval vpospar set $hl
3887 echoerr IT IS WRONG IF YOU SEE THIS
3890 echo on-XY-enter, mailx-command<$mailx-command>
3891 set t_oce autobcc=oce@exam.ple
3892 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3893 echo mailx-subject<$mailx-subject>
3894 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3895 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3896 mailx-raw-bcc<$mailx-raw-bcc>
3897 echo mailx-orig-from<$mailx-orig-from> \
3898 mailx-orig-to<$mailx-orig-to> \
3899 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3902 echo on-XY-leave, mailx-command<$mailx-command>
3903 set t_ocl autocc=ocl@exam.ple
3904 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3905 echo mailx-subject<$mailx-subject>
3906 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3907 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3908 mailx-raw-bcc<$mailx-raw-bcc>
3909 echo mailx-orig-from<$mailx-orig-from> \
3910 mailx-orig-to<$mailx-orig-to> \
3911 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3914 echo on-XY-cleanup, mailx-command<$mailx-command>
3915 set t_occ autocc=occ@exam.ple
3916 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3917 echo mailx-subject<$mailx-subject>
3918 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3919 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3920 mailx-raw-bcc<$mailx-raw-bcc>
3921 echo mailx-orig-from<$mailx-orig-from> \
3922 mailx-orig-to<$mailx-orig-to> \
3923 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3925 wysh set on-compose-splice=t_ocs \
3926 on-compose-enter=t_oce on-compose-leave=t_ocl \
3927 on-compose-cleanup=t_occ \
3928 on-resend-enter=t_oce on-resend-cleanup=t_occ
3930 ex0_test behave:compose_hooks-4-estat
3931 ${cat} ./.tnotes >> "${MBOX}"
3933 check behave:compose_hooks-4 - "${MBOX}" '3038884027 7516'
3938 t_behave_C_opt_customhdr() {
3939 t_prolog t_behave_C_opt_customhdr
3940 TRAP_EXIT_ADDONS=".
/.t
*"
3942 ${cat} <<-_EOT > ./.tsendmail.sh
3944 (echo 'From CimicifugaRacemosa Mon Dec 25 21:33:40 2017' &&
3948 chmod 0755 ./.tsendmail.sh
3951 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
3952 -C 'C-One : Custom One Body' \
3953 -C 'C-Two:CustomTwoBody' \
3954 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3955 this-goes@nowhere >./.tall 2>&1
3956 ex0_test behave:C_opt_customhdr-1-estat
3957 ${cat} ./.tall >> "${MBOX}"
3958 check behave:C_opt_customhdr-1 0 "${MBOX}" '2400078426 195'
3961 printf 'm this-goes@nowhere\nbody\n!.
3963 m this-goes2@nowhere\nbody2\n!.
3964 set customhdr=%ccustom1 : custom1 body%c
3965 m this-goes2@nowhere\nbody2\n!.
3966 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
3967 m this-goes3@nowhere\nbody3\n!.
3969 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh -Sescape=! \
3970 -C 'C-One : Custom One Body' \
3971 -C 'C-Two:CustomTwoBody' \
3972 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3974 ex0_test behave:C_opt_customhdr-2-estat
3975 ${cat} ./.tall >> "${MBOX}"
3976 check behave:C_opt_customhdr-2 0 "${MBOX}" '3546878678 752'
3981 t_behave_mass_recipients() {
3982 t_prolog t_behave_mass_recipients
3983 TRAP_EXIT_ADDONS=".
/.t
*"
3985 ${cat} <<-_EOT > ./.tsendmail.sh
3987 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3990 chmod 0755 ./.tsendmail.sh
3992 ${cat} <<'__EOT__' > ./.trc
3994 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3997 wysh set nr=$1 hn=$2
3998 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
4000 xcall bail "ins_addr
$hn 1-$nr"
4002 vput vexpr nr + $nr 1
4003 if [ "$nr" -le "$maximum" ]
4004 xcall ins_addr $nr $hn
4008 wysh set nr=$1 hn=$2
4009 alternates $hn$nr@$hn
4010 vput vexpr nr + $nr 2
4011 if [ "$nr" -le "$maximum" ]
4012 xcall bld_alter $nr $hn
4022 if [ "$t_remove" != '' ]
4027 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4030 printf 'm this-goes@nowhere\nbody\n!.\n' |
4031 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4032 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
4034 ex0_test behave:mass_recipients-1-estat
4035 ${cat} ./.tall >> "${MBOX}"
4036 check behave:mass_recipients-1 - "${MBOX}" '2912243346 51526'
4039 printf 'm this-goes@nowhere\nbody\n!.\n' |
4040 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4041 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
4043 ex0_test behave:mass_recipients-2-estat
4044 ${cat} ./.tall >> "${MBOX}"
4045 check behave:mass_recipients-2 - "${MBOX}" '4097804632 34394'
4050 t_behave_mime_types_load_control() {
4051 t_prolog t_behave_mime_types_load_control
4052 TRAP_EXIT_ADDONS=".
/.t
*"
4054 ${cat} <<-_EOT > ./.tmts1
4055 @ application/mathml+xml mathml
4057 ${cat} <<-_EOT > ./.tmts2
4058 @ x-conference/x-cooltalk ice
4060 @ application/aga-aga aga
4063 ${cat} <<-_EOT > ./.tmts1.mathml
4064 <head>nonsense ML</head>
4066 ${cat} <<-_EOT > ./.tmts2.ice
4069 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.doom
4070 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.aga
4084 ' "${MBOX}" "${MBOX}" |
4086 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
4088 ex0_test behave:mime_types_load_control-1-estat
4089 ${cat} "${MBOX}" >> ./.tout
4090 check behave:mime_types_load_control-1 - ./.tout '1441260727 2449'
4092 echo type | ${MAILX} ${ARGS} -R \
4093 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
4094 -f "${MBOX}" >> ./.tout 2>&1
4095 check behave:mime_types_load_control-2 0 ./.tout '1441391438 3646'
4100 t_behave_lreply_futh_rth_etc() {
4101 t_prolog t_behave_lreply_futh_rth_etc
4102 TRAP_EXIT_ADDONS=".
/.t
*"
4104 ${cat} <<-_EOT > ./.tsendmail.sh
4106 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
4109 chmod 0755 ./.tsendmail.sh
4111 ${cat} <<-_EOT > ./.tmbox
4112 From neverneverland Sun Jul 23 13:46:25 2017
4113 Subject: Bugstop: five miles out 1
4114 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4115 From: mister originator <mr@originator>
4116 To: bugstop-commit@five.miles.out, laber@backe.eu
4118 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4119 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4120 Date: Wed, 19 Jul 2017 09:22:57 -0400
4121 Message-Id: <20170719132257.766AF781267@originator>
4124 > |Sorry, I think I misunderstand something. I would think that
4128 From neverneverland Fri Jul 7 22:39:11 2017
4129 Subject: Bugstop: five miles out 2
4130 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4131 Content-Transfer-Encoding: 7bit
4132 From: mister originator <mr@originator>
4133 To: bugstop-commit@five.miles.out
4135 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4136 Date: Fri, 07 Jul 2017 16:33:59 -0400
4139 capable of changing back.
4141 From neverneverland Fri Jul 7 22:42:00 2017
4142 Subject: Bugstop: five miles out 3
4143 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4144 Content-Transfer-Encoding: 7bit
4145 From: mister originator <mr@originator>
4146 To: bugstop-commit@five.miles.out
4148 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4149 Date: Fri, 07 Jul 2017 16:33:59 -0400
4150 List-Post: <mailto:bugstop@five.miles.out>
4153 are you ready, boots?
4155 From neverneverland Sat Aug 19 23:15:00 2017
4156 Subject: Bugstop: five miles out 4
4157 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4158 Content-Transfer-Encoding: 7bit
4159 From: mister originator <mr@originator>
4160 To: bugstop@five.miles.out
4162 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4163 Date: Fri, 07 Jul 2017 16:33:59 -0400
4164 List-Post: <mailto:bugstop@five.miles.out>
4167 are you ready, boots?
4172 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
4173 -Rf ./.tmbox >> "${MBOX}" 2>&1
4175 wysh set m="This is text of
\"reply
${1}.
"
4186 echo -----After reply
$1.1
- $1.3
: $?
/$^ERRNAME
4189 wysh
set m
="This is text of \"Reply ${1}."
4195 echo -----After Reply $1.$2: $?/$^ERRNAME
4204 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
4208 # We need two indirections for this test: one for the case that Lreply
4209 # fails because of missing recipients: we need to read EOF next, thus
4210 # place this in _Ls last; and second for the succeeding cases EOF is
4211 # not what these should read, so go over the backside and splice it in!
4213 echo -----After Lreply $1.$2: $?/$^ERRNAME
4216 localopts call-fixate yes
4218 call R $1 1; call R $1 2; call R $1 3; call R $1 4
4219 call L $1 1; call L $1 2; call L $1 3
4222 echo;echo '===== CHANGING
=== '"$*"' =====';echo
4226 set from=laber@backe.eu
4229 call tweak set reply-to-honour
4231 call tweak set followup-to
4233 call tweak set followup-to-honour
4235 call tweak mlist bugstop@five.miles.out
4237 call tweak mlsubscribe bugstop@five.miles.out
4239 call tweak set recipients-in-cc
4243 check behave:lreply_futh_rth_etc-1 0 "${MBOX}" '940818845 29373'
4247 ${cat} <<-_EOT > ./.tmbox
4248 From tom@i-i.example Thu Oct 26 03:15:55 2017
4249 Date: Wed, 25 Oct 2017 21:15:46 -0400
4250 From: tom <tom@i-i.example>
4251 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4252 Cc: tom <tom@i-i.example>
4253 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4254 Message-ID: <20171026011546.GA11643@i-i.example>
4255 Reply-To: tom@i-i.example
4256 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4257 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4260 The report's useful
:-)
4263 printf 'reply 1\nthank you\n!.\n' |
4264 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4265 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4266 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4271 t_behave_xxxheads_rfc2047
() {
4272 t_prolog t_behave_xxxheads_rfc2047
4273 TRAP_EXIT_ADDONS
="./.t*"
4275 ${cat} <<-_EOT > ./.tsendmail.sh
4277 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4280 chmod 0755 .
/.tsendmail.sh
4284 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4285 -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̲' \
4287 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4289 # Single word (overlong line split -- bad standard! Requires injection of
4290 # artificial data!! But can be prevented by using RFC 2047 encoding)
4292 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4293 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4294 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4296 # Combination of encoded words, space and tabs of varying sort
4298 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4299 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4300 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4301 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4302 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4303 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4305 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4307 # Overlong multibyte sequence that must be forcefully split
4308 # todo This works even before v15.0, but only by accident
4310 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4311 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4312 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4313 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4315 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4319 echo | ${MAILX} ${ARGS} \
4320 -s "1-1 B2 B3 B4 B5 B6 B\
4321 1-2 B2 B3 B4 B5 B6 B\
4322 1-3 B2 B3 B4 B5 B6 B\
4323 1-4 B2 B3 B4 B5 B6 B\
4324 1-5 B2 B3 B4 B5 B6 B\
4325 1-6 B2 B3 B4 B5 B6
" \
4327 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4329 # Leading and trailing WS
4331 echo | ${MAILX} ${ARGS} \
4332 -s " 2-1 B2 B3 B4 B5 B6 B\
4333 1-2 B2 B3 B4 B5 B6 B\
4334 1-3 B2 B3 B4 B5 B6 B\
4335 1-4 B2 B3 B4 B5 B6
" \
4337 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4339 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4341 echo "Dat Früchtchen riecht häußlich
" |
4342 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4344 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4345 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4350 t_behave_rfc2231() {
4351 t_prolog t_behave_rfc2231
4352 TRAP_EXIT_ADDONS=".
/.t
*"
4355 mkdir ./.ttt || exit 1
4359 : > 'diet\ is \curd.txt'
4360 : > 'diet "is
" curd.txt'
4362 : > 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
4363 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4364 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4365 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4367 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4368 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4369 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4370 -a ./.ttt/höde-tröge.txt \
4371 -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 \
4372 -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 \
4373 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4374 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4376 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4378 # `resend' test, reusing $MBOX
4379 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4380 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4382 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4383 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4388 t_behave_iconv_mbyte_base64() {
4389 t_prolog t_behave_iconv_mbyte_base64
4390 TRAP_EXIT_ADDONS=".
/.t
*"
4392 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4393 (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4394 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4397 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4401 ${cat} <<-_EOT > ./.tsendmail.sh
4403 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4406 chmod 0755 ./.tsendmail.sh
4408 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4409 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4410 -Smta=./.tsendmail.sh \
4411 -Sescape=! -Smime-encoding=base64 2>./.terr
4412 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4414 !s Japanese from UTF-8 to ISO-2022-JP
4415 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4417 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4420 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4422 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4425 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4427 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4428 \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
4430 \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
4433 \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
4435 \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
4438 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4439 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4441 printf 'eval f 1; write ./.twrite\n' |
4442 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4443 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4444 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4446 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4449 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4450 rm -f "${MBOX}" ./.twrite
4451 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4452 -Smta=./.tsendmail.sh \
4453 -Sescape=! -Smime-encoding=base64 2>./.terr
4454 set ttycharset=utf-8 sendcharsets=euc-jp
4456 !s Japanese from UTF-8 to EUC-JP
4457 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4459 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4462 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4464 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4467 set ttycharset=EUC-JP sendcharsets=utf-8
4469 !s Japanese from EUC-JP to UTF-8
4470 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4472 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4475 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4477 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4480 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4481 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4483 printf 'eval f 1; write ./.twrite\n' |
4484 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4485 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4486 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4488 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4494 t_behave_iconv_mainbody
() {
4495 t_prolog t_behave_iconv_mainbody
4496 TRAP_EXIT_ADDONS
="./.t*"
4498 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4501 echo 'behave:iconv_mainbody: unsupported, skipped'
4505 ${cat} <<-_EOT > ./.tsendmail.sh
4507 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4510 chmod 0755 .
/.tsendmail.sh
4512 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4513 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4514 -s '–' over-the@rain.bow
2>.
/.terr
4515 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4516 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4518 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4519 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4520 -s '–' over-the@rain.bow
2>.
/.terr
4521 exn0_test behave
:iconv_mainbody-3
4522 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4523 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4525 # The different iconv(3) implementations use different replacement sequence
4526 # types (character-wise, byte-wise, and the character(s) used differ)
4527 i
="${MAILX_ICONV_MODE}"
4528 if [ -n "${i}" ]; then
4529 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4531 ex0_test behave:iconv_mainbody-5-0 ${j}
4532 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4533 if [ ${i} -eq 13 ]; then
4534 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4535 elif [ ${i} -eq 12 ]; then
4536 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4537 elif [ ${i} -eq 3 ]; then
4538 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4540 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4543 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4549 t_behave_q_t_etc_opts() {
4550 t_prolog t_behave_q_t_etc_opts
4551 TRAP_EXIT_ADDONS=".
/.t
*"
4553 # Three tests for MIME encoding and (a bit) content classification.
4554 # At the same time testing -q FILE, < FILE and -t FILE
4555 t__put_body > ./.tin
4558 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4559 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4560 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4563 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4564 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4565 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4568 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4570 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4571 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4577 have_feat smime || {
4578 echo 'behave:s/mime: unsupported, skipped'
4582 t_prolog t_behave_s_mime
4583 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4584 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4585 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4587 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4588 ${cat} <<-_EOT > ./.t.conf
4591 default_keyfile = keyfile.pem
4592 distinguished_name = req_distinguished_name
4593 attributes = req_attributes
4597 [ req_distinguished_name ]
4604 emailAddress = test@localhost
4609 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4610 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
4611 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4614 printf 'behave:s/mime:sign/verify: '
4615 echo bla | ${MAILX} ${ARGS} \
4616 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4617 -Ssmime-sign -Sfrom=test@localhost \
4618 -s 'S/MIME test' ./.VERIFY
4619 if [ $? -eq 0 ]; then
4630 /^Content-Description: /{ skip = 2; print; next }
4631 /^$/{ if(skip) --skip }
4634 < ./.VERIFY > "${MBOX}"
4635 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4637 printf 'behave:s/mime:sign/verify:verify '
4638 printf 'verify\nx\n' |
4640 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4641 -Ssmime-sign -Sfrom=test@localhost \
4643 -f ./.VERIFY >/dev/null 2>&1
4644 if [ $? -eq 0 ]; then
4653 printf 'behave:s/mime:sign/verify:disproof-1 '
4654 if openssl smime -verify -CAfile ./.tcert.pem \
4655 -in ./.VERIFY >/dev/null 2>&1; then
4664 # (signing +) encryption / decryption
4665 ${cat} <<-_EOT > ./.tsendmail.sh
4667 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4669 chmod 0755 ./.tsendmail.sh
4671 printf 'behave:s/mime:encrypt+sign: '
4674 -Ssmime-force-encryption \
4675 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4676 -Smta=./.tsendmail.sh \
4677 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4678 -Ssmime-sign -Sfrom=test@localhost \
4679 -s 'S/MIME test' recei@ver.com
4680 if [ $? -eq 0 ]; then
4684 printf 'error: encrypt+sign failed\n'
4687 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4688 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4690 printf 'behave:s/mime:decrypt+verify: '
4691 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4693 -Ssmime-force-encryption \
4694 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4695 -Smta=./.tsendmail.sh \
4696 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4697 -Ssmime-sign -Sfrom=test@localhost \
4699 -f ./.ENCRYPT >/dev/null 2>&1
4700 if [ $? -eq 0 ]; then
4709 /^Content-Description: /{ skip = 2; print; next }
4710 /^$/{ if(skip) --skip }
4713 < ./.DECRYPT > "${MBOX}"
4714 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4716 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4717 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4718 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
4725 printf "behave
:s
/mime
:encrypt
: "
4726 echo bla | ${MAILX} ${ARGS} \
4727 -Ssmime-force-encryption \
4728 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4729 -Smta=./.tsendmail.sh \
4730 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4731 -Sfrom=test@localhost \
4732 -s 'S/MIME test' recei@ver.com
4733 if [ $? -eq 0 ]; then
4740 # Same as behave:s/mime:encrypt+sign:checksum above
4741 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4742 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4745 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4746 -Ssmime-force-encryption \
4747 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4748 -Smta=./.tsendmail.sh \
4749 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4750 -Sfrom=test@localhost \
4752 -f ./.ENCRYPT >/dev/null 2>&1
4753 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4755 printf 'behave:s/mime:decrypt:disproof-1: '
4756 if openssl smime -decrypt -inkey ./.tkey.pem \
4757 -in ./.ENCRYPT >/dev/null 2>&1; then
4768 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4769 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4770 # Note we unfortunately need to place some statements without proper
4771 # indentation because of continuation problems
4772 # xxx Note: t_content() was the first test (series) written. Today many
4773 # xxx aspects are (better) covered by other tests above, some are not.
4774 # xxx At some future date and time, convert the last remains not covered
4775 # xxx elsewhere to a real t_behave_* test and drop t_content()
4779 # Test for [260e19d] (Juergen Daubert)
4781 echo body | ${MAILX} ${ARGS} "${MBOX}"
4782 check content
:004 0 "${MBOX}" '2917662811 98'
4784 # "Test for" [d6f316a] (Gavin Troy)
4786 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4787 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4788 check content:006 0 "${MBOX}" '2099098650 122'
4789 check content:006-1 - "${BODY}" '794542938 174'
4791 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4794 for(i = 0; i < 10000; ++i)
4796 #printf "\xF0\x90\x87\x90"
4797 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4798 check content
:007 0 "${MBOX}" '534262374 61816'
4804 # MIME encoding (QP) stress message subject
4805 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
4806 'adadaddsssssssddddddddddddddddddddd'\
4807 'ddddddddddddddddddddddddddddddddddd'\
4808 'ddddddddddddddddddddddddddddddddddd'\
4809 'dddddddddddddddddddd Hallelulja? Od'\
4810 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4811 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4812 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
4813 'fffffffffffffffffffffffffffffffffff'\
4814 'fffffffffffffffffffff ggggggggggggg'\
4815 'ggggggggggggggggggggggggggggggggggg'\
4816 'ggggggggggggggggggggggggggggggggggg'\
4817 'ggggggggggggggggggggggggggggggggggg'\
4822 # MIME encoding (QP) stress message body
4824 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4825 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4826 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4827 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4828 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4829 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4830 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4831 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4832 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4833 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4834 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4835 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4836 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4837 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4838 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4839 "auf den zeilen vorher.\r\n"\
4840 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4842 "Die letzte Zeile war nur ein Punkt.\r\n"\
4844 "Das waren deren zwei.\r\n"\
4846 "Die letzte Zeile war ein Leerschritt.\n"\
4847 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4850 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4852 "Das waren deren zwei. ditto.\n"\
4854 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4855 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4856 "auf den zeilen vorher.\n"\
4858 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4859 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4861 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4863 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4865 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4867 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4869 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4871 "QP am Zeilenende über soft-nl hinweg\n"\
4872 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4874 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4876 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4878 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4880 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
4882 "Die letzte Zeile war ein Leerschritt.\n"\
4887 # if have_feat devel; then
4888 # ARGS="${ARGS} -Smemdebug"
4892 if [ -n "${UTF8_LOCALE}" ]; then
4893 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
4895 printf 'No Unicode locale found, disabling Unicode tests\n'
4902 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
4904 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
4907 while [ ${#} -gt 0 ]; do
4913 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'