2 #@ Synopsis: ./cc-test.sh [--check-only s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ The latter generates output files.
5 #@ TODO All ex0_test should say TESTNUMBER-estat instead of having own numbers
6 #@ TODO _All_ the tests should happen in a temporary subdir.
9 # Instead of figuring out the environment in here, require a configured build
10 # system and include that! Our makefile and configure ensure that this test
11 # does not run in the configured, but the user environment nonetheless!
12 if [ -f .
/mk-config.ev
]; then
14 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
15 MAILX__CC_TEST_RUNNING
=1
16 export MAILX__CC_TEST_RUNNING
17 exec "${SHELL}" "${0}" "${@}"
20 echo >&2 'S-nail/S-mailx is not configured.'
21 echo >&2 'This test script requires the shell environment that only the'
22 echo >&2 'configuration script can figure out, even if it will be used to'
23 echo >&2 'test a different binary than the one that would be produced!'
27 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
28 # such is a compile-time variable
29 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
30 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
31 ADDARG_UNI
=-Sttycharset=UTF-8
36 #UTF8_LOCALE= autodetected unless set
38 # Note valgrind has problems with FDs in forked childs, which causes some tests
39 # to fail (the FD is rewound and thus will be dumped twice)
41 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
43 ## -- (>8 -- 8<) -- ##
45 ( set -o noglob
) >/dev
/null
2>&1 && noglob_shell
=1 ||
unset noglob_shell
50 printf >&2 -- "${fmt}\\n" "${@}"
55 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
59 # Wed Oct 2 01:50:07 UTC 1996
60 SOURCE_DATE_EPOCH
=844221007
62 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
63 unset POSIXLY_CORRECT LOGNAME USER
66 echo >&2 "Synopsis: ./cc-test.sh [--check-only s-mailx-binary]"
67 echo >&2 "Synopsis: ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]"
71 CHECK_ONLY
= MAE_TEST
= MAILX
=
72 if [ "${1}" = --check-only ]; then
75 [ -x "${MAILX}" ] || usage
77 elif [ "${1}" = --mae-test ]; then
80 [ -x "${MAILX}" ] || usage
84 MAILX
="${MEMTESTER}${MAILX}"
87 if [ -n "${CHECK_ONLY}${MAE_TEST}" ] && [ -z "${UTF8_LOCALE}" ]; then
88 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
89 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
91 \if [ "${ttycharset}" @i=% utf ]
98 \eval xcall cset_test "${@}"
102 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
103 en_US.utf8 en_US.UTF-8
105 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
107 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
108 UTF8_LOCALE
=`locale -a | { m=
110 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
112 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
126 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
127 trap "exit 1" HUP INT TERM
130 # Test all configs TODO doesn't cover all *combinations*, stupid!
134 NOTME["OPT_AUTOCC"] = 1
135 NOTME["OPT_DEBUG"] = 1
136 NOTME["OPT_DEVEL"] = 1
137 NOTME["OPT_NOEXTMD5"] = 1
138 NOTME["OPT_ASAN_ADDRESS"] = 1
139 NOTME["OPT_ASAN_MEMORY"] = 1
140 NOTME["OPT_FORCED_STACKPROT"] = 1
141 NOTME["OPT_NOMEMDBG"] = 1
142 NOTME["OPT_NYD2"] = 1
145 /^[[:space:]]*OPT_/ {
146 sub(/^[[:space:]]*/, "")
147 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
148 # does not seem to be a compliant escape for =
150 $1 = substr($1, 1, index($1, "=") - 1)
156 # Doing this completely sequentially and not doing make distclean in
157 # between runs should effectively result in lesser compilations.
158 # It is completely dumb nonetheless... TODO
159 for (j = 1; j < i; ++j) {
160 for (k = 1; k < j; ++k)
162 for (k = j; k < i; ++k)
164 printf "OPT_AUTOCC=1\n"
166 for (j = 1; j < i; ++j) {
167 for (k = 1; k < j; ++k)
169 for (k = j; k < i; ++k)
171 printf "OPT_AUTOCC=1\n"
174 for (j = 1; j < i; ++j) {
175 for (k = 1; k < j; ++k)
177 for (k = j; k < i; ++k)
179 printf "OPT_AUTOCC=1\n"
180 printf "OPT_DEBUG=1\n"
182 for (j = 1; j < i; ++j) {
183 for (k = 1; k < j; ++k)
185 for (k = j; k < i; ++k)
187 printf "OPT_AUTOCC=1\n"
188 printf "OPT_DEBUG=1\n"
191 printf "CONFIG=NULL OPT_AUTOCC=0\n"
192 printf "CONFIG=NULL OPT_AUTOCC=1\n"
193 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
194 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
195 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
196 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
197 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
198 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
199 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
200 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
201 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
202 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
203 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
204 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
207 printf "\n\n##########\n$c\n"
208 printf "\n\n##########\n$c\n" >&2
209 sh
-c "${MAKE} ${c} all test"
215 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
216 ${grep} +${1} ) >/dev
/null
2>&1
220 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
222 [ ${#} -gt 0 ] && printf '[%s]\n' "${1}"
229 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
230 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
231 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
232 csum
="`${cksum} < ${f}`"
233 if [ "${csum}" = "${s}" ]; then
234 printf '%s: ok\n' "${tid}"
237 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
239 if [ -n "${MAE_TEST}" ]; then
240 x
=`echo ${tid} | ${tr} "/:=" "__-"`
241 ${cp} -f "${f}" ./mae-test-"${x}"
247 printf '%s: error: %s\n' ${1} "${2}"
251 # $1=test name [$2=status]
253 [ ${#} -gt 1 ] && __qm__=${2}
254 if [ ${__qm__} -ne 0 ]; then
255 err $1 'unexpected non-0 exit status'
257 printf '%s: ok\n' "${1}"
262 # $1=test name [$2=status]
264 [ ${#} -gt 1 ] && __qm__=${2}
265 if [ ${__qm__} -eq 0 ]; then
266 err $1 'unexpected 0 exit status'
268 printf '%s: ok\n' "${1}"
272 if ( [ "$
((1 + 1))" = 2 ] ) >/dev/null 2>&1; then
274 echo "$
((${1} + ${2}))"
278 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
282 if ( [ "$
((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
284 echo "$
((${1} % ${2}))"
288 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
293 # Basic (easily testable) behaviour tests
295 t_behave_X_opt_input_command_stack
299 t_behave_input_inject_semicolon_seq
300 t_behave_commandalias
304 t_behave_macro_param_shift
315 t_behave_record_a_resend
320 # FIXME t_behave_mlist
323 t_behave_message_injections
325 t_behave_compose_hooks
326 t_behave_C_opt_customhdr
328 t_behave_mass_recipients
329 t_behave_mime_types_load_control
330 t_behave_lreply_futh_rth_etc
332 t_behave_xxxheads_rfc2047
334 t_behave_iconv_mbyte_base64
335 t_behave_iconv_mainbody
336 t_behave_binary_mainbody
337 t_behave_q_t_etc_opts
342 t_behave_X_opt_input_command_stack() {
343 t_prolog t_behave_X_opt_input_command_stack
345 ${cat} <<- '__EOT' > "${BODY}"
353 echo "define mac1
{";\
354 echo " echo mac1-1 via1 \
$0";\
356 echo " echo mac1-2
";\
358 echo " echo mac1-3
";\
361 echo "define mac2
{";\
362 echo " echo mac2-1 via1 \
$0";\
364 echo " echo mac2-2
";\
370 echo echo 1-1-1 via1 \
$0;\
382 # The -X option supports multiline arguments, and those can internally use
383 # reverse solidus newline escaping. And all -X options are joined...
385 < "${BODY}" ${MAILX} ${ARGS} \
400 echo "define mac1 {";\
401 echo " echo mac1-1 via2 \$0";\
403 echo " echo mac1-2";\
405 echo " echo mac1-3";\
408 echo "define mac2 {";\
409 echo " echo mac2-1 via2 \$0";\
411 echo " echo mac2-2";\
417 echo echo 1-1-1 via2 \$0;\
431 check behave
:x_opt_input_command_stack
0 "${MBOX}" '1786542668 416'
436 t_behave_X_errexit
() {
437 t_prolog t_behave_X_errexit
439 ${cat} <<- '__EOT' > "${BODY}"
445 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
446 -X'echo one' -X' echos nono ' -X'echo two' \
448 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
450 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
452 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
454 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
456 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
460 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
461 -X'echo one' -X' echos nono ' -X'echo two' \
463 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
465 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
467 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
469 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
471 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
473 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
475 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
477 ## Repeat 4-7 with ignerr set
479 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
481 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
482 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
484 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
486 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
488 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
490 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
492 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
494 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
496 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
501 t_behave_S_freeze() {
502 t_prolog t_behave_S_freeze
506 # Test basic assumption
507 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
508 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
510 check behave
:s_freeze-1
0 "${MBOX}" '270686329 21'
513 ${cat} <<- '__EOT' > "${BODY}"
518 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
519 -Snoasksub -Sasksub -Snoasksub \
520 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
522 check behave
:s_freeze-2
0 "${MBOX}" '3182942628 37'
524 ${cat} <<- '__EOT' > "${BODY}"
529 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
530 -Snoasksub -Sasksub \
531 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
533 check behave
:s_freeze-3
0 "${MBOX}" '2006554293 39'
536 ${cat} <<- '__EOT' > "${BODY}"
537 echo dietcurd<$dietcurd>
539 echo dietcurd<$dietcurd>
541 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
542 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
543 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
544 -X'echo dietcurd<$dietcurd>' \
546 check behave
:s_freeze-4
0 "${MBOX}" '1985768109 65'
548 ${cat} <<- '__EOT' > "${BODY}"
549 echo dietcurd<$dietcurd>
551 echo dietcurd<$dietcurd>
553 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
554 -Sdietcurd=strawberry
-Snodietcurd \
555 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
556 -X'echo dietcurd<$dietcurd>' \
558 check behave
:s_freeze-5
0 "${MBOX}" '151574279 51'
560 # TODO once we have a detached one with env=1..
561 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
562 echo 'behave:s_freeze-{6,7}: shell sets $TERM, skipped'
564 ${cat} <<- '__EOT' > "${BODY}"
565 !echo "shell says TERM<$TERM>"
567 !echo "shell says TERM<$TERM>"
569 !echo "shell says TERM<$TERM>"
571 !echo "shell says TERM<$TERM>"
573 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
574 -STERM=strawberry
-SnoTERM -STERM=vanilla \
575 -X'echo mail<$TERM>' -X'unset TERM' \
576 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
578 check behave
:s_freeze-6
0 "${MBOX}" '1211476036 167'
580 ${cat} <<- '__EOT' > "${BODY}"
581 !echo "shell says TERM<$TERM>"
583 !echo "shell says TERM<$TERM>"
585 !echo "shell says TERM<$TERM>"
587 !echo "shell says TERM<$TERM>"
589 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
590 -STERM=strawberry
-SnoTERM \
591 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
592 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
594 check behave
:s_freeze-7
0 "${MBOX}" '3365080441 132'
602 t_prolog t_behave_wysh
604 ${cat} <<- '__EOT' > "${BODY}"
623 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
624 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
625 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
627 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
628 echo a$'\u0041\u41\u0C1\U00000041\U41'c
651 echo a$'b\U0000000'dt
652 echo a$'b\U00000000'du
662 if [ -z "${UTF8_LOCALE}" ]; then
663 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
665 < "${BODY}" DIET=CURD TIED= \
666 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
667 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
670 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
671 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
673 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
674 wysh set mager='\hey\'
676 wysh set mager="\hey\\"
678 wysh set mager=$'\hey\\'
681 check behave:wysh-3 0 "${MBOX}" '1289698238 69'
686 t_behave_input_inject_semicolon_seq() {
687 t_prolog t_behave_input_inject_semicolon_seq
689 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
694 echon this_is_mymac;call mydeepmac;echon ';';
696 echon one';';call mymac;echon two";";call mymac;echo three$';';
698 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
700 echon one';';call mymac;echon two";";call mymac;echo three$';';
703 check behave:input_inject_semicolon_seq 0 "${MBOX}" '512117110 140'
708 t_behave_commandalias() {
709 t_prolog t_behave_commandalias
711 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
712 commandalias echo echo hoho
716 commandalias XxX XxXx
717 commandalias XxXx XxXxX
718 commandalias XxXxX XxXxXx
719 commandalias XxXxXx echo huhu
720 commandalias XxXxXxX echo huhu
722 commandalias XxXxXx XxXxXxX
725 commandalias XxXxXx echo huhu
729 check behave:commandalias 0 "${MBOX}" '3694143612 31'
735 t_prolog t_behave_ifelse
737 # Nestable conditions test
738 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
760 if $dietcurd == 'yoho'
765 if $dietcurd @== 'Yoho'
770 if $dietcurd == 'Yoho'
775 if $dietcurd != 'yoho'
780 if $dietcurd @!= 'Yoho'
785 if $dietcurd != 'Yoho'
846 if $dietcurd == 'yohu'
848 elif $dietcurd == 'yoha'
850 elif $dietcurd == 'yohe'
852 elif $dietcurd == 'yoho'
854 if $dietcurd == 'yohu'
856 elif $dietcurd == 'yoha'
858 elif $dietcurd == 'yohe'
860 elif $dietcurd == 'yoho'
862 if $dietcurd == 'yohu'
864 elif $dietcurd == 'yoha'
866 elif $dietcurd == 'yohe'
868 elif $dietcurd == 'yoho'
1017 set diet=abc curd=abc
1023 set diet=abc curd=abcd
1029 # 1. Shitty grouping capabilities as of today
1030 unset diet curd ndefined
1031 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1037 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1042 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1047 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1052 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1057 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1058 && [ no ] || [ yes ]
1063 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1068 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1073 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1078 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1083 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1088 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1093 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1098 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1103 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1108 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1114 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1120 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1125 # 2. Shitty grouping capabilities as of today
1126 unset diet curd ndefined
1127 if [ false || false || true ] && [ false || true ] && yes
1132 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1137 if [ 1 || 0 || 0 || 0 ]
1142 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1147 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1152 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1157 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1162 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1167 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1172 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1177 if 1 || 0 || 0 || 0 && 0
1182 if 1 || 0 || 0 || 0 && 1
1187 if 0 || 0 || 0 || 1 && 0
1192 if 0 || 0 || 0 || 1 && 1
1197 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1202 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1208 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1213 if $diet == 'yo' && $curd == 'ho' && $ndefined
1219 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1224 if $diet == 'yo' && $curd == 'ho' && $ndefined
1229 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1234 # Some more en-braced variables
1236 if ${diet} == ${curd}
1241 if ${diet} != ${curd}
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 ] ] ] ] ] || 3
1297 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
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 ] ] ] ] ] || 3
1343 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1350 check behave:if-normal 0 "${MBOX}" '1688759742 719'
1352 if have_feat regex; then
1353 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1355 if $dietcurd =~ '^yo.*'
1360 if $dietcurd =~ '^Yo.*'
1365 if $dietcurd @=~ '^Yo.*'
1370 if $dietcurd =~ '^yOho.+'
1375 if $dietcurd @!~ '.*Ho$'
1380 if $dietcurd !~ '.+yohO$'
1385 if [ $dietcurd @i!~ '.+yoho$' ]
1390 if ! [ $dietcurd @i=~ '.+yoho$' ]
1395 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1400 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1405 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1410 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1415 if ! ! ! $dietcurd !~ '.+yoho$'
1420 if ! ! ! $dietcurd =~ '.+yoho$'
1425 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1430 set diet=abc curd='^abc$'
1436 set diet=abc curd='^abcd$'
1444 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1446 printf 'behave:if-regex: unsupported, skipped\n'
1452 t_behave_localopts() {
1453 t_prolog t_behave_localopts
1455 # Nestable conditions test
1456 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1471 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1476 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1477 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1486 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1488 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1497 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1504 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1511 echo ----- $1: $2 -> $3 -> $4
1519 call llx
'call off' on on on
1520 call llx
'call off' off on on
1521 call llx
'call off' on off on
1522 call llx
'call off' on off off
1523 localopts call-fixate on
1524 call llx
'call-fixate on' on on on
1525 call llx
'call-fixate on' off on on
1526 call llx
'call-fixate on' on off on
1527 call llx
'call-fixate on' on off off
1528 unset x
;localopts call on
1529 call llx
'call on' on on on
1530 call llx
'call on' off on on
1531 call llx
'call on' on off on
1532 call llx
'call on' on off off
1537 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1543 t_prolog t_behave_local
1545 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1573 echo ------- global-1 du=$du
1575 echo ------- global-2 du=$du
1578 echo ------- global-3 du=$du
1580 echo ------- global-4 du=$du
1582 echo ------- global-5 du=$du
1585 check behave:local-1 0 "${MBOX}" '2411598140 641'
1590 t_behave_macro_param_shift() {
1591 t_prolog t_behave_macro_param_shift
1593 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1596 echo t2.0 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1601 echo t2.1 has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1602 if [ $# > 1 ] ||
[ $ignerr == '' ]
1607 echo t2.2
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1609 echo t2.3
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1613 echo t2.4
:$? has
$#/${#} parameters: "$1,${2},$3" (${*}) [$@
]
1618 call t2
1 you get four args
1619 echo t1.1
: $?
';' ignerr
($ignerr) should not exist
1620 call t2
1 you get
'three args'
1621 echo t1.2
: $?
';' ignerr
($ignerr) should not exist
1622 call t2
1 you
'get two args'
1623 echo t1.3
: $?
';' ignerr
($ignerr) should not exist
1624 call t2
1 'you get one arg'
1625 echo t1.4
: $?
';' ignerr
($ignerr) should not exist
1626 ignerr call t2
'' 'you get one arg'
1627 echo t1.5
: $?
';' ignerr
($ignerr) should not exist
1632 check behave
:macro_param_shift
0 "${MBOX}" '1402489146 1682'
1637 t_behave_addrcodec
() {
1638 t_prolog t_behave_addrcodec
1640 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1641 vput addrcodec res e 1 <doog@def>
1642 echo $?/$^ERRNAME $res
1643 eval vput addrcodec res d $res
1644 echo $?/$^ERRNAME $res
1645 vput addrcodec res e 2 . <doog@def>
1646 echo $?/$^ERRNAME $res
1647 eval vput addrcodec res d $res
1648 echo $?/$^ERRNAME $res
1649 vput addrcodec res e 3 Sauer Dr. <doog@def>
1650 echo $?/$^ERRNAME $res
1651 eval vput addrcodec res d $res
1652 echo $?/$^ERRNAME $res
1653 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1654 echo $?/$^ERRNAME $res
1655 eval vput addrcodec res d $res
1656 echo $?/$^ERRNAME $res
1657 vput addrcodec res e 3.51 Sauer (Ma) "Dr.
" <doog@def>
1658 echo $?/$^ERRNAME $res
1659 eval vput addrcodec res d $res
1660 echo $?/$^ERRNAME $res
1662 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1663 echo $?/$^ERRNAME $res
1664 eval vput addrcodec res d $res
1665 echo $?/$^ERRNAME $res
1666 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1667 echo $?/$^ERRNAME $res
1668 eval vput addrcodec res d $res
1669 echo $?/$^ERRNAME $res
1670 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1671 echo $?/$^ERRNAME $res
1672 eval vput addrcodec res d $res
1673 echo $?/$^ERRNAME $res
1674 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1675 echo $?/$^ERRNAME $res
1676 eval vput addrcodec res d $res
1677 echo $?/$^ERRNAME $res
1678 vput addrcodec res +e 8 \
1679 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1680 echo $?/$^ERRNAME $res
1681 eval vput addrcodec res d $res
1682 echo $?/$^ERRNAME $res
1683 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1684 echo $?/$^ERRNAME $res
1685 eval vput addrcodec res d $res
1686 echo $?/$^ERRNAME $res
1687 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1688 echo $?/$^ERRNAME $res
1689 eval vput addrcodec res d $res
1690 echo $?/$^ERRNAME $res
1691 vput addrcodec res +e 11 (Ma)Braten Dr".
" (Heu) <doog@def>
1692 echo $?/$^ERRNAME $res
1693 eval vput addrcodec res d $res
1694 echo $?/$^ERRNAME $res
1695 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1696 echo $?/$^ERRNAME $res
1697 eval vput addrcodec res d $res
1698 echo $?/$^ERRNAME $res
1699 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1700 echo $?/$^ERRNAME $res
1701 eval vput addrcodec res d $res
1702 echo $?/$^ERRNAME $res
1703 vput addrcodec res +e 14 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 15 \
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 16 \
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 17 \
1718 "Hey
" Du <doog@def> "Wie
() findet
" " Dr.
""" das? ()
1719 echo $?/$^ERRNAME $res
1720 eval vput addrcodec res d $res
1721 echo $?/$^ERRNAME $res
1722 vput addrcodec res +e 18 \
1723 <doog@def> "Hey
" Du "Wie
() findet
" " Dr.
""" das? ()
1724 echo $?/$^ERRNAME $res
1725 eval vput addrcodec res d $res
1726 echo $?/$^ERRNAME $res
1727 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1728 echo $?/$^ERRNAME $res
1729 eval vput addrcodec res d $res
1730 echo $?/$^ERRNAME $res
1732 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1733 echo $?/$^ERRNAME $res
1734 vput addrcodec res ++e 21 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
+++e
22 Hey
\\,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1740 echo $?
/$^ERRNAME
$res
1741 eval vput addrcodec res d
$res
1742 echo $?
/$^ERRNAME
$res
1744 vput addrcodec res s \
1745 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def
>
1746 echo $?
/$^ERRNAME
$res
1748 # Fix for [f3852f88]
1749 vput addrcodec res
++e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1750 echo $?
/$^ERRNAME
$res
1751 eval vput addrcodec res d
$res
1752 echo $?
/$^ERRNAME
$res
1753 vput addrcodec res e
<from2@exam.ple
> 100 (comment
) "Quot(e)d"
1754 echo $?
/$^ERRNAME
$res
1755 eval vput addrcodec res d
$res
1756 echo $?
/$^ERRNAME
$res
1759 check behave
:addrcodec-1
0 "${MBOX}" '1047317989 2612'
1761 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1763 mlsubscribe isa2@list
1765 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1766 echo $?/$^ERRNAME $res
1767 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie
()" find \" Dr. \" das?
1768 echo $?/$^ERRNAME $res
1769 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1770 echo $?/$^ERRNAME $res
1771 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie
()" find \" Dr. \" das?
1772 echo $?/$^ERRNAME $res
1773 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1774 echo $?/$^ERRNAME $res
1775 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie
()" find \" Dr. \" das?
1776 echo $?/$^ERRNAME $res
1779 check behave:addrcodec-2 0 "${MBOX}" '1391779299 104'
1781 if have_feat idna; then
1782 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1783 vput addrcodec res e
(heu
) <du@blödiän
> "stroh" du
1784 echo $?
/$^ERRNAME
$res
1785 eval vput addrcodec res d
$res
1786 echo $?
/$^ERRNAME
$res
1787 vput addrcodec res e
<du@blödiän
> du
1788 echo $?
/$^ERRNAME
$res
1789 eval vput addrcodec res d
$res
1790 echo $?
/$^ERRNAME
$res
1791 vput addrcodec res e du
<du@blödiän
>
1792 echo $?
/$^ERRNAME
$res
1793 eval vput addrcodec res d
$res
1794 echo $?
/$^ERRNAME
$res
1795 vput addrcodec res e
<du@blödiän
>
1796 echo $?
/$^ERRNAME
$res
1797 eval vput addrcodec res d
$res
1798 echo $?
/$^ERRNAME
$res
1799 vput addrcodec res e du@blödiän
1800 echo $?
/$^ERRNAME
$res
1801 eval vput addrcodec res d
$res
1802 echo $?
/$^ERRNAME
$res
1805 check behave
:addrcodec-idna
0 "${MBOX}" '498775983 326'
1807 printf 'behave:addrcodec-idna: unsupported, skipped\n'
1814 t_prolog t_behave_vexpr
1816 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1818 vput vexpr res = 9223372036854775807
1819 echo $?/$^ERRNAME $res
1820 vput vexpr res = 9223372036854775808
1821 echo $?/$^ERRNAME $res
1822 vput vexpr res = u9223372036854775808
1823 echo $?/$^ERRNAME $res
1824 vput vexpr res @= 9223372036854775808
1825 echo $?/$^ERRNAME $res
1826 vput vexpr res = -9223372036854775808
1827 echo $?/$^ERRNAME $res
1828 vput vexpr res = -9223372036854775809
1829 echo $?/$^ERRNAME $res
1830 vput vexpr res @= -9223372036854775809
1831 echo $?/$^ERRNAME $res
1832 vput vexpr res = U9223372036854775809
1833 echo $?/$^ERRNAME $res
1836 0b0111111111111111111111111111111111111111111111111111111111111111
1837 echo $?/$^ERRNAME $res
1839 S0b1000000000000000000000000000000000000000000000000000000000000000
1840 echo $?/$^ERRNAME $res
1842 S0b1000000000000000000000000000000000000000000000000000000000000000
1843 echo $?/$^ERRNAME $res
1845 U0b1000000000000000000000000000000000000000000000000000000000000000
1846 echo $?/$^ERRNAME $res
1848 0b1000000000000000000000000000000000000000000000000000000000000000
1849 echo $?/$^ERRNAME $res
1851 0b1000000000000000000000000000000000000000000000000000000000000000
1852 echo $?/$^ERRNAME $res
1854 -0b1000000000000000000000000000000000000000000000000000000000000000
1855 echo $?/$^ERRNAME $res
1857 S0b1000000000000000000000000000000000000000000000000000000000000001
1858 echo $?/$^ERRNAME $res
1860 S0b1000000000000000000000000000000000000000000000000000000000000001
1861 echo $?/$^ERRNAME $res
1863 -0b1000000000000000000000000000000000000000000000000000000000000001
1864 echo $?/$^ERRNAME $res
1866 U0b1000000000000000000000000000000000000000000000000000000000000001
1867 echo $?/$^ERRNAME $res
1869 vput vexpr res = 0777777777777777777777
1870 echo $?/$^ERRNAME $res
1871 vput vexpr res = S01000000000000000000000
1872 echo $?/$^ERRNAME $res
1873 vput vexpr res @= S01000000000000000000000
1874 echo $?/$^ERRNAME $res
1875 vput vexpr res = U01000000000000000000000
1876 echo $?/$^ERRNAME $res
1877 vput vexpr res = 01000000000000000000000
1878 echo $?/$^ERRNAME $res
1879 vput vexpr res @= 01000000000000000000000
1880 echo $?/$^ERRNAME $res
1881 vput vexpr res = -01000000000000000000000
1882 echo $?/$^ERRNAME $res
1883 vput vexpr res = S01000000000000000000001
1884 echo $?/$^ERRNAME $res
1885 vput vexpr res @= S01000000000000000000001
1886 echo $?/$^ERRNAME $res
1887 vput vexpr res @= -01000000000000000000001
1888 echo $?/$^ERRNAME $res
1889 vput vexpr res = U01000000000000000000001
1890 echo $?/$^ERRNAME $res
1892 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1893 echo $?/$^ERRNAME $res
1894 vput vexpr res = S0x8000000000000000
1895 echo $?/$^ERRNAME $res
1896 vput vexpr res @= S0x8000000000000000
1897 echo $?/$^ERRNAME $res
1898 vput vexpr res = U0x8000000000000000
1899 echo $?/$^ERRNAME $res
1900 vput vexpr res = 0x8000000000000000
1901 echo $?/$^ERRNAME $res
1902 vput vexpr res @= 0x8000000000000000
1903 echo $?/$^ERRNAME $res
1904 vput vexpr res = -0x8000000000000000
1905 echo $?/$^ERRNAME $res
1906 vput vexpr res = S0x8000000000000001
1907 echo $?/$^ERRNAME $res
1908 vput vexpr res @= S0x8000000000000001
1909 echo $?/$^ERRNAME $res
1910 vput vexpr res @= -0x8000000000000001
1911 echo $?/$^ERRNAME $res
1912 vput vexpr res = u0x8000000000000001
1913 echo $?/$^ERRNAME $res
1916 echo $?/$^ERRNAME $res
1918 echo $?/$^ERRNAME $res
1920 echo $?/$^ERRNAME $res
1922 vput vexpr res + 0 0
1923 echo $?/$^ERRNAME $res
1924 vput vexpr res + 0 1
1925 echo $?/$^ERRNAME $res
1926 vput vexpr res + 1 1
1927 echo $?/$^ERRNAME $res
1929 vput vexpr res + 9223372036854775807 0
1930 echo $?/$^ERRNAME $res
1931 vput vexpr res + 9223372036854775807 1
1932 echo $?/$^ERRNAME $res
1933 vput vexpr res @+ 9223372036854775807 1
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res + 0 9223372036854775807
1936 echo $?/$^ERRNAME $res
1937 vput vexpr res + 1 9223372036854775807
1938 echo $?/$^ERRNAME $res
1939 vput vexpr res @+ 1 9223372036854775807
1940 echo $?/$^ERRNAME $res
1942 vput vexpr res + -9223372036854775808 0
1943 echo $?/$^ERRNAME $res
1944 vput vexpr res + -9223372036854775808 -1
1945 echo $?/$^ERRNAME $res
1946 vput vexpr res @+ -9223372036854775808 -1
1947 echo $?/$^ERRNAME $res
1948 vput vexpr res + 0 -9223372036854775808
1949 echo $?/$^ERRNAME $res
1950 vput vexpr res + -1 -9223372036854775808
1951 echo $?/$^ERRNAME $res
1952 vput vexpr res @+ -1 -9223372036854775808
1953 echo $?/$^ERRNAME $res
1955 vput vexpr res - 0 0
1956 echo $?/$^ERRNAME $res
1957 vput vexpr res - 0 1
1958 echo $?/$^ERRNAME $res
1959 vput vexpr res - 1 1
1960 echo $?/$^ERRNAME $res
1962 vput vexpr res - 9223372036854775807 0
1963 echo $?/$^ERRNAME $res
1964 vput vexpr res - 9223372036854775807 -1
1965 echo $?/$^ERRNAME $res
1966 vput vexpr res @- 9223372036854775807 -1
1967 echo $?/$^ERRNAME $res
1968 vput vexpr res - 0 9223372036854775807
1969 echo $?/$^ERRNAME $res
1970 vput vexpr res - -1 9223372036854775807
1971 echo $?/$^ERRNAME $res
1972 vput vexpr res - -2 9223372036854775807
1973 echo $?/$^ERRNAME $res
1974 vput vexpr res @- -2 9223372036854775807
1975 echo $?/$^ERRNAME $res
1977 vput vexpr res - -9223372036854775808 +0
1978 echo $?/$^ERRNAME $res
1979 vput vexpr res - -9223372036854775808 +1
1980 echo $?/$^ERRNAME $res
1981 vput vexpr res @- -9223372036854775808 +1
1982 echo $?/$^ERRNAME $res
1983 vput vexpr res - 0 -9223372036854775808
1984 echo $?/$^ERRNAME $res
1985 vput vexpr res - +1 -9223372036854775808
1986 echo $?/$^ERRNAME $res
1987 vput vexpr res @- +1 -9223372036854775808
1988 echo $?/$^ERRNAME $res
1990 vput vexpr res + -13 -2
1991 echo $?/$^ERRNAME $res
1992 vput vexpr res - 0 0
1993 echo $?/$^ERRNAME $res
1994 vput vexpr res - 0 1
1995 echo $?/$^ERRNAME $res
1996 vput vexpr res - 1 1
1997 echo $?/$^ERRNAME $res
1998 vput vexpr res - -13 -2
1999 echo $?/$^ERRNAME $res
2001 vput vexpr res * 0 0
2002 echo $?/$^ERRNAME $res
2003 vput vexpr res * 0 1
2004 echo $?/$^ERRNAME $res
2005 vput vexpr res * 1 1
2006 echo $?/$^ERRNAME $res
2007 vput vexpr res * -13 -2
2008 echo $?/$^ERRNAME $res
2010 vput vexpr res / 0 0
2011 echo $?/$^ERRNAME $res
2012 vput vexpr res / 0 1
2013 echo $?/$^ERRNAME $res
2014 vput vexpr res / 1 1
2015 echo $?/$^ERRNAME $res
2016 vput vexpr res / -13 -2
2017 echo $?/$^ERRNAME $res
2019 vput vexpr res % 0 0
2020 echo $?/$^ERRNAME $res
2021 vput vexpr res % 0 1
2022 echo $?/$^ERRNAME $res
2023 vput vexpr res % 1 1
2024 echo $?/$^ERRNAME $res
2025 vput vexpr res % -13 -2
2026 echo $?/$^ERRNAME $res
2029 check behave:vexpr-numeric 0 "${MBOX}" '960821755 1962'
2031 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2032 vput vexpr res
find 'bananarama' 'nana'
2033 echo $?
/$^ERRNAME
:$res:
2034 vput vexpr res
find 'bananarama' 'bana'
2035 echo $?
/$^ERRNAME
:$res:
2036 vput vexpr res
find 'bananarama' 'Bana'
2037 echo $?
/$^ERRNAME
:$res:
2038 vput vexpr res
find 'bananarama' 'rama'
2039 echo $?
/$^ERRNAME
:$res:
2041 vput vexpr res ifind
'bananarama' 'nana'
2042 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res ifind
'bananarama' 'bana'
2044 echo $?
/$^ERRNAME
:$res:
2045 vput vexpr res ifind
'bananarama' 'Bana'
2046 echo $?
/$^ERRNAME
:$res:
2047 vput vexpr res ifind
'bananarama' 'rama'
2048 echo $?
/$^ERRNAME
:$res:
2050 vput vexpr res substring
'bananarama' 1
2051 echo $?
/$^ERRNAME
:$res:
2052 vput vexpr res substring
'bananarama' 3
2053 echo $?
/$^ERRNAME
:$res:
2054 vput vexpr res substring
'bananarama' 5
2055 echo $?
/$^ERRNAME
:$res:
2056 vput vexpr res substring
'bananarama' 7
2057 echo $?
/$^ERRNAME
:$res:
2058 vput vexpr res substring
'bananarama' 9
2059 echo $?
/$^ERRNAME
:$res:
2060 vput vexpr res substring
'bananarama' 10
2061 echo $?
/$^ERRNAME
:$res:
2062 vput vexpr res substring
'bananarama' 1 3
2063 echo $?
/$^ERRNAME
:$res:
2064 vput vexpr res substring
'bananarama' 3 3
2065 echo $?
/$^ERRNAME
:$res:
2066 vput vexpr res substring
'bananarama' 5 3
2067 echo $?
/$^ERRNAME
:$res:
2068 vput vexpr res substring
'bananarama' 7 3
2069 echo $?
/$^ERRNAME
:$res:
2070 vput vexpr res substring
'bananarama' 9 3
2071 echo $?
/$^ERRNAME
:$res:
2072 vput vexpr res substring
'bananarama' 10 3
2073 echo $?
/$^ERRNAME
:$res:
2075 vput vexpr res substring
'bananarama' -1
2076 echo $?
/$^ERRNAME
:$res:
2077 vput vexpr res substring
'bananarama' -3
2078 echo $?
/$^ERRNAME
:$res:
2079 vput vexpr res substring
'bananarama' -5
2080 echo $?
/$^ERRNAME
:$res:
2081 vput vexpr res substring
'bananarama' -7
2082 echo $?
/$^ERRNAME
:$res:
2083 vput vexpr res substring
'bananarama' -9
2084 echo $?
/$^ERRNAME
:$res:
2085 vput vexpr res substring
'bananarama' -10
2086 echo $?
/$^ERRNAME
:$res:
2087 vput vexpr res substring
'bananarama' 1 -3
2088 echo $?
/$^ERRNAME
:$res:
2089 vput vexpr res substring
'bananarama' 3 -3
2090 echo $?
/$^ERRNAME
:$res:
2091 vput vexpr res substring
'bananarama' 5 -3
2092 echo $?
/$^ERRNAME
:$res:
2093 vput vexpr res substring
'bananarama' 7 -3
2094 echo $?
/$^ERRNAME
:$res:
2095 vput vexpr res substring
'bananarama' 9 -3
2096 echo $?
/$^ERRNAME
:$res:
2097 vput vexpr res substring
'bananarama' 10 -3
2098 echo $?
/$^ERRNAME
:$res:
2100 vput vexpr res trim
'Cocoon Cocoon'
2101 echo $?
/$^ERRNAME
:$res:
2102 vput vexpr res trim
' Cocoon Cocoon '
2103 echo $?
/$^ERRNAME
:$res:
2104 vput vexpr res trim-front
'Cocoon Cocoon'
2105 echo $?
/$^ERRNAME
:$res:
2106 vput vexpr res trim-front
' Cocoon Cocoon '
2107 echo $?
/$^ERRNAME
:$res:
2108 vput vexpr res trim-end
'Cocoon Cocoon'
2109 echo $?
/$^ERRNAME
:$res:
2110 vput vexpr res trim-end
' Cocoon Cocoon '
2111 echo $?
/$^ERRNAME
:$res:
2114 check behave
:vexpr-string
0 "${MBOX}" '3182004322 601'
2116 if have_feat regex
; then
2117 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2118 vput vexpr res regex 'bananarama' 'nana'
2119 echo $?/$^ERRNAME :$res:
2120 vput vexpr res regex 'bananarama' 'bana'
2121 echo $?/$^ERRNAME :$res:
2122 vput vexpr res regex 'bananarama' 'Bana'
2123 echo $?/$^ERRNAME :$res:
2124 vput vexpr res regex 'bananarama' 'rama'
2125 echo $?/$^ERRNAME :$res:
2127 vput vexpr res iregex 'bananarama' 'nana'
2128 echo $?/$^ERRNAME :$res:
2129 vput vexpr res iregex 'bananarama' 'bana'
2130 echo $?/$^ERRNAME :$res:
2131 vput vexpr res iregex 'bananarama' 'Bana'
2132 echo $?/$^ERRNAME :$res:
2133 vput vexpr res iregex 'bananarama' 'rama'
2134 echo $?/$^ERRNAME :$res:
2136 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2137 echo $?/$^ERRNAME :$res:
2138 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2139 echo $?/$^ERRNAME :$res:
2140 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2141 echo $?/$^ERRNAME :$res:
2142 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2143 echo $?/$^ERRNAME :$res:
2145 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2146 echo $?/$^ERRNAME :$res:
2147 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2148 echo $?/$^ERRNAME :$res:
2149 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2150 echo $?/$^ERRNAME :$res:
2151 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2152 echo $?/$^ERRNAME :$res:
2156 check behave:vexpr-regex 0 "${MBOX}" '3270360157 311'
2158 printf 'behave:vexpr-regex: unsupported, skipped\n'
2164 t_behave_call_ret() {
2165 t_prolog t_behave_call_ret
2167 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2172 vput vexpr j
'&' $i 7
2178 vput vexpr j
'&' $i 7
2184 echo ! The end
for $1
2188 # Transport $?/$! up the call chain
2194 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2198 echo ! The end
for $1
2199 return $i $^ERR-BUSY
2203 # Up and down it goes
2210 vput vexpr k
- $1 $2
2214 echo "# <$i/$j> .. "
2218 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2221 echo ! The end
for $1=$i/$2
2225 return $i $^ERR-BUSY
2231 call w1
0; echo ?
=$?
!=$
!; echo -----;
2232 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2233 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2236 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
2242 t_prolog t_behave_xcall
2244 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2249 vput vexpr j '&' $i 7
2255 echo ! The end for $1/$2
2257 return $i $^ERR-BUSY
2268 echo ?=$? !=$^ERRNAME
2271 echo ?=$? !=$^ERRNAME
2273 echo ?=$? !=$^ERRNAME
2276 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
2280 ${cat} <<- '__EOT' > "${BODY}"
2285 vput vexpr j '&' $i 7
2291 echo ! The end for $1
2294 echo would be err with errexit
2303 echo zwei, ?=$? !=$!
2304 localopts yes; set errexit
2306 echo drei, ?=$? !=$^ERRNAME
2308 echo vier, ?=$? !=$^ERRNAME, this is an error
2311 echo outer 1, ?=$? !=$^ERRNAME
2313 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2315 echo outer 3, ?=$? !=$^ERRNAME
2316 echo this is definitely an error
2319 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
2321 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
2323 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
2325 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
2330 t_behave_vpospar() {
2331 t_prolog t_behave_vpospar
2333 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2334 vpospar
set hey
, "'you ", world
!
2335 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2336 vput vpospar x quote
; echo x
<$x>
2337 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2338 vput vpospar y quote
;echo y
<$y>
2339 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2340 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2341 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2344 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2345 vput vpospar z quote
;echo infun2
:z
<$z>
2349 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2350 vput vpospar y quote
;echo infun
:y
<$y>
2351 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2352 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2354 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2355 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2358 call infun This
"in a" fun
2359 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2360 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2362 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2365 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2367 echo ifs<$ifs> ifs-ws<$ifs-ws>
2368 vpospar set hey, "'you ", world!
2369 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2370 vput vpospar x quote; echo x<$x>
2371 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2372 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2375 echo ifs<$ifs> ifs-ws<$ifs-ws>
2376 vpospar set hey, "'you
", world!
2377 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2379 vput vpospar x quote; echo x<$x>
2380 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2381 eval vpospar set ${x};\
2382 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2385 echo ifs<$ifs> ifs-ws<$ifs-ws>
2386 vpospar set hey, "'you ", world!
2387 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2389 vput vpospar x quote; echo x<$x>
2390 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2391 eval vpospar set ${x};\
2392 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2394 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2399 t_behave_atxplode() {
2400 t_prolog t_behave_atxplode
2401 TRAP_EXIT_ADDONS="./.t*"
2403 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2406 printf " (1/$#: <$1>)"
2408 if [ $# -gt 0 ]; then
2422 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2423 printf xxx;xxx arg ,b u.
2424 printf xxx;xxx arg , .
2425 printf xxx;xxx arg ,ball.
2431 echon " (1/$#: <$1>)"
2446 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2447 echon xxx;call xxx arg ,b u.
2448 echon xxx;call xxx arg , .
2449 echon xxx;call xxx arg ,ball.
2452 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2453 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2455 #${SHELL} ./.t.sh > ./.tshout 2>&1
2456 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2462 t_prolog t_behave_read
2463 TRAP_EXIT_ADDONS="./.t*"
2465 ${cat} <<- '__EOT
' > .tin
2466 hey1, "'you
", world!
2467 hey2, "'you ", bugs bunny!
2472 ${cat} <<- '__EOT
' |\
2473 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2475 echo $?/$^ERRNAME / <$a><$b><$c>
2477 echo $?/$^ERRNAME / <$a><$b><$c>
2479 echo $?/$^ERRNAME / <$a><$b><$c>
2481 echo $?/$^ERRNAME / <$a><$b><$c>
2482 unset a b c;read a b c
2483 echo $?/$^ERRNAME / <$a><$b><$c>
2484 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2486 check behave:read-1 0 "${MBOX}" '1527910147 173'
2488 ${cat} <<- '__EOT
' > .tin2
2489 hey2.0,:"'you
",:world!:mars.:
2490 hey2.1,:"'you ",:world!
2491 hey2.2,:"'you
",:bugs bunny!
2497 ${cat} <<- '__EOT' |\
2498 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2501 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2503 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2505 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2507 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2509 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2511 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2512 unset a b c
;read a b c
2513 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2515 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2516 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2518 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2520 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2522 readall d; echo $?/$^ERRNAME / <$d>
2523 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2524 readctl create .tin2
2525 readall d; echo $?/$^ERRNAME / <$d>
2526 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2527 readctl remove .tin;echo $?/$^ERRNAME;\
2528 readctl remove .tin2;echo $?/$^ERRNAME
2530 check behave:readall 0 "${MBOX}" '860434889 333'
2536 t_prolog t_behave_mbox
2537 TRAP_EXIT_ADDONS=".
/.t
*"
2541 while [ ${i} -lt 112 ]; do
2542 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2543 "${MBOX}" "${i}" "${i}"
2546 ) | ${MAILX} ${ARGS}
2547 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2549 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2550 ${MAILX} ${ARGS} -Sshowlast > .tlst
2551 check behave:mbox-2 0 .tlst '2739893312 9103'
2553 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2554 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tlst
2555 check behave
:mbox-3
0 .tlst
'1702194178 9110'
2557 # only the odd (even)
2559 printf 'File "file://%s"\ncopy ' .tmbox2
2561 while [ ${i} -lt 112 ]; do
2563 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2566 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2567 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2568 check behave
:mbox-4
0 .tmbox3
'631132924 6890'
2569 check behave
:mbox-5
- .tlst
'2960975049 4573'
2572 printf 'file "file://%s"\nmove ' .tmbox2
2574 while [ ${i} -lt 112 ]; do
2576 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2579 printf 'file://%s\nFile "file://%s
"\nfrom*\nFile "file://%s
"\nfrom*' \
2580 .tmbox3 .tmbox3 .tmbox2
2581 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2582 check behave:mbox-6 0 .tmbox3 '1387070539 13655'
2583 ${sed} 2d < .tlst > .tlstx
2584 check behave:mbox-7 - .tlstx '2729940494 13645'
2589 t_behave_maildir() {
2590 t_prolog t_behave_maildir
2591 TRAP_EXIT_ADDONS=".
/.t
*"
2595 while [ ${i} -lt 112 ]; do
2596 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2597 "${MBOX}" "${i}" "${i}"
2600 ) | ${MAILX} ${ARGS}
2601 check behave:maildir-1 0 "${MBOX}" '1140119864 13780'
2607 ' "${MBOX}" .tmdir1 .tmdir1 |
2608 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2609 check behave:maildir-2 0 .tlst '1797938753 9103'
2612 copy * "maildir
://%s
"
2615 ' "${MBOX}" .tmdir2 .tmdir2 |
2616 ${MAILX} ${ARGS} -Sshowlast > .tlst
2617 check behave:maildir-3 0 .tlst '1155631089 9113'
2619 printf 'File "maildir
://%s
"
2623 ' .tmdir2 .tmbox1 .tmbox1 |
2624 ${MAILX} ${ARGS} -Sshowlast > .tlst
2625 check behave:maildir-4 0 .tmbox1 '2646131190 13220'
2626 check behave:maildir-5 - .tlst '3701297796 9110'
2628 # only the odd (even)
2630 printf 'File "maildir
://%s
"
2633 while [ ${i} -lt 112 ]; do
2635 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2642 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2643 check behave:maildir-6 0 .tmbox2 '142890131 6610'
2644 check behave:maildir-7 - .tlst '960096773 4573'
2647 printf 'file "maildir
://%s
"
2650 while [ ${i} -lt 112 ]; do
2652 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2660 ' .tmbox2 .tmbox2 .tmdir2
2661 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2662 check behave
:maildir-8
0 .tmbox2
'3806905791 13100'
2663 ${sed} 2d
< .tlst
> .tlstx
2664 check behave
:maildir-9
- .tlstx
'4216815295 13645'
2669 t_behave_record_a_resend
() {
2670 t_prolog t_behave_record_a_resend
2671 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2675 m %s\n~s Subject 1.\nHello.\n~.
2676 set record-files add-file-recipients
2677 m %s\n~s Subject 2.\nHello.\n~.
2679 resend 2 ./.t.resent
2680 Resend 1 ./.t.resent
2682 resend 2 ./.t.resent
2683 Resend 1 ./.t.resent
2684 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2687 check behave
:record_a_resend-1
0 "${MBOX}" '3057873538 256'
2688 check behave
:record_a_resend-2
- .t.record
'391356429 460'
2689 check behave
:record_a_resend-3
- .t.resent
'2685231691 648'
2694 t_behave_e_H_L_opts
() {
2695 t_prolog t_behave_e_H_L_opts
2696 TRAP_EXIT_ADDONS
="./.tsendmail.sh ./.t.mbox"
2699 ${MAILX} ${ARGS} -ef .
/.t.mbox
2700 echo ${?} > "${MBOX}"
2702 ${cat} <<-_EOT > ./.tsendmail.sh
2704 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2707 chmod 0755 .
/.tsendmail.sh
2708 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2709 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2710 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2711 ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2713 ${MAILX} ${ARGS} -ef .
/.t.mbox
2714 echo ${?} >> "${MBOX}"
2715 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2716 echo ${?} >> "${MBOX}"
2717 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2718 echo ${?} >> "${MBOX}"
2719 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2720 echo ${?} >> "${MBOX}"
2721 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2722 echo ${?} >> "${MBOX}"
2723 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2724 echo ${?} >> "${MBOX}"
2725 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2726 echo ${?} >> "${MBOX}"
2728 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2729 echo ${?} >> "${MBOX}"
2730 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2731 echo ${?} >> "${MBOX}"
2732 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2733 echo ${?} >> "${MBOX}"
2734 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2735 echo ${?} >> "${MBOX}"
2736 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2737 echo ${?} >> "${MBOX}"
2738 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2739 echo ${?} >> "${MBOX}"
2740 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev/null
2741 echo ${?} >> "${MBOX}"
2743 check behave:e_H_L_opts - "${MBOX}" '1708955574 678'
2748 t_behave_alternates() {
2749 t_prolog t_behave_alternates
2750 TRAP_EXIT_ADDONS=".
/.t
*"
2752 ${cat} <<-_EOT > ./.tsendmail.sh
2754 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2757 chmod 0755 ./.tsendmail.sh
2759 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2763 alternates a1@b1 a2@b2 a3@b3
2768 echo $?/$^ERRNAME <$rv>
2773 echo $?/$^ERRNAME <$rv>
2776 echo $?/$^ERRNAME <$rv>
2779 echo $?/$^ERRNAME <$rv>
2783 alternates a1@b1 a2@b2 a3@b3
2786 echo $?/$^ERRNAME <$rv>
2789 echo $?/$^ERRNAME <$rv>
2792 echo $?/$^ERRNAME <$rv>
2795 alternates a1@b1 a2@b2 a3@b3
2798 echo $?/$^ERRNAME <$rv>
2801 echo $?/$^ERRNAME <$rv>
2804 echo $?/$^ERRNAME <$rv>
2808 alternates a1@b1 a2@b2 a3@b3
2811 echo $?/$^ERRNAME <$rv>
2815 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2817 ~s all alternates, only a1@b1 remains
2819 ~b a3@b3 a3@c3 a3@d3
2828 alternates a1@b1 a1@c1 a2@b2 a3@b3
2830 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
2832 ~b a3@b3 a3@c3 a3@d3
2839 alternates a1@b1 a2@b2 a3; set allnet
2841 ~s all alternates via allnet, only a1@b1 remains
2843 ~b a3@b3 a3@c3 a3@d3
2854 echo $?/$^ERRNAME <$rv>
2858 echo $?/$^ERRNAME <$rv>
2862 echo $?/$^ERRNAME <$rv>
2866 echo $?/$^ERRNAME <$rv>
2870 echo $?/$^ERRNAME <$rv>
2874 alternates a1@b1 a2@b2
2877 echo $?/$^ERRNAME <$rv>
2878 alternates a3@b3 a4@b4
2881 echo $?/$^ERRNAME <$rv>
2883 check behave:alternates-1 0 "${MBOX}" '142184864 515'
2884 check behave:alternates-2 - .tall '1878598364 505'
2890 t_prolog t_behave_alias
2891 TRAP_EXIT_ADDONS=".
/.t
*"
2893 ${cat} <<-_EOT > ./.tsendmail.sh
2895 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2898 chmod 0755 ./.tsendmail.sh
2900 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh > ./.tall 2>&1
2902 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
2904 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2906 alias a4 a5 ex1@a4.ple
2908 alias a6 a7 ex1@a6.ple
2922 check behave:alias-1 0 "${MBOX}" '2496925843 272'
2923 check behave:alias-2 - .tall '3548953204 152'
2925 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2926 # TODO need to somehow provide its contents to the test, then test
2931 t_behave_filetype() {
2932 t_prolog t_behave_filetype
2933 TRAP_EXIT_ADDONS=".
/.t
*"
2935 ${cat} <<-_EOT > ./.tsendmail.sh
2937 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2940 chmod 0755 ./.tsendmail.sh
2942 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2943 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
2944 check behave
:filetype-1
0 "${MBOX}" '1594682963 13520'
2946 if (echo |
gzip -c) >/dev
/null
2>&1; then
2949 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
2950 "${MBOX}" | ${MAILX} ${ARGS} \
2951 -X'filetype gz gzip\ -dc gzip\ -c'
2952 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2953 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
2955 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2956 check behave:filetype-3 - ".
/.t.out
" '2392348396 102'
2958 echo 'behave:filetype-2: unsupported, skipped'
2959 echo 'behave:filetype-3: unsupported, skipped'
2964 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2970 -X'filetype gz gzip\ -dc gzip\ -c' \
2971 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2972 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2973 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2975 -X'filetype gz gzip\ -dc gzip\ -c' \
2976 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2978 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2979 check behave:filetype-5 - ".
/.t.out
" '852335377 172'
2984 t_behave_message_injections() {
2985 t_prolog t_behave_message_injections
2986 TRAP_EXIT_ADDONS=".
/.t
*"
2988 ${cat} <<-_EOT > ./.tsendmail.sh
2990 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
2993 chmod 0755 ./.tsendmail.sh
2995 echo mysig > ./.tmysig
2997 echo some-body | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
2998 -Smessage-inject-head=head-inject \
2999 -Smessage-inject-tail=tail-inject \
3000 -Ssignature=./.tmysig \
3001 ex@am.ple > ./.tall 2>&1
3002 check behave:message_injections-1 0 "${MBOX}" '2434746382 134'
3003 check behave:message_injections-2 - .tall '4294967295 0' # empty file
3005 ${cat} <<-_EOT > ./.template
3009 Subject: This subject is
3011 Body, body, body me.
3013 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tsendmail.sh \
3014 -Smessage-inject-head=head-inject \
3015 -Smessage-inject-tail=tail-inject \
3016 -Ssignature=./.tmysig \
3018 check behave:message_injections-3 0 "${MBOX}" '3114203412 198'
3019 check behave:message_injections-4 - .tall '4294967295 0' # empty file
3024 t_behave_attachments() {
3025 t_prolog t_behave_attachments
3026 TRAP_EXIT_ADDONS=".
/.t
*"
3028 ${cat} <<-_EOT > ./.tsendmail.sh
3030 (echo 'From Cannabis Sun Feb 18 02:02:46 2018' && ${cat} && echo
3033 chmod 0755 ./.tsendmail.sh
3035 ${cat} <<-_EOT > ./.tx
3036 From steffen Sun Feb 18 02:48:40 2018
3037 Date: Sun, 18 Feb 2018 02:48:40 +0100
3040 User-Agent: s-nail v14.9.7
3043 From steffen Sun Feb 18 02:48:42 2018
3044 Date: Sun, 18 Feb 2018 02:48:42 +0100
3047 User-Agent: s-nail v14.9.7
3052 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
3053 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
3054 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3057 !@ ./.t3 ".
/.t
4" ""
3065 ' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
3066 -a ./.t1 -a './.t 2' \
3067 -s attachment-test \
3068 ex@am.ple > ./.tall 2>&1
3069 check behave:attachments-1 0 "${MBOX}" '4107062253 634'
3070 check behave:attachments-2 - .tall '1928331872 720'
3075 !s This the subject is
3076 !@ ./.t3 "#2" "./.t 4" "#1" ""
3086 !@ .
/.t3
"#2" "./.t 4" "#1" ""
3094 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3103 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3117 ' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh -Rf ./.tx \
3119 check behave:attachments-3 0 "${MBOX}" '798122412 2285'
3120 check behave:attachments-4 - .tall '2526106274 1910'
3125 t_behave_compose_hooks() { # TODO monster
3126 t_prolog t_behave_compose_hooks
3127 TRAP_EXIT_ADDONS="./.t*"
3129 (echo line one&&echo line two&&echo line three) > ./.treadctl
3130 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
3132 ${cat} <<-_EOT > ./.tsendmail.sh
3134 (echo 'From PrimulaVeris Wed Apr
10 22:59:00 2017' && ${cat} && echo
3137 chmod 0755 ./.tsendmail.sh
3139 ${cat} <<'__EOT__' > ./.trc
3141 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3144 vput vexpr es substr "$1" 0 1
3149 define read_mline_res {
3150 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3151 echo $len/$es/$^ERRNAME: $hl
3152 if [ $es -ne $^ERR-NONE ]
3153 xcall bail read_mline_res
3155 \xcall read_mline_res
3160 echo "~^header list"; read hl; echo $hl;\
3161 call xerr "$hl" "in_addr ($xh) 0-1"
3163 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3164 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3165 echo "~^header insert $xh <${xh}2@exam.ple>";\
3166 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3167 echo "~^header insert $xh ${xh}3@exam.ple";\
3168 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3169 echo "~^header list $xh"; read hl; echo $hl;\
3170 call xerr "$hl" "ins_addr $xh 1-4"
3171 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3174 if [ "$t_remove" == "" ]
3178 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3179 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3181 xcall bail "ins_addr $xh 2-2"
3183 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3185 xcall bail "ins_addr $xh 2-3"
3187 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3189 xcall bail "ins_addr $xh 2-4"
3193 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3194 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3195 echo "~^header insert $xh <${xh}2@exam.ple>";\
3196 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3197 echo "~^header insert $xh ${xh}3@exam.ple";\
3198 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3199 echo "~^header list $xh"; read hl; echo $hl;\
3200 call xerr "$hl" "ins_addr $xh 3-4"
3201 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3204 echo "~^header remove-at $xh 1"; read es;\
3205 call xerr $es "ins_addr $xh 3-6"
3206 echo "~^header remove-at $xh 1"; read es;\
3207 call xerr $es "ins_addr $xh 3-7"
3208 echo "~^header remove-at $xh 1"; read es;\
3209 call xerr $es "ins_addr $xh 3-8"
3210 echo "~^header remove-at $xh 1"; read es;\
3211 vput vexpr es substr $es 0 3
3213 xcall bail "ins_addr $xh 3-9"
3215 echo "~^header remove-at $xh T"; read es;\
3216 vput vexpr es substr $es 0 3
3218 xcall bail "ins_addr $xh 3-10"
3220 echo "~^header list $xh"; read es;\
3221 vput vexpr es substr $es 0 3
3223 xcall bail "ins_addr $xh 3-11"
3225 echo "~^header show $xh"; read es;\
3226 vput vexpr es substr $es 0 3
3228 xcall bail "ins_addr $xh 3-12"
3232 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3233 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3234 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3235 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3236 echo "~^header insert $xh ${xh}3@exam.ple";\
3237 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3238 echo "~^header list $xh"; read hl; echo $hl;\
3239 call xerr "$hl" "header list $xh 3-4"
3240 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3243 echo "~^header remove-at $xh 3"; read es;\
3244 call xerr $es "ins_addr $xh 4-6"
3245 echo "~^header remove-at $xh 2"; read es;\
3246 call xerr $es "ins_addr $xh 4-7"
3247 echo "~^header remove-at $xh 1"; read es;\
3248 call xerr $es "ins_addr $xh 4-8"
3249 echo "~^header remove-at $xh 1"; read es;\
3250 vput vexpr es substr $es 0 3
3252 xcall bail "ins_addr $xh 4-9"
3254 echo "~^header remove-at $xh T"; read es;\
3255 vput vexpr es substr $es 0 3
3257 xcall bail "ins_addr $xh 4-10"
3259 echo "~^header list $xh"; read es;\
3260 vput vexpr es substr $es 0 3
3262 xcall bail "ins_addr $xh 4-11"
3264 echo "~^header show $xh"; read es;\
3265 vput vexpr es substr $es 0 3
3267 xcall bail "ins_addr $xh 4-12"
3271 wysh set xh=$1 mult=$2
3272 echo "~^header list"; read hl; echo $hl;\
3273 call xerr "$hl" "ins_ref ($xh) 0-1"
3275 echo "~^header insert $xh <$xh@exam.ple>";\
3276 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3278 echo "~^header insert $xh <${xh}2@exam.ple>";\
3279 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3280 echo "~^header insert $xh ${xh}3@exam.ple";\
3281 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3283 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3284 vput vexpr es substr $es 0 3
3286 xcall bail "ins_ref $xh 1-4"
3290 echo "~^header list $xh"; read hl; echo $hl;\
3291 call xerr "$hl" "ins_ref $xh 1-5"
3292 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3295 if [ "$t_remove" == "" ]
3299 echo "~^header remove $xh"; read es;\
3300 call xerr $es "ins_ref $xh 2-1"
3301 echo "~^header remove $xh"; read es;\
3302 vput vexpr es substr $es 0 3
3304 xcall bail "ins_ref $xh 2-2"
3306 echo "~^header list $xh"; read es;\
3307 vput vexpr es substr $es 0 3
3309 xcall bail "$es ins_ref $xh 2-3"
3311 echo "~^header show $xh"; read es;\
3312 vput vexpr es substr $es 0 3
3314 xcall bail "ins_ref $xh 2-4"
3318 echo "~^header insert $xh <$xh@exam.ple>";\
3319 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3321 echo "~^header insert $xh <${xh}2@exam.ple>";\
3322 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3323 echo "~^header insert $xh ${xh}3@exam.ple";\
3324 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3326 echo "~^header list $xh";\
3327 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3328 echo "~^header show $xh";\
3329 read es; call xerr $es "ins_ref $xh 3-5"
3332 echo "~^header remove-at $xh 1"; read es;\
3333 call xerr $es "ins_ref $xh 3-6"
3334 if [ $mult -ne 0 ] && [ $xh != subject ]
3335 echo "~^header remove-at $xh 1"; read es;\
3336 call xerr $es "ins_ref $xh 3-7"
3337 echo "~^header remove-at $xh 1"; read es;\
3338 call xerr $es "ins_ref $xh 3-8"
3340 echo "~^header remove-at $xh 1"; read es;\
3341 vput vexpr es substr $es 0 3
3343 xcall bail "ins_ref $xh 3-9"
3345 echo "~^header remove-at $xh T"; read es;\
3346 vput vexpr es substr $es 0 3
3348 xcall bail "ins_ref $xh 3-10"
3350 echo "~^header show $xh"; read es;\
3351 vput vexpr es substr $es 0 3
3353 xcall bail "ins_ref $xh 3-11"
3357 echo "~^header insert $xh <$xh@exam.ple> ";\
3358 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3360 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3361 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3362 echo "~^header insert $xh ${xh}3@exam.ple";\
3363 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3365 echo "~^header list $xh"; read hl; echo $hl;\
3366 call xerr "$hl" "ins_ref $xh 4-4"
3367 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3370 if [ $mult -ne 0 ] && [ $xh != subject ]
3371 echo "~^header remove-at $xh 3"; read es;\
3372 call xerr $es "ins_ref $xh 4-6"
3373 echo "~^header remove-at $xh 2"; read es;\
3374 call xerr $es "ins_ref $xh 4-7"
3376 echo "~^header remove-at $xh 1"; read es;\
3377 call xerr $es "ins_ref $xh 4-8"
3378 echo "~^header remove-at $xh 1"; read es;\
3379 vput vexpr es substr $es 0 3
3381 xcall bail "ins_ref $xh 4-9"
3383 echo "~^header remove-at $xh T"; read es;\
3384 vput vexpr es substr $es 0 3
3386 xcall bail "ins_ref $xh 4-10"
3388 echo "~^header show $xh"; read es;\
3389 vput vexpr es substr $es 0 3
3391 xcall bail "ins_ref $xh 4-11"
3396 # In collect.c order
3398 call ins_ref sender 0 # Not a "ref", but works
3402 call ins_addr reply-To
3403 call ins_addr mail-Followup-to
3404 call ins_ref messAge-id 0
3405 call ins_ref rEfErEncEs 1
3406 call ins_ref in-Reply-to 1
3407 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3408 call ins_addr freeForm1
3409 call ins_addr freeform2
3411 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3413 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3421 echo "~^attachment";\
3422 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3424 xcall bail "attach 0-1"
3427 echo "~^attach attribute ./.treadctl";\
3428 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3430 xcall bail "attach 0-2"
3432 echo "~^attachment attribute-at 1";\
3433 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3435 xcall bail "attach 0-3"
3438 echo "~^attachment insert ./.treadctl=ascii";\
3439 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3440 echo "~^attachment list";\
3441 read es; echo $es;call xerr "$es" "attach 1-2"
3443 echo "~^attachment attribute ./.treadctl";\
3444 read es; echo $es;call xerr "$es" "attach 1-3"
3446 echo "~^attachment attribute .treadctl";\
3447 read es; echo $es;call xerr "$es" "attach 1-4"
3449 echo "~^attachment attribute-at 1";\
3450 read es; echo $es;call xerr "$es" "attach 1-5"
3453 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3454 read es; echo $es;call xerr "$es" "attach 1-6"
3455 echo "~^attachment attribute-set .treadctl content-description Au";\
3456 read es; echo $es;call xerr "$es" "attach 1-7"
3457 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3458 read es; echo $es;call xerr "$es" "attach 1-8"
3460 echo "~^attachment attribute ./.treadctl";\
3461 read es; echo $es;call xerr "$es" "attach 1-9"
3463 echo "~^attachment attribute .treadctl";\
3464 read es; echo $es;call xerr "$es" "attach 1-10"
3466 echo "~^attachment attribute rctl";\
3467 read es; echo $es;call xerr "$es" "attach 1-11"
3469 echo "~^attachment attribute-at 1";\
3470 read es; echo $es;call xerr "$es" "attach 1-12"
3474 echo "~^attachment insert ./.tattach=latin1";\
3475 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3476 echo "~^attachment list";\
3477 read es; echo $es;call xerr "$es" "attach 2-2"
3479 echo "~^attachment attribute ./.tattach";\
3480 read es; echo $es;call xerr "$es" "attach 2-3"
3482 echo "~^attachment attribute .tattach";\
3483 read es; echo $es;call xerr "$es" "attach 2-4"
3485 echo "~^attachment attribute-at 2";\
3486 read es; echo $es;call xerr "$es" "attach 2-5"
3489 echo "~^attachment attribute-set ./.tattach filename tat";\
3490 read es; echo $es;call xerr "$es" "attach 2-6"
3492 "~^attachment attribute-set .tattach content-description Au2";\
3493 read es; echo $es;call xerr "$es" "attach 2-7"
3494 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3495 read es; echo $es;call xerr "$es" "attach 2-8"
3497 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3498 read es; echo $es;call xerr "$es" "attach 2-9"
3500 echo "~^attachment attribute ./.tattach";\
3501 read es; echo $es;call xerr "$es" "attach 2-10"
3503 echo "~^attachment attribute .tattach";\
3504 read es; echo $es;call xerr "$es" "attach 2-11"
3506 echo "~^attachment attribute tat";\
3507 read es; echo $es;call xerr "$es" "attach 2-12"
3509 echo "~^attachment attribute-at 2";\
3510 read es; echo $es;call xerr "$es" "attach 2-13"
3514 if [ "$t_remove" == "" ]
3518 echo "~^attachment remove ./.treadctl"; read es;\
3519 call xerr $es "attach 3-1"
3520 echo "~^attachment remove ./.tattach"; read es;\
3521 call xerr $es "attach 3-2"
3522 echo "~^ attachment remove ./.treadctl"; read es;\
3523 vput vexpr es substr $es 0 3
3525 xcall bail "attach 3-3"
3527 echo "~^ attachment remove ./.tattach"; read es;\
3528 vput vexpr es substr $es 0 3
3530 xcall bail "attach 3-4"
3532 echo "~^attachment list"; read es;\
3533 vput vexpr es substr $es 0 3
3535 xcall bail "attach 3-5"
3539 echo "~^attachment insert ./.tattach=latin1";\
3540 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3541 echo "~^attachment insert ./.tattach=latin1";\
3542 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3543 echo "~^attachment list";\
3544 read es; echo $es;call xerr "$es" "attach 4-3"
3546 echo "~^ attachment remove .tattach"; read es;\
3547 vput vexpr es substr $es 0 3
3549 xcall bail "attach 4-4 $es"
3551 echo "~^attachment remove-at T"; read es;\
3552 vput vexpr es substr $es 0 3
3554 xcall bail "attach 4-5"
3556 echo "~^attachment remove ./.tattach"; read es;\
3557 call xerr $es "attach 4-6"
3558 echo "~^attachment remove ./.tattach"; read es;\
3559 call xerr $es "attach 4-7"
3560 echo "~^ attachment remove ./.tattach"; read es;\
3561 vput vexpr es substr $es 0 3
3563 xcall bail "attach 4-8 $es"
3565 echo "~^attachment list"; read es;\
3566 vput vexpr es substr $es 0 3
3568 xcall bail "attach 4-9"
3572 echo "~^attachment insert ./.tattach=latin1";\
3573 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3574 echo "~^attachment insert ./.tattach=latin1";\
3575 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3576 echo "~^attachment insert ./.tattach=latin1";\
3577 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3578 echo "~^attachment list";\
3579 read es; echo $es;call xerr "$es" "attach 5-4"
3582 echo "~^attachment remove-at 3"; read es;\
3583 call xerr $es "attach 5-5"
3584 echo "~^attachment remove-at 3"; read es;\
3585 vput vexpr es substr $es 0 3
3587 xcall bail "attach 5-6"
3589 echo "~^attachment remove-at 2"; read es;\
3590 call xerr $es "attach 5-7"
3591 echo "~^attachment remove-at 2"; read es;\
3592 vput vexpr es substr $es 0 3
3594 xcall bail "attach 5-8"
3596 echo "~^attachment remove-at 1"; read es;\
3597 call xerr $es "attach 5-9"
3598 echo "~^attachment remove-at 1"; read es;\
3599 vput vexpr es substr $es 0 3
3601 xcall bail "attach 5-10"
3604 echo "~^attachment list"; read es;\
3605 vput vexpr es substr $es 0 3
3607 xcall bail "attach 5-11"
3611 echo "~^attachment insert ./.tattach=latin1";\
3612 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3613 echo "~^attachment insert ./.tattach=latin1";\
3614 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3615 echo "~^attachment insert ./.tattach=latin1";\
3616 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3617 echo "~^attachment list";\
3618 read es; echo $es;call xerr "$es" "attach 6-4"
3621 echo "~^attachment remove-at 1"; read es;\
3622 call xerr $es "attach 6-5"
3623 echo "~^attachment remove-at 1"; read es;\
3624 call xerr $es "attach 6-6"
3625 echo "~^attachment remove-at 1"; read es;\
3626 call xerr $es "attach 6-7"
3627 echo "~^attachment remove-at 1"; read es;\
3628 vput vexpr es substr $es 0 3
3630 xcall bail "attach 6-8"
3633 echo "~^attachment list"; read es;\
3634 vput vexpr es substr $es 0 3
3636 xcall bail "attach 6-9"
3648 echo on-compose-enter, mailx-command<$mailx-command>
3649 alternates alter1@exam.ple alter2@exam.ple
3651 set autocc='alter1@exam.ple alter2@exam.ple
'
3652 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3653 echo mailx-subject<$mailx-subject>
3654 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3655 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3656 mailx-raw-bcc<$mailx-raw-bcc>
3657 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3658 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3661 echo on-compose-leave, mailx-command<$mailx-command>
3663 eval alternates $al alter3@exam.ple alter4@exam.ple
3665 set autobcc='alter3@exam.ple alter4@exam.ple
'
3666 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3667 echo mailx-subject<$mailx-subject>
3668 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3669 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3670 mailx-raw-bcc<$mailx-raw-bcc>
3671 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3672 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3675 echo on-compose-cleanup, mailx-command<$mailx-command>
3678 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3679 echo mailx-subject<$mailx-subject>
3680 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3681 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3682 mailx-raw-bcc<$mailx-raw-bcc>
3683 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3684 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3686 wysh set on-compose-splice=t_ocs \
3687 on-compose-enter=t_oce on-compose-leave=t_ocl \
3688 on-compose-cleanup=t_occ
3692 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
3693 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3694 -X'source .
/.trc
' -Smta=./.tsendmail.sh \
3696 ${cat} ./.tall >> "${MBOX}"
3697 check behave:compose_hooks-1 0 "${MBOX}" '522535560 10101'
3700 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
3701 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3702 -St_remove=1 -X'source .
/.trc
' -Smta=./.tsendmail.sh \
3704 ${cat} ./.tall >> "${MBOX}"
3705 check behave:compose_hooks-2 0 "${MBOX}" '3654000499 12535'
3709 # Some state machine stress, shell compose hook, localopts for hook, etc.
3710 # readctl in child. ~r as HERE document
3712 printf 'm ex@am.ple
\nbody
\n!.
3713 echon
${mailx-command}${mailx-subject}
3714 echon
${mailx-from}${mailx-sender}
3715 echon
${mailx-to}${mailx-cc}${mailx-bcc}
3716 echon
${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3717 echon
${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3718 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3719 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3720 -Smta=./.tsendmail.sh \
3723 echoerr
"Failed: $1. Bailing out"; echo "~x"; xit
3726 vput vexpr es substr
"$1" 0 1
3731 define read_mline_res
{
3732 read hl
; wysh
set len
=$? es
=$
! en
=$^ERRNAME
;\
3733 echo $len/$es/$^ERRNAME
: $hl
3734 if [ $es -ne $^ERR-NONE
]
3735 xcall bail read_mline_res
3737 \xcall read_mline_res
3741 vput vexpr i
+ 1 "$2"
3743 vput vexpr j
% $i 10
3750 eval \\$j _work
$1 $i
3753 vput vexpr i
+ $i "$1"
3757 wysh
set line
; read line
;wysh
set es
=$? en
=$^ERRNAME
;\
3758 echo read:$es/$en: $line
3759 if [ "${es}" -ne -1 ]
3762 readctl remove
$cwd/.treadctl
; echo readctl remove
:$?
/$^ERRNAME
3767 echo "~^header list"; read hl
; echo $hl;\
3768 vput vexpr es substr
"$hl" 0 1
3770 xcall bail
"header list"
3773 call _work
1; echo $?
3774 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3775 read es
; echo $es; vput vexpr es substr
"$es" 0 1
3777 xcall bail
"be diet"
3779 echo "~^header insert cc <splice2@exam.ple>";\
3780 read es
; echo $es; vput vexpr es substr
"$es" 0 1
3782 xcall bail
"be diet2"
3785 call _work
2; echo $?
3786 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3787 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3789 xcall bail
"be juicy"
3791 echo "~^header insert bcc juice2@exam.ple";\
3792 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3794 xcall bail
"be juicy2"
3796 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3797 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3799 xcall bail
"be juicy3"
3801 echo "~^header insert bcc juice4@exam.ple";\
3802 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3804 xcall bail
"be juicy4"
3807 echo "~^header remove-at bcc 3";\
3808 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3810 xcall bail
"remove juicy5"
3812 echo "~^header remove-at bcc 2";\
3813 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3815 xcall bail
"remove juicy6"
3817 echo "~^header remove-at bcc 3";\
3818 read es
; echo $es;vput vexpr es substr
"$es" 0 3
3820 xcall bail
"failed to remove-at"
3822 # Add duplicates which ought to be removed!
3823 echo "~^header insert bcc juice4@exam.ple";\
3824 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3826 xcall bail
"be juicy4-1"
3828 echo "~^header insert bcc juice4@exam.ple";\
3829 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3831 xcall bail
"be juicy4-2"
3833 echo "~^header insert bcc juice4@exam.ple";\
3834 read es
; echo $es;vput vexpr es substr
"$es" 0 1
3836 xcall bail
"be juicy4-3"
3841 call _work
3; echo $?
3843 vput
! i
echo just knock
if you can hear me
;\
3845 while [ $i -lt 24 ]; do printf "%s " $i; i
=`expr $i + 1`; done;\
3847 echon shell-cmd says $?
/$^ERRNAME
: $i
3848 echo "~x will not become interpreted, we are reading until __EOT"
3850 read r_status
; echo "~~r status output: $r_status"
3851 echo "~:echo $? $! $^ERRNAME"
3853 echo "~~r status from parent: $r_status"
3856 call _work
4; echo $?
3857 vput cwd cwd
;echo cwd
:$?
3858 readctl create
$cwd/.treadctl
;echo readctl
:$?
/$^ERRNAME
;\
3862 call _work
5; echo $?
3863 echo "~^header show MAILX-Command"; read es
;\
3864 call xerr
$es "t_header 1000"; call read_mline_res
3865 echo "~^header show MAILX-raw-TO"; read es
;\
3866 call xerr
$es "t_header 1001"; xcall read_mline_res
3868 echoerr IT IS WRONG IF YOU SEE THIS
3871 echo on-compose-enter
, mailx-command
<$mailx-command>
3872 set t_oce autobcc
=oce@exam.ple
3873 alternates alter1@exam.ple alter2@exam.ple
3875 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
3876 echo mailx-subject
<$mailx-subject>
3877 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
3878 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
3879 mailx-raw-bcc
<$mailx-raw-bcc>
3880 echo mailx-orig-from
<$mailx-orig-from> \
3881 mailx-orig-to
<$mailx-orig-to> \
3882 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
3885 echo on-compose-leave
, mailx-command
<$mailx-command>
3886 set t_ocl autocc
=ocl@exam.ple
3888 alternates alter3@exam.ple alter4@exam.ple
3890 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
3891 echo mailx-subject
<$mailx-subject>
3892 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
3893 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
3894 mailx-raw-bcc
<$mailx-raw-bcc>
3895 echo mailx-orig-from
<$mailx-orig-from> \
3896 mailx-orig-to
<$mailx-orig-to> \
3897 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
3900 echo on-compose-cleanup
, mailx-command
<$mailx-command>
3901 set t_occ autocc
=occ@exam.ple
3904 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
3905 echo mailx-subject
<$mailx-subject>
3906 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
3907 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
3908 mailx-raw-bcc
<$mailx-raw-bcc>
3909 echo mailx-orig-from
<$mailx-orig-from> \
3910 mailx-orig-to
<$mailx-orig-to> \
3911 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
3913 wysh
set on-compose-splice
=t_ocs \
3914 on-compose-splice-shell
="read ver;printf \"t_ocs-shell\\n\
3915 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3916 on-compose-enter
=t_oce on-compose-leave
=t_ocl \
3917 on-compose-cleanup
=t_occ
3919 ex0_test behave:compose_hooks-3-estat
3920 ${cat} ./.tnotes >> "${MBOX}"
3922 check behave:compose_hooks-3 - "${MBOX}" '679526364 2431'
3924 # Reply, forward, resend, Resend
3927 printf 'set from
=f1@z
\nm t1@z
\nb
1\n!.
\nset from
=f2@z
\nm t2@z
\nb
2\n!.
\n' |
3928 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3929 -Smta=./.tsendmail.sh
3932 echo start
: $? $
! $^ERRNAME
3934 echo File
: $? $
! $^ERRNAME
;echo;echo
3936 this is content of reply
1
3938 echo reply
1: $? $
! $^ERRNAME
;echo;echo
3940 this is content of Reply
1 2
3942 echo Reply
1 2: $? $
! $^ERRNAME
;echo;echo
3943 forward
1 fwdex@am.ple
3944 this is content of forward
1
3946 echo forward
1: $? $
! $^ERRNAME
;echo;echo
3947 resend
1 2 resendex@am.ple
3948 echo resend
1 2: $? $
! $^ERRNAME
;echo;echo
3949 Resend
1 2 Resendex@am.ple
3950 echo Resend
1 2: $? $
! $^ERRNAME
;echo;echo
3952 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3953 -Smta=./.tsendmail.sh \
3956 echoerr
"Failed: $1. Bailing out"; echo "~x"; xit
3959 vput vexpr es substr
"$1" 0 1
3964 define read_mline_res
{
3965 read hl
; wysh
set len
=$? es
=$
! en
=$^ERRNAME
;\
3966 echo mline_res
:$len/$es/$^ERRNAME
: $hl
3967 if [ $es -ne $^ERR-NONE
]
3968 xcall bail read_mline_res
3970 \xcall read_mline_res
3974 echo "~^header show $1"; read es
;\
3975 call xerr
$es "work_hl $1"; echo $1; call read_mline_res
3983 echo t_ocs version
$ver
3984 echo "~^header list"; read hl
; echo $hl;\
3985 echoerr the header list is
$hl;\
3986 call xerr
"$hl" "header list"
3987 eval vpospar
set $hl
3990 echoerr IT IS WRONG IF YOU SEE THIS
3993 echo on-XY-enter
, mailx-command
<$mailx-command>
3994 set t_oce autobcc
=oce@exam.ple
3995 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
3996 echo mailx-subject
<$mailx-subject>
3997 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
3998 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
3999 mailx-raw-bcc
<$mailx-raw-bcc>
4000 echo mailx-orig-from
<$mailx-orig-from> \
4001 mailx-orig-to
<$mailx-orig-to> \
4002 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
4005 echo on-XY-leave
, mailx-command
<$mailx-command>
4006 set t_ocl autocc
=ocl@exam.ple
4007 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
4008 echo mailx-subject
<$mailx-subject>
4009 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
4010 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
4011 mailx-raw-bcc
<$mailx-raw-bcc>
4012 echo mailx-orig-from
<$mailx-orig-from> \
4013 mailx-orig-to
<$mailx-orig-to> \
4014 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
4017 echo on-XY-cleanup
, mailx-command
<$mailx-command>
4018 set t_occ autocc
=occ@exam.ple
4019 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
4020 echo mailx-subject
<$mailx-subject>
4021 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
4022 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
4023 mailx-raw-bcc
<$mailx-raw-bcc>
4024 echo mailx-orig-from
<$mailx-orig-from> \
4025 mailx-orig-to
<$mailx-orig-to> \
4026 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
4028 wysh
set on-compose-splice
=t_ocs \
4029 on-compose-enter
=t_oce on-compose-leave
=t_ocl \
4030 on-compose-cleanup
=t_occ \
4031 on-resend-enter
=t_oce on-resend-cleanup
=t_occ
4033 ex0_test behave:compose_hooks-4-estat
4034 ${cat} ./.tnotes >> "${MBOX}"
4036 check behave:compose_hooks-4 - "${MBOX}" '3038884027 7516'
4041 t_behave_C_opt_customhdr() {
4042 t_prolog t_behave_C_opt_customhdr
4043 TRAP_EXIT_ADDONS="./.t*"
4045 ${cat} <<-_EOT > ./.tsendmail.sh
4047 (echo 'From CimicifugaRacemosa Mon Dec
25 21:33:40 2017' &&
4051 chmod 0755 ./.tsendmail.sh
4054 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
4055 -C 'C-One
: Custom One Body
' \
4056 -C 'C-Two
:CustomTwoBody
' \
4057 -S customhdr='chdr1
: chdr1 body
, chdr2
:chdr2 body
' \
4058 this-goes@nowhere >./.tall 2>&1
4059 ex0_test behave:C_opt_customhdr-1-estat
4060 ${cat} ./.tall >> "${MBOX}"
4061 check behave:C_opt_customhdr-1 0 "${MBOX}" '2400078426 195'
4064 printf 'm this-goes@nowhere
\nbody
\n!.
4066 m this-goes2@nowhere
\nbody
2\n!.
4067 set customhdr
=%ccustom1
: custom1 body
%c
4068 m this-goes2@nowhere
\nbody
2\n!.
4069 set customhdr
=%ccustom1
: custom1
\\, body
, custom2
: custom2 body
%c
4070 m this-goes3@nowhere
\nbody
3\n!.
4072 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh -Sescape=! \
4073 -C 'C-One
: Custom One Body
' \
4074 -C 'C-Two
:CustomTwoBody
' \
4075 -S customhdr='chdr1
: chdr1 body
, chdr2
:chdr2 body
' \
4077 ex0_test behave:C_opt_customhdr-2-estat
4078 ${cat} ./.tall >> "${MBOX}"
4079 check behave:C_opt_customhdr-2 0 "${MBOX}" '3546878678 752'
4084 t_behave_mass_recipients() {
4085 t_prolog t_behave_mass_recipients
4086 TRAP_EXIT_ADDONS="./.t*"
4088 ${cat} <<-_EOT > ./.tsendmail.sh
4090 (echo 'From Eucalyptus Sat Jul
08 21:14:57 2017' && ${cat} && echo
4093 chmod 0755 ./.tsendmail.sh
4095 ${cat} <<'__EOT__' > ./.trc
4097 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4100 wysh set nr=$1 hn=$2
4101 echo "~$hn $hn$nr@$hn"; echo '~
:echo $?
'; read es
4103 xcall bail "ins_addr $hn 1-$nr"
4105 vput vexpr nr + $nr 1
4106 if [ "$nr" -le "$maximum" ]
4107 xcall ins_addr $nr $hn
4111 wysh set nr=$1 hn=$2
4112 alternates $hn$nr@$hn
4113 vput vexpr nr + $nr 2
4114 if [ "$nr" -le "$maximum" ]
4115 xcall bld_alter $nr $hn
4125 if [ "$t_remove" != '' ]
4130 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4133 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
4134 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4135 -X'source .
/.trc
' -Smta=./.tsendmail.sh -Smaximum=2001 \
4137 ex0_test behave:mass_recipients-1-estat
4138 ${cat} ./.tall >> "${MBOX}"
4139 check behave:mass_recipients-1 - "${MBOX}" '2912243346 51526'
4142 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
4143 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4144 -St_remove=1 -X'source .
/.trc
' -Smta=./.tsendmail.sh -Smaximum=2001 \
4146 ex0_test behave:mass_recipients-2-estat
4147 ${cat} ./.tall >> "${MBOX}"
4148 check behave:mass_recipients-2 - "${MBOX}" '4097804632 34394'
4153 t_behave_mime_types_load_control() {
4154 t_prolog t_behave_mime_types_load_control
4155 TRAP_EXIT_ADDONS="./.t*"
4157 ${cat} <<-_EOT > ./.tmts1
4158 @ application/mathml+xml mathml
4160 ${cat} <<-_EOT > ./.tmts2
4161 @ x-conference/x-cooltalk ice
4163 @ application/aga-aga aga
4166 ${cat} <<-_EOT > ./.tmts1.mathml
4167 <head>nonsense ML</head>
4169 ${cat} <<-_EOT > ./.tmts2.ice
4172 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.doom
4173 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.aga
4187 ' "${MBOX}" "${MBOX}" |
4189 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
4191 ex0_test behave:mime_types_load_control-1-estat
4192 ${cat} "${MBOX}" >> ./.tout
4193 check behave:mime_types_load_control-1 - ./.tout '1441260727 2449'
4195 echo type | ${MAILX} ${ARGS} -R \
4196 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
4197 -f "${MBOX}" >> ./.tout 2>&1
4198 check behave:mime_types_load_control-2 0 ./.tout '1441391438 3646'
4203 t_behave_lreply_futh_rth_etc() {
4204 t_prolog t_behave_lreply_futh_rth_etc
4205 TRAP_EXIT_ADDONS="./.t*"
4207 ${cat} <<-_EOT > ./.tsendmail.sh
4209 (echo 'From HumulusLupulus Thu Jul
27 14:41:20 2017' && ${cat} && echo
4212 chmod 0755 ./.tsendmail.sh
4214 ${cat} <<-_EOT > ./.tmbox
4215 From neverneverland Sun Jul 23 13:46:25 2017
4216 Subject: Bugstop: five miles out 1
4217 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4218 From: mister originator <mr@originator>
4219 To: bugstop-commit@five.miles.out, laber@backe.eu
4221 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4222 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4223 Date: Wed, 19 Jul 2017 09:22:57 -0400
4224 Message-Id: <20170719132257.766AF781267@originator>
4227 > |Sorry, I think I misunderstand something. I would think that
4231 From neverneverland Fri Jul
7 22:39:11 2017
4232 Subject
: Bugstop
: five miles out
2
4233 Reply-To
: mister originator2
<mr2@originator
>,bugstop@five.miles.out
,is@a.list
4234 Content-Transfer-Encoding
: 7bit
4235 From
: mister originator
<mr@originator
>
4236 To
: bugstop-commit@five.miles.out
4238 Message-ID
: <149945963975.28888.6950788126957753723.reportbug@five.miles.out
>
4239 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
4242 capable of changing back.
4244 From neverneverland Fri Jul
7 22:42:00 2017
4245 Subject
: Bugstop
: five miles out
3
4246 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
4247 Content-Transfer-Encoding
: 7bit
4248 From
: mister originator
<mr@originator
>
4249 To
: bugstop-commit@five.miles.out
4251 Message-ID
: <149945963975.28888.6950788126957753746.reportbug@five.miles.out
>
4252 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
4253 List-Post
: <mailto
:bugstop@five.miles.out
>
4256 are you ready
, boots?
4258 From neverneverland Sat Aug
19 23:15:00 2017
4259 Subject
: Bugstop
: five miles out
4
4260 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
4261 Content-Transfer-Encoding
: 7bit
4262 From
: mister originator
<mr@originator
>
4263 To
: bugstop@five.miles.out
4265 Message-ID
: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out
>
4266 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
4267 List-Post
: <mailto
:bugstop@five.miles.out
>
4270 are you ready
, boots?
4275 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh \
4276 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4278 wysh
set m
="This is text of \"reply ${1}."
4289 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4292 wysh set m="This is text of
\"Reply
${1}.
"
4298 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4307 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4311 # We need two indirections for this test: one for the case that Lreply
4312 # fails because of missing recipients: we need to read EOF next, thus
4313 # place this in _Ls last; and second for the succeeding cases EOF is
4314 # not what these should read, so go over the backside and splice it in!
4316 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4319 localopts call-fixate
yes
4321 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4322 call L
$1 1; call L
$1 2; call L
$1 3
4325 echo;echo '===== CHANGING === '"$*"' =====';echo
4329 set from
=laber@backe.eu
4332 call tweak
set reply-to-honour
4334 call tweak
set followup-to
4336 call tweak
set followup-to-honour
4338 call tweak mlist bugstop@five.miles.out
4340 call tweak mlsubscribe bugstop@five.miles.out
4342 call tweak
set recipients-in-cc
4346 check behave
:lreply_futh_rth_etc-1
0 "${MBOX}" '940818845 29373'
4350 ${cat} <<-_EOT > ./.tmbox
4351 From tom@i-i.example Thu Oct 26 03:15:55 2017
4352 Date: Wed, 25 Oct 2017 21:15:46 -0400
4353 From: tom <tom@i-i.example>
4354 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4355 Cc: tom <tom@i-i.example>
4356 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4357 Message-ID: <20171026011546.GA11643@i-i.example>
4358 Reply-To: tom@i-i.example
4359 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4360 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4363 The report's useful :-)
4366 printf 'reply 1\nthank you\n!.\n' |
4367 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tsendmail.sh
-Sreply-to-honour \
4368 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4369 check behave
:lreply_futh_rth_etc-2
0 "${MBOX}" '1045866991 331'
4374 t_behave_xxxheads_rfc2047
() {
4375 t_prolog t_behave_xxxheads_rfc2047
4376 TRAP_EXIT_ADDONS
="./.t*"
4378 ${cat} <<-_EOT > ./.tsendmail.sh
4380 (echo 'From GentianaLutea Mon Dec 04 17:15:29 2017' && ${cat} &&
4383 chmod 0755 .
/.tsendmail.sh
4387 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4388 -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̲' \
4390 check behave
:xxxheads_rfc2047-1
0 "${MBOX}" '3370931614 375'
4392 # Single word (overlong line split -- bad standard! Requires injection of
4393 # artificial data!! But can be prevented by using RFC 2047 encoding)
4395 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4396 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4397 check behave:xxxheads_rfc2047-2 0 "${MBOX}" '489922370 1718'
4399 # Combination of encoded words, space and tabs of varying sort
4401 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4402 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4403 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4404 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4405 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4406 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4408 check behave:xxxheads_rfc2047-3 0 "${MBOX}" '1676887734 591'
4410 # Overlong multibyte sequence that must be forcefully split
4411 # todo This works even before v15.0, but only by accident
4413 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4414 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4415 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4416 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4418 check behave:xxxheads_rfc2047-4 0 "${MBOX}" '3029301775 659'
4422 echo | ${MAILX} ${ARGS} \
4423 -s "1-1 B2 B3 B4 B5 B6 B\
4424 1-2 B2 B3 B4 B5 B6 B\
4425 1-3 B2 B3 B4 B5 B6 B\
4426 1-4 B2 B3 B4 B5 B6 B\
4427 1-5 B2 B3 B4 B5 B6 B\
4428 1-6 B2 B3 B4 B5 B6
" \
4430 check behave:xxxheads_rfc2047-5 0 "${MBOX}" '4126167195 297'
4432 # Leading and trailing WS
4434 echo | ${MAILX} ${ARGS} \
4435 -s " 2-1 B2 B3 B4 B5 B6 B\
4436 1-2 B2 B3 B4 B5 B6 B\
4437 1-3 B2 B3 B4 B5 B6 B\
4438 1-4 B2 B3 B4 B5 B6
" \
4440 check behave:xxxheads_rfc2047-6 0 "${MBOX}" '3600624479 236'
4442 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4444 echo "Dat Früchtchen riecht häußlich
" |
4445 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tsendmail.sh \
4447 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4448 check behave:xxxheads_rfc2047-7 0 "${MBOX}" '800505986 368'
4453 t_behave_rfc2231() {
4454 t_prolog t_behave_rfc2231
4455 TRAP_EXIT_ADDONS=".
/.t
*"
4458 mkdir ./.ttt || exit 1
4462 : > 'diet\ is \curd.txt'
4463 : > 'diet "is
" curd.txt'
4465 : > 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
4466 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4467 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4468 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4470 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4471 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4472 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4473 -a ./.ttt/höde-tröge.txt \
4474 -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 \
4475 -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 \
4476 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4477 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4479 check behave:rfc2231-1 0 "${MBOX}" '684985954 3092'
4481 # `resend' test, reusing $MBOX
4482 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4483 check behave
:rfc2231-2
0 .
/.t2
'684985954 3092'
4485 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4486 check behave:rfc2231-3 0 ./.t3 '3130352658 3148'
4491 t_behave_iconv_mbyte_base64() {
4492 t_prolog t_behave_iconv_mbyte_base64
4493 TRAP_EXIT_ADDONS=".
/.t
*"
4495 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4496 (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4497 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4500 echo 'behave:iconv_mbyte_base64: unsupported, skipped'
4504 ${cat} <<-_EOT > ./.tsendmail.sh
4506 (echo 'From DroseriaRotundifolia Thu Aug 03 17:26:25 2017' && ${cat} &&
4509 chmod 0755 ./.tsendmail.sh
4511 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4512 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4513 -Smta=./.tsendmail.sh \
4514 -Sescape=! -Smime-encoding=base64 2>./.terr
4515 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4517 !s Japanese from UTF-8 to ISO-2022-JP
4518 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4520 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4523 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4525 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4528 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4530 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4531 \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
4533 \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
4536 \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
4538 \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
4541 check behave
:iconv_mbyte_base64-1
0 "${MBOX}" '3428985079 1976'
4542 check behave
:iconv_mbyte_base64-2
- .
/.terr
'4294967295 0'
4544 printf 'eval f 1; write ./.twrite\n' |
4545 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4546 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4547 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4549 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4552 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4553 rm -f "${MBOX}" ./.twrite
4554 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4555 -Smta=./.tsendmail.sh \
4556 -Sescape=! -Smime-encoding=base64 2>./.terr
4557 set ttycharset=utf-8 sendcharsets=euc-jp
4559 !s Japanese from UTF-8 to EUC-JP
4560 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4562 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4565 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4567 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4570 set ttycharset=EUC-JP sendcharsets=utf-8
4572 !s Japanese from EUC-JP to UTF-8
4573 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4575 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4578 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4580 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4583 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4584 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4586 printf 'eval f 1; write ./.twrite\n' |
4587 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >.
/.tlog
2>&1
4588 check behave
:iconv_mbyte_base64-7
0 .
/.twrite
'1259742080 686'
4589 check behave
:iconv_mbyte_base64-8
- .
/.tlog
'500059195 119'
4591 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4597 t_behave_iconv_mainbody
() {
4598 t_prolog t_behave_iconv_mainbody
4599 TRAP_EXIT_ADDONS
="./.t*"
4601 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4604 echo 'behave:iconv_mainbody: unsupported, skipped'
4608 ${cat} <<-_EOT > ./.tsendmail.sh
4610 (echo 'From HamamelisVirginiana Fri Oct 20 16:23:21 2017' && ${cat} &&
4613 chmod 0755 .
/.tsendmail.sh
4615 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4616 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4617 -s '–' over-the@rain.bow
2>.
/.terr
4618 check behave
:iconv_mainbody-1
0 "${MBOX}" '3634015017 251'
4619 check behave
:iconv_mainbody-2
- .
/.terr
'4294967295 0'
4621 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tsendmail.sh \
4622 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4623 -s '–' over-the@rain.bow
2>.
/.terr
4624 exn0_test behave
:iconv_mainbody-3
4625 check behave
:iconv_mainbody-3
- "${MBOX}" '3634015017 251'
4626 check behave
:iconv_mainbody-4
- .
/.terr
'2579894983 148'
4628 # The different iconv(3) implementations use different replacement sequence
4629 # types (character-wise, byte-wise, and the character(s) used differ)
4630 i
="${MAILX_ICONV_MODE}"
4631 if [ -n "${i}" ]; then
4632 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4634 ex0_test behave:iconv_mainbody-5-0 ${j}
4635 check behave:iconv_mainbody-5-1 - ./.terr '4294967295 0'
4636 if [ ${i} -eq 13 ]; then
4637 check behave:iconv_mainbody-5-2 - ./.tout '189327996 283'
4638 elif [ ${i} -eq 12 ]; then
4639 check behave:iconv_mainbody-5-3 - ./.tout '1959197095 283'
4640 elif [ ${i} -eq 3 ]; then
4641 check behave:iconv_mainbody-5-4 - ./.tout '3196380198 279'
4643 check behave:iconv_mainbody-5-5 - ./.tout '3760313827 279'
4646 echo 'behave:iconv_mainbody-5: unsupported, skipped'
4652 t_behave_binary_mainbody() {
4653 t_prolog t_behave_binary_mainbody
4654 TRAP_EXIT_ADDONS=".
/.t
*"
4656 printf 'abra\0\nka\r\ndabra' |
4657 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4659 check behave:binary_mainbody-1 0 "${MBOX}" '2430168141 243'
4660 check behave:binary_mainbody-2 - ./.terr '4294967295 0'
4662 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4663 ${MAILX} ${ARGS} -Rf \
4664 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4665 "${MBOX}" >./.tall 2>&1
4666 check behave:binary_mainbody-3 0 ./.tall '1151843761 324'
4667 check behave:binary_mainbody-4 - ./.tcat '3817108933 15'
4668 check behave:binary_mainbody-5 - ./.twrite '3817108933 15'
4673 t_behave_q_t_etc_opts() {
4674 t_prolog t_behave_q_t_etc_opts
4675 TRAP_EXIT_ADDONS=".
/.t
*"
4677 # Three tests for MIME encoding and (a bit) content classification.
4678 # At the same time testing -q FILE, < FILE and -t FILE
4679 t__put_body > ./.tin
4682 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4683 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4684 check behave:q_t_etc_opts-1 0 "${MBOX}" '3570973309 6646'
4687 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4688 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4689 check behave:q_t_etc_opts-2 0 "${MBOX}" '3570973309 6646'
4692 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4694 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4695 check behave:q_t_etc_opts-3 0 "${MBOX}" '3570973309 6646'
4701 have_feat smime || {
4702 echo 'behave:s/mime: unsupported, skipped'
4706 t_prolog t_behave_s_mime
4707 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4708 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4709 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tsendmail.sh
"
4711 printf 'behave:s/mime: .. generating test key and certificate ..\n'
4712 ${cat} <<-_EOT > ./.t.conf
4715 default_keyfile = keyfile.pem
4716 distinguished_name = req_distinguished_name
4717 attributes = req_attributes
4721 [ req_distinguished_name ]
4728 emailAddress = test@localhost
4733 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4734 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >/dev/null 2>&1
4735 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4738 printf 'behave:s/mime:sign/verify: '
4739 echo bla | ${MAILX} ${ARGS} \
4740 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4741 -Ssmime-sign -Sfrom=test@localhost \
4742 -s 'S/MIME test' ./.VERIFY
4743 if [ $? -eq 0 ]; then
4754 /^Content-Description: /{ skip = 2; print; next }
4755 /^$/{ if(skip) --skip }
4758 < ./.VERIFY > "${MBOX}"
4759 check behave:s/mime:sign/verify:checksum - "${MBOX}" '2900817158 648'
4761 printf 'behave:s/mime:sign/verify:verify '
4762 printf 'verify\nx\n' |
4764 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4765 -Ssmime-sign -Sfrom=test@localhost \
4767 -f ./.VERIFY >/dev/null 2>&1
4768 if [ $? -eq 0 ]; then
4777 printf 'behave:s/mime:sign/verify:disproof-1 '
4778 if openssl smime -verify -CAfile ./.tcert.pem \
4779 -in ./.VERIFY >/dev/null 2>&1; then
4788 # (signing +) encryption / decryption
4789 ${cat} <<-_EOT > ./.tsendmail.sh
4791 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
4793 chmod 0755 ./.tsendmail.sh
4795 printf 'behave:s/mime:encrypt+sign: '
4798 -Ssmime-force-encryption \
4799 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4800 -Smta=./.tsendmail.sh \
4801 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4802 -Ssmime-sign -Sfrom=test@localhost \
4803 -s 'S/MIME test' recei@ver.com
4804 if [ $? -eq 0 ]; then
4808 printf 'error: encrypt+sign failed\n'
4811 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4812 check behave:s/mime:encrypt+sign:checksum - "${MBOX}" '1937410597 327'
4814 printf 'behave:s/mime:decrypt+verify: '
4815 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
4817 -Ssmime-force-encryption \
4818 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4819 -Smta=./.tsendmail.sh \
4820 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4821 -Ssmime-sign -Sfrom=test@localhost \
4823 -f ./.ENCRYPT >/dev/null 2>&1
4824 if [ $? -eq 0 ]; then
4833 /^Content-Description: /{ skip = 2; print; next }
4834 /^$/{ if(skip) --skip }
4837 < ./.DECRYPT > "${MBOX}"
4838 check behave:s/mime:decrypt+verify:checksum - "${MBOX}" '1720739247 931'
4840 printf 'behave:s/mime:decrypt+verify:disproof-1: '
4841 if (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
4842 openssl smime -verify -CAfile ./.tcert.pem) >/dev/null 2>&1; then
4849 printf "behave
:s
/mime
:encrypt
: "
4850 echo bla | ${MAILX} ${ARGS} \
4851 -Ssmime-force-encryption \
4852 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4853 -Smta=./.tsendmail.sh \
4854 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4855 -Sfrom=test@localhost \
4856 -s 'S/MIME test' recei@ver.com
4857 if [ $? -eq 0 ]; then
4864 # Same as behave:s/mime:encrypt+sign:checksum above
4865 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4866 check behave:s/mime:encrypt:checksum - "${MBOX}" '1937410597 327'
4869 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
4870 -Ssmime-force-encryption \
4871 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4872 -Smta=./.tsendmail.sh \
4873 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4874 -Sfrom=test@localhost \
4876 -f ./.ENCRYPT >/dev/null 2>&1
4877 check behave:s/mime:decrypt 0 ".
/.DECRYPT
" '2624716890 422'
4879 printf 'behave:s/mime:decrypt:disproof-1: '
4880 if openssl smime -decrypt -inkey ./.tkey.pem \
4881 -in ./.ENCRYPT >/dev/null 2>&1; then
4892 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4893 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4894 # Note we unfortunately need to place some statements without proper
4895 # indentation because of continuation problems
4896 # xxx Note: t_content() was the first test (series) written. Today many
4897 # xxx aspects are (better) covered by other tests above, some are not.
4898 # xxx At some future date and time, convert the last remains not covered
4899 # xxx elsewhere to a real t_behave_* test and drop t_content()
4903 # Test for [260e19d] (Juergen Daubert)
4905 echo body | ${MAILX} ${ARGS} "${MBOX}"
4906 check content
:004 0 "${MBOX}" '2917662811 98'
4908 # "Test for" [d6f316a] (Gavin Troy)
4910 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4911 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4912 check content:006 0 "${MBOX}" '2099098650 122'
4913 check content:006-1 - "${BODY}" '794542938 174'
4915 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4918 for(i = 0; i < 10000; ++i)
4920 #printf "\xF0\x90\x87\x90"
4921 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4922 check content
:007 0 "${MBOX}" '534262374 61816'
4928 # MIME encoding (QP) stress message subject
4929 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
4930 'adadaddsssssssddddddddddddddddddddd'\
4931 'ddddddddddddddddddddddddddddddddddd'\
4932 'ddddddddddddddddddddddddddddddddddd'\
4933 'dddddddddddddddddddd Hallelulja? Od'\
4934 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4935 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
4936 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
4937 'fffffffffffffffffffffffffffffffffff'\
4938 'fffffffffffffffffffff ggggggggggggg'\
4939 'ggggggggggggggggggggggggggggggggggg'\
4940 'ggggggggggggggggggggggggggggggggggg'\
4941 'ggggggggggggggggggggggggggggggggggg'\
4946 # MIME encoding (QP) stress message body
4948 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4949 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4950 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4951 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4952 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4953 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4954 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4955 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4956 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4957 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4958 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4959 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4960 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4961 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4962 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4963 "auf den zeilen vorher.\r\n"\
4964 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4966 "Die letzte Zeile war nur ein Punkt.\r\n"\
4968 "Das waren deren zwei.\r\n"\
4970 "Die letzte Zeile war ein Leerschritt.\n"\
4971 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4974 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4976 "Das waren deren zwei. ditto.\n"\
4978 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4979 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4980 "auf den zeilen vorher.\n"\
4982 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4983 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4985 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4987 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4989 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4991 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4993 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4995 "QP am Zeilenende über soft-nl hinweg\n"\
4996 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4998 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5000 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5002 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5004 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5006 "Die letzte Zeile war ein Leerschritt.\n"\
5011 # if have_feat devel; then
5012 # ARGS="${ARGS} -Smemdebug"
5016 if [ -n "${UTF8_LOCALE}" ]; then
5017 printf 'Using Unicode locale %s\n' "${UTF8_LOCALE}"
5019 printf 'No Unicode locale found, disabling Unicode tests\n'
5026 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5028 elif [ -z "${MAE_TEST}" ] ||
[ ${#} -eq 0 ]; then
5031 while [ ${#} -gt 0 ]; do
5037 [ ${ESTAT} -eq 0 ] && echo Ok ||
echo >&2 'Errors occurred'