2 #@ Usage: ./cc-test.sh [--check-only s-mailx-binary]
3 #@ TODO _All_ the tests should happen in a temporary subdir.
6 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
7 # such is a compile-time variable
8 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
9 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
10 ADDARG_UNI
=-Sttycharset=UTF-8
15 #UTF8_LOCALE= autodetected unless set
17 # Note valgrind has problems with FDs in forked childs, which causes some tests
18 # to fail (the FD is rewound and thus will be dumped twice)
20 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
22 if ( command -v command ) >/dev
/null
2>&1; then :; else
29 MAKE
="${MAKE:-`command -v make`}"
30 awk=${awk:-`command -v awk`}
31 cat=${cat:-`command -v cat`}
32 cksum=${cksum:-`command -v cksum`}
33 rm=${rm:-`command -v rm`}
34 sed=${sed:-`command -v sed`}
35 grep=${grep:-`command -v grep`}
37 # Problem: force $SHELL to be a real shell. It seems some testing environments
38 # use nologin(?), but we need a real shell for command execution
39 if { echo ${SHELL} | ${grep} nologin; } >/dev
/null
2>&1; then
40 echo >&2 '$SHELL seems to be nologin, overwriting to /bin/sh!'
45 # We sometimes "fake" sendmail(1) a.k.a. *mta* with a shell wrapper, and it
46 # happens that /bin/sh is often terribly slow
47 if command -v dash
>/dev
/null
2>&1; then
48 MYSHELL
="`command -v dash`"
49 elif command -v mksh
>/dev
/null
2>&1; then
50 MYSHELL
="`command -v mksh`"
57 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
61 # Wed Oct 2 01:50:07 UTC 1996
62 SOURCE_DATE_EPOCH
=844221007
64 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
68 echo >&2 "Usage: ./cc-test.sh [--check-only s-mailx-binary]"
73 if [ "${1}" = --check-only ]; then
76 [ -x "${MAILX}" ] || usage
79 MAILX
="${MEMTESTER}${MAILX}"
82 if [ -n "${CHECK_ONLY}" ] && [ -z "${UTF8_LOCALE}" ]; then
83 # Try ourselfs for nl_langinfo(CODESET) output first (requires a new version)
84 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
86 \if [ "${ttycharset}" @i=% utf ]
93 \eval xcall cset_test "${@}"
97 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 en_EN.utf8 en_EN.UTF-8 \
98 en_US.utf8 en_US.UTF-8
100 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
102 if [ -z "${UTF8_LOCALE}" ] && command -v locale
>/dev
/null
2>&1; then
103 UTF8_LOCALE
=`locale -a | { m=
105 if { echo ${n} | ${grep} -i 'utf-\{0,1\}8'; } >/dev/null 2>&1; then
107 if { echo ${n} | ${grep} -e POSIX -e en_EN -e en_US; }; then
121 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \${TRAP_EXIT_ADDONS}" EXIT
122 trap "exit 1" HUP INT TERM
125 # Test all configs TODO doesn't cover all *combinations*, stupid!
129 NOTME["OPT_AUTOCC"] = 1
130 NOTME["OPT_DEBUG"] = 1
131 NOTME["OPT_DEVEL"] = 1
132 NOTME["OPT_NOEXTMD5"] = 1
133 NOTME["OPT_ASAN_ADDRESS"] = 1
134 NOTME["OPT_ASAN_MEMORY"] = 1
135 NOTME["OPT_FORCED_STACKPROT"] = 1
136 NOTME["OPT_NOMEMDBG"] = 1
137 NOTME["OPT_NYD2"] = 1
140 /^[[:space:]]*OPT_/ {
141 sub(/^[[:space:]]*/, "")
142 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
143 # does not seem to be a compliant escape for =
145 $1 = substr($1, 1, index($1, "=") - 1)
151 # Doing this completely sequentially and not doing make distclean in
152 # between runs should effectively result in lesser compilations.
153 # It is completely dumb nonetheless... TODO
154 for (j = 1; j < i; ++j) {
155 for (k = 1; k < j; ++k)
157 for (k = j; k < i; ++k)
159 printf "OPT_AUTOCC=1\n"
161 for (j = 1; j < i; ++j) {
162 for (k = 1; k < j; ++k)
164 for (k = j; k < i; ++k)
166 printf "OPT_AUTOCC=1\n"
169 for (j = 1; j < i; ++j) {
170 for (k = 1; k < j; ++k)
172 for (k = j; k < i; ++k)
174 printf "OPT_AUTOCC=1\n"
175 printf "OPT_DEBUG=1\n"
177 for (j = 1; j < i; ++j) {
178 for (k = 1; k < j; ++k)
180 for (k = j; k < i; ++k)
182 printf "OPT_AUTOCC=1\n"
183 printf "OPT_DEBUG=1\n"
186 printf "CONFIG=NULL OPT_AUTOCC=0\n"
187 printf "CONFIG=NULL OPT_AUTOCC=1\n"
188 printf "CONFIG=NULLI OPT_AUTOCC=0\n"
189 printf "CONFIG=NULLI OPT_AUTOCC=1\n"
190 printf "CONFIG=MINIMAL OPT_AUTOCC=0\n"
191 printf "CONFIG=MINIMAL OPT_AUTOCC=1\n"
192 printf "CONFIG=NETSEND OPT_AUTOCC=0\n"
193 printf "CONFIG=NETSEND OPT_AUTOCC=1\n"
194 printf "CONFIG=MAXIMAL OPT_AUTOCC=0\n"
195 printf "CONFIG=MAXIMAL OPT_AUTOCC=1\n"
196 printf "CONFIG=DEVEL OPT_AUTOCC=0\n"
197 printf "CONFIG=DEVEL OPT_AUTOCC=1\n"
198 printf "CONFIG=ODEVEL OPT_AUTOCC=0\n"
199 printf "CONFIG=ODEVEL OPT_AUTOCC=1\n"
202 printf "\n\n##########\n$c\n"
203 printf "\n\n##########\n$c\n" >&2
204 sh
-c "${MAKE} ${c} all test"
210 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
211 ${grep} +${1} ) >/dev
/null
2>&1
215 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
223 restat
=${?} tid=${1} eestat=${2} f=${3} s=${4}
224 #x=`echo ${tid} | tr "/:=" "__-"`
225 #cp -f "${f}" "${TMPDIR}/${x}"
226 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
227 err
"${tid}" 'unexpected exit status: '"${restat} != ${eestat}"
228 csum
="`${cksum} < ${f}`"
229 if [ "${csum}" = "${s}" ]; then
230 printf '%s: ok\n' "${tid}"
233 printf '%s: error: checksum mismatch (got %s)\n' "${tid}" "${csum}"
239 printf '%s: error: %s\n' ${1} "${2}"
243 [ $?
-ne 0 ] && err
$1 'unexpected non-0 exit status'
247 [ $?
-eq 0 ] && err
$1 'unexpected 0 exit status'
250 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
252 echo "$((${1} + ${2}))"
254 elif command -v expr >/dev
/null
2>&1; then
256 echo `expr ${1} + ${2}`
260 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
264 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
266 echo "$((${1} % ${2}))"
268 elif command -v expr >/dev
/null
2>&1; then
270 echo `expr ${1} % ${2}`
274 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
279 # Basic (easily testable) behaviour tests
281 t_behave_X_opt_input_command_stack
284 t_behave_input_inject_semicolon_seq
285 t_behave_commandalias
288 t_behave_macro_param_shift
300 # FIXME t_behave_mlist
303 t_behave_record_a_resend
306 t_behave_compose_hooks
307 t_behave_message_injections
308 t_behave_mime_types_load_control
313 t_behave_mass_recipients
314 t_behave_lreply_futh_rth_etc
315 t_behave_iconv_mbyte_base64
318 t_behave_X_opt_input_command_stack
() {
321 ${cat} <<- '__EOT' > "${BODY}"
329 echo "define mac1 {";\
330 echo " echo mac1-1 via1 \$0";\
332 echo " echo mac1-2";\
334 echo " echo mac1-3";\
337 echo "define mac2 {";\
338 echo " echo mac2-1 via1 \$0";\
340 echo " echo mac2-2";\
346 echo echo 1-1-1 via1 \$0;\
358 # The -X option supports multiline arguments, and those can internally use
359 # reverse solidus newline escaping. And all -X options are joined...
361 < "${BODY}" ${MAILX} ${ARGS} \
376 echo "define mac1 {";\
377 echo " echo mac1-1 via2 \$0";\
379 echo " echo mac1-2";\
381 echo " echo mac1-3";\
384 echo "define mac2 {";\
385 echo " echo mac2-1 via2 \$0";\
387 echo " echo mac2-2";\
393 echo echo 1-1-1 via2 \$0;\
407 check behave:x_opt_input_command_stack 0 "${MBOX}" '1786542668 416'
412 t_behave_X_errexit() {
415 ${cat} <<- '__EOT' > "${BODY}"
421 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
422 -X'echo one' -X' echos nono ' -X'echo two' \
424 check behave:x_errexit-1 0 "${MBOX}" '916157812 53'
426 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
428 check behave:x_errexit-2 0 "${MBOX}" '916157812 53'
430 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
432 check behave
:x_errexit-3
0 "${MBOX}" '916157812 53'
436 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
437 -X'echo one' -X' echos nono ' -X'echo two' \
439 check behave
:x_errexit-4
1 "${MBOX}" '2118430867 49'
441 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
443 check behave:x_errexit-5 1 "${MBOX}" '2118430867 49'
445 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
447 check behave
:x_errexit-6
1 "${MBOX}" '12955965 172'
449 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
451 check behave:x_errexit-7 1 "${MBOX}" '12955965 172'
453 ## Repeat 4-7 with ignerr set
455 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
457 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
458 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
460 check behave
:x_errexit-8
0 "${BODY}" '916157812 53'
462 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
464 check behave:x_errexit-9 0 "${BODY}" '916157812 53'
466 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
468 check behave
:x_errexit-10
0 "${BODY}" '916157812 53'
470 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
472 check behave:x_errexit-11 0 "${BODY}" '916157812 53'
480 ${cat} <<- '__EOT' > "${BODY}"
499 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
500 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
501 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
503 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
504 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
527 echo a$
'b\U0000000'dt
528 echo a$
'b\U00000000'du
538 if [ -z "${UTF8_LOCALE}" ]; then
539 echo 'Skip behave:wysh_unicode, no UTF8_LOCALE'
541 < "${BODY}" DIET
=CURD TIED
= \
542 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} 2>/dev/null > "${MBOX}"
543 check behave:wysh_unicode 0 "${MBOX}" '475805847 317'
546 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
547 check behave:wysh_c 0 "${MBOX}" '1473887148 321'
552 t_behave_input_inject_semicolon_seq() {
555 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
560 echon this_is_mymac
;call mydeepmac
;echon
';';
562 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
564 echon this_is_mymac
;call mydeepmac
;echon
,TOO
'!;';
566 echon one
';';call mymac
;echon two
";";call mymac
;echo three$
';';
569 check behave
:input_inject_semicolon_seq
0 "${MBOX}" '512117110 140'
574 t_behave_commandalias
() {
577 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
578 commandalias echo echo hoho
582 commandalias XxX XxXx
583 commandalias XxXx XxXxX
584 commandalias XxXxX XxXxXx
585 commandalias XxXxXx echo huhu
586 commandalias XxXxXxX echo huhu
588 commandalias XxXxXx XxXxXxX
591 commandalias XxXxXx echo huhu
595 check behave:commandalias 0 "${MBOX}" '3694143612 31'
603 # Nestable conditions test
604 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
626 if $dietcurd == 'yoho'
631 if $dietcurd @
== 'Yoho'
636 if $dietcurd == 'Yoho'
641 if $dietcurd != 'yoho'
646 if $dietcurd @
!= 'Yoho'
651 if $dietcurd != 'Yoho'
712 if $dietcurd == 'yohu'
714 elif $dietcurd == 'yoha'
716 elif $dietcurd == 'yohe'
718 elif $dietcurd == 'yoho'
720 if $dietcurd == 'yohu'
722 elif $dietcurd == 'yoha'
724 elif $dietcurd == 'yohe'
726 elif $dietcurd == 'yoho'
728 if $dietcurd == 'yohu'
730 elif $dietcurd == 'yoha'
732 elif $dietcurd == 'yohe'
734 elif $dietcurd == 'yoho'
883 set diet
=abc curd
=abc
889 set diet
=abc curd
=abcd
895 # 1. Shitty grouping capabilities as of today
896 unset diet curd ndefined
897 if [ [ false
] ||
[ false
] ||
[ true
] ] && [ [ false
] ||
[ true
] ] && \
903 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
908 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
913 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
918 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
923 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
929 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
934 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
939 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
944 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
949 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
954 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
959 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
964 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
969 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
974 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
980 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
986 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
991 # 2. Shitty grouping capabilities as of today
992 unset diet curd ndefined
993 if [ false || false || true
] && [ false || true
] && yes
998 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
1003 if [ 1 ||
0 ||
0 ||
0 ]
1008 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
1013 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
1018 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
1023 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1028 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1033 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1038 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1043 if 1 ||
0 ||
0 ||
0 && 0
1048 if 1 ||
0 ||
0 ||
0 && 1
1053 if 0 ||
0 ||
0 ||
1 && 0
1058 if 0 ||
0 ||
0 ||
1 && 1
1063 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
1068 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
1074 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1079 if $diet == 'yo' && $curd == 'ho' && $ndefined
1085 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1090 if $diet == 'yo' && $curd == 'ho' && $ndefined
1095 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1100 # Some more en-braced variables
1102 if ${diet} == ${curd}
1107 if ${diet} != ${curd}
1123 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1128 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1133 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1138 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1143 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1148 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1153 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1158 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
1163 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1169 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1174 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1179 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1184 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1189 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1194 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1199 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1204 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
1209 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1216 check behave
:if-normal
0 "${MBOX}" '1688759742 719'
1218 if have_feat regex
; then
1219 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1221 if $dietcurd =~ '^yo.*'
1226 if $dietcurd =~ '^Yo.*'
1231 if $dietcurd @=~ '^Yo.*'
1236 if $dietcurd =~ '^yOho.+'
1241 if $dietcurd @!~ '.*Ho$'
1246 if $dietcurd !~ '.+yohO$'
1251 if [ $dietcurd @i!~ '.+yoho$' ]
1256 if ! [ $dietcurd @i=~ '.+yoho$' ]
1261 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1266 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1271 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1276 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1281 if ! ! ! $dietcurd !~ '.+yoho$'
1286 if ! ! ! $dietcurd =~ '.+yoho$'
1291 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1296 set diet=abc curd='^abc$'
1302 set diet=abc curd='^abcd$'
1310 check behave:if-regex 0 "${MBOX}" '1115671789 95'
1312 printf 'behave:if-regex: unsupported, skipped\n'
1318 t_behave_localopts() {
1321 # Nestable conditions test
1322 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1337 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1342 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1343 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1352 echo active trouble
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1354 echo active null
: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1363 wysh
set y
=$1; shift; eval localopts
$y; localopts
$1; shift
1370 wysh
set y
=$1; shift; eval localopts
$y; localopts
$1; shift
1377 echo ----- $1: $2 -> $3 -> $4
1385 call llx
'call off' on on on
1386 call llx
'call off' off on on
1387 call llx
'call off' on off on
1388 call llx
'call off' on off off
1389 localopts call-fixate on
1390 call llx
'call-fixate on' on on on
1391 call llx
'call-fixate on' off on on
1392 call llx
'call-fixate on' on off on
1393 call llx
'call-fixate on' on off off
1394 unset x
;localopts call on
1395 call llx
'call on' on on on
1396 call llx
'call on' off on on
1397 call llx
'call on' on off on
1398 call llx
'call on' on off off
1403 check behave
:localopts
0 "${MBOX}" '4016155249 1246'
1408 t_behave_macro_param_shift
() {
1411 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev/null
1414 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1419 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1420 if [ $# > 1 ] || [ $ignerr == '' ]
1425 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1427 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1431 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1436 call t2 1 you get four args
1437 echo t1.1: $?';' ignerr ($ignerr) should not exist
1438 call t2 1 you get 'three args'
1439 echo t1.2: $?';' ignerr ($ignerr) should not exist
1440 call t2 1 you 'get two args'
1441 echo t1.3: $?';' ignerr ($ignerr) should not exist
1442 call t2 1 'you get one arg'
1443 echo t1.4: $?';' ignerr ($ignerr) should not exist
1444 ignerr call t2 '' 'you get one arg'
1445 echo t1.5: $?';' ignerr ($ignerr) should not exist
1450 check behave:macro_param_shift 0 "${MBOX}" '1402489146 1682'
1455 t_behave_addrcodec() {
1458 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1459 vput addrcodec res e
1 <doog@def
>
1460 echo $?
/$^ERRNAME
$res
1461 eval vput addrcodec res d
$res
1462 echo $?
/$^ERRNAME
$res
1463 vput addrcodec res e
2 .
<doog@def
>
1464 echo $?
/$^ERRNAME
$res
1465 eval vput addrcodec res d
$res
1466 echo $?
/$^ERRNAME
$res
1467 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1468 echo $?
/$^ERRNAME
$res
1469 eval vput addrcodec res d
$res
1470 echo $?
/$^ERRNAME
$res
1471 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1472 echo $?
/$^ERRNAME
$res
1473 eval vput addrcodec res d
$res
1474 echo $?
/$^ERRNAME
$res
1475 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1476 echo $?
/$^ERRNAME
$res
1477 eval vput addrcodec res d
$res
1478 echo $?
/$^ERRNAME
$res
1480 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1481 echo $?
/$^ERRNAME
$res
1482 eval vput addrcodec res d
$res
1483 echo $?
/$^ERRNAME
$res
1484 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1485 echo $?
/$^ERRNAME
$res
1486 eval vput addrcodec res d
$res
1487 echo $?
/$^ERRNAME
$res
1488 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1489 echo $?
/$^ERRNAME
$res
1490 eval vput addrcodec res d
$res
1491 echo $?
/$^ERRNAME
$res
1492 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1493 echo $?
/$^ERRNAME
$res
1494 eval vput addrcodec res d
$res
1495 echo $?
/$^ERRNAME
$res
1496 vput addrcodec res
+e
8 \
1497 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1498 echo $?
/$^ERRNAME
$res
1499 eval vput addrcodec res d
$res
1500 echo $?
/$^ERRNAME
$res
1501 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1502 echo $?
/$^ERRNAME
$res
1503 eval vput addrcodec res d
$res
1504 echo $?
/$^ERRNAME
$res
1505 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1506 echo $?
/$^ERRNAME
$res
1507 eval vput addrcodec res d
$res
1508 echo $?
/$^ERRNAME
$res
1509 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1510 echo $?
/$^ERRNAME
$res
1511 eval vput addrcodec res d
$res
1512 echo $?
/$^ERRNAME
$res
1513 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1514 echo $?
/$^ERRNAME
$res
1515 eval vput addrcodec res d
$res
1516 echo $?
/$^ERRNAME
$res
1517 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1518 echo $?
/$^ERRNAME
$res
1519 eval vput addrcodec res d
$res
1520 echo $?
/$^ERRNAME
$res
1521 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1522 echo $?
/$^ERRNAME
$res
1523 eval vput addrcodec res d
$res
1524 echo $?
/$^ERRNAME
$res
1525 vput addrcodec res
+e
15 \
1526 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1527 echo $?
/$^ERRNAME
$res
1528 eval vput addrcodec res d
$res
1529 echo $?
/$^ERRNAME
$res
1530 vput addrcodec res
+e
16 \
1531 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1532 echo $?
/$^ERRNAME
$res
1533 eval vput addrcodec res d
$res
1534 echo $?
/$^ERRNAME
$res
1535 vput addrcodec res
+e
17 \
1536 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1537 echo $?
/$^ERRNAME
$res
1538 eval vput addrcodec res d
$res
1539 echo $?
/$^ERRNAME
$res
1540 vput addrcodec res
+e
18 \
1541 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1542 echo $?
/$^ERRNAME
$res
1543 eval vput addrcodec res d
$res
1544 echo $?
/$^ERRNAME
$res
1545 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1546 echo $?
/$^ERRNAME
$res
1547 eval vput addrcodec res d
$res
1548 echo $?
/$^ERRNAME
$res
1550 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1551 echo $?
/$^ERRNAME
$res
1552 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1553 echo $?/$^ERRNAME $res
1554 eval vput addrcodec res d $res
1555 echo $?/$^ERRNAME $res
1557 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1558 echo $?/$^ERRNAME $res
1559 eval vput addrcodec res d $res
1560 echo $?/$^ERRNAME $res
1562 vput addrcodec res s \
1563 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1564 echo $?/$^ERRNAME $res
1567 check behave:addrcodec 0 "${MBOX}" '429099645 2414'
1575 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>/dev
/null
1576 vput vexpr res
= 9223372036854775807
1577 echo $?
/$^ERRNAME
$res
1578 vput vexpr res
= 9223372036854775808
1579 echo $?
/$^ERRNAME
$res
1580 vput vexpr res
=@
9223372036854775808
1581 echo $?
/$^ERRNAME
$res
1582 vput vexpr res
= -9223372036854775808
1583 echo $?
/$^ERRNAME
$res
1584 vput vexpr res
= -9223372036854775809
1585 echo $?
/$^ERRNAME
$res
1586 vput vexpr res
=@
-9223372036854775809
1587 echo $?
/$^ERRNAME
$res
1590 echo $?
/$^ERRNAME
$res
1592 echo $?
/$^ERRNAME
$res
1594 echo $?
/$^ERRNAME
$res
1596 vput vexpr res
+ 0 0
1597 echo $?
/$^ERRNAME
$res
1598 vput vexpr res
+ 0 1
1599 echo $?
/$^ERRNAME
$res
1600 vput vexpr res
+ 1 1
1601 echo $?
/$^ERRNAME
$res
1603 vput vexpr res
+ 9223372036854775807 0
1604 echo $?
/$^ERRNAME
$res
1605 vput vexpr res
+ 9223372036854775807 1
1606 echo $?
/$^ERRNAME
$res
1607 vput vexpr res
+@
9223372036854775807 1
1608 echo $?
/$^ERRNAME
$res
1609 vput vexpr res
+ 0 9223372036854775807
1610 echo $?
/$^ERRNAME
$res
1611 vput vexpr res
+ 1 9223372036854775807
1612 echo $?
/$^ERRNAME
$res
1613 vput vexpr res
+@
1 9223372036854775807
1614 echo $?
/$^ERRNAME
$res
1616 vput vexpr res
+ -9223372036854775808 0
1617 echo $?
/$^ERRNAME
$res
1618 vput vexpr res
+ -9223372036854775808 -1
1619 echo $?
/$^ERRNAME
$res
1620 vput vexpr res
+@
-9223372036854775808 -1
1621 echo $?
/$^ERRNAME
$res
1622 vput vexpr res
+ 0 -9223372036854775808
1623 echo $?
/$^ERRNAME
$res
1624 vput vexpr res
+ -1 -9223372036854775808
1625 echo $?
/$^ERRNAME
$res
1626 vput vexpr res
+@
-1 -9223372036854775808
1627 echo $?
/$^ERRNAME
$res
1629 vput vexpr res
- 0 0
1630 echo $?
/$^ERRNAME
$res
1631 vput vexpr res
- 0 1
1632 echo $?
/$^ERRNAME
$res
1633 vput vexpr res
- 1 1
1634 echo $?
/$^ERRNAME
$res
1636 vput vexpr res
- 9223372036854775807 0
1637 echo $?
/$^ERRNAME
$res
1638 vput vexpr res
- 9223372036854775807 -1
1639 echo $?
/$^ERRNAME
$res
1640 vput vexpr res
-@
9223372036854775807 -1
1641 echo $?
/$^ERRNAME
$res
1642 vput vexpr res
- 0 9223372036854775807
1643 echo $?
/$^ERRNAME
$res
1644 vput vexpr res
- -1 9223372036854775807
1645 echo $?
/$^ERRNAME
$res
1646 vput vexpr res
- -2 9223372036854775807
1647 echo $?
/$^ERRNAME
$res
1648 vput vexpr res
-@
-2 9223372036854775807
1649 echo $?
/$^ERRNAME
$res
1651 vput vexpr res
- -9223372036854775808 +0
1652 echo $?
/$^ERRNAME
$res
1653 vput vexpr res
- -9223372036854775808 +1
1654 echo $?
/$^ERRNAME
$res
1655 vput vexpr res
-@
-9223372036854775808 +1
1656 echo $?
/$^ERRNAME
$res
1657 vput vexpr res
- 0 -9223372036854775808
1658 echo $?
/$^ERRNAME
$res
1659 vput vexpr res
- +1 -9223372036854775808
1660 echo $?
/$^ERRNAME
$res
1661 vput vexpr res
-@
+1 -9223372036854775808
1662 echo $?
/$^ERRNAME
$res
1664 vput vexpr res
+ -13 -2
1665 echo $?
/$^ERRNAME
$res
1666 vput vexpr res
- 0 0
1667 echo $?
/$^ERRNAME
$res
1668 vput vexpr res
- 0 1
1669 echo $?
/$^ERRNAME
$res
1670 vput vexpr res
- 1 1
1671 echo $?
/$^ERRNAME
$res
1672 vput vexpr res
- -13 -2
1673 echo $?
/$^ERRNAME
$res
1675 vput vexpr res
* 0 0
1676 echo $?
/$^ERRNAME
$res
1677 vput vexpr res
* 0 1
1678 echo $?
/$^ERRNAME
$res
1679 vput vexpr res
* 1 1
1680 echo $?
/$^ERRNAME
$res
1681 vput vexpr res
* -13 -2
1682 echo $?
/$^ERRNAME
$res
1684 vput vexpr res
/ 0 0
1685 echo $?
/$^ERRNAME
$res
1686 vput vexpr res
/ 0 1
1687 echo $?
/$^ERRNAME
$res
1688 vput vexpr res
/ 1 1
1689 echo $?
/$^ERRNAME
$res
1690 vput vexpr res
/ -13 -2
1691 echo $?
/$^ERRNAME
$res
1693 vput vexpr res
% 0 0
1694 echo $?
/$^ERRNAME
$res
1695 vput vexpr res
% 0 1
1696 echo $?
/$^ERRNAME
$res
1697 vput vexpr res
% 1 1
1698 echo $?
/$^ERRNAME
$res
1699 vput vexpr res
% -13 -2
1700 echo $?
/$^ERRNAME
$res
1703 check behave
:vexpr-numeric
0 "${MBOX}" '1723609217 1048'
1705 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1706 vput vexpr res find 'bananarama' 'nana'
1707 echo $?/$^ERRNAME :$res:
1708 vput vexpr res find 'bananarama' 'bana'
1709 echo $?/$^ERRNAME :$res:
1710 vput vexpr res find 'bananarama' 'Bana'
1711 echo $?/$^ERRNAME :$res:
1712 vput vexpr res find 'bananarama' 'rama'
1713 echo $?/$^ERRNAME :$res:
1715 vput vexpr res ifind 'bananarama' 'nana'
1716 echo $?/$^ERRNAME :$res:
1717 vput vexpr res ifind 'bananarama' 'bana'
1718 echo $?/$^ERRNAME :$res:
1719 vput vexpr res ifind 'bananarama' 'Bana'
1720 echo $?/$^ERRNAME :$res:
1721 vput vexpr res ifind 'bananarama' 'rama'
1722 echo $?/$^ERRNAME :$res:
1724 vput vexpr res substring 'bananarama' 1
1725 echo $?/$^ERRNAME :$res:
1726 vput vexpr res substring 'bananarama' 3
1727 echo $?/$^ERRNAME :$res:
1728 vput vexpr res substring 'bananarama' 5
1729 echo $?/$^ERRNAME :$res:
1730 vput vexpr res substring 'bananarama' 7
1731 echo $?/$^ERRNAME :$res:
1732 vput vexpr res substring 'bananarama' 9
1733 echo $?/$^ERRNAME :$res:
1734 vput vexpr res substring 'bananarama' 10
1735 echo $?/$^ERRNAME :$res:
1736 vput vexpr res substring 'bananarama' 1 3
1737 echo $?/$^ERRNAME :$res:
1738 vput vexpr res substring 'bananarama' 3 3
1739 echo $?/$^ERRNAME :$res:
1740 vput vexpr res substring 'bananarama' 5 3
1741 echo $?/$^ERRNAME :$res:
1742 vput vexpr res substring 'bananarama' 7 3
1743 echo $?/$^ERRNAME :$res:
1744 vput vexpr res substring 'bananarama' 9 3
1745 echo $?/$^ERRNAME :$res:
1746 vput vexpr res substring 'bananarama' 10 3
1747 echo $?/$^ERRNAME :$res:
1751 check behave:vexpr-string 0 "${MBOX}" '265398700 267'
1753 if have_feat regex; then
1754 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" #2>/dev/null
1755 vput vexpr res regex
'bananarama' 'nana'
1756 echo $?
/$^ERRNAME
:$res:
1757 vput vexpr res regex
'bananarama' 'bana'
1758 echo $?
/$^ERRNAME
:$res:
1759 vput vexpr res regex
'bananarama' 'Bana'
1760 echo $?
/$^ERRNAME
:$res:
1761 vput vexpr res regex
'bananarama' 'rama'
1762 echo $?
/$^ERRNAME
:$res:
1764 vput vexpr res iregex
'bananarama' 'nana'
1765 echo $?
/$^ERRNAME
:$res:
1766 vput vexpr res iregex
'bananarama' 'bana'
1767 echo $?
/$^ERRNAME
:$res:
1768 vput vexpr res iregex
'bananarama' 'Bana'
1769 echo $?
/$^ERRNAME
:$res:
1770 vput vexpr res iregex
'bananarama' 'rama'
1771 echo $?
/$^ERRNAME
:$res:
1773 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1774 echo $?
/$^ERRNAME
:$res:
1775 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1776 echo $?
/$^ERRNAME
:$res:
1777 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
1778 echo $?
/$^ERRNAME
:$res:
1779 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
1780 echo $?
/$^ERRNAME
:$res:
1782 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
1783 echo $?
/$^ERRNAME
:$res:
1784 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
1785 echo $?
/$^ERRNAME
:$res:
1786 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
1787 echo $?
/$^ERRNAME
:$res:
1788 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
1789 echo $?
/$^ERRNAME
:$res:
1793 check behave
:vexpr-regex
0 "${MBOX}" '3270360157 311'
1795 printf 'behave:vexpr-regex: unsupported, skipped\n'
1801 t_behave_call_ret
() {
1804 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1809 vput vexpr j '&' $i 7
1815 vput vexpr j '&' $i 7
1821 echo ! The end for $1
1825 # Transport $?/$! up the call chain
1831 wysh set i=$? j=$! k=$^ERRNAME
1835 echo ! The end for $1
1836 return $i $^ERR-BUSY
1840 # Up and down it goes
1847 vput vexpr k - $1 $2
1851 echo "# <$i/$j> .. "
1855 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
1858 echo ! The end
for $1=$i/$2
1862 return $i $^ERR-BUSY
1868 call w1
0; echo ?
=$?
!=$
!; echo -----;
1869 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
1870 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
1873 check behave
:call_ret
0 "${MBOX}" '1572045517 5922'
1881 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
1886 vput vexpr j '&' $i 7
1892 echo ! The end for $1/$2
1894 return $i $^ERR-BUSY
1905 echo ?=$? !=$^ERRNAME
1908 echo ?=$? !=$^ERRNAME
1910 echo ?=$? !=$^ERRNAME
1913 check behave:xcall-1 0 "${MBOX}" '2401702082 23801'
1917 ${cat} <<- '__EOT' > "${BODY}"
1922 vput vexpr j '&' $i 7
1928 echo ! The end for $1
1931 echo would be err with errexit
1940 echo zwei, ?=$? !=$!
1941 localopts yes; set errexit
1943 echo drei, ?=$? !=$^ERRNAME
1945 echo vier, ?=$? !=$^ERRNAME, this is an error
1948 echo outer 1, ?=$? !=$^ERRNAME
1950 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
1952 echo outer 3, ?=$? !=$^ERRNAME
1953 echo this is definitely an error
1956 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' -Snomemdebug \
1958 check behave
:xcall-2
0 "${MBOX}" '3900716531 4200'
1960 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' -Snomemdebug \
1962 check behave:xcall-3 1 "${MBOX}" '1006776201 2799'
1967 t_behave_vpospar() {
1970 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1971 vpospar
set hey
, "'you ", world
!
1972 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1973 vput vpospar x quote
; echo x
<$x>
1974 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1975 vput vpospar y quote
;echo y
<$y>
1976 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1977 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1978 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1981 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1982 vput vpospar z quote
;echo infun2
:z
<$z>
1986 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1987 vput vpospar y quote
;echo infun
:y
<$y>
1988 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1989 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1991 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1992 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
1995 call infun This
"in a" fun
1996 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1997 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
1999 check behave
:vpospar-1
0 "${MBOX}" '155175639 866'
2002 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2004 echo ifs<$ifs> ifs-ws<$ifs-ws>
2005 vpospar set hey, "'you ", world!
2006 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2007 vput vpospar x quote; echo x<$x>
2008 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2009 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2012 echo ifs<$ifs> ifs-ws<$ifs-ws>
2013 vpospar set hey, "'you
", world!
2014 echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2015 vput vpospar x quote; echo x<$x>
2016 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2017 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2020 echo ifs<$ifs> ifs-ws<$ifs-ws>
2021 vpospar set hey, "'you ", world!
2022 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2023 vput vpospar x quote; echo x<$x>
2024 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2025 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2027 check behave:vpospar-ifs 0 "${MBOX}" '2015927702 706'
2032 t_behave_atxplode() {
2034 TRAP_EXIT_ADDONS="./.t*"
2036 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2039 printf " (1/$#: <$1>)"
2041 if [ $# -gt 0 ]; then
2055 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2056 printf xxx;xxx arg ,b u.
2057 printf xxx;xxx arg , .
2058 printf xxx;xxx arg ,ball.
2064 echon " (1/$#: <$1>)"
2079 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2080 echon xxx;call xxx arg ,b u.
2081 echon xxx;call xxx arg , .
2082 echon xxx;call xxx arg ,ball.
2085 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2086 check behave:atxplode-1 0 "${MBOX}" '41566293 164'
2088 #${SHELL} ./.t.sh > ./.tshout 2>&1
2089 #check behave:atxplode:disproof-1 0 ./.tshout '41566293 164'
2096 TRAP_EXIT_ADDONS="./.t*"
2098 ${cat} <<- '__EOT
' > .tin
2099 hey1, "'you
", world!
2100 hey2, "'you ", bugs bunny!
2105 ${cat} <<- '__EOT
' |\
2106 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2108 echo $?/$^ERRNAME / <$a><$b><$c>
2110 echo $?/$^ERRNAME / <$a><$b><$c>
2112 echo $?/$^ERRNAME / <$a><$b><$c>
2114 echo $?/$^ERRNAME / <$a><$b><$c>
2115 unset a b c;read a b c
2116 echo $?/$^ERRNAME / <$a><$b><$c>
2117 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2119 check behave:read-1 0 "${MBOX}" '1527910147 173'
2121 ${cat} <<- '__EOT
' > .tin2
2122 hey2.0,:"'you
",:world!:mars.:
2123 hey2.1,:"'you ",:world!
2124 hey2.2,:"'you
",:bugs bunny!
2130 ${cat} <<- '__EOT' |\
2131 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2134 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2136 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2138 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2140 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2142 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2144 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2145 unset a b c
;read a b c
2146 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2148 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2149 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2151 check behave
:read-ifs
0 "${MBOX}" '890153490 298'
2153 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2155 readall d; echo $?/$^ERRNAME / <$d>
2156 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2157 readctl create .tin2
2158 readall d; echo $?/$^ERRNAME / <$d>
2159 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2160 readctl remove .tin;echo $?/$^ERRNAME;\
2161 readctl remove .tin2;echo $?/$^ERRNAME
2163 check behave:readall 0 "${MBOX}" '860434889 333'
2170 TRAP_EXIT_ADDONS=".
/.t
*"
2174 while [ ${i} -lt 112 ]; do
2175 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2176 "${MBOX}" "${i}" "${i}"
2179 ) | ${MAILX} ${ARGS}
2180 check behave:mbox-1 0 "${MBOX}" '1140119864 13780'
2186 ' "${MBOX}" .tmbox1 .tmbox1 |
2187 ${MAILX} ${ARGS} > .tlst
2188 check behave:mbox-2 0 .tlst '2739893312 9103'
2194 ' "${MBOX}" .tmbox2 .tmbox2 |
2195 ${MAILX} ${ARGS} > .tlst
2196 check behave:mbox-3 0 .tlst '1702194178 9110'
2198 # only the odd (even)
2200 printf 'File "file://%s
"
2203 while [ ${i} -lt 112 ]; do
2205 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2212 ) | ${MAILX} ${ARGS} > .tlst
2213 check behave:mbox-4 0 .tmbox3 '631132924 6890'
2214 check behave:mbox-5 - .tlst '2960975049 4573'
2217 printf 'file "file://%s
"
2220 while [ ${i} -lt 112 ]; do
2222 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2230 ' .tmbox3 .tmbox3 .tmbox2
2231 ) |
${MAILX} ${ARGS} > .tlst
2232 check behave
:mbox-6
0 .tmbox3
'1387070539 13655'
2233 ${sed} 2d
< .tlst
> .tlstx
2234 check behave
:mbox-7
- .tlstx
'2729940494 13645'
2239 t_behave_alternates
() {
2241 TRAP_EXIT_ADDONS
="./.t*"
2243 ${cat} <<-_EOT > ./.tsendmail.sh
2245 (echo 'From Valeriana Sat Jul 08 15:54:03 2017' && ${cat} && echo
2248 chmod 0755 .
/.tsendmail.sh
2250 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2254 alternates a1@b1 a2@b2 a3@b3
2259 echo $?
/$^ERRNAME
<$rv>
2264 echo $?
/$^ERRNAME
<$rv>
2267 echo $?
/$^ERRNAME
<$rv>
2270 echo $?
/$^ERRNAME
<$rv>
2274 alternates a1@b1 a2@b2 a3@b3
2277 echo $?
/$^ERRNAME
<$rv>
2280 echo $?
/$^ERRNAME
<$rv>
2283 echo $?
/$^ERRNAME
<$rv>
2286 alternates a1@b1 a2@b2 a3@b3
2289 echo $?
/$^ERRNAME
<$rv>
2292 echo $?
/$^ERRNAME
<$rv>
2295 echo $?
/$^ERRNAME
<$rv>
2299 alternates a1@b1 a2@b2 a3@b3
2302 echo $?
/$^ERRNAME
<$rv>
2306 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2308 ~s all alternates
, only a1@b1 remains
2310 ~b a3@b3 a3@c3 a3@d3
2319 alternates a1@b1 a1@c1 a2@b2 a3@b3
2321 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2323 ~b a3@b3 a3@c3 a3@d3
2330 alternates a1@b1 a2@b2 a3
; set allnet
2332 ~s all alternates via allnet
, only a1@b1 remains
2334 ~b a3@b3 a3@c3 a3@d3
2345 echo $?
/$^ERRNAME
<$rv>
2349 echo $?
/$^ERRNAME
<$rv>
2353 echo $?
/$^ERRNAME
<$rv>
2357 echo $?
/$^ERRNAME
<$rv>
2361 echo $?
/$^ERRNAME
<$rv>
2365 alternates a1@b1 a2@b2
2368 echo $?
/$^ERRNAME
<$rv>
2369 alternates a3@b3 a4@b4
2372 echo $?
/$^ERRNAME
<$rv>
2374 check behave
:alternates-1
0 "${MBOX}" '142184864 515'
2375 check behave
:alternates-2
- .tall
'1878598364 505'
2382 TRAP_EXIT_ADDONS
="./.t*"
2384 ${cat} <<-_EOT > ./.tsendmail.sh
2386 (echo 'From Hippocastanum Mon Jun 19 15:07:07 2017' && ${cat} && echo
2389 chmod 0755 .
/.tsendmail.sh
2391 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh
> .
/.tall
2>&1
2393 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2395 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2397 alias a4 a5 ex1@a4.ple
2399 alias a6 a7 ex1@a6.ple
2413 check behave
:alias-1
0 "${MBOX}" '2496925843 272'
2414 check behave
:alias-2
- .tall
'3548953204 152'
2416 # TODO t_behave_alias: n_ALIAS_MAXEXP is compile-time constant,
2417 # TODO need to somehow provide its contents to the test, then test
2422 t_behave_filetype
() {
2424 TRAP_EXIT_ADDONS
="./.t*"
2426 ${cat} <<-_EOT > ./.tsendmail.sh
2428 (echo 'From Alchemilla Wed Apr 25 15:12:13 2017' && ${cat} && echo
2431 chmod 0755 .
/.tsendmail.sh
2433 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2434 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2435 check behave:filetype-1 0 "${MBOX}" '1594682963 13520'
2437 if command -v gzip >/dev/null 2>&1; then
2440 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2441 copy 2 ./.t.mbox.gz' "${MBOX}" |
2443 -X'filetype gz gzip\ -dc gzip\ -c'
2444 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2446 -X'filetype gz gzip\ -dc gzip\ -c'
2448 check behave:filetype-2 - ".
/.t.mbox
" '1594682963 13520'
2449 check behave:filetype-3 - ".
/.t.out
" '2494681730 102'
2451 echo 'behave:filetype-2: unsupported, skipped'
2452 echo 'behave:filetype-3: unsupported, skipped'
2457 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
2463 -X'filetype gz gzip\ -dc gzip\ -c' \
2464 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
2465 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
2466 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
2468 -X'filetype gz gzip\ -dc gzip\ -c' \
2469 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
2471 check behave:filetype-4 - ".
/.t.mbox
" '2886541147 27060'
2472 check behave:filetype-5 - ".
/.t.out
" '838452520 172'
2477 t_behave_record_a_resend() {
2479 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
2483 m %s\n~s Subject 1.\nHello.\n~.
2484 set record-files add-file-recipients
2485 m %s\n~s Subject 2.\nHello.\n~.
2487 resend 2 ./.t.resent
2488 Resend 1 ./.t.resent
2490 resend 2 ./.t.resent
2491 Resend 1 ./.t.resent
2492 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
2495 check behave:record_a_resend-1 0 "${MBOX}" '3057873538 256'
2496 check behave:record_a_resend-2 - .t.record '391356429 460'
2497 check behave:record_a_resend-3 - .t.resent '2685231691 648'
2502 t_behave_e_H_L_opts() {
2504 TRAP_EXIT_ADDONS=".
/.tsendmail.sh .
/.t.mbox
"
2507 ${MAILX} ${ARGS} -ef ./.t.mbox
2508 echo ${?} > "${MBOX}"
2510 ${cat} <<-_EOT > ./.tsendmail.sh
2512 (echo 'From Alchemilla Wed Apr 07 17:03:33 2017' && ${cat} && echo
2515 chmod 0755 ./.tsendmail.sh
2516 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2517 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2518 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2519 ${MAILX} ${ARGS} -Smta=./.tsendmail.sh
2521 ${MAILX} ${ARGS} -ef ./.t.mbox
2522 echo ${?} >> "${MBOX}"
2523 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox
2524 echo ${?} >> "${MBOX}"
2525 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox
2526 echo ${?} >> "${MBOX}"
2527 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox
2528 echo ${?} >> "${MBOX}"
2529 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox
2530 echo ${?} >> "${MBOX}"
2531 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox
2532 echo ${?} >> "${MBOX}"
2533 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox
2534 echo ${?} >> "${MBOX}"
2536 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2537 echo ${?} >> "${MBOX}"
2538 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2539 echo ${?} >> "${MBOX}"
2540 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2541 echo ${?} >> "${MBOX}"
2542 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2543 echo ${?} >> "${MBOX}"
2544 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2545 echo ${?} >> "${MBOX}"
2546 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2547 echo ${?} >> "${MBOX}"
2548 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>/dev
/null
2549 echo ${?} >> "${MBOX}"
2551 check behave
:e_H_L_opts
- "${MBOX}" '1708955574 678'
2556 t_behave_compose_hooks
() { # TODO monster
2558 TRAP_EXIT_ADDONS
="./.t*"
2560 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
2561 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
2563 ${cat} <<-_EOT > ./.tsendmail.sh
2565 (echo 'From PrimulaVeris Wed Apr 10 22:59:00 2017' && ${cat} && echo
2568 chmod 0755 .
/.tsendmail.sh
2570 ${cat} <<'__EOT__' > ./.trc
2572 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
2575 vput vexpr es substr "$1" 0 1
2580 define read_mline_res {
2581 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
2582 echo $len/$es/$^ERRNAME: $hl
2583 if [ $es -ne $^ERR-NONE ]
2584 xcall bail read_mline_res
2586 \xcall read_mline_res
2591 echo "~^header list"; read hl; echo $hl;\
2592 call xerr "$hl" "in_addr ($xh) 0-1"
2594 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2595 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
2596 echo "~^header insert $xh <${xh}2@exam.ple>";\
2597 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
2598 echo "~^header insert $xh ${xh}3@exam.ple";\
2599 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
2600 echo "~^header list $xh"; read hl; echo $hl;\
2601 call xerr "$hl" "ins_addr $xh 1-4"
2602 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
2605 if [ "$t_remove" == "" ]
2609 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
2610 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
2612 xcall bail "ins_addr $xh 2-2"
2614 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
2616 xcall bail "ins_addr $xh 2-3"
2618 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
2620 xcall bail "ins_addr $xh 2-4"
2624 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2625 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
2626 echo "~^header insert $xh <${xh}2@exam.ple>";\
2627 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
2628 echo "~^header insert $xh ${xh}3@exam.ple";\
2629 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
2630 echo "~^header list $xh"; read hl; echo $hl;\
2631 call xerr "$hl" "ins_addr $xh 3-4"
2632 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
2635 echo "~^header remove-at $xh 1"; read es;\
2636 call xerr $es "ins_addr $xh 3-6"
2637 echo "~^header remove-at $xh 1"; read es;\
2638 call xerr $es "ins_addr $xh 3-7"
2639 echo "~^header remove-at $xh 1"; read es;\
2640 call xerr $es "ins_addr $xh 3-8"
2641 echo "~^header remove-at $xh 1"; read es;\
2642 vput vexpr es substr $es 0 3
2644 xcall bail "ins_addr $xh 3-9"
2646 echo "~^header remove-at $xh T"; read es;\
2647 vput vexpr es substr $es 0 3
2649 xcall bail "ins_addr $xh 3-10"
2651 echo "~^header list $xh"; read es;\
2652 vput vexpr es substr $es 0 3
2654 xcall bail "ins_addr $xh 3-11"
2656 echo "~^header show $xh"; read es;\
2657 vput vexpr es substr $es 0 3
2659 xcall bail "ins_addr $xh 3-12"
2663 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
2664 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
2665 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
2666 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
2667 echo "~^header insert $xh ${xh}3@exam.ple";\
2668 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
2669 echo "~^header list $xh"; read hl; echo $hl;\
2670 call xerr "$hl" "header list $xh 3-4"
2671 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
2674 echo "~^header remove-at $xh 3"; read es;\
2675 call xerr $es "ins_addr $xh 4-6"
2676 echo "~^header remove-at $xh 2"; read es;\
2677 call xerr $es "ins_addr $xh 4-7"
2678 echo "~^header remove-at $xh 1"; read es;\
2679 call xerr $es "ins_addr $xh 4-8"
2680 echo "~^header remove-at $xh 1"; read es;\
2681 vput vexpr es substr $es 0 3
2683 xcall bail "ins_addr $xh 4-9"
2685 echo "~^header remove-at $xh T"; read es;\
2686 vput vexpr es substr $es 0 3
2688 xcall bail "ins_addr $xh 4-10"
2690 echo "~^header list $xh"; read es;\
2691 vput vexpr es substr $es 0 3
2693 xcall bail "ins_addr $xh 4-11"
2695 echo "~^header show $xh"; read es;\
2696 vput vexpr es substr $es 0 3
2698 xcall bail "ins_addr $xh 4-12"
2702 wysh set xh=$1 mult=$2
2703 echo "~^header list"; read hl; echo $hl;\
2704 call xerr "$hl" "ins_ref ($xh) 0-1"
2706 echo "~^header insert $xh <$xh@exam.ple>";\
2707 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
2709 echo "~^header insert $xh <${xh}2@exam.ple>";\
2710 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
2711 echo "~^header insert $xh ${xh}3@exam.ple";\
2712 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
2714 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
2715 vput vexpr es substr $es 0 3
2717 xcall bail "ins_ref $xh 1-4"
2721 echo "~^header list $xh"; read hl; echo $hl;\
2722 call xerr "$hl" "ins_ref $xh 1-5"
2723 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
2726 if [ "$t_remove" == "" ]
2730 echo "~^header remove $xh"; read es;\
2731 call xerr $es "ins_ref $xh 2-1"
2732 echo "~^header remove $xh"; read es;\
2733 vput vexpr es substr $es 0 3
2735 xcall bail "ins_ref $xh 2-2"
2737 echo "~^header list $xh"; read es;\
2738 vput vexpr es substr $es 0 3
2740 xcall bail "$es ins_ref $xh 2-3"
2742 echo "~^header show $xh"; read es;\
2743 vput vexpr es substr $es 0 3
2745 xcall bail "ins_ref $xh 2-4"
2749 echo "~^header insert $xh <$xh@exam.ple>";\
2750 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
2752 echo "~^header insert $xh <${xh}2@exam.ple>";\
2753 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
2754 echo "~^header insert $xh ${xh}3@exam.ple";\
2755 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
2757 echo "~^header list $xh";\
2758 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
2759 echo "~^header show $xh";\
2760 read es; call xerr $es "ins_ref $xh 3-5"
2763 echo "~^header remove-at $xh 1"; read es;\
2764 call xerr $es "ins_ref $xh 3-6"
2765 if [ $mult -ne 0 ] && [ $xh != subject ]
2766 echo "~^header remove-at $xh 1"; read es;\
2767 call xerr $es "ins_ref $xh 3-7"
2768 echo "~^header remove-at $xh 1"; read es;\
2769 call xerr $es "ins_ref $xh 3-8"
2771 echo "~^header remove-at $xh 1"; read es;\
2772 vput vexpr es substr $es 0 3
2774 xcall bail "ins_ref $xh 3-9"
2776 echo "~^header remove-at $xh T"; read es;\
2777 vput vexpr es substr $es 0 3
2779 xcall bail "ins_ref $xh 3-10"
2781 echo "~^header show $xh"; read es;\
2782 vput vexpr es substr $es 0 3
2784 xcall bail "ins_ref $xh 3-11"
2788 echo "~^header insert $xh <$xh@exam.ple> ";\
2789 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
2791 echo "~^header insert $xh <${xh}2@exam.ple> ";\
2792 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
2793 echo "~^header insert $xh ${xh}3@exam.ple";\
2794 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
2796 echo "~^header list $xh"; read hl; echo $hl;\
2797 call xerr "$hl" "ins_ref $xh 4-4"
2798 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
2801 if [ $mult -ne 0 ] && [ $xh != subject ]
2802 echo "~^header remove-at $xh 3"; read es;\
2803 call xerr $es "ins_ref $xh 4-6"
2804 echo "~^header remove-at $xh 2"; read es;\
2805 call xerr $es "ins_ref $xh 4-7"
2807 echo "~^header remove-at $xh 1"; read es;\
2808 call xerr $es "ins_ref $xh 4-8"
2809 echo "~^header remove-at $xh 1"; read es;\
2810 vput vexpr es substr $es 0 3
2812 xcall bail "ins_ref $xh 4-9"
2814 echo "~^header remove-at $xh T"; read es;\
2815 vput vexpr es substr $es 0 3
2817 xcall bail "ins_ref $xh 4-10"
2819 echo "~^header show $xh"; read es;\
2820 vput vexpr es substr $es 0 3
2822 xcall bail "ins_ref $xh 4-11"
2827 # In collect.c order
2829 call ins_ref sender 0 # Not a "ref", but works
2833 call ins_addr reply-To
2834 call ins_addr mail-Followup-to
2835 call ins_ref messAge-id 0
2836 call ins_ref rEfErEncEs 1
2837 call ins_ref in-Reply-to 1
2838 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
2839 call ins_addr freeForm1
2840 call ins_addr freeform2
2842 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
2844 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
2852 echo "~^attachment";\
2853 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2855 xcall bail "attach 0-1"
2858 echo "~^attach attribute ./.treadctl";\
2859 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2861 xcall bail "attach 0-2"
2863 echo "~^attachment attribute-at 1";\
2864 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
2866 xcall bail "attach 0-3"
2869 echo "~^attachment insert ./.treadctl=ascii";\
2870 read hl; echo $hl; call xerr "$hl" "attach 1-1"
2871 echo "~^attachment list";\
2872 read es; echo $es;call xerr "$es" "attach 1-2"
2874 echo "~^attachment attribute ./.treadctl";\
2875 read es; echo $es;call xerr "$es" "attach 1-3"
2877 echo "~^attachment attribute .treadctl";\
2878 read es; echo $es;call xerr "$es" "attach 1-4"
2880 echo "~^attachment attribute-at 1";\
2881 read es; echo $es;call xerr "$es" "attach 1-5"
2884 echo "~^attachment attribute-set ./.treadctl filename rctl";\
2885 read es; echo $es;call xerr "$es" "attach 1-6"
2886 echo "~^attachment attribute-set .treadctl content-description Au";\
2887 read es; echo $es;call xerr "$es" "attach 1-7"
2888 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
2889 read es; echo $es;call xerr "$es" "attach 1-8"
2891 echo "~^attachment attribute ./.treadctl";\
2892 read es; echo $es;call xerr "$es" "attach 1-9"
2894 echo "~^attachment attribute .treadctl";\
2895 read es; echo $es;call xerr "$es" "attach 1-10"
2897 echo "~^attachment attribute rctl";\
2898 read es; echo $es;call xerr "$es" "attach 1-11"
2900 echo "~^attachment attribute-at 1";\
2901 read es; echo $es;call xerr "$es" "attach 1-12"
2905 echo "~^attachment insert ./.tattach=latin1";\
2906 read hl; echo $hl; call xerr "$hl" "attach 2-1"
2907 echo "~^attachment list";\
2908 read es; echo $es;call xerr "$es" "attach 2-2"
2910 echo "~^attachment attribute ./.tattach";\
2911 read es; echo $es;call xerr "$es" "attach 2-3"
2913 echo "~^attachment attribute .tattach";\
2914 read es; echo $es;call xerr "$es" "attach 2-4"
2916 echo "~^attachment attribute-at 2";\
2917 read es; echo $es;call xerr "$es" "attach 2-5"
2920 echo "~^attachment attribute-set ./.tattach filename tat";\
2921 read es; echo $es;call xerr "$es" "attach 2-6"
2923 "~^attachment attribute-set .tattach content-description Au2";\
2924 read es; echo $es;call xerr "$es" "attach 2-7"
2925 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
2926 read es; echo $es;call xerr "$es" "attach 2-8"
2928 "~^attachment attribute-set-at 2 content-type application/x-sh";\
2929 read es; echo $es;call xerr "$es" "attach 2-9"
2931 echo "~^attachment attribute ./.tattach";\
2932 read es; echo $es;call xerr "$es" "attach 2-10"
2934 echo "~^attachment attribute .tattach";\
2935 read es; echo $es;call xerr "$es" "attach 2-11"
2937 echo "~^attachment attribute tat";\
2938 read es; echo $es;call xerr "$es" "attach 2-12"
2940 echo "~^attachment attribute-at 2";\
2941 read es; echo $es;call xerr "$es" "attach 2-13"
2945 if [ "$t_remove" == "" ]
2949 echo "~^attachment remove ./.treadctl"; read es;\
2950 call xerr $es "attach 3-1"
2951 echo "~^attachment remove ./.tattach"; read es;\
2952 call xerr $es "attach 3-2"
2953 echo "~^ attachment remove ./.treadctl"; read es;\
2954 vput vexpr es substr $es 0 3
2956 xcall bail "attach 3-3"
2958 echo "~^ attachment remove ./.tattach"; read es;\
2959 vput vexpr es substr $es 0 3
2961 xcall bail "attach 3-4"
2963 echo "~^attachment list"; read es;\
2964 vput vexpr es substr $es 0 3
2966 xcall bail "attach 3-5"
2970 echo "~^attachment insert ./.tattach=latin1";\
2971 read hl; echo $hl; call xerr "$hl" "attach 4-1"
2972 echo "~^attachment insert ./.tattach=latin1";\
2973 read hl; echo $hl; call xerr "$hl" "attach 4-2"
2974 echo "~^attachment list";\
2975 read es; echo $es;call xerr "$es" "attach 4-3"
2977 echo "~^ attachment remove .tattach"; read es;\
2978 vput vexpr es substr $es 0 3
2980 xcall bail "attach 4-4 $es"
2982 echo "~^attachment remove-at T"; read es;\
2983 vput vexpr es substr $es 0 3
2985 xcall bail "attach 4-5"
2987 echo "~^attachment remove ./.tattach"; read es;\
2988 call xerr $es "attach 4-6"
2989 echo "~^attachment remove ./.tattach"; read es;\
2990 call xerr $es "attach 4-7"
2991 echo "~^ attachment remove ./.tattach"; read es;\
2992 vput vexpr es substr $es 0 3
2994 xcall bail "attach 4-8 $es"
2996 echo "~^attachment list"; read es;\
2997 vput vexpr es substr $es 0 3
2999 xcall bail "attach 4-9"
3003 echo "~^attachment insert ./.tattach=latin1";\
3004 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3005 echo "~^attachment insert ./.tattach=latin1";\
3006 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3007 echo "~^attachment insert ./.tattach=latin1";\
3008 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3009 echo "~^attachment list";\
3010 read es; echo $es;call xerr "$es" "attach 5-4"
3013 echo "~^attachment remove-at 3"; read es;\
3014 call xerr $es "attach 5-5"
3015 echo "~^attachment remove-at 3"; read es;\
3016 vput vexpr es substr $es 0 3
3018 xcall bail "attach 5-6"
3020 echo "~^attachment remove-at 2"; read es;\
3021 call xerr $es "attach 5-7"
3022 echo "~^attachment remove-at 2"; read es;\
3023 vput vexpr es substr $es 0 3
3025 xcall bail "attach 5-8"
3027 echo "~^attachment remove-at 1"; read es;\
3028 call xerr $es "attach 5-9"
3029 echo "~^attachment remove-at 1"; read es;\
3030 vput vexpr es substr $es 0 3
3032 xcall bail "attach 5-10"
3035 echo "~^attachment list"; read es;\
3036 vput vexpr es substr $es 0 3
3038 xcall bail "attach 5-11"
3042 echo "~^attachment insert ./.tattach=latin1";\
3043 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3044 echo "~^attachment insert ./.tattach=latin1";\
3045 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3046 echo "~^attachment insert ./.tattach=latin1";\
3047 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3048 echo "~^attachment list";\
3049 read es; echo $es;call xerr "$es" "attach 6-4"
3052 echo "~^attachment remove-at 1"; read es;\
3053 call xerr $es "attach 6-5"
3054 echo "~^attachment remove-at 1"; read es;\
3055 call xerr $es "attach 6-6"
3056 echo "~^attachment remove-at 1"; read es;\
3057 call xerr $es "attach 6-7"
3058 echo "~^attachment remove-at 1"; read es;\
3059 vput vexpr es substr $es 0 3
3061 xcall bail "attach 6-8"
3064 echo "~^attachment list"; read es;\
3065 vput vexpr es substr $es 0 3
3067 xcall bail "attach 6-9"
3079 echo on-compose-enter, mailx-command<$mailx-command>
3080 alternates alter1@exam.ple alter2@exam.ple
3082 set autocc='alter1@exam.ple alter2@exam.ple'
3083 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3084 echo mailx-subject<$mailx-subject>
3085 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3086 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3087 mailx-raw-bcc<$mailx-raw-bcc>
3088 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3089 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3092 echo on-compose-leave, mailx-command<$mailx-command>
3094 eval alternates $al alter3@exam.ple alter4@exam.ple
3096 set autobcc='alter3@exam.ple alter4@exam.ple'
3097 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3098 echo mailx-subject<$mailx-subject>
3099 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3100 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3101 mailx-raw-bcc<$mailx-raw-bcc>
3102 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3103 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3106 echo on-compose-cleanup, mailx-command<$mailx-command>
3109 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3110 echo mailx-subject<$mailx-subject>
3111 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3112 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3113 mailx-raw-bcc<$mailx-raw-bcc>
3114 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3115 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3117 wysh set on-compose-splice=t_ocs \
3118 on-compose-enter=t_oce on-compose-leave=t_ocl \
3119 on-compose-cleanup=t_occ
3123 printf 'm this-goes@nowhere\nbody\n!.\n' |
3124 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3125 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3127 ${cat} .
/.tall
>> "${MBOX}"
3128 check behave
:compose_hooks-1
0 "${MBOX}" '3479456964 10101'
3131 printf 'm this-goes@nowhere\nbody\n!.\n' |
3132 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3133 -St_remove=1 -X'source ./.trc' -Smta=.
/.tsendmail.sh \
3135 ${cat} .
/.tall
>> "${MBOX}"
3136 check behave
:compose_hooks-2
0 "${MBOX}" '3654000499 12535'
3140 # Some state machine stress, shell compose hook, localopts for hook, etc.
3141 # readctl in child. ~r as HERE document
3143 printf 'm ex@am.ple\nbody\n!.\nvar t_oce t_ocs t_ocs_sh t_ocl t_occ autocc' |
3144 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3145 -Smta=.
/.tsendmail.sh \
3148 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3151 vput vexpr es substr "$1" 0 1
3156 define read_mline_res {
3157 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3158 echo $len/$es/$^ERRNAME: $hl
3159 if [ $es -ne $^ERR-NONE ]
3160 xcall bail read_mline_res
3162 \xcall read_mline_res
3166 vput vexpr i + 1 "$2"
3168 vput vexpr j % $i 10
3175 eval \\$j _work $1 $i
3178 vput vexpr i + $i "$1"
3182 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3183 echo read:$es/$en: $line
3184 if [ "${es}" -ne -1 ]
3187 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3192 echo "~^header list"; read hl; echo $hl;\
3193 vput vexpr es substr "$hl" 0 1
3195 xcall bail "header list"
3198 call _work 1; echo $?
3199 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3200 read es; echo $es; vput vexpr es substr "$es" 0 1
3202 xcall bail "be diet"
3204 echo "~^header insert cc <splice2@exam.ple>";\
3205 read es; echo $es; vput vexpr es substr "$es" 0 1
3207 xcall bail "be diet2"
3210 call _work 2; echo $?
3211 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3212 read es; echo $es;vput vexpr es substr "$es" 0 1
3214 xcall bail "be juicy"
3216 echo "~^header insert bcc juice2@exam.ple";\
3217 read es; echo $es;vput vexpr es substr "$es" 0 1
3219 xcall bail "be juicy2"
3221 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3222 read es; echo $es;vput vexpr es substr "$es" 0 1
3224 xcall bail "be juicy3"
3226 echo "~^header insert bcc juice4@exam.ple";\
3227 read es; echo $es;vput vexpr es substr "$es" 0 1
3229 xcall bail "be juicy4"
3232 echo "~^header remove-at bcc 3";\
3233 read es; echo $es;vput vexpr es substr "$es" 0 1
3235 xcall bail "remove juicy5"
3237 echo "~^header remove-at bcc 2";\
3238 read es; echo $es;vput vexpr es substr "$es" 0 1
3240 xcall bail "remove juicy6"
3242 echo "~^header remove-at bcc 3";\
3243 read es; echo $es;vput vexpr es substr "$es" 0 3
3245 xcall bail "failed to remove-at"
3247 # Add duplicates which ought to be removed!
3248 echo "~^header insert bcc juice4@exam.ple";\
3249 read es; echo $es;vput vexpr es substr "$es" 0 1
3251 xcall bail "be juicy4-1"
3253 echo "~^header insert bcc juice4@exam.ple";\
3254 read es; echo $es;vput vexpr es substr "$es" 0 1
3256 xcall bail "be juicy4-2"
3258 echo "~^header insert bcc juice4@exam.ple";\
3259 read es; echo $es;vput vexpr es substr "$es" 0 1
3261 xcall bail "be juicy4-3"
3266 call _work 3; echo $?
3268 vput ! i echo just knock if you can hear me;\
3270 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3272 echon shell-cmd says $?/$^ERRNAME: $i
3273 echo "~x will not become interpreted, we are reading until __EOT"
3275 read r_status; echo "~~r status output: $r_status"
3276 echo "~:echo $? $! $^ERRNAME"
3278 echo "~~r status from parent: $r_status"
3281 call _work 4; echo $?
3282 vput cwd cwd;echo cwd:$?
3283 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3287 call _work 5; echo $?
3288 echo "~^header show MAILX-Command"; read es;\
3289 call xerr $es "t_header 1000"; call read_mline_res
3290 echo "~^header show MAILX-raw-TO"; read es;\
3291 call xerr $es "t_header 1001"; xcall read_mline_res
3293 echoerr IT IS WRONG IF YOU SEE THIS
3296 echo on-compose-enter, mailx-command<$mailx-command>
3297 set t_oce autobcc=oce@exam.ple
3298 alternates alter1@exam.ple alter2@exam.ple
3300 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3301 echo mailx-subject<$mailx-subject>
3302 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3303 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3304 mailx-raw-bcc<$mailx-raw-bcc>
3305 echo mailx-orig-from<$mailx-orig-from> \
3306 mailx-orig-to<$mailx-orig-to> \
3307 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3310 echo on-compose-leave, mailx-command<$mailx-command>
3311 set t_ocl autocc=ocl@exam.ple
3313 alternates alter3@exam.ple alter4@exam.ple
3315 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3316 echo mailx-subject<$mailx-subject>
3317 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3318 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3319 mailx-raw-bcc<$mailx-raw-bcc>
3320 echo mailx-orig-from<$mailx-orig-from> \
3321 mailx-orig-to<$mailx-orig-to> \
3322 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3325 echo on-compose-cleanup, mailx-command<$mailx-command>
3326 set t_occ autocc=occ@exam.ple
3329 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3330 echo mailx-subject<$mailx-subject>
3331 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3332 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3333 mailx-raw-bcc<$mailx-raw-bcc>
3334 echo mailx-orig-from<$mailx-orig-from> \
3335 mailx-orig-to<$mailx-orig-to> \
3336 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3338 wysh set on-compose-splice=t_ocs \
3339 on-compose-splice-shell="read ver;printf \"t_ocs-shell\\n\
3340 ~t shell@exam.ple\\n~:set t_ocs_sh\\n\"" \
3341 on-compose-enter=t_oce on-compose-leave=t_ocl \
3342 on-compose-cleanup=t_occ
3344 ex0_test behave
:compose_hooks-3
3345 ${cat} .
/.tnotes
>> "${MBOX}"
3347 check behave
:compose_hooks-3
- "${MBOX}" '679526364 2431'
3349 # Reply, forward, resend, Resend
3352 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3353 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3354 -Smta=.
/.tsendmail.sh
3357 echo start: $? $! $^ERRNAME
3359 echo File: $? $! $^ERRNAME;echo;echo
3361 this is content of reply 1
3363 echo reply 1: $? $! $^ERRNAME;echo;echo
3365 this is content of Reply 1 2
3367 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3368 forward 1 fwdex@am.ple
3369 this is content of forward 1
3371 echo forward 1: $? $! $^ERRNAME;echo;echo
3372 resend 1 2 resendex@am.ple
3373 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3374 Resend 1 2 Resendex@am.ple
3375 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3377 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3378 -Smta=.
/.tsendmail.sh \
3381 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3384 vput vexpr es substr "$1" 0 1
3389 define read_mline_res {
3390 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3391 echo mline_res:$len/$es/$^ERRNAME: $hl
3392 if [ $es -ne $^ERR-NONE ]
3393 xcall bail read_mline_res
3395 \xcall read_mline_res
3399 echo "~^header show $1"; read es;\
3400 call xerr $es "work_hl $1"; echo $1; call read_mline_res
3408 echo t_ocs version $ver
3409 echo "~^header list"; read hl; echo $hl;\
3410 echoerr the header list is $hl;\
3411 call xerr "$hl" "header list"
3412 eval vpospar set $hl
3415 echoerr IT IS WRONG IF YOU SEE THIS
3418 echo on-XY-enter, mailx-command<$mailx-command>
3419 set t_oce autobcc=oce@exam.ple
3420 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3421 echo mailx-subject<$mailx-subject>
3422 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3423 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3424 mailx-raw-bcc<$mailx-raw-bcc>
3425 echo mailx-orig-from<$mailx-orig-from> \
3426 mailx-orig-to<$mailx-orig-to> \
3427 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3430 echo on-XY-leave, mailx-command<$mailx-command>
3431 set t_ocl autocc=ocl@exam.ple
3432 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3433 echo mailx-subject<$mailx-subject>
3434 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3435 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3436 mailx-raw-bcc<$mailx-raw-bcc>
3437 echo mailx-orig-from<$mailx-orig-from> \
3438 mailx-orig-to<$mailx-orig-to> \
3439 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3442 echo on-XY-cleanup, mailx-command<$mailx-command>
3443 set t_occ autocc=occ@exam.ple
3444 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3445 echo mailx-subject<$mailx-subject>
3446 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3447 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3448 mailx-raw-bcc<$mailx-raw-bcc>
3449 echo mailx-orig-from<$mailx-orig-from> \
3450 mailx-orig-to<$mailx-orig-to> \
3451 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3453 wysh set on-compose-splice=t_ocs \
3454 on-compose-enter=t_oce on-compose-leave=t_ocl \
3455 on-compose-cleanup=t_occ \
3456 on-resend-enter=t_oce on-resend-cleanup=t_occ
3458 ex0_test behave
:compose_hooks-4
3459 ${cat} .
/.tnotes
>> "${MBOX}"
3461 check behave
:compose_hooks-4
- "${MBOX}" '3038884027 7516'
3466 t_behave_message_injections
() {
3468 TRAP_EXIT_ADDONS
="./.t*"
3470 ${cat} <<-_EOT > ./.tsendmail.sh
3472 (echo 'From Echinacea Tue Jun 20 15:54:02 2017' && ${cat} && echo
3475 chmod 0755 .
/.tsendmail.sh
3477 echo mysig
> .
/.tmysig
3479 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tsendmail.sh \
3480 -Smessage-inject-head=head-inject \
3481 -Smessage-inject-tail=tail-inject \
3482 -Ssignature=.
/.tmysig \
3483 ex@am.ple
> .
/.tall
2>&1
3484 check behave
:message_injections-1
0 "${MBOX}" '2434746382 134'
3485 check behave
:message_injections-2
- .tall
'4294967295 0' # empty file
3487 ${cat} <<-_EOT > ./.template
3491 Subject: This subject is
3493 Body, body, body me.
3495 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tsendmail.sh \
3496 -Smessage-inject-head=head-inject \
3497 -Smessage-inject-tail=tail-inject \
3498 -Ssignature=.
/.tmysig \
3500 check behave
:message_injections-3
0 "${MBOX}" '3114203412 198'
3501 check behave
:message_injections-4
- .tall
'4294967295 0' # empty file
3506 t_behave_mime_types_load_control
() {
3508 TRAP_EXIT_ADDONS
="./.t*"
3510 ${cat} <<-_EOT > ./.tmts1
3511 @ application/mathml+xml mathml
3513 ${cat} <<-_EOT > ./.tmts2
3514 @ x-conference/x-cooltalk ice
3516 @ application/aga-aga aga
3519 ${cat} <<-_EOT > ./.tmts1.mathml
3520 <head>nonsense ML</head>
3522 ${cat} <<-_EOT > ./.tmts2.ice
3525 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3526 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3540 ' "${MBOX}" "${MBOX}" |
3542 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3544 ex0_test behave
:mime_types_load_control
3546 ${cat} "${MBOX}" >> .
/.tout
3547 check behave
:mime_types_load_control-1
- .
/.tout
'1441260727 2449'
3549 echo type |
${MAILX} ${ARGS} -R \
3550 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3551 -f "${MBOX}" >> .
/.tout
2>&1
3552 check behave
:mime_types_load_control-2
0 .
/.tout
'1441391438 3646'
3558 have_feat smime ||
{
3559 echo 'behave:s/mime: unsupported, skipped'
3564 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
3565 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
3566 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tsendmail.sh"
3568 printf 'behave:s/mime: .. generating test key and certificate ..\n'
3569 ${cat} <<-_EOT > ./.t.conf
3572 default_keyfile = keyfile.pem
3573 distinguished_name = req_distinguished_name
3574 attributes = req_attributes
3578 [ req_distinguished_name ]
3585 emailAddress = test@localhost
3590 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
3591 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>/dev
/null
2>&1
3592 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
3595 printf 'behave:s/mime:sign/verify: '
3596 echo bla |
${MAILX} ${ARGS} \
3597 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3598 -Ssmime-sign -Sfrom=test@localhost \
3599 -s 'S/MIME test' .
/.VERIFY
3600 if [ $?
-eq 0 ]; then
3611 /^Content-Description: /{ skip = 2; print; next }
3612 /^$/{ if(skip) --skip }
3615 < .
/.VERIFY
> "${MBOX}"
3616 check behave
:s
/mime
:sign
/verify
:checksum
- "${MBOX}" '2900817158 648'
3618 printf 'behave:s/mime:sign/verify:verify '
3619 printf 'verify\nx\n' |
3621 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3622 -Ssmime-sign -Sfrom=test@localhost \
3624 -f .
/.VERIFY
>/dev
/null
2>&1
3625 if [ $?
-eq 0 ]; then
3634 printf 'behave:s/mime:sign/verify:disproof-1 '
3635 if openssl smime
-verify -CAfile .
/.tcert.pem \
3636 -in .
/.VERIFY
>/dev
/null
2>&1; then
3645 # (signing +) encryption / decryption
3646 ${cat} <<-_EOT > ./.tsendmail.sh
3648 (echo 'From Euphrasia Thu Apr 27 17:56:23 2017' && ${cat}) > ./.ENCRYPT
3650 chmod 0755 .
/.tsendmail.sh
3652 printf 'behave:s/mime:encrypt+sign: '
3655 -Ssmime-force-encryption \
3656 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3657 -Smta=.
/.tsendmail.sh \
3658 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3659 -Ssmime-sign -Sfrom=test@localhost \
3660 -s 'S/MIME test' recei@ver.com
3661 if [ $?
-eq 0 ]; then
3665 printf 'error: encrypt+sign failed\n'
3668 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3669 check behave
:s
/mime
:encrypt
+sign
:checksum
- "${MBOX}" '1937410597 327'
3671 printf 'behave:s/mime:decrypt+verify: '
3672 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
3674 -Ssmime-force-encryption \
3675 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3676 -Smta=.
/.tsendmail.sh \
3677 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3678 -Ssmime-sign -Sfrom=test@localhost \
3680 -f .
/.ENCRYPT
>/dev
/null
2>&1
3681 if [ $?
-eq 0 ]; then
3690 /^Content-Description: /{ skip = 2; print; next }
3691 /^$/{ if(skip) --skip }
3694 < .
/.DECRYPT
> "${MBOX}"
3695 check behave
:s
/mime
:decrypt
+verify
:checksum
- "${MBOX}" '1720739247 931'
3697 printf 'behave:s/mime:decrypt+verify:disproof-1: '
3698 if (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
3699 openssl smime
-verify -CAfile .
/.tcert.pem
) >/dev
/null
2>&1; then
3706 printf "behave:s/mime:encrypt: "
3707 echo bla |
${MAILX} ${ARGS} \
3708 -Ssmime-force-encryption \
3709 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3710 -Smta=.
/.tsendmail.sh \
3711 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3712 -Sfrom=test@localhost \
3713 -s 'S/MIME test' recei@ver.com
3714 if [ $?
-eq 0 ]; then
3721 # Same as behave:s/mime:encrypt+sign:checksum above
3722 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
3723 check behave
:s
/mime
:encrypt
:checksum
- "${MBOX}" '1937410597 327'
3726 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
3727 -Ssmime-force-encryption \
3728 -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
3729 -Smta=.
/.tsendmail.sh \
3730 -Ssmime-ca-file=.
/.tcert.pem
-Ssmime-sign-cert=.
/.tpair.pem \
3731 -Sfrom=test@localhost \
3733 -f .
/.ENCRYPT
>/dev
/null
2>&1
3734 check behave
:s
/mime
:decrypt
0 "./.DECRYPT" '2624716890 422'
3736 printf 'behave:s/mime:decrypt:disproof-1: '
3737 if openssl smime
-decrypt -inkey .
/.tkey.pem \
3738 -in .
/.ENCRYPT
>/dev
/null
2>&1; then
3748 t_behave_maildir
() {
3750 TRAP_EXIT_ADDONS
="./.t*"
3754 while [ ${i} -lt 112 ]; do
3755 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
3756 "${MBOX}" "${i}" "${i}"
3759 ) |
${MAILX} ${ARGS}
3760 check behave
:maildir-1
0 "${MBOX}" '1140119864 13780'
3766 ' "${MBOX}" .tmdir1 .tmdir1 |
3767 ${MAILX} ${ARGS} -Snewfolders=maildir
> .tlst
3768 check behave
:maildir-2
0 .tlst
'1797938753 9103'
3771 copy * "maildir://%s"
3774 ' "${MBOX}" .tmdir2 .tmdir2 |
3775 ${MAILX} ${ARGS} > .tlst
3776 check behave
:maildir-3
0 .tlst
'1155631089 9113'
3778 printf 'File "maildir://%s"
3782 ' .tmdir2 .tmbox1 .tmbox1 |
3783 ${MAILX} ${ARGS} > .tlst
3784 check behave
:maildir-4
0 .tmbox1
'2646131190 13220'
3785 check behave
:maildir-5
- .tlst
'3701297796 9110'
3787 # only the odd (even)
3789 printf 'File "maildir://%s"
3792 while [ ${i} -lt 112 ]; do
3794 [ ${j} -eq 1 ] && printf '%s ' "${i}"
3801 ) |
${MAILX} ${ARGS} > .tlst
3802 check behave
:maildir-6
0 .tmbox2
'142890131 6610'
3803 check behave
:maildir-7
- .tlst
'960096773 4573'
3806 printf 'file "maildir://%s"
3809 while [ ${i} -lt 112 ]; do
3811 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
3819 ' .tmbox2 .tmbox2 .tmdir2
3820 ) | ${MAILX} ${ARGS} > .tlst
3821 check behave:maildir-8 0 .tmbox2 '3806905791 13100'
3822 ${sed} 2d < .tlst > .tlstx
3823 check behave:maildir-9 - .tlstx '4216815295 13645'
3828 t_behave_mass_recipients() {
3830 TRAP_EXIT_ADDONS=".
/.t
*"
3832 ${cat} <<-_EOT > ./.tsendmail.sh
3834 (echo 'From Eucalyptus Sat Jul 08 21:14:57 2017' && ${cat} && echo
3837 chmod 0755 ./.tsendmail.sh
3839 ${cat} <<'__EOT__' > ./.trc
3841 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
3844 wysh set nr=$1 hn=$2
3845 echo "~
$hn $hn$nr@
$hn"; echo '~:echo $?'; read es
3847 xcall bail "ins_addr
$hn 1-$nr"
3849 vput vexpr nr + $nr 1
3850 if [ "$nr" -le "$maximum" ]
3851 xcall ins_addr $nr $hn
3855 wysh set nr=$1 hn=$2
3856 alternates $hn$nr@$hn
3857 vput vexpr nr + $nr 2
3858 if [ "$nr" -le "$maximum" ]
3859 xcall bld_alter $nr $hn
3869 if [ "$t_remove" != '' ]
3874 set on-compose-splice=t_ocs on-compose-leave=t_ocl
3878 printf 'm this-goes@nowhere\nbody\n!.\n' |
3879 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3880 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3882 ${cat} ./.tall >> "${MBOX}"
3883 check behave:mass_recipients-1 0 "${MBOX}" '2912243346 51526'
3886 printf 'm this-goes@nowhere\nbody\n!.\n' |
3887 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3888 -St_remove=1 -X'source ./.trc' -Smta=./.tsendmail.sh -Smaximum=2001 \
3890 ${cat} ./.tall >> "${MBOX}"
3891 check behave:mass_recipients-2 0 "${MBOX}" '4097804632 34394'
3896 t_behave_lreply_futh_rth_etc() {
3898 TRAP_EXIT_ADDONS=".
/.t
*"
3900 ${cat} <<-_EOT > ./.tsendmail.sh
3902 (echo 'From HumulusLupulus Thu Jul 27 14:41:20 2017' && ${cat} && echo
3905 chmod 0755 ./.tsendmail.sh
3907 ${cat} <<-_EOT > ./.tmbox
3908 From neverneverland Sun Jul 23 13:46:25 2017
3909 Subject: Bugstop: five miles out 1
3910 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3911 From: mister originator <mr@originator>
3912 To: bugstop-commit@five.miles.out, laber@backe.eu
3914 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
3915 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
3916 Date: Wed, 19 Jul 2017 09:22:57 -0400
3917 Message-Id: <20170719132257.766AF781267@originator>
3920 > |Sorry, I think I misunderstand something. I would think that
3924 From neverneverland Fri Jul 7 22:39:11 2017
3925 Subject: Bugstop: five miles out 2
3926 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
3927 Content-Transfer-Encoding: 7bit
3928 From: mister originator <mr@originator>
3929 To: bugstop-commit@five.miles.out
3931 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
3932 Date: Fri, 07 Jul 2017 16:33:59 -0400
3935 capable of changing back.
3937 From neverneverland Fri Jul 7 22:42:00 2017
3938 Subject: Bugstop: five miles out 3
3939 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3940 Content-Transfer-Encoding: 7bit
3941 From: mister originator <mr@originator>
3942 To: bugstop-commit@five.miles.out
3944 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
3945 Date: Fri, 07 Jul 2017 16:33:59 -0400
3946 List-Post: <mailto:bugstop@five.miles.out>
3949 are you ready, boots?
3951 From neverneverland Sat Aug 19 23:15:00 2017
3952 Subject: Bugstop: five miles out 4
3953 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
3954 Content-Transfer-Encoding: 7bit
3955 From: mister originator <mr@originator>
3956 To: bugstop@five.miles.out
3958 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
3959 Date: Fri, 07 Jul 2017 16:33:59 -0400
3960 List-Post: <mailto:bugstop@five.miles.out>
3963 are you ready, boots?
3968 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tsendmail.sh \
3969 -Rf ./.tmbox >> "${MBOX}" 2>&1
3971 wysh set m="This is text of
\"reply
${1}.
"
3982 echo -----After reply
$1.1
- $1.3
: $?
/$^ERRNAME
3985 wysh
set m
="This is text of \"Reply ${1}."
3991 echo -----After Reply $1.$2: $?/$^ERRNAME
4000 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
4004 # We need two indirections for this test: one for the case that Lreply
4005 # fails because of missing recipients: we need to read EOF next, thus
4006 # place this in _Ls last; and second for the succeeding cases EOF is
4007 # not what these should read, so go over the backside and splice it in!
4009 echo -----After Lreply $1.$2: $?/$^ERRNAME
4012 localopts call-fixate yes
4014 call R $1 1; call R $1 2; call R $1 3; call R $1 4
4015 call L $1 1; call L $1 2; call L $1 3
4018 echo;echo '===== CHANGING
=== '"$*"' =====';echo
4022 set from=laber@backe.eu
4025 call tweak set reply-to-honour
4027 call tweak set followup-to
4029 call tweak set followup-to-honour
4031 call tweak mlist bugstop@five.miles.out
4033 call tweak mlsubscribe bugstop@five.miles.out
4035 call tweak set recipients-in-cc
4039 check behave:lreply_futh_rth_etc 0 "${MBOX}" '940818845 29373'
4044 t_behave_iconv_mbyte_base64() {
4046 TRAP_EXIT_ADDONS="./.t*"
4048 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv &&
4049 command -v iconv >/dev/null 2>&1 &&
4050 ( iconv -l | ${grep} -i -e iso-2022-jp -e euc-jp) >/dev/null 2>&1; then
4053 echo 'behave
:iconv_mbyte_base64
: unsupported
, skipped
'
4057 ${cat} <<-_EOT > ./.tsendmail.sh
4059 (echo 'From DroseriaRotundifolia Thu Aug
03 17:26:25 2017' && ${cat} &&
4062 chmod 0755 ./.tsendmail.sh
4064 if ( iconv -l | ${grep} -i iso-2022-jp ) >/dev/null 2>&1; then
4066 set ttycharset
=utf-8 sendcharsets
=iso-2022-jp
4068 !s Japanese from UTF-8 to ISO-2022-JP
4069 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4071 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4074 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4076 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4079 set ttycharset
=iso-2022-jp charset-7bit
=iso-2022-jp sendcharsets
=utf-8
4081 !s Japanese from ISO-2022-JP to UTF-8
, eh
, no
, also ISO-2022-JP
4082 \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
4084 \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
4087 \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
4089 \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
4091 ' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
4092 -Sescape=! -Smime-encoding=base64 2>./.terr
4093 check behave:iconv_mbyte_base64-1 0 "${MBOX}" '3428985079 1976'
4094 check behave:iconv_mbyte_base64-2 - ./.terr '4294967295 0'
4096 printf 'eval f 1; write ./.twrite\n' |
4097 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4098 check behave:iconv_mbyte_base64-3 0 ./.twrite '1259742080 686'
4099 check behave:iconv_mbyte_base64-4 - ./.tlog '3956097665 119'
4101 echo 'behave:iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4104 if ( iconv -l | ${grep} -i euc-jp ) >/dev/null 2>&1; then
4105 rm -f "${MBOX}" ./.twrite
4107 set ttycharset=utf-8 sendcharsets=euc-jp
4109 !s Japanese from UTF-8 to EUC-JP
4110 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4112 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4115 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4117 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4120 set ttycharset=EUC-JP sendcharsets=utf-8
4122 !s Japanese from EUC-JP to UTF-8
4123 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4125 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4128 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4130 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4132 ' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} -Smta=./.tsendmail.sh \
4133 -Sescape=! -Smime-encoding=base64 2>./.terr
4134 check behave:iconv_mbyte_base64-5 0 "${MBOX}" '1686827547 2051'
4135 check behave:iconv_mbyte_base64-6 - ./.terr '4294967295 0'
4137 printf 'eval f 1; write ./.twrite\n' |
4138 ${MAILX} ${ARGS} ${ADDARG_UNI} -Rf "${MBOX}" >./.tlog 2>&1
4139 check behave:iconv_mbyte_base64-7 0 ./.twrite '1259742080 686'
4140 check behave:iconv_mbyte_base64-8 - ./.tlog '500059195 119'
4142 echo 'behave:iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4149 # Some basic tests regarding correct sending of mails, via STDIN / -t / -q,
4150 # including basic MIME Content-Transfer-Encoding correctness (quoted-printable)
4151 # Note we unfortunately need to place some statements without proper
4152 # indentation because of continuation problems
4156 # MIME encoding (QP) stress message body
4158 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
4159 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
4160 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
4161 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
4162 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
4163 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
4164 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
4165 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
4166 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
4167 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
4168 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
4169 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
4170 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
4171 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
4172 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
4173 "auf den zeilen vorher.\r\n"\
4174 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
4176 "Die letzte Zeile war nur ein Punkt.\r\n"\
4178 "Das waren deren zwei.\r\n"\
4180 "Die letzte Zeile war ein Leerschritt.\n"\
4181 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
4184 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
4186 "Das waren deren zwei. ditto.\n"\
4188 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
4189 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
4190 "auf den zeilen vorher.\n"\
4192 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
4193 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
4195 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4197 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4199 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4201 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4203 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
4205 "QP am Zeilenende über soft-nl hinweg\n"\
4206 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4208 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4210 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4212 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
4214 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
4216 "Die letzte Zeile war ein Leerschritt.\n"\
4220 # MIME encoding (QP) stress message subject
4221 SUB="Äbrä Kä?dä=brö Fü?di=bus? \
4222 adadaddsssssssddddddddddddddddddddd\
4223 ddddddddddddddddddddddddddddddddddd\
4224 ddddddddddddddddddddddddddddddddddd\
4225 dddddddddddddddddddd Hallelulja? Od\
4226 er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4227 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee\
4228 eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f\
4229 fffffffffffffffffffffffffffffffffff\
4230 fffffffffffffffffffff ggggggggggggg\
4231 ggggggggggggggggggggggggggggggggggg\
4232 ggggggggggggggggggggggggggggggggggg\
4233 ggggggggggggggggggggggggggggggggggg\
4236 # Three tests for MIME encoding and (a bit) content classification.
4237 # At the same time testing -q FILE, < FILE and -t FILE
4240 < "${BODY}" ${MAILX} ${ARGS} ${ADDARG_UNI} \
4241 -a "${BODY}" -s "${SUB}" "${MBOX}"
4242 check content:001 0 "${MBOX}" '1145066634 6654'
4245 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4246 -a "${BODY}" -s "${SUB}" -q "${BODY}" "${MBOX}"
4247 check content:002 0 "${MBOX}" '1145066634 6654'
4250 ( echo "To: ${MBOX}" && echo "Subject: ${SUB}" && echo &&
4252 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a "${BODY}" -t
4253 check content:003 0 "${MBOX}" '1145066634 6654'
4255 # Test for [260e19d] (Juergen Daubert)
4257 echo body | ${MAILX} ${ARGS} "${MBOX}"
4258 check content:004 0 "${MBOX}" '2917662811 98'
4260 # Sending of multiple mails in a single invocation
4262 ( printf "m ${MBOX}\n~s subject1\nE-Mail Körper 1\n~.\n" &&
4263 printf "m ${MBOX}\n~s subject2\nEmail body 2\n~.\n" &&
4265 ) | ${MAILX} ${ARGS} ${ADDARG_UNI}
4266 check content:005 0 "${MBOX}" '2098659767 358'
4270 # "Test for" [d6f316a] (Gavin Troy)
4272 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
4273 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
4274 check content:006 0 "${MBOX}" '2099098650 122'
4275 check content:006-1 - "${BODY}" '794542938 174'
4277 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
4280 for(i = 0; i < 10000; ++i)
4282 #printf "\xF0\x90\x87\x90"
4283 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
4284 check content:007 0 "${MBOX}" '534262374 61816'
4286 ## Test some more corner cases for header bodies (as good as we can today) ##
4290 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4291 -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̲' \
4293 check content:008 0 "${MBOX}" '3370931614 375'
4295 # Single word (overlong line split -- bad standard! Requires injection of
4296 # artificial data!! But can be prevented by using RFC 2047 encoding)
4298 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4299 echo | ${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4300 check content:009 0 "${MBOX}" '489922370 1718'
4302 # Combination of encoded words, space and tabs of varying sort
4304 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4305 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
4306 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
4307 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
4308 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
4309 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
4311 check content:010 0 "${MBOX}" '1676887734 591'
4313 # Overlong multibyte sequence that must be forcefully split
4314 # todo This works even before v15.0, but only by accident
4316 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4317 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4318 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4319 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
4321 check content:011 0 "${MBOX}" '3029301775 659'
4325 echo | ${MAILX} ${ARGS} \
4326 -s "1-1 B2 B3 B4 B5 B6 B\
4327 1-2 B2 B3 B4 B5 B6 B\
4328 1-3 B2 B3 B4 B5 B6 B\
4329 1-4 B2 B3 B4 B5 B6 B\
4330 1-5 B2 B3 B4 B5 B6 B\
4331 1-6 B2 B3 B4 B5 B6 " \
4333 check content:012 0 "${MBOX}" '4126167195 297'
4335 # Leading and trailing WS
4337 echo | ${MAILX} ${ARGS} \
4338 -s " 2-1 B2 B3 B4 B5 B6 B\
4339 1-2 B2 B3 B4 B5 B6 B\
4340 1-3 B2 B3 B4 B5 B6 B\
4341 1-4 B2 B3 B4 B5 B6 " \
4343 check content:013 0 "${MBOX}" '3600624479 236'
4345 # Quick'n dirty RFC 2231 test; i had more when implementing it, but until we
4346 # have a (better) test framework materialize a quick shot
4348 TRAP_EXIT_ADDONS=./.ttt
4350 mkdir ./.ttt || exit 1
4354 : > 'diet\ is \curd.txt'
4355 : > 'diet "is" curd.txt'
4357 : > 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
4358 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4359 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4360 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4362 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4363 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
4364 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
4365 -a ./.ttt/höde-tröge.txt \
4366 -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 \
4367 -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 \
4368 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4369 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4371 check content:014-1 0 "${MBOX}" '684985954 3092'
4373 # `resend
' test, reusing $MBOX
4375 printf "Resend ${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4376 check content:014-2 0 "${BODY}" '684985954 3092'
4379 printf "resend ${BODY}\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4380 check content:014-3 0 "${BODY}" '3130352658 3148'
4386 # if have_feat devel; then
4387 # ARGS="${ARGS} -Smemdebug"
4391 if [ -n "${UTF8_LOCALE}" ]; then
4392 printf 'Using Unicode locale
%s
\n' "${UTF8_LOCALE}"
4394 printf 'No Unicode locale found
, disabling Unicode tests
\n'
4401 if [ -z "${CHECK_ONLY}" ]; then
4407 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred
'