2 #@ Synopsis: ./cc-test.sh [--check-only s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ The latter generates output files.
5 #@ TODO _All_ the tests should happen in a temporary subdir.
8 # Instead of figuring out the environment in here, require a configured build
9 # system and include that! Our makefile and configure ensure that this test
10 # does not run in the configured, but the user environment nonetheless!
11 if [ -f .
/mk-config.ev
]; then
13 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
14 MAILX__CC_TEST_RUNNING
=1
15 export MAILX__CC_TEST_RUNNING
16 exec "${SHELL}" "${0}" "${@}"
19 echo >&2 'S-nail/S-mailx is not configured.'
20 echo >&2 'This test script requires the shell environment that only the'
21 echo >&2 'configuration script can figure out, even if it will be used to'
22 echo >&2 'test a different binary than the one that would be produced!'
26 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
27 # such is a compile-time variable
28 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
29 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
30 ADDARG_UNI
=-Sttycharset=UTF-8
35 #UTF8_LOCALE= autodetected unless set
37 # Note valgrind has problems with FDs in forked childs, which causes some tests
38 # to fail (the FD is rewound and thus will be dumped twice)
40 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
42 ## -- (>8 -- 8<) -- ##
44 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
49 printf >&2 -- "${fmt}\\n" "${@}"
54 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
58 # Wed Oct 2 01:50:07 UTC 1996
59 SOURCE_DATE_EPOCH
=844221007
61 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
62 unset POSIXLY_CORRECT LOGNAME USER
65 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
66 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
70 CHECK_ONLY
= MAE_TEST
= MAILX
=
71 if [ "${1}" = --check-only ]; then
74 [ -x "${MAILX}" ] || usage
76 elif [ "${1}" = --mae-test ]; then
79 [ -x "${MAILX}" ] || usage
83 MAILX
="${MEMTESTER}${MAILX}"
86 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
87 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
88 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
90 \if [ "${ttycharset}" @i=% utf ]
97 \eval xcall cset_test "${@}"
101 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
102 en_US.utf8 en_US.UTF-8
104 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
106 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
107 UTF8_LOCALE
=`locale -a | { m=
109 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
111 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
125 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
126 trap "exit 1" HUP INT TERM
129 # Test all configs TODO doesn't cover all *combinations*, stupid!
133 NOTME["OPT_AUTOCC"] = 1
134 NOTME["OPT_DEBUG"] = 1
135 NOTME["OPT_DEVEL"] = 1
136 NOTME["OPT_NOEXTMD5"] = 1
137 NOTME["OPT_ASAN_ADDRESS"] = 1
138 NOTME["OPT_ASAN_MEMORY"] = 1
139 NOTME["OPT_FORCED_STACKPROT"] = 1
140 NOTME["OPT_NOMEMDBG"] = 1
141 NOTME["OPT_NYD2"] = 1
144 /^[[:space:]]*OPT_/ {
145 sub(/^[[:space:]]*/, "")
146 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
147 # does not seem to be a compliant escape for =
149 $1 = substr($1, 1, index($1, "=") - 1)
155 # Doing this completely sequentially and not doing make distclean in
156 # between runs should effectively result in lesser compilations.
157 # It is completely dumb nonetheless... TODO
158 for (j = 1; j < i; ++j) {
159 for (k = 1; k < j; ++k)
161 for (k = j; k < i; ++k)
163 printf "OPT_AUTOCC=1\n"
165 for (j = 1; j < i; ++j) {
166 for (k = 1; k < j; ++k)
168 for (k = j; k < i; ++k)
170 printf "OPT_AUTOCC=1\n"
173 for (j = 1; j < i; ++j) {
174 for (k = 1; k < j; ++k)
176 for (k = j; k < i; ++k)
178 printf "OPT_AUTOCC=1\n"
179 printf "OPT_DEBUG=1\n"
181 for (j = 1; j < i; ++j) {
182 for (k = 1; k < j; ++k)
184 for (k = j; k < i; ++k)
186 printf "OPT_AUTOCC=1\n"
187 printf "OPT_DEBUG=1\n"
190 printf "CONFIG=NULL OPT_AUTOCC=0\n"
191 printf "CONFIG=NULL OPT_AUTOCC=1\n"
192 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
193 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
194 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
195 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
196 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
197 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
198 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
199 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
200 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
201 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
202 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
203 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
206 printf "\n\n##########\n$c\n"
207 printf "\n\n##########\n$c\n" >&2
208 sh
-c "${MAKE} ${c} all test"
214 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
215 ${grep} +${1} ) >/dev
/null
2>&1
219 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
221 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
228 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
229 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
230 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
231 csum
="`${cksum} < ${f}`"
232 if [ "${csum}" = "${s}" ]; then
233 printf '%s: ok\n' "${tid}"
236 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
238 if [ -n "${MAE_TEST}" ]; then
239 x
=`echo ${tid} | ${tr} "/:=" "__-"`
240 ${cp} -f "${f}" ./mae-test-"${x}"
246 printf '%s: error: %s\n' ${1} "${2}"
250 # $1=test name [$2=status]
252 [ ${#} -gt 1 ] && __qm__=${2}
253 if [ ${__qm__} -ne 0 ]; then
254 err $1 'unexpected non-0 exit status'
256 printf '%s: ok\n' "${1}"
261 # $1=test name [$2=status]
263 [ ${#} -gt 1 ] && __qm__=${2}
264 if [ ${__qm__} -eq 0 ]; then
265 err $1 'unexpected 0 exit status'
267 printf '%s: ok\n' "${1}"
271 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
273 echo "$
((${1} + ${2}))"
277 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
281 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
283 echo "$
((${1} % ${2}))"
287 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
292 # Basic (easily testable) behaviour tests
294 t_behave_X_opt_input_command_stack
298 t_behave_input_inject_semicolon_seq
299 t_behave_commandalias
303 t_behave_macro_param_shift
314 t_behave_record_a_resend
319 # FIXME t_behave_mlist
322 t_behave_message_injections
323 t_behave_compose_hooks
324 t_behave_mass_recipients
325 t_behave_mime_types_load_control
326 t_behave_lreply_futh_rth_etc
328 t_behave_xxxheads_rfc2047
330 t_behave_iconv_mbyte_base64
331 t_behave_iconv_mainbody
332 t_behave_q_t_etc_opts
337 t_behave_X_opt_input_command_stack() {
338 t_prolog t_behave_X_opt_input_command_stack
340 ${cat} <<- '__EOT' > "${BODY}"
348 echo "define mac1
{";\
349 echo " echo mac1-1 via1 \
$0";\
351 echo " echo mac1-2
";\
353 echo " echo mac1-3
";\
356 echo "define mac2
{";\
357 echo " echo mac2-1 via1 \
$0";\
359 echo " echo mac2-2
";\
365 echo echo 1-1-1 via1 \
$0;\
377 # The -X option supports multiline arguments, and those can internally use
378 # reverse solidus newline escaping. And all -X options are joined...
380 < "${BODY}" ${MAILX} ${ARGS} \
395 echo "define mac1 {";\
396 echo " echo mac1-1 via2 \$0";\
398 echo " echo mac1-2";\
400 echo " echo mac1-3";\
403 echo "define mac2 {";\
404 echo " echo mac2-1 via2 \$0";\
406 echo " echo mac2-2";\
412 echo echo 1-1-1 via2 \$0;\
426 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
431 t_behave_X_errexit
() {
432 t_prolog t_behave_X_errexit
434 ${cat} <<- '__EOT' > "${BODY}"
440 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
441 -X'echo one' -X' echos nono ' -X'echo two' \
443 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
445 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
447 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
449 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
451 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
455 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
456 -X'echo one' -X' echos nono ' -X'echo two' \
458 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
460 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
462 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
464 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
466 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
468 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
470 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
472 ## Repeat 4-7 with ignerr set
474 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
476 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
477 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
479 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
481 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
483 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
485 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
487 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
489 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
491 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
496 t_behave_S_freeze() {
497 t_prolog t_behave_S_freeze
501 # Test basic assumption
502 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
503 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
505 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
508 ${cat} <<- '__EOT' > "${BODY}"
513 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
514 -Snoasksub -Sasksub -Snoasksub \
515 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
517 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
519 ${cat} <<- '__EOT' > "${BODY}"
524 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
525 -Snoasksub -Sasksub \
526 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
528 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
531 ${cat} <<- '__EOT' > "${BODY}"
532 echo dietcurd<$dietcurd>
534 echo dietcurd<$dietcurd>
536 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
537 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
538 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
539 -X'echo dietcurd<$dietcurd>' \
541 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
543 ${cat} <<- '__EOT' > "${BODY}"
544 echo dietcurd<$dietcurd>
546 echo dietcurd<$dietcurd>
548 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
549 -Sdietcurd=strawberry
-Snodietcurd \
550 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
551 -X'echo dietcurd<$dietcurd>' \
553 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
555 # TODO once we have a detached one with env=1..
556 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
557 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
559 ${cat} <<- '__EOT' > "${BODY}"
560 !echo "shell says TERM<$TERM>"
562 !echo "shell says TERM<$TERM>"
564 !echo "shell says TERM<$TERM>"
566 !echo "shell says TERM<$TERM>"
568 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
569 -STERM=strawberry
-SnoTERM -STERM=vanilla \
570 -X'echo mail<$TERM>' -X'unset TERM' \
571 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
573 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
575 ${cat} <<- '__EOT' > "${BODY}"
576 !echo "shell says TERM<$TERM>"
578 !echo "shell says TERM<$TERM>"
580 !echo "shell says TERM<$TERM>"
582 !echo "shell says TERM<$TERM>"
584 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
585 -STERM=strawberry
-SnoTERM \
586 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
587 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
589 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
597 t_prolog t_behave_wysh
599 ${cat} <<- '__EOT' > "${BODY}"
618 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
619 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
620 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
622 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
623 echo a$'\u0041\u41\u0C1\U00000041\U41'c
646 echo a$'b\U0000000'dt
647 echo a$'b\U00000000'du
657 if [ -z "${UTF8_LOCALE}" ]; then
658 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
660 < "${BODY}" DIET=CURD TIED= \
661 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
662 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
665 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
666 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
671 t_behave_input_inject_semicolon_seq() {
672 t_prolog t_behave_input_inject_semicolon_seq
674 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
679 echon this_is_mymac;call mydeepmac;echon ';';
681 echon one';';call mymac;echon two";";call mymac;echo three$';';
683 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
685 echon one';';call mymac;echon two";";call mymac;echo three$';';
688 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
693 t_behave_commandalias() {
694 t_prolog t_behave_commandalias
696 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
697 commandalias echo echo hoho
701 commandalias XxX XxXx
702 commandalias XxXx XxXxX
703 commandalias XxXxX XxXxXx
704 commandalias XxXxXx echo huhu
705 commandalias XxXxXxX echo huhu
707 commandalias XxXxXx XxXxXxX
710 commandalias XxXxXx echo huhu
714 check behave:commandalias 0 "${MBOX}" '3694143612 31'
720 t_prolog t_behave_ifelse
722 # Nestable conditions test
723 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
745 if $dietcurd == 'yoho'
750 if $dietcurd @== 'Yoho'
755 if $dietcurd == 'Yoho'
760 if $dietcurd != 'yoho'
765 if $dietcurd @!= 'Yoho'
770 if $dietcurd != 'Yoho'
831 if $dietcurd == 'yohu'
833 elif $dietcurd == 'yoha'
835 elif $dietcurd == 'yohe'
837 elif $dietcurd == 'yoho'
839 if $dietcurd == 'yohu'
841 elif $dietcurd == 'yoha'
843 elif $dietcurd == 'yohe'
845 elif $dietcurd == 'yoho'
847 if $dietcurd == 'yohu'
849 elif $dietcurd == 'yoha'
851 elif $dietcurd == 'yohe'
853 elif $dietcurd == 'yoho'
1002 set diet=abc curd=abc
1008 set diet=abc curd=abcd
1014 # 1. Shitty grouping capabilities as of today
1015 unset diet curd ndefined
1016 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1022 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1027 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1032 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1037 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1042 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1043 && [ no ] || [ yes ]
1048 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1053 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1058 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1063 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1068 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1073 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1078 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1083 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1088 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1093 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1099 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1105 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1110 # 2. Shitty grouping capabilities as of today
1111 unset diet curd ndefined
1112 if [ false || false || true ] && [ false || true ] && yes
1117 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1122 if [ 1 || 0 || 0 || 0 ]
1127 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1132 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1137 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1142 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1147 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1152 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1157 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1162 if 1 || 0 || 0 || 0 && 0
1167 if 1 || 0 || 0 || 0 && 1
1172 if 0 || 0 || 0 || 1 && 0
1177 if 0 || 0 || 0 || 1 && 1
1182 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1187 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1193 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1198 if $diet == 'yo' && $curd == 'ho' && $ndefined
1204 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1209 if $diet == 'yo' && $curd == 'ho' && $ndefined
1214 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1219 # Some more en-braced variables
1221 if ${diet} == ${curd}
1226 if ${diet} != ${curd}
1242 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1247 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1252 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1257 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1262 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1267 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1272 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1277 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1282 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1288 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1293 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1298 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1303 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1308 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1313 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1318 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1323 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1328 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1335 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1337 if have_feat regex; then
1338 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1340 if $dietcurd =~ '^yo.*'
1345 if $dietcurd =~ '^Yo.*'
1350 if $dietcurd @=~ '^Yo.*'
1355 if $dietcurd =~ '^yOho.+'
1360 if $dietcurd @!~ '.*Ho$'
1365 if $dietcurd !~ '.+yohO$'
1370 if [ $dietcurd @i!~ '.+yoho$' ]
1375 if ! [ $dietcurd @i=~ '.+yoho$' ]
1380 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1385 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1390 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1395 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1400 if ! ! ! $dietcurd !~ '.+yoho$'
1405 if ! ! ! $dietcurd =~ '.+yoho$'
1410 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1415 set diet=abc curd='^abc$'
1421 set diet=abc curd='^abcd$'
1429 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1431 printf 'behave:if-regex: unsupported, skipped\n'
1437 t_behave_localopts() {
1438 t_prolog t_behave_localopts
1440 # Nestable conditions test
1441 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1456 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1461 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1462 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1471 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1473 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1482 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1489 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1496 echo ----- $1: $2 -> $3 -> $4
1504 call llx
'call off' on on on
1505 call llx
'call off' off on on
1506 call llx
'call off' on off on
1507 call llx
'call off' on off off
1508 localopts call-fixate on
1509 call llx
'call-fixate on' on on on
1510 call llx
'call-fixate on' off on on
1511 call llx
'call-fixate on' on off on
1512 call llx
'call-fixate on' on off off
1513 unset x
;localopts call on
1514 call llx
'call on' on on on
1515 call llx
'call on' off on on
1516 call llx
'call on' on off on
1517 call llx
'call on' on off off
1522 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1528 t_prolog t_behave_local
1530 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1558 echo ------- global-1 du=$du
1560 echo ------- global-2 du=$du
1563 echo ------- global-3 du=$du
1565 echo ------- global-4 du=$du
1567 echo ------- global-5 du=$du
1570 check behave:local-1 0 "${MBOX}" '2411598140 641'
1575 t_behave_macro_param_shift() {
1576 t_prolog t_behave_macro_param_shift
1578 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1581 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1586 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1587 if [ $# > 1 ] ||
[ $ignerr == '' ]
1592 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1594 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1598 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1603 call t2
1 you get four args
1604 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1605 call t2
1 you get
'three args'
1606 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1607 call t2
1 you
'get two args'
1608 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1609 call t2
1 'you get one arg'
1610 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1611 ignerr call t2
'' 'you get one arg'
1612 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1617 check behave
:macro_param_shift
0 "${MBOX}" '1402489146 1682'
1622 t_behave_addrcodec
() {
1623 t_prolog t_behave_addrcodec
1625 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1626 vput addrcodec res e 1 <doog@def>
1627 echo $?/$^ERRNAME $res
1628 eval vput addrcodec res d $res
1629 echo $?/$^ERRNAME $res
1630 vput addrcodec res e 2 . <doog@def>
1631 echo $?/$^ERRNAME $res
1632 eval vput addrcodec res d $res
1633 echo $?/$^ERRNAME $res
1634 vput addrcodec res e 3 Sauer Dr. <doog@def>
1635 echo $?/$^ERRNAME $res
1636 eval vput addrcodec res d $res
1637 echo $?/$^ERRNAME $res
1638 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1639 echo $?/$^ERRNAME $res
1640 eval vput addrcodec res d $res
1641 echo $?/$^ERRNAME $res
1642 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1643 echo $?/$^ERRNAME $res
1644 eval vput addrcodec res d $res
1645 echo $?/$^ERRNAME $res
1647 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1648 echo $?/$^ERRNAME $res
1649 eval vput addrcodec res d $res
1650 echo $?/$^ERRNAME $res
1651 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1652 echo $?/$^ERRNAME $res
1653 eval vput addrcodec res d $res
1654 echo $?/$^ERRNAME $res
1655 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1656 echo $?/$^ERRNAME $res
1657 eval vput addrcodec res d $res
1658 echo $?/$^ERRNAME $res
1659 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1660 echo $?/$^ERRNAME $res
1661 eval vput addrcodec res d $res
1662 echo $?/$^ERRNAME $res
1663 vput addrcodec res +e 8 \
1664 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1665 echo $?/$^ERRNAME $res
1666 eval vput addrcodec res d $res
1667 echo $?/$^ERRNAME $res
1668 vput addrcodec res +e 9 Dr.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 10 (Ma)Braten Dr. (Heu) <doog@def>
1673 echo $?/$^ERRNAME $res
1674 eval vput addrcodec res d $res
1675 echo $?/$^ERRNAME $res
1676 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1677 echo $?/$^ERRNAME $res
1678 eval vput addrcodec res d $res
1679 echo $?/$^ERRNAME $res
1680 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1681 echo $?/$^ERRNAME $res
1682 eval vput addrcodec res d $res
1683 echo $?/$^ERRNAME $res
1684 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1685 echo $?/$^ERRNAME $res
1686 eval vput addrcodec res d $res
1687 echo $?/$^ERRNAME $res
1688 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1689 echo $?/$^ERRNAME $res
1690 eval vput addrcodec res d $res
1691 echo $?/$^ERRNAME $res
1692 vput addrcodec res +e 15 \
1693 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1694 echo $?/$^ERRNAME $res
1695 eval vput addrcodec res d $res
1696 echo $?/$^ERRNAME $res
1697 vput addrcodec res +e 16 \
1698 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1699 echo $?/$^ERRNAME $res
1700 eval vput addrcodec res d $res
1701 echo $?/$^ERRNAME $res
1702 vput addrcodec res +e 17 \
1703 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1704 echo $?/$^ERRNAME $res
1705 eval vput addrcodec res d $res
1706 echo $?/$^ERRNAME $res
1707 vput addrcodec res +e 18 \
1708 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1709 echo $?/$^ERRNAME $res
1710 eval vput addrcodec res d $res
1711 echo $?/$^ERRNAME $res
1712 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1713 echo $?/$^ERRNAME $res
1714 eval vput addrcodec res d $res
1715 echo $?/$^ERRNAME $res
1717 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1718 echo $?/$^ERRNAME $res
1719 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1720 echo $?
/$^ERRNAME
$res
1721 eval vput addrcodec res d
$res
1722 echo $?
/$^ERRNAME
$res
1724 vput addrcodec res
+++e
22 Hey
\\,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1725 echo $?
/$^ERRNAME
$res
1726 eval vput addrcodec res d
$res
1727 echo $?
/$^ERRNAME
$res
1729 vput addrcodec res s \
1730 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1731 echo $?
/$^ERRNAME
$res
1734 check behave
:addrcodec-1
0 "${MBOX}" '429099645 2414'
1736 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1738 mlsubscribe isa2@list
1740 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1741 echo $?/$^ERRNAME $res
1742 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1743 echo $?/$^ERRNAME $res
1744 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1745 echo $?/$^ERRNAME $res
1746 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1747 echo $?/$^ERRNAME $res
1748 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1749 echo $?/$^ERRNAME $res
1750 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1751 echo $?/$^ERRNAME $res
1754 check behave:addrcodec-2 0 "${MBOX}" '1391779299 104'
1760 t_prolog t_behave_vexpr
1762 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1763 vput vexpr res
= 9223372036854775807
1764 echo $?
/$^ERRNAME
$res
1765 vput vexpr res
= 9223372036854775808
1766 echo $?
/$^ERRNAME
$res
1767 vput vexpr res
=@
9223372036854775808
1768 echo $?
/$^ERRNAME
$res
1769 vput vexpr res
= -9223372036854775808
1770 echo $?
/$^ERRNAME
$res
1771 vput vexpr res
= -9223372036854775809
1772 echo $?
/$^ERRNAME
$res
1773 vput vexpr res
=@
-9223372036854775809
1774 echo $?
/$^ERRNAME
$res
1777 echo $?
/$^ERRNAME
$res
1779 echo $?
/$^ERRNAME
$res
1781 echo $?
/$^ERRNAME
$res
1783 vput vexpr res
+ 0 0
1784 echo $?
/$^ERRNAME
$res
1785 vput vexpr res
+ 0 1
1786 echo $?
/$^ERRNAME
$res
1787 vput vexpr res
+ 1 1
1788 echo $?
/$^ERRNAME
$res
1790 vput vexpr res
+ 9223372036854775807 0
1791 echo $?
/$^ERRNAME
$res
1792 vput vexpr res
+ 9223372036854775807 1
1793 echo $?
/$^ERRNAME
$res
1794 vput vexpr res
+@
9223372036854775807 1
1795 echo $?
/$^ERRNAME
$res
1796 vput vexpr res
+ 0 9223372036854775807
1797 echo $?
/$^ERRNAME
$res
1798 vput vexpr res
+ 1 9223372036854775807
1799 echo $?
/$^ERRNAME
$res
1800 vput vexpr res
+@
1 9223372036854775807
1801 echo $?
/$^ERRNAME
$res
1803 vput vexpr res
+ -9223372036854775808 0
1804 echo $?
/$^ERRNAME
$res
1805 vput vexpr res
+ -9223372036854775808 -1
1806 echo $?
/$^ERRNAME
$res
1807 vput vexpr res
+@
-9223372036854775808 -1
1808 echo $?
/$^ERRNAME
$res
1809 vput vexpr res
+ 0 -9223372036854775808
1810 echo $?
/$^ERRNAME
$res
1811 vput vexpr res
+ -1 -9223372036854775808
1812 echo $?
/$^ERRNAME
$res
1813 vput vexpr res
+@
-1 -9223372036854775808
1814 echo $?
/$^ERRNAME
$res
1816 vput vexpr res
- 0 0
1817 echo $?
/$^ERRNAME
$res
1818 vput vexpr res
- 0 1
1819 echo $?
/$^ERRNAME
$res
1820 vput vexpr res
- 1 1
1821 echo $?
/$^ERRNAME
$res
1823 vput vexpr res
- 9223372036854775807 0
1824 echo $?
/$^ERRNAME
$res
1825 vput vexpr res
- 9223372036854775807 -1
1826 echo $?
/$^ERRNAME
$res
1827 vput vexpr res
-@
9223372036854775807 -1
1828 echo $?
/$^ERRNAME
$res
1829 vput vexpr res
- 0 9223372036854775807
1830 echo $?
/$^ERRNAME
$res
1831 vput vexpr res
- -1 9223372036854775807
1832 echo $?
/$^ERRNAME
$res
1833 vput vexpr res
- -2 9223372036854775807
1834 echo $?
/$^ERRNAME
$res
1835 vput vexpr res
-@
-2 9223372036854775807
1836 echo $?
/$^ERRNAME
$res
1838 vput vexpr res
- -9223372036854775808 +0
1839 echo $?
/$^ERRNAME
$res
1840 vput vexpr res
- -9223372036854775808 +1
1841 echo $?
/$^ERRNAME
$res
1842 vput vexpr res
-@
-9223372036854775808 +1
1843 echo $?
/$^ERRNAME
$res
1844 vput vexpr res
- 0 -9223372036854775808
1845 echo $?
/$^ERRNAME
$res
1846 vput vexpr res
- +1 -9223372036854775808
1847 echo $?
/$^ERRNAME
$res
1848 vput vexpr res
-@
+1 -9223372036854775808
1849 echo $?
/$^ERRNAME
$res
1851 vput vexpr res
+ -13 -2
1852 echo $?
/$^ERRNAME
$res
1853 vput vexpr res
- 0 0
1854 echo $?
/$^ERRNAME
$res
1855 vput vexpr res
- 0 1
1856 echo $?
/$^ERRNAME
$res
1857 vput vexpr res
- 1 1
1858 echo $?
/$^ERRNAME
$res
1859 vput vexpr res
- -13 -2
1860 echo $?
/$^ERRNAME
$res
1862 vput vexpr res
* 0 0
1863 echo $?
/$^ERRNAME
$res
1864 vput vexpr res
* 0 1
1865 echo $?
/$^ERRNAME
$res
1866 vput vexpr res
* 1 1
1867 echo $?
/$^ERRNAME
$res
1868 vput vexpr res
* -13 -2
1869 echo $?
/$^ERRNAME
$res
1871 vput vexpr res
/ 0 0
1872 echo $?
/$^ERRNAME
$res
1873 vput vexpr res
/ 0 1
1874 echo $?
/$^ERRNAME
$res
1875 vput vexpr res
/ 1 1
1876 echo $?
/$^ERRNAME
$res
1877 vput vexpr res
/ -13 -2
1878 echo $?
/$^ERRNAME
$res
1880 vput vexpr res
% 0 0
1881 echo $?
/$^ERRNAME
$res
1882 vput vexpr res
% 0 1
1883 echo $?
/$^ERRNAME
$res
1884 vput vexpr res
% 1 1
1885 echo $?
/$^ERRNAME
$res
1886 vput vexpr res
% -13 -2
1887 echo $?
/$^ERRNAME
$res
1890 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1892 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1893 vput vexpr res find 'bananarama' 'nana'
1894 echo $?/$^ERRNAME :$res:
1895 vput vexpr res find 'bananarama' 'bana'
1896 echo $?/$^ERRNAME :$res:
1897 vput vexpr res find 'bananarama' 'Bana'
1898 echo $?/$^ERRNAME :$res:
1899 vput vexpr res find 'bananarama' 'rama'
1900 echo $?/$^ERRNAME :$res:
1902 vput vexpr res ifind 'bananarama' 'nana'
1903 echo $?/$^ERRNAME :$res:
1904 vput vexpr res ifind 'bananarama' 'bana'
1905 echo $?/$^ERRNAME :$res:
1906 vput vexpr res ifind 'bananarama' 'Bana'
1907 echo $?/$^ERRNAME :$res:
1908 vput vexpr res ifind 'bananarama' 'rama'
1909 echo $?/$^ERRNAME :$res:
1911 vput vexpr res substring 'bananarama' 1
1912 echo $?/$^ERRNAME :$res:
1913 vput vexpr res substring 'bananarama' 3
1914 echo $?/$^ERRNAME :$res:
1915 vput vexpr res substring 'bananarama' 5
1916 echo $?/$^ERRNAME :$res:
1917 vput vexpr res substring 'bananarama' 7
1918 echo $?/$^ERRNAME :$res:
1919 vput vexpr res substring 'bananarama' 9
1920 echo $?/$^ERRNAME :$res:
1921 vput vexpr res substring 'bananarama' 10
1922 echo $?/$^ERRNAME :$res:
1923 vput vexpr res substring 'bananarama' 1 3
1924 echo $?/$^ERRNAME :$res:
1925 vput vexpr res substring 'bananarama' 3 3
1926 echo $?/$^ERRNAME :$res:
1927 vput vexpr res substring 'bananarama' 5 3
1928 echo $?/$^ERRNAME :$res:
1929 vput vexpr res substring 'bananarama' 7 3
1930 echo $?/$^ERRNAME :$res:
1931 vput vexpr res substring 'bananarama' 9 3
1932 echo $?/$^ERRNAME :$res:
1933 vput vexpr res substring 'bananarama' 10 3
1934 echo $?/$^ERRNAME :$res:
1936 vput vexpr res substring 'bananarama' -1
1937 echo $?/$^ERRNAME :$res:
1938 vput vexpr res substring 'bananarama' -3
1939 echo $?/$^ERRNAME :$res:
1940 vput vexpr res substring 'bananarama' -5
1941 echo $?/$^ERRNAME :$res:
1942 vput vexpr res substring 'bananarama' -7
1943 echo $?/$^ERRNAME :$res:
1944 vput vexpr res substring 'bananarama' -9
1945 echo $?/$^ERRNAME :$res:
1946 vput vexpr res substring 'bananarama' -10
1947 echo $?/$^ERRNAME :$res:
1948 vput vexpr res substring 'bananarama' 1 -3
1949 echo $?/$^ERRNAME :$res:
1950 vput vexpr res substring 'bananarama' 3 -3
1951 echo $?/$^ERRNAME :$res:
1952 vput vexpr res substring 'bananarama' 5 -3
1953 echo $?/$^ERRNAME :$res:
1954 vput vexpr res substring 'bananarama' 7 -3
1955 echo $?/$^ERRNAME :$res:
1956 vput vexpr res substring 'bananarama' 9 -3
1957 echo $?/$^ERRNAME :$res:
1958 vput vexpr res substring 'bananarama' 10 -3
1959 echo $?/$^ERRNAME :$res:
1961 vput vexpr res trim 'Cocoon Cocoon'
1962 echo $?/$^ERRNAME :$res:
1963 vput vexpr res trim ' Cocoon Cocoon '
1964 echo $?/$^ERRNAME :$res:
1965 vput vexpr res trim-front 'Cocoon Cocoon'
1966 echo $?/$^ERRNAME :$res:
1967 vput vexpr res trim-front ' Cocoon Cocoon '
1968 echo $?/$^ERRNAME :$res:
1969 vput vexpr res trim-end 'Cocoon Cocoon'
1970 echo $?/$^ERRNAME :$res:
1971 vput vexpr res trim-end ' Cocoon Cocoon '
1972 echo $?/$^ERRNAME :$res:
1975 check behave:vexpr-string 0 "${MBOX}" '3182004322 601'
1977 if have_feat regex; then
1978 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1979 vput vexpr res regex
'bananarama' 'nana'
1980 echo $?
/$^ERRNAME
:$res:
1981 vput vexpr res regex
'bananarama' 'bana'
1982 echo $?
/$^ERRNAME
:$res:
1983 vput vexpr res regex
'bananarama' 'Bana'
1984 echo $?
/$^ERRNAME
:$res:
1985 vput vexpr res regex
'bananarama' 'rama'
1986 echo $?
/$^ERRNAME
:$res:
1988 vput vexpr res iregex
'bananarama' 'nana'
1989 echo $?
/$^ERRNAME
:$res:
1990 vput vexpr res iregex
'bananarama' 'bana'
1991 echo $?
/$^ERRNAME
:$res:
1992 vput vexpr res iregex
'bananarama' 'Bana'
1993 echo $?
/$^ERRNAME
:$res:
1994 vput vexpr res iregex
'bananarama' 'rama'
1995 echo $?
/$^ERRNAME
:$res:
1997 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1998 echo $?
/$^ERRNAME
:$res:
1999 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2000 echo $?
/$^ERRNAME
:$res:
2001 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2002 echo $?
/$^ERRNAME
:$res:
2003 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2004 echo $?
/$^ERRNAME
:$res:
2006 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2007 echo $?
/$^ERRNAME
:$res:
2008 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2009 echo $?
/$^ERRNAME
:$res:
2010 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2011 echo $?
/$^ERRNAME
:$res:
2012 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2013 echo $?
/$^ERRNAME
:$res:
2017 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
2019 printf 'behave:vexpr-regex: unsupported, skipped\n'
2025 t_behave_call_ret
() {
2026 t_prolog t_behave_call_ret
2028 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2033 vput vexpr j '&' $i 7
2039 vput vexpr j '&' $i 7
2045 echo ! The end for $1
2049 # Transport $?/$! up the call chain
2055 wysh set i=$? j=$! k=$^ERRNAME
2059 echo ! The end for $1
2060 return $i $^ERR-BUSY
2064 # Up and down it goes
2071 vput vexpr k - $1 $2
2075 echo "# <$i/$j> .. "
2079 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2082 echo ! The end
for $1=$i/$2
2086 return $i $^ERR-BUSY
2092 call w1
0; echo ?
=$?
!=$
!; echo -----;
2093 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2094 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2097 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2103 t_prolog t_behave_xcall
2105 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2110 vput vexpr j '&' $i 7
2116 echo ! The end for $1/$2
2118 return $i $^ERR-BUSY
2129 echo ?=$? !=$^ERRNAME
2132 echo ?=$? !=$^ERRNAME
2134 echo ?=$? !=$^ERRNAME
2137 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2141 ${cat} <<- '__EOT' > "${BODY}"
2146 vput vexpr j '&' $i 7
2152 echo ! The end for $1
2155 echo would be err with errexit
2164 echo zwei, ?=$? !=$!
2165 localopts yes; set errexit
2167 echo drei, ?=$? !=$^ERRNAME
2169 echo vier, ?=$? !=$^ERRNAME, this is an error
2172 echo outer 1, ?=$? !=$^ERRNAME
2174 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2176 echo outer 3, ?=$? !=$^ERRNAME
2177 echo this is definitely an error
2180 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2182 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2184 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2186 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2191 t_behave_vpospar() {
2192 t_prolog t_behave_vpospar
2194 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2195 vpospar
set hey
, "'you ", world
!
2196 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2197 vput vpospar x quote
; echo x
<$x>
2198 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2199 vput vpospar y quote
;echo y
<$y>
2200 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2201 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2202 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2205 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2206 vput vpospar z quote
;echo infun2
:z
<$z>
2210 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2211 vput vpospar y quote
;echo infun
:y
<$y>
2212 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2213 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2215 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2216 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2219 call infun This
"in a" fun
2220 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2221 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2223 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2226 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2228 echo ifs<$ifs> ifs-ws<$ifs-ws>
2229 vpospar set hey, "'you ", world!
2230 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2231 vput vpospar x quote; echo x<$x>
2232 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2233 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2236 echo ifs<$ifs> ifs-ws<$ifs-ws>
2237 vpospar set hey, "'you
", world!
2238 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2240 vput vpospar x quote; echo x<$x>
2241 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2242 eval vpospar set ${x};\
2243 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2246 echo ifs<$ifs> ifs-ws<$ifs-ws>
2247 vpospar set hey, "'you ", world!
2248 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2250 vput vpospar x quote; echo x<$x>
2251 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2252 eval vpospar set ${x};\
2253 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2255 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2260 t_behave_atxplode() {
2261 t_prolog t_behave_atxplode
2262 TRAP_EXIT_ADDONS="./.t*"
2264 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2267 printf " (1/$#: <$1>)"
2269 if [ $# -gt 0 ]; then
2283 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2284 printf xxx;xxx arg ,b u.
2285 printf xxx;xxx arg , .
2286 printf xxx;xxx arg ,ball.
2292 echon " (1/$#: <$1>)"
2307 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2308 echon xxx;call xxx arg ,b u.
2309 echon xxx;call xxx arg , .
2310 echon xxx;call xxx arg ,ball.
2313 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2314 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2316 #${SHELL} ./.t.sh > ./.tshout 2>&1
2317 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2323 t_prolog t_behave_read
2324 TRAP_EXIT_ADDONS="./.t*"
2326 ${cat} <<- '__EOT
' > .tin
2327 hey1, "'you
", world!
2328 hey2, "'you ", bugs bunny!
2333 ${cat} <<- '__EOT
' |\
2334 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2336 echo $?/$^ERRNAME / <$a><$b><$c>
2338 echo $?/$^ERRNAME / <$a><$b><$c>
2340 echo $?/$^ERRNAME / <$a><$b><$c>
2342 echo $?/$^ERRNAME / <$a><$b><$c>
2343 unset a b c;read a b c
2344 echo $?/$^ERRNAME / <$a><$b><$c>
2345 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2347 check behave:read-1 0 "${MBOX}" '1527910147 173'
2349 ${cat} <<- '__EOT
' > .tin2
2350 hey2.0,:"'you
",:world!:mars.:
2351 hey2.1,:"'you ",:world!
2352 hey2.2,:"'you
",:bugs bunny!
2358 ${cat} <<- '__EOT' |\
2359 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2362 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2364 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2366 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2368 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2370 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2372 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2373 unset a b c
;read a b c
2374 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2376 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2377 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2379 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2381 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2383 readall d; echo $?/$^ERRNAME / <$d>
2384 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2385 readctl create .tin2
2386 readall d; echo $?/$^ERRNAME / <$d>
2387 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2388 readctl remove .tin;echo $?/$^ERRNAME;\
2389 readctl remove .tin2;echo $?/$^ERRNAME
2391 check behave:readall 0 "${MBOX}" '860434889 333'
2397 t_prolog t_behave_mbox
2398 TRAP_EXIT_ADDONS=".
/.t
*"
2402 while [ ${i} -lt 112 ]; do
2403 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2404 "${MBOX}" "${i}" "${i}"
2407 ) | ${MAILX} ${ARGS}
2408 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2410 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2411 ${MAILX} ${ARGS} > .tlst
2412 check behave:mbox-2 0 .tlst '2739893312 9103'
2414 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2415 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} > .tlst
2416 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2418 # only the odd (even)
2420 printf 'File "file://%s"\ncopy ' .tmbox2
2422 while [ ${i} -lt 112 ]; do
2424 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2427 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2428 ) |
${MAILX} ${ARGS} > .tlst
2429 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2430 check behave
:mbox-5
- .tlst
'2960975049 4573'
2433 printf 'file "file://%s"\nmove ' .tmbox2
2435 while [ ${i} -lt 112 ]; do
2437 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2440 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2441 .tmbox3 .tmbox3 .tmbox2
2442 ) | ${MAILX} ${ARGS} > .tlst
2443 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2444 ${sed} 2d < .tlst > .tlstx
2445 check behave:mbox-7 - .tlstx '2729940494 13645'
2450 t_behave_maildir() {
2451 t_prolog t_behave_maildir
2452 TRAP_EXIT_ADDONS=".
/.t
*"
2456 while [ ${i} -lt 112 ]; do
2457 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2458 "${MBOX}" "${i}" "${i}"
2461 ) | ${MAILX} ${ARGS}
2462 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2468 ' "${MBOX}" .tmdir1 .tmdir1 |
2469 ${MAILX} ${ARGS} -Snewfolders=maildir > .tlst
2470 check behave:maildir-2 0 .tlst '1797938753 9103'
2473 copy * "maildir
://%s
"
2476 ' "${MBOX}" .tmdir2 .tmdir2 |
2477 ${MAILX} ${ARGS} > .tlst
2478 check behave:maildir-3 0 .tlst '1155631089 9113'
2480 printf 'File "maildir
://%s
"
2484 ' .tmdir2 .tmbox1 .tmbox1 |
2485 ${MAILX} ${ARGS} > .tlst
2486 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2487 check behave:maildir-5 - .tlst '3701297796 9110'
2489 # only the odd (even)
2491 printf 'File "maildir
://%s
"
2494 while [ ${i} -lt 112 ]; do
2496 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2503 ) | ${MAILX} ${ARGS} > .tlst
2504 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2505 check behave:maildir-7 - .tlst '960096773 4573'
2508 printf 'file "maildir
://%s
"
2511 while [ ${i} -lt 112 ]; do
2513 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2521 ' .tmbox2 .tmbox2 .tmdir2
2522 ) |
${MAILX} ${ARGS} > .tlst
2523 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2524 ${sed} 2d
< .tlst
> .tlstx
2525 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2530 t_behave_record_a_resend
() {
2531 t_prolog t_behave_record_a_resend
2532 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2536 m %s\n~s Subject 1.\nHello.\n~.
2537 set record-files add-file-recipients
2538 m %s\n~s Subject 2.\nHello.\n~.
2540 resend 2 ./.t.resent
2541 Resend 1 ./.t.resent
2543 resend 2 ./.t.resent
2544 Resend 1 ./.t.resent
2545 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2548 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2549 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2550 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2555 t_behave_e_H_L_opts
() {
2556 t_prolog t_behave_e_H_L_opts
2557 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2560 ${MAILX} ${ARGS} -ef .
/.t.mbox
2561 echo ${?} > "${MBOX}"
2563 ${cat} <<-_EOT > ./.tsendmail.sh
2565 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2568 chmod 0755 .
/.tsendmail.sh
2569 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2570 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2571 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2572 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2574 ${MAILX} ${ARGS} -ef .
/.t.mbox
2575 echo ${?} >> "${MBOX}"
2576 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2577 echo ${?} >> "${MBOX}"
2578 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2579 echo ${?} >> "${MBOX}"
2580 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2581 echo ${?} >> "${MBOX}"
2582 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2583 echo ${?} >> "${MBOX}"
2584 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2585 echo ${?} >> "${MBOX}"
2586 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2587 echo ${?} >> "${MBOX}"
2589 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2590 echo ${?} >> "${MBOX}"
2591 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2592 echo ${?} >> "${MBOX}"
2593 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2594 echo ${?} >> "${MBOX}"
2595 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2596 echo ${?} >> "${MBOX}"
2597 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2598 echo ${?} >> "${MBOX}"
2599 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2600 echo ${?} >> "${MBOX}"
2601 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2602 echo ${?} >> "${MBOX}"
2604 check behave:e_H_L_opts - "${MBOX}" '1708955574 678'
2609 t_behave_alternates() {
2610 t_prolog t_behave_alternates
2611 TRAP_EXIT_ADDONS=".
/.t
*"
2613 ${cat} <<-_EOT > ./.tsendmail.sh
2615 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2618 chmod 0755 ./.tsendmail.sh
2620 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2624 alternates a1@b1 a2@b2 a3@b3
2629 echo $?/$^ERRNAME <$rv>
2634 echo $?/$^ERRNAME <$rv>
2637 echo $?/$^ERRNAME <$rv>
2640 echo $?/$^ERRNAME <$rv>
2644 alternates a1@b1 a2@b2 a3@b3
2647 echo $?/$^ERRNAME <$rv>
2650 echo $?/$^ERRNAME <$rv>
2653 echo $?/$^ERRNAME <$rv>
2656 alternates a1@b1 a2@b2 a3@b3
2659 echo $?/$^ERRNAME <$rv>
2662 echo $?/$^ERRNAME <$rv>
2665 echo $?/$^ERRNAME <$rv>
2669 alternates a1@b1 a2@b2 a3@b3
2672 echo $?/$^ERRNAME <$rv>
2676 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2678 ~s all alternates, only a1@b1 remains
2680 ~b a3@b3 a3@c3 a3@d3
2689 alternates a1@b1 a1@c1 a2@b2 a3@b3
2691 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2693 ~b a3@b3 a3@c3 a3@d3
2700 alternates a1@b1 a2@b2 a3; set allnet
2702 ~s all alternates via allnet, only a1@b1 remains
2704 ~b a3@b3 a3@c3 a3@d3
2715 echo $?/$^ERRNAME <$rv>
2719 echo $?/$^ERRNAME <$rv>
2723 echo $?/$^ERRNAME <$rv>
2727 echo $?/$^ERRNAME <$rv>
2731 echo $?/$^ERRNAME <$rv>
2735 alternates a1@b1 a2@b2
2738 echo $?/$^ERRNAME <$rv>
2739 alternates a3@b3 a4@b4
2742 echo $?/$^ERRNAME <$rv>
2744 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2745 check behave:alternates-2 - .tall '1878598364 505'
2751 t_prolog t_behave_alias
2752 TRAP_EXIT_ADDONS=".
/.t
*"
2754 ${cat} <<-_EOT > ./.tsendmail.sh
2756 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2759 chmod 0755 ./.tsendmail.sh
2761 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2763 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2765 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2767 alias a4 a5 ex1@a4.ple
2769 alias a6 a7 ex1@a6.ple
2783 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2784 check behave:alias-2 - .tall '3548953204 152'
2786 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2787 # TODO need to somehow provide its contents to the test, then test
2792 t_behave_filetype() {
2793 t_prolog t_behave_filetype
2794 TRAP_EXIT_ADDONS=".
/.t
*"
2796 ${cat} <<-_EOT > ./.tsendmail.sh
2798 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2801 chmod 0755 ./.tsendmail.sh
2803 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2804 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2805 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2807 if (echo |
gzip -c) >/dev
/null
2>&1; then
2810 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2811 "${MBOX}" | ${MAILX} ${ARGS} \
2812 -X'filetype gz gzip\ -dc gzip\ -c'
2813 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2814 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2816 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2817 check behave:filetype-3 - ".
/.t.out
" '2494681730 102'
2819 echo 'behave:filetype-2: unsupported, skipped'
2820 echo 'behave:filetype-3: unsupported, skipped'
2825 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2831 -X'filetype gz gzip\ -dc gzip\ -c' \
2832 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2833 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2834 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2836 -X'filetype gz gzip\ -dc gzip\ -c' \
2837 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2839 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2840 check behave:filetype-5 - ".
/.t.out
" '838452520 172'
2845 t_behave_message_injections() {
2846 t_prolog t_behave_message_injections
2847 TRAP_EXIT_ADDONS=".
/.t
*"
2849 ${cat} <<-_EOT > ./.tsendmail.sh
2851 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
2854 chmod 0755 ./.tsendmail.sh
2856 echo mysig > ./.tmysig
2858 echo some-body | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
2859 -Smessage-inject-head=head-inject \
2860 -Smessage-inject-tail=tail-inject \
2861 -Ssignature=./.tmysig \
2862 ex@am.ple > ./.tall 2>&1
2863 check behave:message_injections-1 0 "${MBOX}" '2434746382 134'
2864 check behave:message_injections-2 - .tall '4294967295 0' # empty file
2866 ${cat} <<-_EOT > ./.template
2870 Subject: This subject is
2872 Body, body, body me.
2874 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tsendmail.sh \
2875 -Smessage-inject-head=head-inject \
2876 -Smessage-inject-tail=tail-inject \
2877 -Ssignature=./.tmysig \
2879 check behave:message_injections-3 0 "${MBOX}" '3114203412 198'
2880 check behave:message_injections-4 - .tall '4294967295 0' # empty file
2885 t_behave_compose_hooks() { # TODO monster
2886 t_prolog t_behave_compose_hooks
2887 TRAP_EXIT_ADDONS=".
/.t
*"
2889 (echo line one&&echo line two&&echo line three) > ./.treadctl
2890 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
2892 ${cat} <<-_EOT > ./.tsendmail.sh
2894 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2897 chmod 0755 ./.tsendmail.sh
2899 ${cat} <<'__EOT__' > ./.trc
2901 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
2904 vput vexpr es substr "$1" 0 1
2909 define read_mline_res {
2910 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2911 echo $len/$es/$^ERRNAME: $hl
2912 if [ $es -ne $^ERR-NONE ]
2913 xcall bail read_mline_res
2915 \xcall read_mline_res
2920 echo "~^header list
"; read hl; echo $hl;\
2921 call xerr "$hl" "in_addr
($xh) 0-1"
2923 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2924 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
2925 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2926 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
2927 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2928 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
2929 echo "~^header list
$xh"; read hl; echo $hl;\
2930 call xerr "$hl" "ins_addr
$xh 1-4"
2931 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
2934 if [ "$t_remove" == "" ]
2938 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
2939 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
2941 xcall bail "ins_addr
$xh 2-2"
2943 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
2945 xcall bail "ins_addr
$xh 2-3"
2947 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
2949 xcall bail "ins_addr
$xh 2-4"
2953 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2954 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
2955 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2956 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
2957 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2958 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
2959 echo "~^header list
$xh"; read hl; echo $hl;\
2960 call xerr "$hl" "ins_addr
$xh 3-4"
2961 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
2964 echo "~^header remove-at
$xh 1"; read es;\
2965 call xerr $es "ins_addr
$xh 3-6"
2966 echo "~^header remove-at
$xh 1"; read es;\
2967 call xerr $es "ins_addr
$xh 3-7"
2968 echo "~^header remove-at
$xh 1"; read es;\
2969 call xerr $es "ins_addr
$xh 3-8"
2970 echo "~^header remove-at
$xh 1"; read es;\
2971 vput vexpr es substr $es 0 3
2973 xcall bail "ins_addr
$xh 3-9"
2975 echo "~^header remove-at
$xh T
"; read es;\
2976 vput vexpr es substr $es 0 3
2978 xcall bail "ins_addr
$xh 3-10"
2980 echo "~^header list
$xh"; read es;\
2981 vput vexpr es substr $es 0 3
2983 xcall bail "ins_addr
$xh 3-11"
2985 echo "~^header show
$xh"; read es;\
2986 vput vexpr es substr $es 0 3
2988 xcall bail "ins_addr
$xh 3-12"
2992 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2993 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
2994 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
2995 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
2996 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2997 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
2998 echo "~^header list
$xh"; read hl; echo $hl;\
2999 call xerr "$hl" "header list
$xh 3-4"
3000 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
3003 echo "~^header remove-at
$xh 3"; read es;\
3004 call xerr $es "ins_addr
$xh 4-6"
3005 echo "~^header remove-at
$xh 2"; read es;\
3006 call xerr $es "ins_addr
$xh 4-7"
3007 echo "~^header remove-at
$xh 1"; read es;\
3008 call xerr $es "ins_addr
$xh 4-8"
3009 echo "~^header remove-at
$xh 1"; read es;\
3010 vput vexpr es substr $es 0 3
3012 xcall bail "ins_addr
$xh 4-9"
3014 echo "~^header remove-at
$xh T
"; read es;\
3015 vput vexpr es substr $es 0 3
3017 xcall bail "ins_addr
$xh 4-10"
3019 echo "~^header list
$xh"; read es;\
3020 vput vexpr es substr $es 0 3
3022 xcall bail "ins_addr
$xh 4-11"
3024 echo "~^header show
$xh"; read es;\
3025 vput vexpr es substr $es 0 3
3027 xcall bail "ins_addr
$xh 4-12"
3031 wysh set xh=$1 mult=$2
3032 echo "~^header list
"; read hl; echo $hl;\
3033 call xerr "$hl" "ins_ref
($xh) 0-1"
3035 echo "~^header insert
$xh <$xh@exam.ple
>";\
3036 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
3038 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3039 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
3040 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3041 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
3043 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
3044 vput vexpr es substr $es 0 3
3046 xcall bail "ins_ref
$xh 1-4"
3050 echo "~^header list
$xh"; read hl; echo $hl;\
3051 call xerr "$hl" "ins_ref
$xh 1-5"
3052 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
3055 if [ "$t_remove" == "" ]
3059 echo "~^header remove
$xh"; read es;\
3060 call xerr $es "ins_ref
$xh 2-1"
3061 echo "~^header remove
$xh"; read es;\
3062 vput vexpr es substr $es 0 3
3064 xcall bail "ins_ref
$xh 2-2"
3066 echo "~^header list
$xh"; read es;\
3067 vput vexpr es substr $es 0 3
3069 xcall bail "$es ins_ref
$xh 2-3"
3071 echo "~^header show
$xh"; read es;\
3072 vput vexpr es substr $es 0 3
3074 xcall bail "ins_ref
$xh 2-4"
3078 echo "~^header insert
$xh <$xh@exam.ple
>";\
3079 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
3081 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3082 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
3083 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3084 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
3086 echo "~^header list
$xh";\
3087 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
3088 echo "~^header show
$xh";\
3089 read es; call xerr $es "ins_ref
$xh 3-5"
3092 echo "~^header remove-at
$xh 1"; read es;\
3093 call xerr $es "ins_ref
$xh 3-6"
3094 if [ $mult -ne 0 ] && [ $xh != subject ]
3095 echo "~^header remove-at
$xh 1"; read es;\
3096 call xerr $es "ins_ref
$xh 3-7"
3097 echo "~^header remove-at
$xh 1"; read es;\
3098 call xerr $es "ins_ref
$xh 3-8"
3100 echo "~^header remove-at
$xh 1"; read es;\
3101 vput vexpr es substr $es 0 3
3103 xcall bail "ins_ref
$xh 3-9"
3105 echo "~^header remove-at
$xh T
"; read es;\
3106 vput vexpr es substr $es 0 3
3108 xcall bail "ins_ref
$xh 3-10"
3110 echo "~^header show
$xh"; read es;\
3111 vput vexpr es substr $es 0 3
3113 xcall bail "ins_ref
$xh 3-11"
3117 echo "~^header insert
$xh <$xh@exam.ple
> ";\
3118 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
3120 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
3121 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
3122 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3123 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
3125 echo "~^header list
$xh"; read hl; echo $hl;\
3126 call xerr "$hl" "ins_ref
$xh 4-4"
3127 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
3130 if [ $mult -ne 0 ] && [ $xh != subject ]
3131 echo "~^header remove-at
$xh 3"; read es;\
3132 call xerr $es "ins_ref
$xh 4-6"
3133 echo "~^header remove-at
$xh 2"; read es;\
3134 call xerr $es "ins_ref
$xh 4-7"
3136 echo "~^header remove-at
$xh 1"; read es;\
3137 call xerr $es "ins_ref
$xh 4-8"
3138 echo "~^header remove-at
$xh 1"; read es;\
3139 vput vexpr es substr $es 0 3
3141 xcall bail "ins_ref
$xh 4-9"
3143 echo "~^header remove-at
$xh T
"; read es;\
3144 vput vexpr es substr $es 0 3
3146 xcall bail "ins_ref
$xh 4-10"
3148 echo "~^header show
$xh"; read es;\
3149 vput vexpr es substr $es 0 3
3151 xcall bail "ins_ref
$xh 4-11"
3156 # In collect.c order
3158 call ins_ref sender 0 # Not a "ref
", but works
3162 call ins_addr reply-To
3163 call ins_addr mail-Followup-to
3164 call ins_ref messAge-id 0
3165 call ins_ref rEfErEncEs 1
3166 call ins_ref in-Reply-to 1
3167 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
3168 call ins_addr freeForm1
3169 call ins_addr freeform2
3171 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
3173 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
3181 echo "~^attachment
";\
3182 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3184 xcall bail "attach
0-1"
3187 echo "~^attach attribute .
/.treadctl
";\
3188 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3190 xcall bail "attach
0-2"
3192 echo "~^attachment attribute-at
1";\
3193 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3195 xcall bail "attach
0-3"
3198 echo "~^attachment insert .
/.treadctl
=ascii
";\
3199 read hl; echo $hl; call xerr "$hl" "attach
1-1"
3200 echo "~^attachment list
";\
3201 read es; echo $es;call xerr "$es" "attach
1-2"
3203 echo "~^attachment attribute .
/.treadctl
";\
3204 read es; echo $es;call xerr "$es" "attach
1-3"
3206 echo "~^attachment attribute .treadctl
";\
3207 read es; echo $es;call xerr "$es" "attach
1-4"
3209 echo "~^attachment attribute-at
1";\
3210 read es; echo $es;call xerr "$es" "attach
1-5"
3213 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
3214 read es; echo $es;call xerr "$es" "attach
1-6"
3215 echo "~^attachment attribute-set .treadctl content-description Au
";\
3216 read es; echo $es;call xerr "$es" "attach
1-7"
3217 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
3218 read es; echo $es;call xerr "$es" "attach
1-8"
3220 echo "~^attachment attribute .
/.treadctl
";\
3221 read es; echo $es;call xerr "$es" "attach
1-9"
3223 echo "~^attachment attribute .treadctl
";\
3224 read es; echo $es;call xerr "$es" "attach
1-10"
3226 echo "~^attachment attribute rctl
";\
3227 read es; echo $es;call xerr "$es" "attach
1-11"
3229 echo "~^attachment attribute-at
1";\
3230 read es; echo $es;call xerr "$es" "attach
1-12"
3234 echo "~^attachment insert .
/.tattach
=latin1
";\
3235 read hl; echo $hl; call xerr "$hl" "attach
2-1"
3236 echo "~^attachment list
";\
3237 read es; echo $es;call xerr "$es" "attach
2-2"
3239 echo "~^attachment attribute .
/.tattach
";\
3240 read es; echo $es;call xerr "$es" "attach
2-3"
3242 echo "~^attachment attribute .tattach
";\
3243 read es; echo $es;call xerr "$es" "attach
2-4"
3245 echo "~^attachment attribute-at
2";\
3246 read es; echo $es;call xerr "$es" "attach
2-5"
3249 echo "~^attachment attribute-set .
/.tattach filename tat
";\
3250 read es; echo $es;call xerr "$es" "attach
2-6"
3252 "~^attachment attribute-set .tattach content-description Au2
";\
3253 read es; echo $es;call xerr "$es" "attach
2-7"
3254 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
3255 read es; echo $es;call xerr "$es" "attach
2-8"
3257 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
3258 read es; echo $es;call xerr "$es" "attach
2-9"
3260 echo "~^attachment attribute .
/.tattach
";\
3261 read es; echo $es;call xerr "$es" "attach
2-10"
3263 echo "~^attachment attribute .tattach
";\
3264 read es; echo $es;call xerr "$es" "attach
2-11"
3266 echo "~^attachment attribute tat
";\
3267 read es; echo $es;call xerr "$es" "attach
2-12"
3269 echo "~^attachment attribute-at
2";\
3270 read es; echo $es;call xerr "$es" "attach
2-13"
3274 if [ "$t_remove" == "" ]
3278 echo "~^attachment remove .
/.treadctl
"; read es;\
3279 call xerr $es "attach
3-1"
3280 echo "~^attachment remove .
/.tattach
"; read es;\
3281 call xerr $es "attach
3-2"
3282 echo "~^ attachment remove .
/.treadctl
"; read es;\
3283 vput vexpr es substr $es 0 3
3285 xcall bail "attach
3-3"
3287 echo "~^ attachment remove .
/.tattach
"; read es;\
3288 vput vexpr es substr $es 0 3
3290 xcall bail "attach
3-4"
3292 echo "~^attachment list
"; read es;\
3293 vput vexpr es substr $es 0 3
3295 xcall bail "attach
3-5"
3299 echo "~^attachment insert .
/.tattach
=latin1
";\
3300 read hl; echo $hl; call xerr "$hl" "attach
4-1"
3301 echo "~^attachment insert .
/.tattach
=latin1
";\
3302 read hl; echo $hl; call xerr "$hl" "attach
4-2"
3303 echo "~^attachment list
";\
3304 read es; echo $es;call xerr "$es" "attach
4-3"
3306 echo "~^ attachment remove .tattach
"; read es;\
3307 vput vexpr es substr $es 0 3
3309 xcall bail "attach
4-4 $es"
3311 echo "~^attachment remove-at T
"; read es;\
3312 vput vexpr es substr $es 0 3
3314 xcall bail "attach
4-5"
3316 echo "~^attachment remove .
/.tattach
"; read es;\
3317 call xerr $es "attach
4-6"
3318 echo "~^attachment remove .
/.tattach
"; read es;\
3319 call xerr $es "attach
4-7"
3320 echo "~^ attachment remove .
/.tattach
"; read es;\
3321 vput vexpr es substr $es 0 3
3323 xcall bail "attach
4-8 $es"
3325 echo "~^attachment list
"; read es;\
3326 vput vexpr es substr $es 0 3
3328 xcall bail "attach
4-9"
3332 echo "~^attachment insert .
/.tattach
=latin1
";\
3333 read hl; echo $hl; call xerr "$hl" "attach
5-1"
3334 echo "~^attachment insert .
/.tattach
=latin1
";\
3335 read hl; echo $hl; call xerr "$hl" "attach
5-2"
3336 echo "~^attachment insert .
/.tattach
=latin1
";\
3337 read hl; echo $hl; call xerr "$hl" "attach
5-3"
3338 echo "~^attachment list
";\
3339 read es; echo $es;call xerr "$es" "attach
5-4"
3342 echo "~^attachment remove-at
3"; read es;\
3343 call xerr $es "attach
5-5"
3344 echo "~^attachment remove-at
3"; read es;\
3345 vput vexpr es substr $es 0 3
3347 xcall bail "attach
5-6"
3349 echo "~^attachment remove-at
2"; read es;\
3350 call xerr $es "attach
5-7"
3351 echo "~^attachment remove-at
2"; read es;\
3352 vput vexpr es substr $es 0 3
3354 xcall bail "attach
5-8"
3356 echo "~^attachment remove-at
1"; read es;\
3357 call xerr $es "attach
5-9"
3358 echo "~^attachment remove-at
1"; read es;\
3359 vput vexpr es substr $es 0 3
3361 xcall bail "attach
5-10"
3364 echo "~^attachment list
"; read es;\
3365 vput vexpr es substr $es 0 3
3367 xcall bail "attach
5-11"
3371 echo "~^attachment insert .
/.tattach
=latin1
";\
3372 read hl; echo $hl; call xerr "$hl" "attach
6-1"
3373 echo "~^attachment insert .
/.tattach
=latin1
";\
3374 read hl; echo $hl; call xerr "$hl" "attach
6-2"
3375 echo "~^attachment insert .
/.tattach
=latin1
";\
3376 read hl; echo $hl; call xerr "$hl" "attach
6-3"
3377 echo "~^attachment list
";\
3378 read es; echo $es;call xerr "$es" "attach
6-4"
3381 echo "~^attachment remove-at
1"; read es;\
3382 call xerr $es "attach
6-5"
3383 echo "~^attachment remove-at
1"; read es;\
3384 call xerr $es "attach
6-6"
3385 echo "~^attachment remove-at
1"; read es;\
3386 call xerr $es "attach
6-7"
3387 echo "~^attachment remove-at
1"; read es;\
3388 vput vexpr es substr $es 0 3
3390 xcall bail "attach
6-8"
3393 echo "~^attachment list
"; read es;\
3394 vput vexpr es substr $es 0 3
3396 xcall bail "attach
6-9"
3408 echo on-compose-enter, mailx-command<$mailx-command>
3409 alternates alter1@exam.ple alter2@exam.ple
3411 set autocc='alter1@exam.ple alter2@exam.ple'
3412 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3413 echo mailx-subject<$mailx-subject>
3414 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3415 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3416 mailx-raw-bcc<$mailx-raw-bcc>
3417 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3418 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3421 echo on-compose-leave, mailx-command<$mailx-command>
3423 eval alternates $al alter3@exam.ple alter4@exam.ple
3425 set autobcc='alter3@exam.ple alter4@exam.ple'
3426 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3427 echo mailx-subject<$mailx-subject>
3428 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3429 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3430 mailx-raw-bcc<$mailx-raw-bcc>
3431 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3432 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3435 echo on-compose-cleanup, mailx-command<$mailx-command>
3438 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3439 echo mailx-subject<$mailx-subject>
3440 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3441 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3442 mailx-raw-bcc<$mailx-raw-bcc>
3443 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3444 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3446 wysh set on-compose-splice=t_ocs \
3447 on-compose-enter=t_oce on-compose-leave=t_ocl \
3448 on-compose-cleanup=t_occ
3452 printf 'm this-goes@nowhere\nbody\n!.\n' |
3453 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3454 -X'source ./.trc' -Smta=./.tsendmail.sh \
3456 ${cat} ./.tall >> "${MBOX}"
3457 check behave:compose_hooks-1 0 "${MBOX}" '522535560 10101'
3460 printf 'm this-goes@nowhere\nbody\n!.\n' |
3461 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3462 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh \
3464 ${cat} ./.tall >> "${MBOX}"
3465 check behave:compose_hooks-2 0 "${MBOX}" '3654000499 12535'
3469 # Some state machine stress, shell compose hook, localopts for hook, etc.
3470 # readctl in child. ~r as HERE document
3472 printf 'm ex@am.ple\nbody\n!.
3473 echon ${mailx-command}${mailx-subject}
3474 echon ${mailx-from}${mailx-sender}
3475 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3476 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3477 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3478 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3479 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3480 -Smta=./.tsendmail.sh \
3483 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3486 vput vexpr es substr "$1" 0 1
3491 define read_mline_res {
3492 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3493 echo $len/$es/$^ERRNAME: $hl
3494 if [ $es -ne $^ERR-NONE ]
3495 xcall bail read_mline_res
3497 \xcall read_mline_res
3501 vput vexpr i + 1 "$2"
3503 vput vexpr j % $i 10
3510 eval \\$j _work $1 $i
3513 vput vexpr i + $i "$1"
3517 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3518 echo read:$es/$en: $line
3519 if [ "${es}" -ne -1 ]
3522 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3527 echo "~^header list
"; read hl; echo $hl;\
3528 vput vexpr es substr "$hl" 0 1
3530 xcall bail "header list
"
3533 call _work 1; echo $?
3534 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
3535 read es; echo $es; vput vexpr es substr "$es" 0 1
3537 xcall bail "be diet
"
3539 echo "~^header insert cc
<splice2@exam.ple
>";\
3540 read es; echo $es; vput vexpr es substr "$es" 0 1
3542 xcall bail "be diet2
"
3545 call _work 2; echo $?
3546 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
3547 read es; echo $es;vput vexpr es substr "$es" 0 1
3549 xcall bail "be juicy
"
3551 echo "~^header insert bcc juice2@exam.ple
";\
3552 read es; echo $es;vput vexpr es substr "$es" 0 1
3554 xcall bail "be juicy2
"
3556 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
3557 read es; echo $es;vput vexpr es substr "$es" 0 1
3559 xcall bail "be juicy3
"
3561 echo "~^header insert bcc juice4@exam.ple
";\
3562 read es; echo $es;vput vexpr es substr "$es" 0 1
3564 xcall bail "be juicy4
"
3567 echo "~^header remove-at bcc
3";\
3568 read es; echo $es;vput vexpr es substr "$es" 0 1
3570 xcall bail "remove juicy5
"
3572 echo "~^header remove-at bcc
2";\
3573 read es; echo $es;vput vexpr es substr "$es" 0 1
3575 xcall bail "remove juicy6
"
3577 echo "~^header remove-at bcc
3";\
3578 read es; echo $es;vput vexpr es substr "$es" 0 3
3580 xcall bail "failed to remove-at
"
3582 # Add duplicates which ought to be removed!
3583 echo "~^header insert bcc juice4@exam.ple
";\
3584 read es; echo $es;vput vexpr es substr "$es" 0 1
3586 xcall bail "be juicy4-1
"
3588 echo "~^header insert bcc juice4@exam.ple
";\
3589 read es; echo $es;vput vexpr es substr "$es" 0 1
3591 xcall bail "be juicy4-2
"
3593 echo "~^header insert bcc juice4@exam.ple
";\
3594 read es; echo $es;vput vexpr es substr "$es" 0 1
3596 xcall bail "be juicy4-3
"
3601 call _work 3; echo $?
3603 vput ! i echo just knock if you can hear me;\
3605 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
3607 echon shell-cmd says $?/$^ERRNAME: $i
3608 echo "~x will not become interpreted
, we are reading
until __EOT
"
3610 read r_status; echo "~~r status output
: $r_status"
3611 echo "~
:echo $? $
! $^ERRNAME
"
3613 echo "~~r status from parent
: $r_status"
3616 call _work 4; echo $?
3617 vput cwd cwd;echo cwd:$?
3618 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3622 call _work 5; echo $?
3623 echo "~^header show MAILX-Command
"; read es;\
3624 call xerr $es "t_header
1000"; call read_mline_res
3625 echo "~^header show MAILX-raw-TO
"; read es;\
3626 call xerr $es "t_header
1001"; xcall read_mline_res
3628 echoerr IT IS WRONG IF YOU SEE THIS
3631 echo on-compose-enter, mailx-command<$mailx-command>
3632 set t_oce autobcc=oce@exam.ple
3633 alternates alter1@exam.ple alter2@exam.ple
3635 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3636 echo mailx-subject<$mailx-subject>
3637 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3638 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3639 mailx-raw-bcc<$mailx-raw-bcc>
3640 echo mailx-orig-from<$mailx-orig-from> \
3641 mailx-orig-to<$mailx-orig-to> \
3642 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3645 echo on-compose-leave, mailx-command<$mailx-command>
3646 set t_ocl autocc=ocl@exam.ple
3648 alternates alter3@exam.ple alter4@exam.ple
3650 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3651 echo mailx-subject<$mailx-subject>
3652 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3653 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3654 mailx-raw-bcc<$mailx-raw-bcc>
3655 echo mailx-orig-from<$mailx-orig-from> \
3656 mailx-orig-to<$mailx-orig-to> \
3657 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3660 echo on-compose-cleanup, mailx-command<$mailx-command>
3661 set t_occ autocc=occ@exam.ple
3664 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3665 echo mailx-subject<$mailx-subject>
3666 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3667 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3668 mailx-raw-bcc<$mailx-raw-bcc>
3669 echo mailx-orig-from<$mailx-orig-from> \
3670 mailx-orig-to<$mailx-orig-to> \
3671 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3673 wysh set on-compose-splice=t_ocs \
3674 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
3675 ~t shell@exam.ple
\\n~
:set t_ocs_sh
\\n
\"" \
3676 on-compose-enter=t_oce on-compose-leave=t_ocl \
3677 on-compose-cleanup=t_occ
3679 ex0_test behave:compose_hooks-3-estat
3680 ${cat} ./.tnotes >> "${MBOX}"
3682 check behave:compose_hooks-3 - "${MBOX}" '679526364 2431'
3684 # Reply, forward, resend, Resend
3687 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3688 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3689 -Smta=./.tsendmail.sh
3692 echo start: $? $! $^ERRNAME
3694 echo File: $? $! $^ERRNAME;echo;echo
3696 this is content of reply 1
3698 echo reply 1: $? $! $^ERRNAME;echo;echo
3700 this is content of Reply 1 2
3702 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3703 forward 1 fwdex@am.ple
3704 this is content of forward 1
3706 echo forward 1: $? $! $^ERRNAME;echo;echo
3707 resend 1 2 resendex@am.ple
3708 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3709 Resend 1 2 Resendex@am.ple
3710 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3712 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3713 -Smta=./.tsendmail.sh \
3716 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3719 vput vexpr es substr "$1" 0 1
3724 define read_mline_res {
3725 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3726 echo mline_res:$len/$es/$^ERRNAME: $hl
3727 if [ $es -ne $^ERR-NONE ]
3728 xcall bail read_mline_res
3730 \xcall read_mline_res
3734 echo "~^header show
$1"; read es;\
3735 call xerr $es "work_hl
$1"; echo $1; call read_mline_res
3743 echo t_ocs version $ver
3744 echo "~^header list
"; read hl; echo $hl;\
3745 echoerr the header list is $hl;\
3746 call xerr "$hl" "header list
"
3747 eval vpospar set $hl
3750 echoerr IT IS WRONG IF YOU SEE THIS
3753 echo on-XY-enter, mailx-command<$mailx-command>
3754 set t_oce autobcc=oce@exam.ple
3755 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3756 echo mailx-subject<$mailx-subject>
3757 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3758 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3759 mailx-raw-bcc<$mailx-raw-bcc>
3760 echo mailx-orig-from<$mailx-orig-from> \
3761 mailx-orig-to<$mailx-orig-to> \
3762 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3765 echo on-XY-leave, mailx-command<$mailx-command>
3766 set t_ocl autocc=ocl@exam.ple
3767 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3768 echo mailx-subject<$mailx-subject>
3769 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3770 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3771 mailx-raw-bcc<$mailx-raw-bcc>
3772 echo mailx-orig-from<$mailx-orig-from> \
3773 mailx-orig-to<$mailx-orig-to> \
3774 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3777 echo on-XY-cleanup, mailx-command<$mailx-command>
3778 set t_occ autocc=occ@exam.ple
3779 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3780 echo mailx-subject<$mailx-subject>
3781 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3782 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3783 mailx-raw-bcc<$mailx-raw-bcc>
3784 echo mailx-orig-from<$mailx-orig-from> \
3785 mailx-orig-to<$mailx-orig-to> \
3786 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3788 wysh set on-compose-splice=t_ocs \
3789 on-compose-enter=t_oce on-compose-leave=t_ocl \
3790 on-compose-cleanup=t_occ \
3791 on-resend-enter=t_oce on-resend-cleanup=t_occ
3793 ex0_test behave:compose_hooks-4-estat
3794 ${cat} ./.tnotes >> "${MBOX}"
3796 check behave:compose_hooks-4 - "${MBOX}" '3038884027 7516'
3801 t_behave_mass_recipients() {
3802 t_prolog t_behave_mass_recipients
3803 TRAP_EXIT_ADDONS=".
/.t
*"
3805 ${cat} <<-_EOT > ./.tsendmail.sh
3807 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3810 chmod 0755 ./.tsendmail.sh
3812 ${cat} <<'__EOT__' > ./.trc
3814 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3817 wysh set nr=$1 hn=$2
3818 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
3820 xcall bail "ins_addr
$hn 1-$nr"
3822 vput vexpr nr + $nr 1
3823 if [ "$nr" -le "$maximum" ]
3824 xcall ins_addr $nr $hn
3828 wysh set nr=$1 hn=$2
3829 alternates $hn$nr@$hn
3830 vput vexpr nr + $nr 2
3831 if [ "$nr" -le "$maximum" ]
3832 xcall bld_alter $nr $hn
3842 if [ "$t_remove" != '' ]
3847 set on-compose-splice=t_ocs on-compose-leave=t_ocl
3851 printf 'm this-goes@nowhere\nbody\n!.\n' |
3852 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3853 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3855 ${cat} ./.tall >> "${MBOX}"
3856 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
3859 printf 'm this-goes@nowhere\nbody\n!.\n' |
3860 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3861 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3863 ${cat} ./.tall >> "${MBOX}"
3864 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
3869 t_behave_mime_types_load_control() {
3870 t_prolog t_behave_mime_types_load_control
3871 TRAP_EXIT_ADDONS=".
/.t
*"
3873 ${cat} <<-_EOT > ./.tmts1
3874 @ application/mathml+xml mathml
3876 ${cat} <<-_EOT > ./.tmts2
3877 @ x-conference/x-cooltalk ice
3879 @ application/aga-aga aga
3882 ${cat} <<-_EOT > ./.tmts1.mathml
3883 <head>nonsense ML</head>
3885 ${cat} <<-_EOT > ./.tmts2.ice
3888 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.doom
3889 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.aga
3903 ' "${MBOX}" "${MBOX}" |
3905 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
3907 ex0_test behave:mime_types_load_control
3909 ${cat} "${MBOX}" >> ./.tout
3910 check behave:mime_types_load_control-1 - ./.tout '1441260727 2449'
3912 echo type | ${MAILX} ${ARGS} -R \
3913 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
3914 -f "${MBOX}" >> ./.tout 2>&1
3915 check behave:mime_types_load_control-2 0 ./.tout '1441391438 3646'
3920 t_behave_lreply_futh_rth_etc() {
3921 t_prolog t_behave_lreply_futh_rth_etc
3922 TRAP_EXIT_ADDONS=".
/.t
*"
3924 ${cat} <<-_EOT > ./.tsendmail.sh
3926 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
3929 chmod 0755 ./.tsendmail.sh
3931 ${cat} <<-_EOT > ./.tmbox
3932 From neverneverland Sun Jul 23 13:46:25 2017
3933 Subject: Bugstop: five miles out 1
3934 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3935 From: mister originator <mr@originator>
3936 To: bugstop-commit@five.miles.out, laber@backe.eu
3938 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
3939 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
3940 Date: Wed, 19 Jul 2017 09:22:57 -0400
3941 Message-Id: <20170719132257.766AF781267@originator>
3944 > |Sorry, I think I misunderstand something. I would think that
3948 From neverneverland Fri Jul 7 22:39:11 2017
3949 Subject: Bugstop: five miles out 2
3950 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
3951 Content-Transfer-Encoding: 7bit
3952 From: mister originator <mr@originator>
3953 To: bugstop-commit@five.miles.out
3955 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
3956 Date: Fri, 07 Jul 2017 16:33:59 -0400
3959 capable of changing back.
3961 From neverneverland Fri Jul 7 22:42:00 2017
3962 Subject: Bugstop: five miles out 3
3963 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3964 Content-Transfer-Encoding: 7bit
3965 From: mister originator <mr@originator>
3966 To: bugstop-commit@five.miles.out
3968 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
3969 Date: Fri, 07 Jul 2017 16:33:59 -0400
3970 List-Post: <mailto:bugstop@five.miles.out>
3973 are you ready, boots?
3975 From neverneverland Sat Aug 19 23:15:00 2017
3976 Subject: Bugstop: five miles out 4
3977 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3978 Content-Transfer-Encoding: 7bit
3979 From: mister originator <mr@originator>
3980 To: bugstop@five.miles.out
3982 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
3983 Date: Fri, 07 Jul 2017 16:33:59 -0400
3984 List-Post: <mailto:bugstop@five.miles.out>
3987 are you ready, boots?
3992 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
3993 -Rf ./.tmbox >> "${MBOX}" 2>&1
3995 wysh set m="This is text of
\"reply
${1}.
"
4006 echo -----After reply
$1.1
- $1.3
: $?
/$^ERRNAME
4009 wysh
set m
="This is text of \"Reply ${1}."
4015 echo -----After Reply $1.$2: $?/$^ERRNAME
4024 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
4028 # We need two indirections for this test: one for the case that Lreply
4029 # fails because of missing recipients: we need to read EOF next, thus
4030 # place this in _Ls last; and second for the succeeding cases EOF is
4031 # not what these should read, so go over the backside and splice it in!
4033 echo -----After Lreply $1.$2: $?/$^ERRNAME
4036 localopts call-fixate yes
4038 call R $1 1; call R $1 2; call R $1 3; call R $1 4
4039 call L $1 1; call L $1 2; call L $1 3
4042 echo;echo '===== CHANGING
=== '"$*"' =====';echo
4046 set from=laber@backe.eu
4049 call tweak set reply-to-honour
4051 call tweak set followup-to
4053 call tweak set followup-to-honour
4055 call tweak mlist bugstop@five.miles.out
4057 call tweak mlsubscribe bugstop@five.miles.out
4059 call tweak set recipients-in-cc
4063 check behave:lreply_futh_rth_etc-1 0 "${MBOX}" '940818845 29373'
4067 ${cat} <<-_EOT > ./.tmbox
4068 From tom@i-i.example Thu Oct 26 03:15:55 2017
4069 Date: Wed, 25 Oct 2017 21:15:46 -0400
4070 From: tom <tom@i-i.example>
4071 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4072 Cc: tom <tom@i-i.example>
4073 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4074 Message-ID: <20171026011546.GA11643@i-i.example>
4075 Reply-To: tom@i-i.example
4076 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4077 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4080 The report's useful
:-)
4083 printf 'reply 1\nthank you\n!.\n' |
4084 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4085 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4086 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4091 t_behave_xxxheads_rfc2047
() {
4092 t_prolog t_behave_xxxheads_rfc2047
4093 TRAP_EXIT_ADDONS
="./.t*"
4095 ${cat} <<-_EOT > ./.tsendmail.sh
4097 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4100 chmod 0755 .
/.tsendmail.sh
4104 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4105 -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̲' \
4107 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4109 # Single word (overlong line split -- bad standard! Requires injection of
4110 # artificial data!! But can be prevented by using RFC 2047 encoding)
4112 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4113 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4114 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4116 # Combination of encoded words, space and tabs of varying sort
4118 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4119 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4120 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4121 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4122 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4123 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4125 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4127 # Overlong multibyte sequence that must be forcefully split
4128 # todo This works even before v15.0, but only by accident
4130 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4131 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4132 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4133 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4135 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4139 echo | ${MAILX} ${ARGS} \
4140 -s "1-1 B2 B3 B4 B5 B6 B\
4141 1-2 B2 B3 B4 B5 B6 B\
4142 1-3 B2 B3 B4 B5 B6 B\
4143 1-4 B2 B3 B4 B5 B6 B\
4144 1-5 B2 B3 B4 B5 B6 B\
4145 1-6 B2 B3 B4 B5 B6
" \
4147 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4149 # Leading and trailing WS
4151 echo | ${MAILX} ${ARGS} \
4152 -s " 2-1 B2 B3 B4 B5 B6 B\
4153 1-2 B2 B3 B4 B5 B6 B\
4154 1-3 B2 B3 B4 B5 B6 B\
4155 1-4 B2 B3 B4 B5 B6
" \
4157 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4159 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4161 echo "Dat Früchtchen riecht häußlich
" |
4162 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4164 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4165 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4170 t_behave_rfc2231() {
4171 t_prolog t_behave_rfc2231
4172 TRAP_EXIT_ADDONS=".
/.t
*"
4175 mkdir ./.ttt || exit 1
4179 : > 'diet\ is \curd.txt'
4180 : > 'diet "is
" curd.txt'
4182 : > 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
4183 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4184 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4185 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4187 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4188 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4189 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4190 -a ./.ttt/höde-tröge.txt \
4191 -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 \
4192 -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 \
4193 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4194 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4196 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4198 # `resend' test, reusing $MBOX
4199 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4200 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4202 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4203 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4208 t_behave_iconv_mbyte_base64() {
4209 t_prolog t_behave_iconv_mbyte_base64
4210 TRAP_EXIT_ADDONS=".
/.t
*"
4212 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4213 (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4214 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4217 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4221 ${cat} <<-_EOT > ./.tsendmail.sh
4223 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4226 chmod 0755 ./.tsendmail.sh
4228 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4229 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4230 -Smta=./.tsendmail.sh \
4231 -Sescape=! -Smime-encoding=base64 2>./.terr
4232 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4234 !s Japanese from UTF-8 to ISO-2022-JP
4235 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4237 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4240 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4242 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4245 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4247 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4248 \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
4250 \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
4253 \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
4255 \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
4258 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4259 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4261 printf 'eval f 1; write ./.twrite\n' |
4262 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4263 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4264 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4266 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4269 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4270 rm -f "${MBOX}" ./.twrite
4271 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4272 -Smta=./.tsendmail.sh \
4273 -Sescape=! -Smime-encoding=base64 2>./.terr
4274 set ttycharset=utf-8 sendcharsets=euc-jp
4276 !s Japanese from UTF-8 to EUC-JP
4277 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4279 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4282 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4284 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4287 set ttycharset=EUC-JP sendcharsets=utf-8
4289 !s Japanese from EUC-JP to UTF-8
4290 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4292 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4295 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4297 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4300 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4301 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4303 printf 'eval f 1; write ./.twrite\n' |
4304 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4305 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4306 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4308 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4314 t_behave_iconv_mainbody
() {
4315 t_prolog t_behave_iconv_mainbody
4316 TRAP_EXIT_ADDONS
="./.t*"
4319 if have_feat
iconv &&
4320 (</dev
/null
iconv -f utf-8
-t ascii
) >/dev
/null
2>&1; then
4321 j
="`printf '–' | iconv -f utf-8 -t ascii 2>/dev/null`"
4322 # This assumes iconv(1) behaves like iconv(3), but well.
4323 # This is flaky because the behaviour is so non-uniform
4324 if [ ${?} -ne 0 ]; then
4325 if [ x
"${j}" = 'x?' ]; then
4330 elif [ x
"${j}" = 'x?' ]; then
4332 elif [ x
"${j}" = 'x*' ]; then
4336 if [ -z "${i}" ]; then
4337 echo 'behave:iconv_mainbody: unsupported, skipped'
4341 ${cat} <<-_EOT > ./.tsendmail.sh
4343 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4346 chmod 0755 .
/.tsendmail.sh
4348 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4349 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4350 -s '–' over-the@rain.bow
2>.
/.terr
4351 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4352 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4354 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4355 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4356 -s '–' over-the@rain.bow
2>.
/.terr
4357 exn0_test behave
:iconv_mainbody-3
4358 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4359 check behave
:iconv_mainbody-4
- .
/.terr
'1960148192 128'
4361 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4363 ex0_test behave:iconv_mainbody-5-0 ${j}
4364 if [ x${i} = x1 ]; then
4365 # yuck, just assume ???, we need a test program for that one!
4366 check behave:iconv_mainbody-5-1-1 - ./.tout '1959197095 283'
4367 check behave:iconv_mainbody-5-1-1 - ./.terr '4294967295 0'
4368 elif [ x${i} = x2 ]; then
4369 check behave:iconv_mainbody-5-2-1 - ./.tout '1959197095 283'
4370 check behave:iconv_mainbody-5-2-2 - ./.terr '4294967295 0'
4371 elif [ x${i} = x3 ]; then
4372 check behave:iconv_mainbody-5-3-1 - ./.tout '3196380198 279'
4373 check behave:iconv_mainbody-5-3-2 - ./.terr '4294967295 0'
4375 check behave:iconv_mainbody-5-4-1 - ./.tout '3760313827 279'
4376 check behave:iconv_mainbody-5-4-2 - ./.terr '4294967295 0'
4382 t_behave_q_t_etc_opts() {
4383 t_prolog t_behave_q_t_etc_opts
4384 TRAP_EXIT_ADDONS=".
/.t
*"
4386 # Three tests for MIME encoding and (a bit) content classification.
4387 # At the same time testing -q FILE, < FILE and -t FILE
4388 t__put_body > ./.tin
4391 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4392 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4393 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4396 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4397 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4398 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4401 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4403 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4404 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4410 have_feat smime || {
4411 echo 'behave:s/mime: unsupported, skipped'
4415 t_prolog t_behave_s_mime
4416 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4417 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4418 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4420 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4421 ${cat} <<-_EOT > ./.t.conf
4424 default_keyfile = keyfile.pem
4425 distinguished_name = req_distinguished_name
4426 attributes = req_attributes
4430 [ req_distinguished_name ]
4437 emailAddress = test@localhost
4442 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4443 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
4444 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4447 printf 'behave:s/mime:sign/verify: '
4448 echo bla | ${MAILX} ${ARGS} \
4449 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4450 -Ssmime-sign -Sfrom=test@localhost \
4451 -s 'S/MIME test' ./.VERIFY
4452 if [ $? -eq 0 ]; then
4463 /^Content-Description: /{ skip = 2; print; next }
4464 /^$/{ if(skip) --skip }
4467 < ./.VERIFY > "${MBOX}"
4468 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4470 printf 'behave:s/mime:sign/verify:verify '
4471 printf 'verify\nx\n' |
4473 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4474 -Ssmime-sign -Sfrom=test@localhost \
4476 -f ./.VERIFY >/dev/null 2>&1
4477 if [ $? -eq 0 ]; then
4486 printf 'behave:s/mime:sign/verify:disproof-1 '
4487 if openssl smime -verify -CAfile ./.tcert.pem \
4488 -in ./.VERIFY >/dev/null 2>&1; then
4497 # (signing +) encryption / decryption
4498 ${cat} <<-_EOT > ./.tsendmail.sh
4500 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4502 chmod 0755 ./.tsendmail.sh
4504 printf 'behave:s/mime:encrypt+sign: '
4507 -Ssmime-force-encryption \
4508 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4509 -Smta=./.tsendmail.sh \
4510 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4511 -Ssmime-sign -Sfrom=test@localhost \
4512 -s 'S/MIME test' recei@ver.com
4513 if [ $? -eq 0 ]; then
4517 printf 'error: encrypt+sign failed\n'
4520 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4521 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4523 printf 'behave:s/mime:decrypt+verify: '
4524 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4526 -Ssmime-force-encryption \
4527 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4528 -Smta=./.tsendmail.sh \
4529 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4530 -Ssmime-sign -Sfrom=test@localhost \
4532 -f ./.ENCRYPT >/dev/null 2>&1
4533 if [ $? -eq 0 ]; then
4542 /^Content-Description: /{ skip = 2; print; next }
4543 /^$/{ if(skip) --skip }
4546 < ./.DECRYPT > "${MBOX}"
4547 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4549 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4550 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4551 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
4558 printf "behave
:s
/mime
:encrypt
: "
4559 echo bla | ${MAILX} ${ARGS} \
4560 -Ssmime-force-encryption \
4561 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4562 -Smta=./.tsendmail.sh \
4563 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4564 -Sfrom=test@localhost \
4565 -s 'S/MIME test' recei@ver.com
4566 if [ $? -eq 0 ]; then
4573 # Same as behave:s/mime:encrypt+sign:checksum above
4574 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4575 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4578 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4579 -Ssmime-force-encryption \
4580 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4581 -Smta=./.tsendmail.sh \
4582 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4583 -Sfrom=test@localhost \
4585 -f ./.ENCRYPT >/dev/null 2>&1
4586 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4588 printf 'behave:s/mime:decrypt:disproof-1: '
4589 if openssl smime -decrypt -inkey ./.tkey.pem \
4590 -in ./.ENCRYPT >/dev/null 2>&1; then
4601 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4602 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4603 # Note we unfortunately need to place some statements without proper
4604 # indentation because of continuation problems
4605 # xxx Note: t_content() was the first test (series) written. Today many
4606 # xxx aspects are (better) covered by other tests above, some are not.
4607 # xxx At some future date and time, convert the last remains not covered
4608 # xxx elsewhere to a real t_behave_* test and drop t_content()
4612 # Test for [260e19d] (Juergen Daubert)
4614 echo body | ${MAILX} ${ARGS} "${MBOX}"
4615 check content
:004 0 "${MBOX}" '2917662811 98'
4617 # "Test for" [d6f316a] (Gavin Troy)
4619 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4620 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4621 check content:006 0 "${MBOX}" '2099098650 122'
4622 check content:006-1 - "${BODY}" '794542938 174'
4624 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4627 for(i = 0; i < 10000; ++i)
4629 #printf "\xF0\x90\x87\x90"
4630 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4631 check content
:007 0 "${MBOX}" '534262374 61816'
4637 # MIME encoding (QP) stress message subject
4638 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
4639 'adadaddsssssssddddddddddddddddddddd'\
4640 'ddddddddddddddddddddddddddddddddddd'\
4641 'ddddddddddddddddddddddddddddddddddd'\
4642 'dddddddddddddddddddd Hallelulja? Od'\
4643 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4644 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4645 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
4646 'fffffffffffffffffffffffffffffffffff'\
4647 'fffffffffffffffffffff ggggggggggggg'\
4648 'ggggggggggggggggggggggggggggggggggg'\
4649 'ggggggggggggggggggggggggggggggggggg'\
4650 'ggggggggggggggggggggggggggggggggggg'\
4655 # MIME encoding (QP) stress message body
4657 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4658 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4659 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4660 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4661 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4662 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4663 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4664 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4665 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4666 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4667 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4668 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4669 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4670 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4671 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4672 "auf den zeilen vorher.\r\n"\
4673 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4675 "Die letzte Zeile war nur ein Punkt.\r\n"\
4677 "Das waren deren zwei.\r\n"\
4679 "Die letzte Zeile war ein Leerschritt.\n"\
4680 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4683 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4685 "Das waren deren zwei. ditto.\n"\
4687 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4688 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4689 "auf den zeilen vorher.\n"\
4691 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4692 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4694 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4696 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4698 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4700 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4702 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4704 "QP am Zeilenende über soft-nl hinweg\n"\
4705 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4707 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4709 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4711 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4713 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
4715 "Die letzte Zeile war ein Leerschritt.\n"\
4720 # if have_feat devel; then
4721 # ARGS="${ARGS} -Smemdebug"
4725 if [ -n "${UTF8_LOCALE}" ]; then
4726 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
4728 printf 'No Unicode locale found, disabling Unicode tests\n'
4735 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
4737 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
4740 while [ ${#} -gt 0 ]; do
4746 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'