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'
668 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
669 wysh set mager='\hey\'
671 wysh set mager="\hey\\"
673 wysh set mager=$'\hey\\'
676 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
681 t_behave_input_inject_semicolon_seq() {
682 t_prolog t_behave_input_inject_semicolon_seq
684 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
689 echon this_is_mymac;call mydeepmac;echon ';';
691 echon one';';call mymac;echon two";";call mymac;echo three$';';
693 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
695 echon one';';call mymac;echon two";";call mymac;echo three$';';
698 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
703 t_behave_commandalias() {
704 t_prolog t_behave_commandalias
706 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
707 commandalias echo echo hoho
711 commandalias XxX XxXx
712 commandalias XxXx XxXxX
713 commandalias XxXxX XxXxXx
714 commandalias XxXxXx echo huhu
715 commandalias XxXxXxX echo huhu
717 commandalias XxXxXx XxXxXxX
720 commandalias XxXxXx echo huhu
724 check behave:commandalias 0 "${MBOX}" '3694143612 31'
730 t_prolog t_behave_ifelse
732 # Nestable conditions test
733 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
755 if $dietcurd == 'yoho'
760 if $dietcurd @== 'Yoho'
765 if $dietcurd == 'Yoho'
770 if $dietcurd != 'yoho'
775 if $dietcurd @!= 'Yoho'
780 if $dietcurd != 'Yoho'
841 if $dietcurd == 'yohu'
843 elif $dietcurd == 'yoha'
845 elif $dietcurd == 'yohe'
847 elif $dietcurd == 'yoho'
849 if $dietcurd == 'yohu'
851 elif $dietcurd == 'yoha'
853 elif $dietcurd == 'yohe'
855 elif $dietcurd == 'yoho'
857 if $dietcurd == 'yohu'
859 elif $dietcurd == 'yoha'
861 elif $dietcurd == 'yohe'
863 elif $dietcurd == 'yoho'
1012 set diet=abc curd=abc
1018 set diet=abc curd=abcd
1024 # 1. Shitty grouping capabilities as of today
1025 unset diet curd ndefined
1026 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1032 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1037 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1042 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1047 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1052 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1053 && [ no ] || [ yes ]
1058 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1063 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1068 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1073 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1078 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1083 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1088 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1093 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1098 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1103 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1109 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1115 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1120 # 2. Shitty grouping capabilities as of today
1121 unset diet curd ndefined
1122 if [ false || false || true ] && [ false || true ] && yes
1127 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1132 if [ 1 || 0 || 0 || 0 ]
1137 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1142 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1147 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1152 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1157 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1162 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1167 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1172 if 1 || 0 || 0 || 0 && 0
1177 if 1 || 0 || 0 || 0 && 1
1182 if 0 || 0 || 0 || 1 && 0
1187 if 0 || 0 || 0 || 1 && 1
1192 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1197 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1203 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1208 if $diet == 'yo' && $curd == 'ho' && $ndefined
1214 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1219 if $diet == 'yo' && $curd == 'ho' && $ndefined
1224 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1229 # Some more en-braced variables
1231 if ${diet} == ${curd}
1236 if ${diet} != ${curd}
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 ] ] ] ] ] && 3
1287 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1292 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
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 ] ] ] ] && 3
1333 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1338 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1345 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1347 if have_feat regex; then
1348 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1350 if $dietcurd =~ '^yo.*'
1355 if $dietcurd =~ '^Yo.*'
1360 if $dietcurd @=~ '^Yo.*'
1365 if $dietcurd =~ '^yOho.+'
1370 if $dietcurd @!~ '.*Ho$'
1375 if $dietcurd !~ '.+yohO$'
1380 if [ $dietcurd @i!~ '.+yoho$' ]
1385 if ! [ $dietcurd @i=~ '.+yoho$' ]
1390 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1395 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1400 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1405 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1410 if ! ! ! $dietcurd !~ '.+yoho$'
1415 if ! ! ! $dietcurd =~ '.+yoho$'
1420 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1425 set diet=abc curd='^abc$'
1431 set diet=abc curd='^abcd$'
1439 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1441 printf 'behave:if-regex: unsupported, skipped\n'
1447 t_behave_localopts() {
1448 t_prolog t_behave_localopts
1450 # Nestable conditions test
1451 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1466 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1471 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1472 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1481 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1483 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1492 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1499 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1506 echo ----- $1: $2 -> $3 -> $4
1514 call llx
'call off' on on on
1515 call llx
'call off' off on on
1516 call llx
'call off' on off on
1517 call llx
'call off' on off off
1518 localopts call-fixate on
1519 call llx
'call-fixate on' on on on
1520 call llx
'call-fixate on' off on on
1521 call llx
'call-fixate on' on off on
1522 call llx
'call-fixate on' on off off
1523 unset x
;localopts call on
1524 call llx
'call on' on on on
1525 call llx
'call on' off on on
1526 call llx
'call on' on off on
1527 call llx
'call on' on off off
1532 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1538 t_prolog t_behave_local
1540 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1568 echo ------- global-1 du=$du
1570 echo ------- global-2 du=$du
1573 echo ------- global-3 du=$du
1575 echo ------- global-4 du=$du
1577 echo ------- global-5 du=$du
1580 check behave:local-1 0 "${MBOX}" '2411598140 641'
1585 t_behave_macro_param_shift() {
1586 t_prolog t_behave_macro_param_shift
1588 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1591 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1596 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1597 if [ $# > 1 ] ||
[ $ignerr == '' ]
1602 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1604 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1608 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1613 call t2
1 you get four args
1614 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1615 call t2
1 you get
'three args'
1616 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1617 call t2
1 you
'get two args'
1618 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1619 call t2
1 'you get one arg'
1620 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1621 ignerr call t2
'' 'you get one arg'
1622 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1627 check behave
:macro_param_shift
0 "${MBOX}" '1402489146 1682'
1632 t_behave_addrcodec
() {
1633 t_prolog t_behave_addrcodec
1635 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1636 vput addrcodec res e 1 <doog@def>
1637 echo $?/$^ERRNAME $res
1638 eval vput addrcodec res d $res
1639 echo $?/$^ERRNAME $res
1640 vput addrcodec res e 2 . <doog@def>
1641 echo $?/$^ERRNAME $res
1642 eval vput addrcodec res d $res
1643 echo $?/$^ERRNAME $res
1644 vput addrcodec res e 3 Sauer Dr. <doog@def>
1645 echo $?/$^ERRNAME $res
1646 eval vput addrcodec res d $res
1647 echo $?/$^ERRNAME $res
1648 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1649 echo $?/$^ERRNAME $res
1650 eval vput addrcodec res d $res
1651 echo $?/$^ERRNAME $res
1652 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1653 echo $?/$^ERRNAME $res
1654 eval vput addrcodec res d $res
1655 echo $?/$^ERRNAME $res
1657 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1658 echo $?/$^ERRNAME $res
1659 eval vput addrcodec res d $res
1660 echo $?/$^ERRNAME $res
1661 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1662 echo $?/$^ERRNAME $res
1663 eval vput addrcodec res d $res
1664 echo $?/$^ERRNAME $res
1665 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1666 echo $?/$^ERRNAME $res
1667 eval vput addrcodec res d $res
1668 echo $?/$^ERRNAME $res
1669 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1670 echo $?/$^ERRNAME $res
1671 eval vput addrcodec res d $res
1672 echo $?/$^ERRNAME $res
1673 vput addrcodec res +e 8 \
1674 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1675 echo $?/$^ERRNAME $res
1676 eval vput addrcodec res d $res
1677 echo $?/$^ERRNAME $res
1678 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1679 echo $?/$^ERRNAME $res
1680 eval vput addrcodec res d $res
1681 echo $?/$^ERRNAME $res
1682 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1683 echo $?/$^ERRNAME $res
1684 eval vput addrcodec res d $res
1685 echo $?/$^ERRNAME $res
1686 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1687 echo $?/$^ERRNAME $res
1688 eval vput addrcodec res d $res
1689 echo $?/$^ERRNAME $res
1690 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1691 echo $?/$^ERRNAME $res
1692 eval vput addrcodec res d $res
1693 echo $?/$^ERRNAME $res
1694 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1695 echo $?/$^ERRNAME $res
1696 eval vput addrcodec res d $res
1697 echo $?/$^ERRNAME $res
1698 vput addrcodec res +e 14 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 15 \
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 16 \
1708 "Hey
," "Du
" <doog@def> "Wie
()" findet "" Dr. "" das? ()
1709 echo $?/$^ERRNAME $res
1710 eval vput addrcodec res d $res
1711 echo $?/$^ERRNAME $res
1712 vput addrcodec res +e 17 \
1713 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1714 echo $?/$^ERRNAME $res
1715 eval vput addrcodec res d $res
1716 echo $?/$^ERRNAME $res
1717 vput addrcodec res +e 18 \
1718 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1719 echo $?/$^ERRNAME $res
1720 eval vput addrcodec res d $res
1721 echo $?/$^ERRNAME $res
1722 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1723 echo $?/$^ERRNAME $res
1724 eval vput addrcodec res d $res
1725 echo $?/$^ERRNAME $res
1727 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1728 echo $?/$^ERRNAME $res
1729 vput addrcodec res ++e 21 Hey\,\"" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1730 echo $?
/$^ERRNAME
$res
1731 eval vput addrcodec res d
$res
1732 echo $?
/$^ERRNAME
$res
1734 vput addrcodec res
+++e
22 Hey
\\,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1735 echo $?
/$^ERRNAME
$res
1736 eval vput addrcodec res d
$res
1737 echo $?
/$^ERRNAME
$res
1739 vput addrcodec res s \
1740 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1741 echo $?
/$^ERRNAME
$res
1743 # Fix for [f3852f88]
1744 vput addrcodec res
++e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1745 echo $?
/$^ERRNAME
$res
1746 eval vput addrcodec res d
$res
1747 echo $?
/$^ERRNAME
$res
1748 vput addrcodec res e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1749 echo $?
/$^ERRNAME
$res
1750 eval vput addrcodec res d
$res
1751 echo $?
/$^ERRNAME
$res
1754 check behave
:addrcodec-1
0 "${MBOX}" '1047317989 2612'
1756 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1758 mlsubscribe isa2@list
1760 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1761 echo $?/$^ERRNAME $res
1762 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1763 echo $?/$^ERRNAME $res
1764 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1765 echo $?/$^ERRNAME $res
1766 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1767 echo $?/$^ERRNAME $res
1768 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1769 echo $?/$^ERRNAME $res
1770 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1771 echo $?/$^ERRNAME $res
1774 check behave:addrcodec-2 0 "${MBOX}" '1391779299 104'
1780 t_prolog t_behave_vexpr
1782 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1783 vput vexpr res
= 9223372036854775807
1784 echo $?
/$^ERRNAME
$res
1785 vput vexpr res
= 9223372036854775808
1786 echo $?
/$^ERRNAME
$res
1787 vput vexpr res
=@
9223372036854775808
1788 echo $?
/$^ERRNAME
$res
1789 vput vexpr res
= -9223372036854775808
1790 echo $?
/$^ERRNAME
$res
1791 vput vexpr res
= -9223372036854775809
1792 echo $?
/$^ERRNAME
$res
1793 vput vexpr res
=@
-9223372036854775809
1794 echo $?
/$^ERRNAME
$res
1797 echo $?
/$^ERRNAME
$res
1799 echo $?
/$^ERRNAME
$res
1801 echo $?
/$^ERRNAME
$res
1803 vput vexpr res
+ 0 0
1804 echo $?
/$^ERRNAME
$res
1805 vput vexpr res
+ 0 1
1806 echo $?
/$^ERRNAME
$res
1807 vput vexpr res
+ 1 1
1808 echo $?
/$^ERRNAME
$res
1810 vput vexpr res
+ 9223372036854775807 0
1811 echo $?
/$^ERRNAME
$res
1812 vput vexpr res
+ 9223372036854775807 1
1813 echo $?
/$^ERRNAME
$res
1814 vput vexpr res
+@
9223372036854775807 1
1815 echo $?
/$^ERRNAME
$res
1816 vput vexpr res
+ 0 9223372036854775807
1817 echo $?
/$^ERRNAME
$res
1818 vput vexpr res
+ 1 9223372036854775807
1819 echo $?
/$^ERRNAME
$res
1820 vput vexpr res
+@
1 9223372036854775807
1821 echo $?
/$^ERRNAME
$res
1823 vput vexpr res
+ -9223372036854775808 0
1824 echo $?
/$^ERRNAME
$res
1825 vput vexpr res
+ -9223372036854775808 -1
1826 echo $?
/$^ERRNAME
$res
1827 vput vexpr res
+@
-9223372036854775808 -1
1828 echo $?
/$^ERRNAME
$res
1829 vput vexpr res
+ 0 -9223372036854775808
1830 echo $?
/$^ERRNAME
$res
1831 vput vexpr res
+ -1 -9223372036854775808
1832 echo $?
/$^ERRNAME
$res
1833 vput vexpr res
+@
-1 -9223372036854775808
1834 echo $?
/$^ERRNAME
$res
1836 vput vexpr res
- 0 0
1837 echo $?
/$^ERRNAME
$res
1838 vput vexpr res
- 0 1
1839 echo $?
/$^ERRNAME
$res
1840 vput vexpr res
- 1 1
1841 echo $?
/$^ERRNAME
$res
1843 vput vexpr res
- 9223372036854775807 0
1844 echo $?
/$^ERRNAME
$res
1845 vput vexpr res
- 9223372036854775807 -1
1846 echo $?
/$^ERRNAME
$res
1847 vput vexpr res
-@
9223372036854775807 -1
1848 echo $?
/$^ERRNAME
$res
1849 vput vexpr res
- 0 9223372036854775807
1850 echo $?
/$^ERRNAME
$res
1851 vput vexpr res
- -1 9223372036854775807
1852 echo $?
/$^ERRNAME
$res
1853 vput vexpr res
- -2 9223372036854775807
1854 echo $?
/$^ERRNAME
$res
1855 vput vexpr res
-@
-2 9223372036854775807
1856 echo $?
/$^ERRNAME
$res
1858 vput vexpr res
- -9223372036854775808 +0
1859 echo $?
/$^ERRNAME
$res
1860 vput vexpr res
- -9223372036854775808 +1
1861 echo $?
/$^ERRNAME
$res
1862 vput vexpr res
-@
-9223372036854775808 +1
1863 echo $?
/$^ERRNAME
$res
1864 vput vexpr res
- 0 -9223372036854775808
1865 echo $?
/$^ERRNAME
$res
1866 vput vexpr res
- +1 -9223372036854775808
1867 echo $?
/$^ERRNAME
$res
1868 vput vexpr res
-@
+1 -9223372036854775808
1869 echo $?
/$^ERRNAME
$res
1871 vput vexpr res
+ -13 -2
1872 echo $?
/$^ERRNAME
$res
1873 vput vexpr res
- 0 0
1874 echo $?
/$^ERRNAME
$res
1875 vput vexpr res
- 0 1
1876 echo $?
/$^ERRNAME
$res
1877 vput vexpr res
- 1 1
1878 echo $?
/$^ERRNAME
$res
1879 vput vexpr res
- -13 -2
1880 echo $?
/$^ERRNAME
$res
1882 vput vexpr res
* 0 0
1883 echo $?
/$^ERRNAME
$res
1884 vput vexpr res
* 0 1
1885 echo $?
/$^ERRNAME
$res
1886 vput vexpr res
* 1 1
1887 echo $?
/$^ERRNAME
$res
1888 vput vexpr res
* -13 -2
1889 echo $?
/$^ERRNAME
$res
1891 vput vexpr res
/ 0 0
1892 echo $?
/$^ERRNAME
$res
1893 vput vexpr res
/ 0 1
1894 echo $?
/$^ERRNAME
$res
1895 vput vexpr res
/ 1 1
1896 echo $?
/$^ERRNAME
$res
1897 vput vexpr res
/ -13 -2
1898 echo $?
/$^ERRNAME
$res
1900 vput vexpr res
% 0 0
1901 echo $?
/$^ERRNAME
$res
1902 vput vexpr res
% 0 1
1903 echo $?
/$^ERRNAME
$res
1904 vput vexpr res
% 1 1
1905 echo $?
/$^ERRNAME
$res
1906 vput vexpr res
% -13 -2
1907 echo $?
/$^ERRNAME
$res
1910 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1912 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1913 vput vexpr res find 'bananarama' 'nana'
1914 echo $?/$^ERRNAME :$res:
1915 vput vexpr res find 'bananarama' 'bana'
1916 echo $?/$^ERRNAME :$res:
1917 vput vexpr res find 'bananarama' 'Bana'
1918 echo $?/$^ERRNAME :$res:
1919 vput vexpr res find 'bananarama' 'rama'
1920 echo $?/$^ERRNAME :$res:
1922 vput vexpr res ifind 'bananarama' 'nana'
1923 echo $?/$^ERRNAME :$res:
1924 vput vexpr res ifind 'bananarama' 'bana'
1925 echo $?/$^ERRNAME :$res:
1926 vput vexpr res ifind 'bananarama' 'Bana'
1927 echo $?/$^ERRNAME :$res:
1928 vput vexpr res ifind 'bananarama' 'rama'
1929 echo $?/$^ERRNAME :$res:
1931 vput vexpr res substring 'bananarama' 1
1932 echo $?/$^ERRNAME :$res:
1933 vput vexpr res substring 'bananarama' 3
1934 echo $?/$^ERRNAME :$res:
1935 vput vexpr res substring 'bananarama' 5
1936 echo $?/$^ERRNAME :$res:
1937 vput vexpr res substring 'bananarama' 7
1938 echo $?/$^ERRNAME :$res:
1939 vput vexpr res substring 'bananarama' 9
1940 echo $?/$^ERRNAME :$res:
1941 vput vexpr res substring 'bananarama' 10
1942 echo $?/$^ERRNAME :$res:
1943 vput vexpr res substring 'bananarama' 1 3
1944 echo $?/$^ERRNAME :$res:
1945 vput vexpr res substring 'bananarama' 3 3
1946 echo $?/$^ERRNAME :$res:
1947 vput vexpr res substring 'bananarama' 5 3
1948 echo $?/$^ERRNAME :$res:
1949 vput vexpr res substring 'bananarama' 7 3
1950 echo $?/$^ERRNAME :$res:
1951 vput vexpr res substring 'bananarama' 9 3
1952 echo $?/$^ERRNAME :$res:
1953 vput vexpr res substring 'bananarama' 10 3
1954 echo $?/$^ERRNAME :$res:
1956 vput vexpr res substring 'bananarama' -1
1957 echo $?/$^ERRNAME :$res:
1958 vput vexpr res substring 'bananarama' -3
1959 echo $?/$^ERRNAME :$res:
1960 vput vexpr res substring 'bananarama' -5
1961 echo $?/$^ERRNAME :$res:
1962 vput vexpr res substring 'bananarama' -7
1963 echo $?/$^ERRNAME :$res:
1964 vput vexpr res substring 'bananarama' -9
1965 echo $?/$^ERRNAME :$res:
1966 vput vexpr res substring 'bananarama' -10
1967 echo $?/$^ERRNAME :$res:
1968 vput vexpr res substring 'bananarama' 1 -3
1969 echo $?/$^ERRNAME :$res:
1970 vput vexpr res substring 'bananarama' 3 -3
1971 echo $?/$^ERRNAME :$res:
1972 vput vexpr res substring 'bananarama' 5 -3
1973 echo $?/$^ERRNAME :$res:
1974 vput vexpr res substring 'bananarama' 7 -3
1975 echo $?/$^ERRNAME :$res:
1976 vput vexpr res substring 'bananarama' 9 -3
1977 echo $?/$^ERRNAME :$res:
1978 vput vexpr res substring 'bananarama' 10 -3
1979 echo $?/$^ERRNAME :$res:
1981 vput vexpr res trim 'Cocoon Cocoon'
1982 echo $?/$^ERRNAME :$res:
1983 vput vexpr res trim ' Cocoon Cocoon '
1984 echo $?/$^ERRNAME :$res:
1985 vput vexpr res trim-front 'Cocoon Cocoon'
1986 echo $?/$^ERRNAME :$res:
1987 vput vexpr res trim-front ' Cocoon Cocoon '
1988 echo $?/$^ERRNAME :$res:
1989 vput vexpr res trim-end 'Cocoon Cocoon'
1990 echo $?/$^ERRNAME :$res:
1991 vput vexpr res trim-end ' Cocoon Cocoon '
1992 echo $?/$^ERRNAME :$res:
1995 check behave:vexpr-string 0 "${MBOX}" '3182004322 601'
1997 if have_feat regex; then
1998 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1999 vput vexpr res regex
'bananarama' 'nana'
2000 echo $?
/$^ERRNAME
:$res:
2001 vput vexpr res regex
'bananarama' 'bana'
2002 echo $?
/$^ERRNAME
:$res:
2003 vput vexpr res regex
'bananarama' 'Bana'
2004 echo $?
/$^ERRNAME
:$res:
2005 vput vexpr res regex
'bananarama' 'rama'
2006 echo $?
/$^ERRNAME
:$res:
2008 vput vexpr res iregex
'bananarama' 'nana'
2009 echo $?
/$^ERRNAME
:$res:
2010 vput vexpr res iregex
'bananarama' 'bana'
2011 echo $?
/$^ERRNAME
:$res:
2012 vput vexpr res iregex
'bananarama' 'Bana'
2013 echo $?
/$^ERRNAME
:$res:
2014 vput vexpr res iregex
'bananarama' 'rama'
2015 echo $?
/$^ERRNAME
:$res:
2017 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2018 echo $?
/$^ERRNAME
:$res:
2019 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2020 echo $?
/$^ERRNAME
:$res:
2021 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2022 echo $?
/$^ERRNAME
:$res:
2023 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2024 echo $?
/$^ERRNAME
:$res:
2026 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2027 echo $?
/$^ERRNAME
:$res:
2028 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2029 echo $?
/$^ERRNAME
:$res:
2030 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2031 echo $?
/$^ERRNAME
:$res:
2032 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2033 echo $?
/$^ERRNAME
:$res:
2037 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
2039 printf 'behave:vexpr-regex: unsupported, skipped\n'
2045 t_behave_call_ret
() {
2046 t_prolog t_behave_call_ret
2048 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2053 vput vexpr j '&' $i 7
2059 vput vexpr j '&' $i 7
2065 echo ! The end for $1
2069 # Transport $?/$! up the call chain
2075 wysh set i=$? j=$! k=$^ERRNAME
2079 echo ! The end for $1
2080 return $i $^ERR-BUSY
2084 # Up and down it goes
2091 vput vexpr k - $1 $2
2095 echo "# <$i/$j> .. "
2099 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2102 echo ! The end
for $1=$i/$2
2106 return $i $^ERR-BUSY
2112 call w1
0; echo ?
=$?
!=$
!; echo -----;
2113 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2114 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2117 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2123 t_prolog t_behave_xcall
2125 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2130 vput vexpr j '&' $i 7
2136 echo ! The end for $1/$2
2138 return $i $^ERR-BUSY
2149 echo ?=$? !=$^ERRNAME
2152 echo ?=$? !=$^ERRNAME
2154 echo ?=$? !=$^ERRNAME
2157 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2161 ${cat} <<- '__EOT' > "${BODY}"
2166 vput vexpr j '&' $i 7
2172 echo ! The end for $1
2175 echo would be err with errexit
2184 echo zwei, ?=$? !=$!
2185 localopts yes; set errexit
2187 echo drei, ?=$? !=$^ERRNAME
2189 echo vier, ?=$? !=$^ERRNAME, this is an error
2192 echo outer 1, ?=$? !=$^ERRNAME
2194 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2196 echo outer 3, ?=$? !=$^ERRNAME
2197 echo this is definitely an error
2200 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2202 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2204 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2206 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2211 t_behave_vpospar() {
2212 t_prolog t_behave_vpospar
2214 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2215 vpospar
set hey
, "'you ", world
!
2216 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2217 vput vpospar x quote
; echo x
<$x>
2218 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2219 vput vpospar y quote
;echo y
<$y>
2220 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2221 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2222 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2225 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2226 vput vpospar z quote
;echo infun2
:z
<$z>
2230 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2231 vput vpospar y quote
;echo infun
:y
<$y>
2232 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2233 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2235 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2236 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2239 call infun This
"in a" fun
2240 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2241 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2243 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2246 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2248 echo ifs<$ifs> ifs-ws<$ifs-ws>
2249 vpospar set hey, "'you ", world!
2250 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2251 vput vpospar x quote; echo x<$x>
2252 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2253 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2256 echo ifs<$ifs> ifs-ws<$ifs-ws>
2257 vpospar set hey, "'you
", world!
2258 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2260 vput vpospar x quote; echo x<$x>
2261 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2262 eval vpospar set ${x};\
2263 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2266 echo ifs<$ifs> ifs-ws<$ifs-ws>
2267 vpospar set hey, "'you ", world!
2268 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2270 vput vpospar x quote; echo x<$x>
2271 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2272 eval vpospar set ${x};\
2273 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2275 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2280 t_behave_atxplode() {
2281 t_prolog t_behave_atxplode
2282 TRAP_EXIT_ADDONS="./.t*"
2284 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2287 printf " (1/$#: <$1>)"
2289 if [ $# -gt 0 ]; then
2303 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2304 printf xxx;xxx arg ,b u.
2305 printf xxx;xxx arg , .
2306 printf xxx;xxx arg ,ball.
2312 echon " (1/$#: <$1>)"
2327 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2328 echon xxx;call xxx arg ,b u.
2329 echon xxx;call xxx arg , .
2330 echon xxx;call xxx arg ,ball.
2333 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2334 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2336 #${SHELL} ./.t.sh > ./.tshout 2>&1
2337 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2343 t_prolog t_behave_read
2344 TRAP_EXIT_ADDONS="./.t*"
2346 ${cat} <<- '__EOT
' > .tin
2347 hey1, "'you
", world!
2348 hey2, "'you ", bugs bunny!
2353 ${cat} <<- '__EOT
' |\
2354 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2356 echo $?/$^ERRNAME / <$a><$b><$c>
2358 echo $?/$^ERRNAME / <$a><$b><$c>
2360 echo $?/$^ERRNAME / <$a><$b><$c>
2362 echo $?/$^ERRNAME / <$a><$b><$c>
2363 unset a b c;read a b c
2364 echo $?/$^ERRNAME / <$a><$b><$c>
2365 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2367 check behave:read-1 0 "${MBOX}" '1527910147 173'
2369 ${cat} <<- '__EOT
' > .tin2
2370 hey2.0,:"'you
",:world!:mars.:
2371 hey2.1,:"'you ",:world!
2372 hey2.2,:"'you
",:bugs bunny!
2378 ${cat} <<- '__EOT' |\
2379 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2382 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2384 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2386 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2388 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2390 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2392 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2393 unset a b c
;read a b c
2394 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2396 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2397 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2399 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2401 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2403 readall d; echo $?/$^ERRNAME / <$d>
2404 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2405 readctl create .tin2
2406 readall d; echo $?/$^ERRNAME / <$d>
2407 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2408 readctl remove .tin;echo $?/$^ERRNAME;\
2409 readctl remove .tin2;echo $?/$^ERRNAME
2411 check behave:readall 0 "${MBOX}" '860434889 333'
2417 t_prolog t_behave_mbox
2418 TRAP_EXIT_ADDONS=".
/.t
*"
2422 while [ ${i} -lt 112 ]; do
2423 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2424 "${MBOX}" "${i}" "${i}"
2427 ) | ${MAILX} ${ARGS}
2428 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2430 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2431 ${MAILX} ${ARGS} > .tlst
2432 check behave:mbox-2 0 .tlst '2739893312 9103'
2434 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2435 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} > .tlst
2436 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2438 # only the odd (even)
2440 printf 'File "file://%s"\ncopy ' .tmbox2
2442 while [ ${i} -lt 112 ]; do
2444 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2447 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2448 ) |
${MAILX} ${ARGS} > .tlst
2449 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2450 check behave
:mbox-5
- .tlst
'2960975049 4573'
2453 printf 'file "file://%s"\nmove ' .tmbox2
2455 while [ ${i} -lt 112 ]; do
2457 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2460 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2461 .tmbox3 .tmbox3 .tmbox2
2462 ) | ${MAILX} ${ARGS} > .tlst
2463 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2464 ${sed} 2d < .tlst > .tlstx
2465 check behave:mbox-7 - .tlstx '2729940494 13645'
2470 t_behave_maildir() {
2471 t_prolog t_behave_maildir
2472 TRAP_EXIT_ADDONS=".
/.t
*"
2476 while [ ${i} -lt 112 ]; do
2477 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2478 "${MBOX}" "${i}" "${i}"
2481 ) | ${MAILX} ${ARGS}
2482 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2488 ' "${MBOX}" .tmdir1 .tmdir1 |
2489 ${MAILX} ${ARGS} -Snewfolders=maildir > .tlst
2490 check behave:maildir-2 0 .tlst '1797938753 9103'
2493 copy * "maildir
://%s
"
2496 ' "${MBOX}" .tmdir2 .tmdir2 |
2497 ${MAILX} ${ARGS} > .tlst
2498 check behave:maildir-3 0 .tlst '1155631089 9113'
2500 printf 'File "maildir
://%s
"
2504 ' .tmdir2 .tmbox1 .tmbox1 |
2505 ${MAILX} ${ARGS} > .tlst
2506 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2507 check behave:maildir-5 - .tlst '3701297796 9110'
2509 # only the odd (even)
2511 printf 'File "maildir
://%s
"
2514 while [ ${i} -lt 112 ]; do
2516 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2523 ) | ${MAILX} ${ARGS} > .tlst
2524 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2525 check behave:maildir-7 - .tlst '960096773 4573'
2528 printf 'file "maildir
://%s
"
2531 while [ ${i} -lt 112 ]; do
2533 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2541 ' .tmbox2 .tmbox2 .tmdir2
2542 ) |
${MAILX} ${ARGS} > .tlst
2543 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2544 ${sed} 2d
< .tlst
> .tlstx
2545 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2550 t_behave_record_a_resend
() {
2551 t_prolog t_behave_record_a_resend
2552 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2556 m %s\n~s Subject 1.\nHello.\n~.
2557 set record-files add-file-recipients
2558 m %s\n~s Subject 2.\nHello.\n~.
2560 resend 2 ./.t.resent
2561 Resend 1 ./.t.resent
2563 resend 2 ./.t.resent
2564 Resend 1 ./.t.resent
2565 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2568 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2569 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2570 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2575 t_behave_e_H_L_opts
() {
2576 t_prolog t_behave_e_H_L_opts
2577 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2580 ${MAILX} ${ARGS} -ef .
/.t.mbox
2581 echo ${?} > "${MBOX}"
2583 ${cat} <<-_EOT > ./.tsendmail.sh
2585 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2588 chmod 0755 .
/.tsendmail.sh
2589 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2590 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2591 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2592 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2594 ${MAILX} ${ARGS} -ef .
/.t.mbox
2595 echo ${?} >> "${MBOX}"
2596 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2597 echo ${?} >> "${MBOX}"
2598 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2599 echo ${?} >> "${MBOX}"
2600 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2601 echo ${?} >> "${MBOX}"
2602 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2603 echo ${?} >> "${MBOX}"
2604 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2605 echo ${?} >> "${MBOX}"
2606 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2607 echo ${?} >> "${MBOX}"
2609 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2610 echo ${?} >> "${MBOX}"
2611 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2612 echo ${?} >> "${MBOX}"
2613 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2614 echo ${?} >> "${MBOX}"
2615 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2616 echo ${?} >> "${MBOX}"
2617 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2618 echo ${?} >> "${MBOX}"
2619 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2620 echo ${?} >> "${MBOX}"
2621 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2622 echo ${?} >> "${MBOX}"
2624 check behave:e_H_L_opts - "${MBOX}" '1708955574 678'
2629 t_behave_alternates() {
2630 t_prolog t_behave_alternates
2631 TRAP_EXIT_ADDONS=".
/.t
*"
2633 ${cat} <<-_EOT > ./.tsendmail.sh
2635 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2638 chmod 0755 ./.tsendmail.sh
2640 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2644 alternates a1@b1 a2@b2 a3@b3
2649 echo $?/$^ERRNAME <$rv>
2654 echo $?/$^ERRNAME <$rv>
2657 echo $?/$^ERRNAME <$rv>
2660 echo $?/$^ERRNAME <$rv>
2664 alternates a1@b1 a2@b2 a3@b3
2667 echo $?/$^ERRNAME <$rv>
2670 echo $?/$^ERRNAME <$rv>
2673 echo $?/$^ERRNAME <$rv>
2676 alternates a1@b1 a2@b2 a3@b3
2679 echo $?/$^ERRNAME <$rv>
2682 echo $?/$^ERRNAME <$rv>
2685 echo $?/$^ERRNAME <$rv>
2689 alternates a1@b1 a2@b2 a3@b3
2692 echo $?/$^ERRNAME <$rv>
2696 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2698 ~s all alternates, only a1@b1 remains
2700 ~b a3@b3 a3@c3 a3@d3
2709 alternates a1@b1 a1@c1 a2@b2 a3@b3
2711 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2713 ~b a3@b3 a3@c3 a3@d3
2720 alternates a1@b1 a2@b2 a3; set allnet
2722 ~s all alternates via allnet, only a1@b1 remains
2724 ~b a3@b3 a3@c3 a3@d3
2735 echo $?/$^ERRNAME <$rv>
2739 echo $?/$^ERRNAME <$rv>
2743 echo $?/$^ERRNAME <$rv>
2747 echo $?/$^ERRNAME <$rv>
2751 echo $?/$^ERRNAME <$rv>
2755 alternates a1@b1 a2@b2
2758 echo $?/$^ERRNAME <$rv>
2759 alternates a3@b3 a4@b4
2762 echo $?/$^ERRNAME <$rv>
2764 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2765 check behave:alternates-2 - .tall '1878598364 505'
2771 t_prolog t_behave_alias
2772 TRAP_EXIT_ADDONS=".
/.t
*"
2774 ${cat} <<-_EOT > ./.tsendmail.sh
2776 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2779 chmod 0755 ./.tsendmail.sh
2781 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2783 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2785 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2787 alias a4 a5 ex1@a4.ple
2789 alias a6 a7 ex1@a6.ple
2803 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2804 check behave:alias-2 - .tall '3548953204 152'
2806 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2807 # TODO need to somehow provide its contents to the test, then test
2812 t_behave_filetype() {
2813 t_prolog t_behave_filetype
2814 TRAP_EXIT_ADDONS=".
/.t
*"
2816 ${cat} <<-_EOT > ./.tsendmail.sh
2818 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2821 chmod 0755 ./.tsendmail.sh
2823 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2824 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2825 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2827 if (echo |
gzip -c) >/dev
/null
2>&1; then
2830 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2831 "${MBOX}" | ${MAILX} ${ARGS} \
2832 -X'filetype gz gzip\ -dc gzip\ -c'
2833 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2834 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2836 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2837 check behave:filetype-3 - ".
/.t.out
" '2392348396 102'
2839 echo 'behave:filetype-2: unsupported, skipped'
2840 echo 'behave:filetype-3: unsupported, skipped'
2845 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2851 -X'filetype gz gzip\ -dc gzip\ -c' \
2852 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2853 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2854 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2856 -X'filetype gz gzip\ -dc gzip\ -c' \
2857 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2859 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2860 check behave:filetype-5 - ".
/.t.out
" '852335377 172'
2865 t_behave_message_injections() {
2866 t_prolog t_behave_message_injections
2867 TRAP_EXIT_ADDONS=".
/.t
*"
2869 ${cat} <<-_EOT > ./.tsendmail.sh
2871 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
2874 chmod 0755 ./.tsendmail.sh
2876 echo mysig > ./.tmysig
2878 echo some-body | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
2879 -Smessage-inject-head=head-inject \
2880 -Smessage-inject-tail=tail-inject \
2881 -Ssignature=./.tmysig \
2882 ex@am.ple > ./.tall 2>&1
2883 check behave:message_injections-1 0 "${MBOX}" '2434746382 134'
2884 check behave:message_injections-2 - .tall '4294967295 0' # empty file
2886 ${cat} <<-_EOT > ./.template
2890 Subject: This subject is
2892 Body, body, body me.
2894 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tsendmail.sh \
2895 -Smessage-inject-head=head-inject \
2896 -Smessage-inject-tail=tail-inject \
2897 -Ssignature=./.tmysig \
2899 check behave:message_injections-3 0 "${MBOX}" '3114203412 198'
2900 check behave:message_injections-4 - .tall '4294967295 0' # empty file
2905 t_behave_compose_hooks() { # TODO monster
2906 t_prolog t_behave_compose_hooks
2907 TRAP_EXIT_ADDONS=".
/.t
*"
2909 (echo line one&&echo line two&&echo line three) > ./.treadctl
2910 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
2912 ${cat} <<-_EOT > ./.tsendmail.sh
2914 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2917 chmod 0755 ./.tsendmail.sh
2919 ${cat} <<'__EOT__' > ./.trc
2921 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
2924 vput vexpr es substr "$1" 0 1
2929 define read_mline_res {
2930 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2931 echo $len/$es/$^ERRNAME: $hl
2932 if [ $es -ne $^ERR-NONE ]
2933 xcall bail read_mline_res
2935 \xcall read_mline_res
2940 echo "~^header list
"; read hl; echo $hl;\
2941 call xerr "$hl" "in_addr
($xh) 0-1"
2943 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2944 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
2945 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2946 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
2947 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2948 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
2949 echo "~^header list
$xh"; read hl; echo $hl;\
2950 call xerr "$hl" "ins_addr
$xh 1-4"
2951 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
2954 if [ "$t_remove" == "" ]
2958 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
2959 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
2961 xcall bail "ins_addr
$xh 2-2"
2963 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
2965 xcall bail "ins_addr
$xh 2-3"
2967 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
2969 xcall bail "ins_addr
$xh 2-4"
2973 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
2974 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
2975 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
2976 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
2977 echo "~^header insert
$xh ${xh}3@exam.ple
";\
2978 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
2979 echo "~^header list
$xh"; read hl; echo $hl;\
2980 call xerr "$hl" "ins_addr
$xh 3-4"
2981 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
2984 echo "~^header remove-at
$xh 1"; read es;\
2985 call xerr $es "ins_addr
$xh 3-6"
2986 echo "~^header remove-at
$xh 1"; read es;\
2987 call xerr $es "ins_addr
$xh 3-7"
2988 echo "~^header remove-at
$xh 1"; read es;\
2989 call xerr $es "ins_addr
$xh 3-8"
2990 echo "~^header remove-at
$xh 1"; read es;\
2991 vput vexpr es substr $es 0 3
2993 xcall bail "ins_addr
$xh 3-9"
2995 echo "~^header remove-at
$xh T
"; read es;\
2996 vput vexpr es substr $es 0 3
2998 xcall bail "ins_addr
$xh 3-10"
3000 echo "~^header list
$xh"; read es;\
3001 vput vexpr es substr $es 0 3
3003 xcall bail "ins_addr
$xh 3-11"
3005 echo "~^header show
$xh"; read es;\
3006 vput vexpr es substr $es 0 3
3008 xcall bail "ins_addr
$xh 3-12"
3012 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
3013 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
3014 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
3015 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
3016 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3017 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
3018 echo "~^header list
$xh"; read hl; echo $hl;\
3019 call xerr "$hl" "header list
$xh 3-4"
3020 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
3023 echo "~^header remove-at
$xh 3"; read es;\
3024 call xerr $es "ins_addr
$xh 4-6"
3025 echo "~^header remove-at
$xh 2"; read es;\
3026 call xerr $es "ins_addr
$xh 4-7"
3027 echo "~^header remove-at
$xh 1"; read es;\
3028 call xerr $es "ins_addr
$xh 4-8"
3029 echo "~^header remove-at
$xh 1"; read es;\
3030 vput vexpr es substr $es 0 3
3032 xcall bail "ins_addr
$xh 4-9"
3034 echo "~^header remove-at
$xh T
"; read es;\
3035 vput vexpr es substr $es 0 3
3037 xcall bail "ins_addr
$xh 4-10"
3039 echo "~^header list
$xh"; read es;\
3040 vput vexpr es substr $es 0 3
3042 xcall bail "ins_addr
$xh 4-11"
3044 echo "~^header show
$xh"; read es;\
3045 vput vexpr es substr $es 0 3
3047 xcall bail "ins_addr
$xh 4-12"
3051 wysh set xh=$1 mult=$2
3052 echo "~^header list
"; read hl; echo $hl;\
3053 call xerr "$hl" "ins_ref
($xh) 0-1"
3055 echo "~^header insert
$xh <$xh@exam.ple
>";\
3056 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
3058 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3059 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
3060 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3061 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
3063 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
3064 vput vexpr es substr $es 0 3
3066 xcall bail "ins_ref
$xh 1-4"
3070 echo "~^header list
$xh"; read hl; echo $hl;\
3071 call xerr "$hl" "ins_ref
$xh 1-5"
3072 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
3075 if [ "$t_remove" == "" ]
3079 echo "~^header remove
$xh"; read es;\
3080 call xerr $es "ins_ref
$xh 2-1"
3081 echo "~^header remove
$xh"; read es;\
3082 vput vexpr es substr $es 0 3
3084 xcall bail "ins_ref
$xh 2-2"
3086 echo "~^header list
$xh"; read es;\
3087 vput vexpr es substr $es 0 3
3089 xcall bail "$es ins_ref
$xh 2-3"
3091 echo "~^header show
$xh"; read es;\
3092 vput vexpr es substr $es 0 3
3094 xcall bail "ins_ref
$xh 2-4"
3098 echo "~^header insert
$xh <$xh@exam.ple
>";\
3099 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
3101 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
3102 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
3103 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3104 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
3106 echo "~^header list
$xh";\
3107 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
3108 echo "~^header show
$xh";\
3109 read es; call xerr $es "ins_ref
$xh 3-5"
3112 echo "~^header remove-at
$xh 1"; read es;\
3113 call xerr $es "ins_ref
$xh 3-6"
3114 if [ $mult -ne 0 ] && [ $xh != subject ]
3115 echo "~^header remove-at
$xh 1"; read es;\
3116 call xerr $es "ins_ref
$xh 3-7"
3117 echo "~^header remove-at
$xh 1"; read es;\
3118 call xerr $es "ins_ref
$xh 3-8"
3120 echo "~^header remove-at
$xh 1"; read es;\
3121 vput vexpr es substr $es 0 3
3123 xcall bail "ins_ref
$xh 3-9"
3125 echo "~^header remove-at
$xh T
"; read es;\
3126 vput vexpr es substr $es 0 3
3128 xcall bail "ins_ref
$xh 3-10"
3130 echo "~^header show
$xh"; read es;\
3131 vput vexpr es substr $es 0 3
3133 xcall bail "ins_ref
$xh 3-11"
3137 echo "~^header insert
$xh <$xh@exam.ple
> ";\
3138 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
3140 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
3141 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
3142 echo "~^header insert
$xh ${xh}3@exam.ple
";\
3143 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
3145 echo "~^header list
$xh"; read hl; echo $hl;\
3146 call xerr "$hl" "ins_ref
$xh 4-4"
3147 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
3150 if [ $mult -ne 0 ] && [ $xh != subject ]
3151 echo "~^header remove-at
$xh 3"; read es;\
3152 call xerr $es "ins_ref
$xh 4-6"
3153 echo "~^header remove-at
$xh 2"; read es;\
3154 call xerr $es "ins_ref
$xh 4-7"
3156 echo "~^header remove-at
$xh 1"; read es;\
3157 call xerr $es "ins_ref
$xh 4-8"
3158 echo "~^header remove-at
$xh 1"; read es;\
3159 vput vexpr es substr $es 0 3
3161 xcall bail "ins_ref
$xh 4-9"
3163 echo "~^header remove-at
$xh T
"; read es;\
3164 vput vexpr es substr $es 0 3
3166 xcall bail "ins_ref
$xh 4-10"
3168 echo "~^header show
$xh"; read es;\
3169 vput vexpr es substr $es 0 3
3171 xcall bail "ins_ref
$xh 4-11"
3176 # In collect.c order
3178 call ins_ref sender 0 # Not a "ref
", but works
3182 call ins_addr reply-To
3183 call ins_addr mail-Followup-to
3184 call ins_ref messAge-id 0
3185 call ins_ref rEfErEncEs 1
3186 call ins_ref in-Reply-to 1
3187 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
3188 call ins_addr freeForm1
3189 call ins_addr freeform2
3191 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
3193 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
3201 echo "~^attachment
";\
3202 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3204 xcall bail "attach
0-1"
3207 echo "~^attach attribute .
/.treadctl
";\
3208 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3210 xcall bail "attach
0-2"
3212 echo "~^attachment attribute-at
1";\
3213 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3215 xcall bail "attach
0-3"
3218 echo "~^attachment insert .
/.treadctl
=ascii
";\
3219 read hl; echo $hl; call xerr "$hl" "attach
1-1"
3220 echo "~^attachment list
";\
3221 read es; echo $es;call xerr "$es" "attach
1-2"
3223 echo "~^attachment attribute .
/.treadctl
";\
3224 read es; echo $es;call xerr "$es" "attach
1-3"
3226 echo "~^attachment attribute .treadctl
";\
3227 read es; echo $es;call xerr "$es" "attach
1-4"
3229 echo "~^attachment attribute-at
1";\
3230 read es; echo $es;call xerr "$es" "attach
1-5"
3233 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
3234 read es; echo $es;call xerr "$es" "attach
1-6"
3235 echo "~^attachment attribute-set .treadctl content-description Au
";\
3236 read es; echo $es;call xerr "$es" "attach
1-7"
3237 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
3238 read es; echo $es;call xerr "$es" "attach
1-8"
3240 echo "~^attachment attribute .
/.treadctl
";\
3241 read es; echo $es;call xerr "$es" "attach
1-9"
3243 echo "~^attachment attribute .treadctl
";\
3244 read es; echo $es;call xerr "$es" "attach
1-10"
3246 echo "~^attachment attribute rctl
";\
3247 read es; echo $es;call xerr "$es" "attach
1-11"
3249 echo "~^attachment attribute-at
1";\
3250 read es; echo $es;call xerr "$es" "attach
1-12"
3254 echo "~^attachment insert .
/.tattach
=latin1
";\
3255 read hl; echo $hl; call xerr "$hl" "attach
2-1"
3256 echo "~^attachment list
";\
3257 read es; echo $es;call xerr "$es" "attach
2-2"
3259 echo "~^attachment attribute .
/.tattach
";\
3260 read es; echo $es;call xerr "$es" "attach
2-3"
3262 echo "~^attachment attribute .tattach
";\
3263 read es; echo $es;call xerr "$es" "attach
2-4"
3265 echo "~^attachment attribute-at
2";\
3266 read es; echo $es;call xerr "$es" "attach
2-5"
3269 echo "~^attachment attribute-set .
/.tattach filename tat
";\
3270 read es; echo $es;call xerr "$es" "attach
2-6"
3272 "~^attachment attribute-set .tattach content-description Au2
";\
3273 read es; echo $es;call xerr "$es" "attach
2-7"
3274 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
3275 read es; echo $es;call xerr "$es" "attach
2-8"
3277 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
3278 read es; echo $es;call xerr "$es" "attach
2-9"
3280 echo "~^attachment attribute .
/.tattach
";\
3281 read es; echo $es;call xerr "$es" "attach
2-10"
3283 echo "~^attachment attribute .tattach
";\
3284 read es; echo $es;call xerr "$es" "attach
2-11"
3286 echo "~^attachment attribute tat
";\
3287 read es; echo $es;call xerr "$es" "attach
2-12"
3289 echo "~^attachment attribute-at
2";\
3290 read es; echo $es;call xerr "$es" "attach
2-13"
3294 if [ "$t_remove" == "" ]
3298 echo "~^attachment remove .
/.treadctl
"; read es;\
3299 call xerr $es "attach
3-1"
3300 echo "~^attachment remove .
/.tattach
"; read es;\
3301 call xerr $es "attach
3-2"
3302 echo "~^ attachment remove .
/.treadctl
"; read es;\
3303 vput vexpr es substr $es 0 3
3305 xcall bail "attach
3-3"
3307 echo "~^ attachment remove .
/.tattach
"; read es;\
3308 vput vexpr es substr $es 0 3
3310 xcall bail "attach
3-4"
3312 echo "~^attachment list
"; read es;\
3313 vput vexpr es substr $es 0 3
3315 xcall bail "attach
3-5"
3319 echo "~^attachment insert .
/.tattach
=latin1
";\
3320 read hl; echo $hl; call xerr "$hl" "attach
4-1"
3321 echo "~^attachment insert .
/.tattach
=latin1
";\
3322 read hl; echo $hl; call xerr "$hl" "attach
4-2"
3323 echo "~^attachment list
";\
3324 read es; echo $es;call xerr "$es" "attach
4-3"
3326 echo "~^ attachment remove .tattach
"; read es;\
3327 vput vexpr es substr $es 0 3
3329 xcall bail "attach
4-4 $es"
3331 echo "~^attachment remove-at T
"; read es;\
3332 vput vexpr es substr $es 0 3
3334 xcall bail "attach
4-5"
3336 echo "~^attachment remove .
/.tattach
"; read es;\
3337 call xerr $es "attach
4-6"
3338 echo "~^attachment remove .
/.tattach
"; read es;\
3339 call xerr $es "attach
4-7"
3340 echo "~^ attachment remove .
/.tattach
"; read es;\
3341 vput vexpr es substr $es 0 3
3343 xcall bail "attach
4-8 $es"
3345 echo "~^attachment list
"; read es;\
3346 vput vexpr es substr $es 0 3
3348 xcall bail "attach
4-9"
3352 echo "~^attachment insert .
/.tattach
=latin1
";\
3353 read hl; echo $hl; call xerr "$hl" "attach
5-1"
3354 echo "~^attachment insert .
/.tattach
=latin1
";\
3355 read hl; echo $hl; call xerr "$hl" "attach
5-2"
3356 echo "~^attachment insert .
/.tattach
=latin1
";\
3357 read hl; echo $hl; call xerr "$hl" "attach
5-3"
3358 echo "~^attachment list
";\
3359 read es; echo $es;call xerr "$es" "attach
5-4"
3362 echo "~^attachment remove-at
3"; read es;\
3363 call xerr $es "attach
5-5"
3364 echo "~^attachment remove-at
3"; read es;\
3365 vput vexpr es substr $es 0 3
3367 xcall bail "attach
5-6"
3369 echo "~^attachment remove-at
2"; read es;\
3370 call xerr $es "attach
5-7"
3371 echo "~^attachment remove-at
2"; read es;\
3372 vput vexpr es substr $es 0 3
3374 xcall bail "attach
5-8"
3376 echo "~^attachment remove-at
1"; read es;\
3377 call xerr $es "attach
5-9"
3378 echo "~^attachment remove-at
1"; read es;\
3379 vput vexpr es substr $es 0 3
3381 xcall bail "attach
5-10"
3384 echo "~^attachment list
"; read es;\
3385 vput vexpr es substr $es 0 3
3387 xcall bail "attach
5-11"
3391 echo "~^attachment insert .
/.tattach
=latin1
";\
3392 read hl; echo $hl; call xerr "$hl" "attach
6-1"
3393 echo "~^attachment insert .
/.tattach
=latin1
";\
3394 read hl; echo $hl; call xerr "$hl" "attach
6-2"
3395 echo "~^attachment insert .
/.tattach
=latin1
";\
3396 read hl; echo $hl; call xerr "$hl" "attach
6-3"
3397 echo "~^attachment list
";\
3398 read es; echo $es;call xerr "$es" "attach
6-4"
3401 echo "~^attachment remove-at
1"; read es;\
3402 call xerr $es "attach
6-5"
3403 echo "~^attachment remove-at
1"; read es;\
3404 call xerr $es "attach
6-6"
3405 echo "~^attachment remove-at
1"; read es;\
3406 call xerr $es "attach
6-7"
3407 echo "~^attachment remove-at
1"; read es;\
3408 vput vexpr es substr $es 0 3
3410 xcall bail "attach
6-8"
3413 echo "~^attachment list
"; read es;\
3414 vput vexpr es substr $es 0 3
3416 xcall bail "attach
6-9"
3428 echo on-compose-enter, mailx-command<$mailx-command>
3429 alternates alter1@exam.ple alter2@exam.ple
3431 set autocc='alter1@exam.ple alter2@exam.ple'
3432 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3433 echo mailx-subject<$mailx-subject>
3434 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3435 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3436 mailx-raw-bcc<$mailx-raw-bcc>
3437 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3438 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3441 echo on-compose-leave, mailx-command<$mailx-command>
3443 eval alternates $al alter3@exam.ple alter4@exam.ple
3445 set autobcc='alter3@exam.ple alter4@exam.ple'
3446 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3447 echo mailx-subject<$mailx-subject>
3448 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3449 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3450 mailx-raw-bcc<$mailx-raw-bcc>
3451 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3452 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3455 echo on-compose-cleanup, mailx-command<$mailx-command>
3458 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3459 echo mailx-subject<$mailx-subject>
3460 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3461 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3462 mailx-raw-bcc<$mailx-raw-bcc>
3463 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3464 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3466 wysh set on-compose-splice=t_ocs \
3467 on-compose-enter=t_oce on-compose-leave=t_ocl \
3468 on-compose-cleanup=t_occ
3472 printf 'm this-goes@nowhere\nbody\n!.\n' |
3473 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3474 -X'source ./.trc' -Smta=./.tsendmail.sh \
3476 ${cat} ./.tall >> "${MBOX}"
3477 check behave:compose_hooks-1 0 "${MBOX}" '522535560 10101'
3480 printf 'm this-goes@nowhere\nbody\n!.\n' |
3481 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3482 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh \
3484 ${cat} ./.tall >> "${MBOX}"
3485 check behave:compose_hooks-2 0 "${MBOX}" '3654000499 12535'
3489 # Some state machine stress, shell compose hook, localopts for hook, etc.
3490 # readctl in child. ~r as HERE document
3492 printf 'm ex@am.ple\nbody\n!.
3493 echon ${mailx-command}${mailx-subject}
3494 echon ${mailx-from}${mailx-sender}
3495 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3496 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3497 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3498 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3499 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3500 -Smta=./.tsendmail.sh \
3503 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3506 vput vexpr es substr "$1" 0 1
3511 define read_mline_res {
3512 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3513 echo $len/$es/$^ERRNAME: $hl
3514 if [ $es -ne $^ERR-NONE ]
3515 xcall bail read_mline_res
3517 \xcall read_mline_res
3521 vput vexpr i + 1 "$2"
3523 vput vexpr j % $i 10
3530 eval \\$j _work $1 $i
3533 vput vexpr i + $i "$1"
3537 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3538 echo read:$es/$en: $line
3539 if [ "${es}" -ne -1 ]
3542 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3547 echo "~^header list
"; read hl; echo $hl;\
3548 vput vexpr es substr "$hl" 0 1
3550 xcall bail "header list
"
3553 call _work 1; echo $?
3554 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
3555 read es; echo $es; vput vexpr es substr "$es" 0 1
3557 xcall bail "be diet
"
3559 echo "~^header insert cc
<splice2@exam.ple
>";\
3560 read es; echo $es; vput vexpr es substr "$es" 0 1
3562 xcall bail "be diet2
"
3565 call _work 2; echo $?
3566 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
3567 read es; echo $es;vput vexpr es substr "$es" 0 1
3569 xcall bail "be juicy
"
3571 echo "~^header insert bcc juice2@exam.ple
";\
3572 read es; echo $es;vput vexpr es substr "$es" 0 1
3574 xcall bail "be juicy2
"
3576 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
3577 read es; echo $es;vput vexpr es substr "$es" 0 1
3579 xcall bail "be juicy3
"
3581 echo "~^header insert bcc juice4@exam.ple
";\
3582 read es; echo $es;vput vexpr es substr "$es" 0 1
3584 xcall bail "be juicy4
"
3587 echo "~^header remove-at bcc
3";\
3588 read es; echo $es;vput vexpr es substr "$es" 0 1
3590 xcall bail "remove juicy5
"
3592 echo "~^header remove-at bcc
2";\
3593 read es; echo $es;vput vexpr es substr "$es" 0 1
3595 xcall bail "remove juicy6
"
3597 echo "~^header remove-at bcc
3";\
3598 read es; echo $es;vput vexpr es substr "$es" 0 3
3600 xcall bail "failed to remove-at
"
3602 # Add duplicates which ought to be removed!
3603 echo "~^header insert bcc juice4@exam.ple
";\
3604 read es; echo $es;vput vexpr es substr "$es" 0 1
3606 xcall bail "be juicy4-1
"
3608 echo "~^header insert bcc juice4@exam.ple
";\
3609 read es; echo $es;vput vexpr es substr "$es" 0 1
3611 xcall bail "be juicy4-2
"
3613 echo "~^header insert bcc juice4@exam.ple
";\
3614 read es; echo $es;vput vexpr es substr "$es" 0 1
3616 xcall bail "be juicy4-3
"
3621 call _work 3; echo $?
3623 vput ! i echo just knock if you can hear me;\
3625 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
3627 echon shell-cmd says $?/$^ERRNAME: $i
3628 echo "~x will not become interpreted
, we are reading
until __EOT
"
3630 read r_status; echo "~~r status output
: $r_status"
3631 echo "~
:echo $? $
! $^ERRNAME
"
3633 echo "~~r status from parent
: $r_status"
3636 call _work 4; echo $?
3637 vput cwd cwd;echo cwd:$?
3638 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3642 call _work 5; echo $?
3643 echo "~^header show MAILX-Command
"; read es;\
3644 call xerr $es "t_header
1000"; call read_mline_res
3645 echo "~^header show MAILX-raw-TO
"; read es;\
3646 call xerr $es "t_header
1001"; xcall read_mline_res
3648 echoerr IT IS WRONG IF YOU SEE THIS
3651 echo on-compose-enter, mailx-command<$mailx-command>
3652 set t_oce autobcc=oce@exam.ple
3653 alternates alter1@exam.ple alter2@exam.ple
3655 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3656 echo mailx-subject<$mailx-subject>
3657 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3658 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3659 mailx-raw-bcc<$mailx-raw-bcc>
3660 echo mailx-orig-from<$mailx-orig-from> \
3661 mailx-orig-to<$mailx-orig-to> \
3662 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3665 echo on-compose-leave, mailx-command<$mailx-command>
3666 set t_ocl autocc=ocl@exam.ple
3668 alternates alter3@exam.ple alter4@exam.ple
3670 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3671 echo mailx-subject<$mailx-subject>
3672 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3673 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3674 mailx-raw-bcc<$mailx-raw-bcc>
3675 echo mailx-orig-from<$mailx-orig-from> \
3676 mailx-orig-to<$mailx-orig-to> \
3677 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3680 echo on-compose-cleanup, mailx-command<$mailx-command>
3681 set t_occ autocc=occ@exam.ple
3684 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3685 echo mailx-subject<$mailx-subject>
3686 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3687 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3688 mailx-raw-bcc<$mailx-raw-bcc>
3689 echo mailx-orig-from<$mailx-orig-from> \
3690 mailx-orig-to<$mailx-orig-to> \
3691 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3693 wysh set on-compose-splice=t_ocs \
3694 on-compose-splice-shell="read ver
;printf \"t_ocs-shell
\\n\
3695 ~t shell@exam.ple
\\n~
:set t_ocs_sh
\\n
\"" \
3696 on-compose-enter=t_oce on-compose-leave=t_ocl \
3697 on-compose-cleanup=t_occ
3699 ex0_test behave:compose_hooks-3-estat
3700 ${cat} ./.tnotes >> "${MBOX}"
3702 check behave:compose_hooks-3 - "${MBOX}" '679526364 2431'
3704 # Reply, forward, resend, Resend
3707 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3708 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3709 -Smta=./.tsendmail.sh
3712 echo start: $? $! $^ERRNAME
3714 echo File: $? $! $^ERRNAME;echo;echo
3716 this is content of reply 1
3718 echo reply 1: $? $! $^ERRNAME;echo;echo
3720 this is content of Reply 1 2
3722 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3723 forward 1 fwdex@am.ple
3724 this is content of forward 1
3726 echo forward 1: $? $! $^ERRNAME;echo;echo
3727 resend 1 2 resendex@am.ple
3728 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3729 Resend 1 2 Resendex@am.ple
3730 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3732 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3733 -Smta=./.tsendmail.sh \
3736 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3739 vput vexpr es substr "$1" 0 1
3744 define read_mline_res {
3745 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3746 echo mline_res:$len/$es/$^ERRNAME: $hl
3747 if [ $es -ne $^ERR-NONE ]
3748 xcall bail read_mline_res
3750 \xcall read_mline_res
3754 echo "~^header show
$1"; read es;\
3755 call xerr $es "work_hl
$1"; echo $1; call read_mline_res
3763 echo t_ocs version $ver
3764 echo "~^header list
"; read hl; echo $hl;\
3765 echoerr the header list is $hl;\
3766 call xerr "$hl" "header list
"
3767 eval vpospar set $hl
3770 echoerr IT IS WRONG IF YOU SEE THIS
3773 echo on-XY-enter, mailx-command<$mailx-command>
3774 set t_oce autobcc=oce@exam.ple
3775 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3776 echo mailx-subject<$mailx-subject>
3777 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3778 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3779 mailx-raw-bcc<$mailx-raw-bcc>
3780 echo mailx-orig-from<$mailx-orig-from> \
3781 mailx-orig-to<$mailx-orig-to> \
3782 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3785 echo on-XY-leave, mailx-command<$mailx-command>
3786 set t_ocl autocc=ocl@exam.ple
3787 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3788 echo mailx-subject<$mailx-subject>
3789 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3790 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3791 mailx-raw-bcc<$mailx-raw-bcc>
3792 echo mailx-orig-from<$mailx-orig-from> \
3793 mailx-orig-to<$mailx-orig-to> \
3794 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3797 echo on-XY-cleanup, mailx-command<$mailx-command>
3798 set t_occ autocc=occ@exam.ple
3799 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3800 echo mailx-subject<$mailx-subject>
3801 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3802 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3803 mailx-raw-bcc<$mailx-raw-bcc>
3804 echo mailx-orig-from<$mailx-orig-from> \
3805 mailx-orig-to<$mailx-orig-to> \
3806 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3808 wysh set on-compose-splice=t_ocs \
3809 on-compose-enter=t_oce on-compose-leave=t_ocl \
3810 on-compose-cleanup=t_occ \
3811 on-resend-enter=t_oce on-resend-cleanup=t_occ
3813 ex0_test behave:compose_hooks-4-estat
3814 ${cat} ./.tnotes >> "${MBOX}"
3816 check behave:compose_hooks-4 - "${MBOX}" '3038884027 7516'
3821 t_behave_mass_recipients() {
3822 t_prolog t_behave_mass_recipients
3823 TRAP_EXIT_ADDONS=".
/.t
*"
3825 ${cat} <<-_EOT > ./.tsendmail.sh
3827 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3830 chmod 0755 ./.tsendmail.sh
3832 ${cat} <<'__EOT__' > ./.trc
3834 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3837 wysh set nr=$1 hn=$2
3838 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
3840 xcall bail "ins_addr
$hn 1-$nr"
3842 vput vexpr nr + $nr 1
3843 if [ "$nr" -le "$maximum" ]
3844 xcall ins_addr $nr $hn
3848 wysh set nr=$1 hn=$2
3849 alternates $hn$nr@$hn
3850 vput vexpr nr + $nr 2
3851 if [ "$nr" -le "$maximum" ]
3852 xcall bld_alter $nr $hn
3862 if [ "$t_remove" != '' ]
3867 set on-compose-splice=t_ocs on-compose-leave=t_ocl
3871 printf 'm this-goes@nowhere\nbody\n!.\n' |
3872 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3873 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3875 ${cat} ./.tall >> "${MBOX}"
3876 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
3879 printf 'm this-goes@nowhere\nbody\n!.\n' |
3880 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3881 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3883 ${cat} ./.tall >> "${MBOX}"
3884 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
3889 t_behave_mime_types_load_control() {
3890 t_prolog t_behave_mime_types_load_control
3891 TRAP_EXIT_ADDONS=".
/.t
*"
3893 ${cat} <<-_EOT > ./.tmts1
3894 @ application/mathml+xml mathml
3896 ${cat} <<-_EOT > ./.tmts2
3897 @ x-conference/x-cooltalk ice
3899 @ application/aga-aga aga
3902 ${cat} <<-_EOT > ./.tmts1.mathml
3903 <head>nonsense ML</head>
3905 ${cat} <<-_EOT > ./.tmts2.ice
3908 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.doom
3909 printf 'of which the c\x01rack is coming soon' > ./.tmtsx.aga
3923 ' "${MBOX}" "${MBOX}" |
3925 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
3927 ex0_test behave:mime_types_load_control
3929 ${cat} "${MBOX}" >> ./.tout
3930 check behave:mime_types_load_control-1 - ./.tout '1441260727 2449'
3932 echo type | ${MAILX} ${ARGS} -R \
3933 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
3934 -f "${MBOX}" >> ./.tout 2>&1
3935 check behave:mime_types_load_control-2 0 ./.tout '1441391438 3646'
3940 t_behave_lreply_futh_rth_etc() {
3941 t_prolog t_behave_lreply_futh_rth_etc
3942 TRAP_EXIT_ADDONS=".
/.t
*"
3944 ${cat} <<-_EOT > ./.tsendmail.sh
3946 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
3949 chmod 0755 ./.tsendmail.sh
3951 ${cat} <<-_EOT > ./.tmbox
3952 From neverneverland Sun Jul 23 13:46:25 2017
3953 Subject: Bugstop: five miles out 1
3954 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3955 From: mister originator <mr@originator>
3956 To: bugstop-commit@five.miles.out, laber@backe.eu
3958 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
3959 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
3960 Date: Wed, 19 Jul 2017 09:22:57 -0400
3961 Message-Id: <20170719132257.766AF781267@originator>
3964 > |Sorry, I think I misunderstand something. I would think that
3968 From neverneverland Fri Jul 7 22:39:11 2017
3969 Subject: Bugstop: five miles out 2
3970 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
3971 Content-Transfer-Encoding: 7bit
3972 From: mister originator <mr@originator>
3973 To: bugstop-commit@five.miles.out
3975 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
3976 Date: Fri, 07 Jul 2017 16:33:59 -0400
3979 capable of changing back.
3981 From neverneverland Fri Jul 7 22:42:00 2017
3982 Subject: Bugstop: five miles out 3
3983 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3984 Content-Transfer-Encoding: 7bit
3985 From: mister originator <mr@originator>
3986 To: bugstop-commit@five.miles.out
3988 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
3989 Date: Fri, 07 Jul 2017 16:33:59 -0400
3990 List-Post: <mailto:bugstop@five.miles.out>
3993 are you ready, boots?
3995 From neverneverland Sat Aug 19 23:15:00 2017
3996 Subject: Bugstop: five miles out 4
3997 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3998 Content-Transfer-Encoding: 7bit
3999 From: mister originator <mr@originator>
4000 To: bugstop@five.miles.out
4002 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4003 Date: Fri, 07 Jul 2017 16:33:59 -0400
4004 List-Post: <mailto:bugstop@five.miles.out>
4007 are you ready, boots?
4012 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
4013 -Rf ./.tmbox >> "${MBOX}" 2>&1
4015 wysh set m="This is text of
\"reply
${1}.
"
4026 echo -----After reply
$1.1
- $1.3
: $?
/$^ERRNAME
4029 wysh
set m
="This is text of \"Reply ${1}."
4035 echo -----After Reply $1.$2: $?/$^ERRNAME
4044 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
4048 # We need two indirections for this test: one for the case that Lreply
4049 # fails because of missing recipients: we need to read EOF next, thus
4050 # place this in _Ls last; and second for the succeeding cases EOF is
4051 # not what these should read, so go over the backside and splice it in!
4053 echo -----After Lreply $1.$2: $?/$^ERRNAME
4056 localopts call-fixate yes
4058 call R $1 1; call R $1 2; call R $1 3; call R $1 4
4059 call L $1 1; call L $1 2; call L $1 3
4062 echo;echo '===== CHANGING
=== '"$*"' =====';echo
4066 set from=laber@backe.eu
4069 call tweak set reply-to-honour
4071 call tweak set followup-to
4073 call tweak set followup-to-honour
4075 call tweak mlist bugstop@five.miles.out
4077 call tweak mlsubscribe bugstop@five.miles.out
4079 call tweak set recipients-in-cc
4083 check behave:lreply_futh_rth_etc-1 0 "${MBOX}" '940818845 29373'
4087 ${cat} <<-_EOT > ./.tmbox
4088 From tom@i-i.example Thu Oct 26 03:15:55 2017
4089 Date: Wed, 25 Oct 2017 21:15:46 -0400
4090 From: tom <tom@i-i.example>
4091 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4092 Cc: tom <tom@i-i.example>
4093 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4094 Message-ID: <20171026011546.GA11643@i-i.example>
4095 Reply-To: tom@i-i.example
4096 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4097 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4100 The report's useful
:-)
4103 printf 'reply 1\nthank you\n!.\n' |
4104 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4105 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4106 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4111 t_behave_xxxheads_rfc2047
() {
4112 t_prolog t_behave_xxxheads_rfc2047
4113 TRAP_EXIT_ADDONS
="./.t*"
4115 ${cat} <<-_EOT > ./.tsendmail.sh
4117 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4120 chmod 0755 .
/.tsendmail.sh
4124 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4125 -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̲' \
4127 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4129 # Single word (overlong line split -- bad standard! Requires injection of
4130 # artificial data!! But can be prevented by using RFC 2047 encoding)
4132 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4133 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4134 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4136 # Combination of encoded words, space and tabs of varying sort
4138 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4139 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4140 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4141 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4142 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4143 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4145 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4147 # Overlong multibyte sequence that must be forcefully split
4148 # todo This works even before v15.0, but only by accident
4150 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4151 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4152 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4153 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4155 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4159 echo | ${MAILX} ${ARGS} \
4160 -s "1-1 B2 B3 B4 B5 B6 B\
4161 1-2 B2 B3 B4 B5 B6 B\
4162 1-3 B2 B3 B4 B5 B6 B\
4163 1-4 B2 B3 B4 B5 B6 B\
4164 1-5 B2 B3 B4 B5 B6 B\
4165 1-6 B2 B3 B4 B5 B6
" \
4167 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4169 # Leading and trailing WS
4171 echo | ${MAILX} ${ARGS} \
4172 -s " 2-1 B2 B3 B4 B5 B6 B\
4173 1-2 B2 B3 B4 B5 B6 B\
4174 1-3 B2 B3 B4 B5 B6 B\
4175 1-4 B2 B3 B4 B5 B6
" \
4177 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4179 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4181 echo "Dat Früchtchen riecht häußlich
" |
4182 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4184 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4185 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4190 t_behave_rfc2231() {
4191 t_prolog t_behave_rfc2231
4192 TRAP_EXIT_ADDONS=".
/.t
*"
4195 mkdir ./.ttt || exit 1
4199 : > 'diet\ is \curd.txt'
4200 : > 'diet "is
" curd.txt'
4202 : > 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
4203 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4204 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4205 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4207 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4208 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4209 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4210 -a ./.ttt/höde-tröge.txt \
4211 -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 \
4212 -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 \
4213 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4214 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4216 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4218 # `resend' test, reusing $MBOX
4219 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4220 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4222 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4223 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4228 t_behave_iconv_mbyte_base64() {
4229 t_prolog t_behave_iconv_mbyte_base64
4230 TRAP_EXIT_ADDONS=".
/.t
*"
4232 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4233 (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4234 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4237 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4241 ${cat} <<-_EOT > ./.tsendmail.sh
4243 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4246 chmod 0755 ./.tsendmail.sh
4248 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4249 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4250 -Smta=./.tsendmail.sh \
4251 -Sescape=! -Smime-encoding=base64 2>./.terr
4252 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4254 !s Japanese from UTF-8 to ISO-2022-JP
4255 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4257 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4260 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4262 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4265 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4267 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4268 \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
4270 \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
4273 \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
4275 \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
4278 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4279 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4281 printf 'eval f 1; write ./.twrite\n' |
4282 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4283 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4284 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4286 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4289 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4290 rm -f "${MBOX}" ./.twrite
4291 cat <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4292 -Smta=./.tsendmail.sh \
4293 -Sescape=! -Smime-encoding=base64 2>./.terr
4294 set ttycharset=utf-8 sendcharsets=euc-jp
4296 !s Japanese from UTF-8 to EUC-JP
4297 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4299 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4302 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4304 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4307 set ttycharset=EUC-JP sendcharsets=utf-8
4309 !s Japanese from EUC-JP to UTF-8
4310 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4312 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4315 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4317 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4320 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4321 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4323 printf 'eval f 1; write ./.twrite\n' |
4324 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4325 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4326 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4328 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4334 t_behave_iconv_mainbody
() {
4335 t_prolog t_behave_iconv_mainbody
4336 TRAP_EXIT_ADDONS
="./.t*"
4339 if have_feat
iconv &&
4340 (</dev
/null
iconv -f utf-8
-t ascii
) >/dev
/null
2>&1; then
4341 j
="`printf '–' | iconv -f utf-8 -t ascii 2>/dev/null`"
4342 # This assumes iconv(1) behaves like iconv(3), but well.
4343 # This is flaky because the behaviour is so non-uniform
4344 if [ ${?} -ne 0 ]; then
4345 if [ x
"${j}" = 'x?' ]; then
4350 elif [ x
"${j}" = 'x?' ]; then
4352 elif [ x
"${j}" = 'x*' ]; then
4356 if [ -z "${i}" ]; then
4357 echo 'behave:iconv_mainbody: unsupported, skipped'
4361 ${cat} <<-_EOT > ./.tsendmail.sh
4363 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4366 chmod 0755 .
/.tsendmail.sh
4368 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4369 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4370 -s '–' over-the@rain.bow
2>.
/.terr
4371 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4372 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4374 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4375 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4376 -s '–' over-the@rain.bow
2>.
/.terr
4377 exn0_test behave
:iconv_mainbody-3
4378 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4379 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4381 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4383 ex0_test behave:iconv_mainbody-5-0 ${j}
4384 if [ x${i} = x1 ]; then
4385 # yuck, just assume ???, we need a test program for that one!
4386 check behave:iconv_mainbody-5-1-1 - ./.tout '1959197095 283'
4387 check behave:iconv_mainbody-5-1-1 - ./.terr '4294967295 0'
4388 elif [ x${i} = x2 ]; then
4389 check behave:iconv_mainbody-5-2-1 - ./.tout '1959197095 283'
4390 check behave:iconv_mainbody-5-2-2 - ./.terr '4294967295 0'
4391 elif [ x${i} = x3 ]; then
4392 check behave:iconv_mainbody-5-3-1 - ./.tout '3196380198 279'
4393 check behave:iconv_mainbody-5-3-2 - ./.terr '4294967295 0'
4395 check behave:iconv_mainbody-5-4-1 - ./.tout '3760313827 279'
4396 check behave:iconv_mainbody-5-4-2 - ./.terr '4294967295 0'
4402 t_behave_q_t_etc_opts() {
4403 t_prolog t_behave_q_t_etc_opts
4404 TRAP_EXIT_ADDONS=".
/.t
*"
4406 # Three tests for MIME encoding and (a bit) content classification.
4407 # At the same time testing -q FILE, < FILE and -t FILE
4408 t__put_body > ./.tin
4411 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4412 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4413 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4416 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4417 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4418 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4421 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4423 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4424 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4430 have_feat smime || {
4431 echo 'behave:s/mime: unsupported, skipped'
4435 t_prolog t_behave_s_mime
4436 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4437 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4438 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4440 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4441 ${cat} <<-_EOT > ./.t.conf
4444 default_keyfile = keyfile.pem
4445 distinguished_name = req_distinguished_name
4446 attributes = req_attributes
4450 [ req_distinguished_name ]
4457 emailAddress = test@localhost
4462 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4463 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
4464 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4467 printf 'behave:s/mime:sign/verify: '
4468 echo bla | ${MAILX} ${ARGS} \
4469 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4470 -Ssmime-sign -Sfrom=test@localhost \
4471 -s 'S/MIME test' ./.VERIFY
4472 if [ $? -eq 0 ]; then
4483 /^Content-Description: /{ skip = 2; print; next }
4484 /^$/{ if(skip) --skip }
4487 < ./.VERIFY > "${MBOX}"
4488 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4490 printf 'behave:s/mime:sign/verify:verify '
4491 printf 'verify\nx\n' |
4493 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4494 -Ssmime-sign -Sfrom=test@localhost \
4496 -f ./.VERIFY >/dev/null 2>&1
4497 if [ $? -eq 0 ]; then
4506 printf 'behave:s/mime:sign/verify:disproof-1 '
4507 if openssl smime -verify -CAfile ./.tcert.pem \
4508 -in ./.VERIFY >/dev/null 2>&1; then
4517 # (signing +) encryption / decryption
4518 ${cat} <<-_EOT > ./.tsendmail.sh
4520 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4522 chmod 0755 ./.tsendmail.sh
4524 printf 'behave:s/mime:encrypt+sign: '
4527 -Ssmime-force-encryption \
4528 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4529 -Smta=./.tsendmail.sh \
4530 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4531 -Ssmime-sign -Sfrom=test@localhost \
4532 -s 'S/MIME test' recei@ver.com
4533 if [ $? -eq 0 ]; then
4537 printf 'error: encrypt+sign failed\n'
4540 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4541 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4543 printf 'behave:s/mime:decrypt+verify: '
4544 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4546 -Ssmime-force-encryption \
4547 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4548 -Smta=./.tsendmail.sh \
4549 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4550 -Ssmime-sign -Sfrom=test@localhost \
4552 -f ./.ENCRYPT >/dev/null 2>&1
4553 if [ $? -eq 0 ]; then
4562 /^Content-Description: /{ skip = 2; print; next }
4563 /^$/{ if(skip) --skip }
4566 < ./.DECRYPT > "${MBOX}"
4567 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4569 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4570 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4571 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
4578 printf "behave
:s
/mime
:encrypt
: "
4579 echo bla | ${MAILX} ${ARGS} \
4580 -Ssmime-force-encryption \
4581 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4582 -Smta=./.tsendmail.sh \
4583 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4584 -Sfrom=test@localhost \
4585 -s 'S/MIME test' recei@ver.com
4586 if [ $? -eq 0 ]; then
4593 # Same as behave:s/mime:encrypt+sign:checksum above
4594 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4595 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4598 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4599 -Ssmime-force-encryption \
4600 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4601 -Smta=./.tsendmail.sh \
4602 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4603 -Sfrom=test@localhost \
4605 -f ./.ENCRYPT >/dev/null 2>&1
4606 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4608 printf 'behave:s/mime:decrypt:disproof-1: '
4609 if openssl smime -decrypt -inkey ./.tkey.pem \
4610 -in ./.ENCRYPT >/dev/null 2>&1; then
4621 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4622 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4623 # Note we unfortunately need to place some statements without proper
4624 # indentation because of continuation problems
4625 # xxx Note: t_content() was the first test (series) written. Today many
4626 # xxx aspects are (better) covered by other tests above, some are not.
4627 # xxx At some future date and time, convert the last remains not covered
4628 # xxx elsewhere to a real t_behave_* test and drop t_content()
4632 # Test for [260e19d] (Juergen Daubert)
4634 echo body | ${MAILX} ${ARGS} "${MBOX}"
4635 check content
:004 0 "${MBOX}" '2917662811 98'
4637 # "Test for" [d6f316a] (Gavin Troy)
4639 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4640 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4641 check content:006 0 "${MBOX}" '2099098650 122'
4642 check content:006-1 - "${BODY}" '794542938 174'
4644 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4647 for(i = 0; i < 10000; ++i)
4649 #printf "\xF0\x90\x87\x90"
4650 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4651 check content
:007 0 "${MBOX}" '534262374 61816'
4657 # MIME encoding (QP) stress message subject
4658 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
4659 'adadaddsssssssddddddddddddddddddddd'\
4660 'ddddddddddddddddddddddddddddddddddd'\
4661 'ddddddddddddddddddddddddddddddddddd'\
4662 'dddddddddddddddddddd Hallelulja? Od'\
4663 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4664 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4665 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
4666 'fffffffffffffffffffffffffffffffffff'\
4667 'fffffffffffffffffffff ggggggggggggg'\
4668 'ggggggggggggggggggggggggggggggggggg'\
4669 'ggggggggggggggggggggggggggggggggggg'\
4670 'ggggggggggggggggggggggggggggggggggg'\
4675 # MIME encoding (QP) stress message body
4677 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4678 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4679 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4680 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4681 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4682 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4683 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4684 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4685 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4686 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4687 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4688 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4689 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4690 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4691 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4692 "auf den zeilen vorher.\r\n"\
4693 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4695 "Die letzte Zeile war nur ein Punkt.\r\n"\
4697 "Das waren deren zwei.\r\n"\
4699 "Die letzte Zeile war ein Leerschritt.\n"\
4700 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4703 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4705 "Das waren deren zwei. ditto.\n"\
4707 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4708 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4709 "auf den zeilen vorher.\n"\
4711 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4712 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4714 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4716 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4718 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4720 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4722 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4724 "QP am Zeilenende über soft-nl hinweg\n"\
4725 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4727 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4729 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4731 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4733 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
4735 "Die letzte Zeile war ein Leerschritt.\n"\
4740 # if have_feat devel; then
4741 # ARGS="${ARGS} -Smemdebug"
4745 if [ -n "${UTF8_LOCALE}" ]; then
4746 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
4748 printf 'No Unicode locale found, disabling Unicode tests\n'
4755 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
4757 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
4760 while [ ${#} -gt 0 ]; do
4766 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'