2 #@ Synopsis: [OBJDIR=XY] ./mx-test.sh --check mailx-binary [:SKIPTESTNAME:]
3 #@ [OBJDIR=XY] ./mx-test.sh --run-test mailx-binary [:TESTNAME:]
4 #@ [./mx-test.sh # Note: performs hundreds of compilations!]
5 #@ --no-jobs can be used to prevent spawning concurrent tests.
6 #@ --no-colour or $MAILX_CC_TEST_NO_COLOUR for not trying to use colour
7 #@ (then grep for ^ERROR, for example).
8 #@ The last mode also reacts on $MAILX_CC_ALL_TESTS_DUMPERR, for even easier
9 #@ grep ^ERROR handling.
10 #@ And setting $MAILX_CC_TEST_NO_CLEANUP keeps all test data around, fwiw:
11 #@ this works with --run-test only.
12 #@ $JOBWAIT, $JOBMON and $SKIPTEST are taken from environment when found.
18 # Instead of figuring out the environment in here, require a configured build
19 # system and include that! Our makefile and configure ensure that this test
20 # does not run in the configured, but the user environment nonetheless!
23 if [ -f .
/mk-config.env
]; then
25 elif [ -f snailmail.jpg
] && [ -f "${OBJDIR}"/mk-config.env
]; then
26 i
=`pwd`/ # not from environment, sic
30 echo >&2 'S-nail/S-mailx is not configured.'
31 echo >&2 'This test script requires the shell environment that only the'
32 echo >&2 'configuration script can figure out, even if used to test'
33 echo >&2 'a different binary than the one that would be produced!'
34 echo >&2 '(The information will be in ${OBJDIR:=.obj}/mk-config.env.)'
35 echo >&2 'Hit RETURN to run "make config"'
41 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
42 MAILX__CC_TEST_RUNNING
=1
43 export MAILX__CC_TEST_RUNNING
44 exec "${SHELL}" "${i}${0}" "${@}"
47 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
48 # such is a compile-time variable
49 ARGS
='-Sv15-compat -:/ -Sdotlock-disable -Smta=test -Smta-bcc-ok'
50 ARGS
="${ARGS}"' -Smemdebug -Sstealthmua'
51 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave'
52 ARGS
="${ARGS}"' -Smailcap-disable -Smimetypes-load-control='
53 NOBATCH_ARGS
="${ARGS}"' -Sexpandaddr'
54 ARGS
="${ARGS}"' -Sexpandaddr=restrict -#'
55 ADDARG_UNI
=-Sttycharset=UTF-8
59 ERR
=.
/.cc-test.err
# Covers some which cannot be checksummed; not quoted!
61 #UTF8_LOCALE= HONOURS_READONLY= autodetected unless set
64 # When testing mass mail/loops, maximum number of receivers/loops.
65 # TODO note we do not gracefully handle ARG_MAX excess yet!
66 # Those which use this have checksums for 2001 and 201.
67 # Some use the smaller automatically if +debug
68 LOOPS_BIG
=2001 LOOPS_SMALL
=201
69 LOOPS_MAX
=$LOOPS_SMALL
71 # How long unless started tests get reaped (avoid endless looping)
76 # Note valgrind has problems with FDs in forked childs, which causes some tests
77 # to fail (the FD is rewound and thus will be dumped twice)
79 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
85 jspawn X_Y_opt_input_go_stack
90 jspawn input_inject_semicolon_seq
92 jspawn commandalias
# test now, save space later on!
102 jspawn macro_param_shift
112 jspawn headerpick
# so we have a notion that it works a bit
115 # Send/RFC absolute basics
130 # MIME and RFC basics
131 jspawn mime_if_not_ascii
133 jspawn xxxheads_rfc2047
134 jspawn iconv_mbyte_base64
135 jspawn iconv_mainbody
136 jspawn mime_force_sendout
137 jspawn binary_mainbody
138 jspawn C_opt_customhdr
141 # Operational basics with trivial tests
148 # Operational basics with easy tests
149 jspawn expandaddr
# (after t_alias)
150 jspawn mta_aliases
# (after t_expandaddr)
154 jspawn message_injections
156 jspawn rfc2231
# (after attachments)
157 jspawn mime_types_load_control
160 # Around state machine, after basics
165 jspawn on_main_loop_tick
166 jspawn on_program_exit
169 # Heavy use of/rely on state machine (behaviour) and basics
171 jspawn mass_recipients
172 jspawn lreply_futh_rth_etc
186 ## Now it is getting really weird. You have been warned.
187 # Setup and support {{{
188 export ARGS ADDARG_UNI CONF BODY MBOX MAIL TMPDIR \
189 MAKE
awk cat cksum rm sed grep
193 # Wed Oct 2 01:50:07 UTC 1996
194 SOURCE_DATE_EPOCH
=844221007
196 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
197 unset POSIXLY_CORRECT LOGNAME USER
202 Synopsis: [OBJDIR=x] mx-test.sh [--no-jobs] --check mailx-binary [:SKIPTEST:]
203 Synopsis: [OBJDIR=x] mx-test.sh [--no-jobs] --run-test mailx-binary [:TEST:]
204 Synopsis: [OBJDIR=x] mx-test.sh [--no-jobs]
206 --check EXE [:SKIPTEST:] run test series, exit success or error.
207 [:SKIPTEST:]s (and $SKIPTEST=) will be excluded.
208 --run-test EXE [:TEST:] run all or only the given TESTs, and create
209 test output data files; if run in a git(1)
210 checkout with the [test-out] branch available,
211 it will also create file diff(1)erences
212 --no-jobs do not spawn multiple jobs simultaneously
213 (dependent on make(1) and sh(1), pass JOBMON=n, too)
214 --no-colour or $MAILX_CC_TEST_NO_COLOUR: no colour
215 (for example to: grep ^ERROR)
216 $MAILX_CC_ALL_TESTS_DUMPER in addition for even
217 easier grep ^ERROR handling
219 The last invocation style will compile and test as many different
220 configurations as possible.
221 EXE should be absolute or relative to $OBJDIR, which can be may be set to the
222 location of the built objects etc.
223 $MAILX_CC_TEST_NO_CLEANUP skips deletion of test data (works only with
224 one test, aka --run-test).
225 $JOBWAIT could denote a timeout, $JOBMON controls usage of "set -m".
230 CHECK
= RUN_TEST
= MAILX
=
231 DEVELDIFF
= DUMPERR
= GIT_REPO
=
232 MAXJOBS
=1 NOCOLOUR
= NOJOBS
=
233 while [ ${#} -gt 0 ]; do
234 if [ "${1}" = --no-jobs ]; then
237 elif [ "${1}" = --no-colour ]; then
240 elif [ "${1}" = -h ] ||
[ "${1}" = --help ]; then
248 if [ "${1}" = --check ]; then
250 [ -x "${MAILX}" ] || usage
252 SKIPTEST
="${@} ${SKIPTEST}"
253 [ -d ..
/.git
] && [ -z "${MAILX__CC_TEST_NO_DATA_FILES}" ] && GIT_REPO
=1
254 echo 'Mode: --check, binary: '"${MAILX}"
255 elif [ "${1}" = --run-test ]; then
256 [ ${#} -ge 2 ] || usage
257 RUN_TEST
=1 MAILX
=${2}
258 [ -x "${MAILX}" ] || usage
260 [ -d ..
/.git
] && GIT_REPO
=1
261 echo 'Mode: --run-test, binary: '"${MAILX}"
263 [ ${#} -eq 0 ] || usage
264 echo 'Mode: full compile test, this will take a long time...'
265 MAILX__CC_TEST_NO_DATA_FILES
=1
266 export MAILX__CC_TEST_NO_DATA_FILES
270 # Since we invoke $MAILX from within several directories we need a fully
271 # qualified path. Or at least something similar.
272 { echo ${MAILX} | ${grep} -q ^/; } || MAILX="${TMPDIR}"/${MAILX}
274 MAILX
="${MEMTESTER}${MAILX}"
275 export RAWMAILX MAILX
277 # We want an UTF-8 locale, and HONOURS_READONLY {{{
278 if [ -n "${CHECK}${RUN_TEST}" ]; then
279 if [ -z "${UTF8_LOCALE}" ]; then
280 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
281 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
282 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
283 echo 'Trying to detect UTF-8 locale via '"${RAWMAILX}"
284 # C,POSIX last due to faulty localedef(1) result of GNU C lib 2.3[24]
285 # so here political friction for some decades, too
286 i
=`</dev/null LC_ALL=de_DE.utf8 ${RAWMAILX} ${ARGS} -X '
288 \if "${ttycharset}" =%?case utf
293 \wysh set LC_ALL=${1}
295 \xcall cset_test "${@}"
301 zh_CN.utf8 zh_CN.UTF-8 \
302 ru_RU.utf8 ru_RU.UTF-8 \
303 en_GB.utf8 en_GB.UTF-8 en_US.utf8 en_US.UTF-8 \
304 POSIX.utf8 POSIX.UTF-8 \
307 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
310 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
311 echo 'Trying to detect UTF-8 locale via locale -a'
312 UTF8_LOCALE
=`locale -a | { m=
315 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
318 ${grep} -e POSIX -e en_EN -e en_US; } \
319 >/dev/null 2>&1; then
329 if [ -n "${UTF8_LOCALE}" ]; then
330 echo 'Using Unicode locale '"${UTF8_LOCALE}"
332 echo 'No Unicode locale found, disabling Unicode tests'
335 if [ -z "${HONOURS_READONLY}" ]; then
336 trap "${rm} -f ./.tisrdonly" EXIT
337 trap "exit 1" HUP INT TERM
338 printf '' > .
/.tisrdonly
339 ${chmod} 0444 .
/.tisrdonly
340 if (printf 'no\n' > .
/.tisrdonly
) >/dev
/null
2>&1 &&
341 test -s .
/.tisrdonly
; then
346 ${rm} -f .
/.tisrdonly
347 trap '' EXIT HUP INT TERM
351 export UTF8_LOCALE HONOURS_READONLY
354 TESTS_PERFORMED
=0 TESTS_OK
=0 TESTS_FAILED
=0 TESTS_SKIPPED
=0
355 JOBS
=0 JOBLIST
= JOBREAPER
= JOBSYNC
=
357 ( sleep .1 ) >/dev
/null
2>&1 && SUBSECOND_SLEEP
=y
359 COLOR_ERR_ON
= COLOR_ERR_OFF
= COLOR_DBGERR_ON
= COLOR_DBGERR_OFF
=
360 COLOR_WARN_ON
= COLOR_WARN_OFF
=
361 COLOR_OK_ON
= COLOR_OK_OFF
=
367 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
368 ${rm} -rf ./t.*.d ./t.*.io ./t.*.result ./t.time.out
370 trap "exit 1" HUP INT QUIT TERM
373 if [ -n "${NOJOBS}" ]; then
377 # The user desired variant
378 if ( echo "${MAKEFLAGS}" |
${grep} -- -j ) >/dev
/null
2>&1; then
379 i
=`echo "${MAKEFLAGS}" |
380 ${sed} -e 's/^.*-j[ ]*\([0-9]\{1,\}\).*$/\1/'`
381 if ( echo "${i}" |
grep -q -e '^[0-9]\{1,\}$' ); then
382 printf 'Job number derived from MAKEFLAGS: %s\n' ${i}
384 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
389 # The actual hardware
390 printf 'all:\n' > t.mk.io
391 if ( ${MAKE} -j 10 -f t.mk.io
) >/dev
/null
2>&1; then
392 if command -v nproc
>/dev
/null
2>&1; then
393 i
=`nproc 2>/dev/null`
394 [ ${?} -eq 0 ] && MAXJOBS
=${i}
396 i
=`getconf _NPROCESSORS_ONLN 2>/dev/null`
398 if [ ${j} -ne 0 ]; then
399 i
=`getconf NPROCESSORS_ONLN 2>/dev/null`
402 if [ ${j} -ne 0 ]; then
404 if command -v kstat
>/dev
/null
2>&1; then
405 i
=`PERL5OPT= kstat -p cpu | ${awk} '
407 {if($2 > no) max = $2; next}
413 if [ ${j} -eq 0 ] && [ -n "${i}" ]; then
414 printf 'Job number derived from CPU number: %s\n' ${i}
418 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
426 # There were problems when using monitor mode with mksh
427 i
=`env -i ${SHELL} -c 'echo $KSH_VERSION'`
428 if [ -n "${i}" ]; then
429 if [ "${i}" != "${i#*MIRBSD}" ]; then
434 if [ -n "${JOBMON}" ]; then
435 ( set -m ) </dev
/null
>/dev
/null
2>&1 || JOBMON
=
437 printf >&2 '%s! $JOBMON: $SHELL %s incapable, disabled!%s\n' \
438 "${COLOR_ERR_ON}" "${SHELL}" "${COLOR_ERR_OFF}"
439 printf >&2 '%s! No process groups available, killed tests may '\
440 'leave process "zombies"!%s\n' \
441 "${COLOR_ERR_ON}" "${COLOR_ERR_OFF}"
451 if [ ${JOBS} -gt 0 ]; then
452 echo 'Cleaning up running jobs'
453 [ -n "${JOBREAPER}" ] && kill -KILL ${JOBREAPER} >/dev
/null
2>&1
461 if [ -n "${CHECK}" ] && [ -n "${SKIPTEST}" ]; then
467 while [ ${#} -gt 0 ]; do
468 if [ "${1}" != "${j}" ]; then
469 SKIPTEST
="${SKIPTEST} ${1}"
470 elif [ -z "${k}" ]; then
476 [ -n "${k}" ] && return
480 if [ ${MAXJOBS} -gt 1 ]; then
481 # We are spawning multiple jobs..
482 [ ${JOBS} -eq 0 ] && printf '...'
484 printf ' [%s=%s]' ${JOBS} "${1}"
487 # Assume problems exist, do not let user keep hanging on terminal
488 if [ -n "${RUN_TEST}" ]; then
489 printf '... [%s]\n' "${1}"
493 [ -n "${JOBMON}" ] && set -m >/dev
/null
2>&1
494 ( # Place the job in its own directory to ease file management
495 trap '' EXIT HUP INT QUIT TERM USR1 USR2
496 ${mkdir} t.${JOBS}.d && cd t.${JOBS}.d
&&
497 eval t_
${1} ${JOBS} ${1} &&
498 ${rm} -f ..
/t.
${JOBS}.id
499 ) > t.
${JOBS}.io
</dev
/null
& # 2>&1 </dev/null &
501 [ -n "${JOBMON}" ] && set +m
>/dev
/null
2>&1
502 JOBLIST
="${JOBLIST} ${i}"
503 printf '%s\n%s\n' ${i} ${1} > t.${JOBS}.id
505 # ..until we should sync or reach the maximum concurrent number
506 [ ${JOBS} -lt ${MAXJOBS} ] && return
512 if [ ${JOBS} -eq 0 ]; then
513 [ -n "${TEST_ANY}" ] && printf '\n'
517 [ -z "${JOBSYNC}" ] && [ ${#} -eq 0 ] && return
519 [ ${MAXJOBS} -ne 1 ] && printf ' .. waiting\n'
521 # Start an asynchronous notify process
522 ${rm} -f .
/t.
time.out
526 trap "kill -TERM ${sleeper}; exit 1" HUP INT TERM
529 printf '' > .
/t.
time.out
530 ) </dev
/null
>/dev
/null
2>&1 &
533 # Then loop a while, looking out for collecting tests
536 [ -f .
/t.
time.out
] && break
539 while [ ${i} -lt ${JOBS} ]; do
541 [ -f t.
${i}.id
] ||
continue
545 [ -n "${alldone}" ] && break
547 if [ -z "${SUBSECOND_SLEEP}" ]; then
548 loops
=`add ${loops} 1`
549 [ ${loops} -lt 111 ] && continue
557 if [ -f .
/t.
time.out
]; then
558 ${rm} -f .
/t.
time.out
561 kill -TERM ${JOBREAPER} >/dev
/null
2>&1
566 # Now collect the zombies
570 # Update global counters
572 while [ ${i} -lt ${JOBS} ]; do
575 [ -s t.
${i}.io ] && ${cat} t.${i}.io
576 if [ -n "${DUMPERR}" ] && [ -s ./t.${i}.d/${ERR} ]; then
577 printf '%s [Debug/Devel: nullified errors]\n' "${COLOR_DBGERR_ON}"
579 printf ' %s\n' "${l}"
580 done < t.${i}.d/${ERR}
581 printf '%s' "${COLOR_DBGERR_OFF}"
584 if [ -f t.${i}.id ]; then
585 { read pid; read desc; } < t.${i}.id
586 desc=${desc#${desc%%[! ]*}}
587 desc=${desc%${desc##*[! ]}}
588 [ -s t.${i}.io ] && printf >&2 '\n'
589 printf >&2 '%s!! Timeout: reaped job %s [%s]%s\n' \
590 "${COLOR_ERR_ON}" ${i} "${desc}" "${COLOR_ERR_OFF}"
591 TESTS_FAILED=`add ${TESTS_FAILED} 1`
592 elif [ -s t.${i}.result ]; then
593 read es tp to tf ts < t.${i}.result
594 TESTS_PERFORMED=`add ${TESTS_PERFORMED} ${tp}`
595 TESTS_OK=`add ${TESTS_OK} ${to}`
596 TESTS_FAILED=`add ${TESTS_FAILED} ${tf}`
597 TESTS_SKIPPED=`add ${TESTS_SKIPPED} ${ts}`
598 [ "${es}" != 0 ] && ESTAT=${es}
600 TESTS_FAILED=`add ${TESTS_FAILED} 1`
605 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
606 ${rm} -rf ./t.*.d ./t.*.id ./t.*.io t.*.result ./t.time.out
613 while [ ${i} -lt ${JOBS} ]; do
615 if [ -f t.${i}.id ] &&
616 read pid < t.${i}.id >/dev/null 2>&1 &&
617 kill -0 ${pid} >/dev/null 2>&1; then
619 [ -n "${JOBMON}" ] && j=-${j}
620 kill -KILL ${j} >/dev/null 2>&1
628 # echoes, checks, etc. {{{
632 ESTAT=0 TESTS_PERFORMED=0 TESTS_OK=0 TESTS_FAILED=0 TESTS_SKIPPED=0 \
633 TEST_NAME=${1} TEST_ANY=
635 printf '%s[%s]%s\n' "" "${TEST_NAME}" ""
639 [ -n "${TEST_ANY}" ] && printf '\n'
641 printf '%s %s %s %s %s\n' \
643 ${TESTS_PERFORMED} ${TESTS_OK} ${TESTS_FAILED} ${TESTS_SKIPPED} \
648 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
649 printf "${__i__}"'%s' "${*}"
654 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
655 printf "${__i__}"'%s%s:ok%s' "${COLOR_OK_ON}" "${*}" "${COLOR_OK_OFF}"
665 [ -n "${TEST_ANY}" ] && __i__="\n" || __i__=
666 printf "${__i__}"'%sERROR: %s%s\n' \
667 "${COLOR_ERR_ON}" "${*}" "${COLOR_ERR_OFF}"
672 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
673 printf "${__i__}"'%s%s%s' "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
678 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
679 printf "${__i__}"'%s%s[skip]%s' \
680 "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
682 TESTS_SKIPPED=`add ${TESTS_SKIPPED} 1`
686 restat=${?} tid=${1} eestat=${2} f=${3} s=${4} optmode=${5}
688 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
693 [ "$eestat" = - ] || exit 200
695 [ -f "${f}" ] && break
696 t_echowarn "[${tid}:async
=wait]"
704 check__bad= check__runx=
706 if [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ]; then
708 t_echoerr "${tid}: bad-status: ${restat} != ${eestat}"
712 csum="`${cksum} < "${f}" | ${sed} -e 's/[ ]\{1,\}/ /g'`"
713 if [ "${csum}" = "${s}" ]; then
715 check__runx=${DEVELDIFF}
718 t_echoerr "${tid}: checksum mismatch
(got
${csum})"
719 check__bad=1 check__runx=1
722 if [ -z "${check__bad}" ]; then
723 TESTS_OK=`add ${TESTS_OK} 1`
725 TESTS_FAILED=`add ${TESTS_FAILED} 1`
728 if [ -n "${CHECK}${RUN_TEST}" ]; then
729 x="t.
${TEST_NAME}-${tid}"
730 if [ -n "${RUN_TEST}" ] ||
731 [ -n "${check__runx}" -a -n "${GIT_REPO}" ]; then
732 ${cp} -f "${f}" ../"${x}"
735 if [ -n "${check__runx}" ] && [ -n "${GIT_REPO}" ] &&
736 command -v diff >/dev
/null
2>&1; then
738 if (git rev-parse
--verify $y) >/dev
/null
2>&1; then :; else
739 y
=refs
/remotes
/origin
/test-out
740 (git rev-parse
--verify $y) >/dev
/null
2>&1 || y
=
742 if [ -n "${y}" ]; then
743 if GIT_CONFIG
=/dev
/null git show
"${y}":"${x}" > \
744 ..
/"${x}".old
2>/dev
/null
; then
745 diff -ru ..
/"${x}".old ../"${x}" > ../"${x}".
diff
746 if [ ${?} -eq 0 ]; then
747 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
748 ${rm} -f ../"${x}" ../"${x}".old ../"${x}".diff
749 elif [ -n "${MAILX_CC_ALL_TESTS_DUMPERR}" ]; then
751 printf 'ERROR-DIFF %s\n' "${l}"
752 done < ../"${x}".diff
755 t_echo0err "${tid}: misses
[test-out
] template
"
763 # $1=test name [$2=status]
765 [ ${#} -gt 1 ] && __qm__=${2}
767 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
769 if [ ${__qm__} -ne 0 ]; then
771 t_echoerr "${1}: unexpected non-0
exit status
: ${__qm__}"
772 TESTS_FAILED=`add ${TESTS_FAILED} 1`
775 TESTS_OK=`add ${TESTS_OK} 1`
780 # $1=test name [$2=status]
782 [ ${#} -gt 1 ] && __qm__=${2}
783 [ ${#} -gt 2 ] && __expect__=${3} || __expect__=
785 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
787 if [ ${__qm__} -eq 0 ]; then
789 t_echoerr "${1}: unexpected
0 exit status
: ${__qm__}"
790 TESTS_FAILED=`add ${TESTS_FAILED} 1`
791 elif [ -n "${__expect__}" ] && [ ${__expect__} -ne ${__qm__} ]; then
793 t_echoerr
"${1}: unexpected exit status: ${__qm__} != ${__expected__}"
794 TESTS_FAILED
=`add ${TESTS_FAILED} 1`
797 TESTS_OK
=`add ${TESTS_OK} 1`
803 [ -n "${NOCOLOUR}" ] && return
804 [ -n "${MAILX_CC_TEST_NO_COLOUR}" ] && return
805 # We do not want color for "make test > .LOG"!
806 if [ -t 1 ] && command -v tput >/dev
/null
2>&1; then
807 { sgr0
=`tput sgr0`; } 2>/dev
/null
808 [ $?
-eq 0 ] ||
return
809 { saf1
=`tput setaf 1`; } 2>/dev
/null
810 [ $?
-eq 0 ] ||
return
811 { saf2
=`tput setaf 2`; } 2>/dev
/null
812 [ $?
-eq 0 ] ||
return
813 { saf3
=`tput setaf 3`; } 2>/dev
/null
814 [ $?
-eq 0 ] ||
return
815 { saf5
=`tput setaf 5`; } 2>/dev
/null
816 [ $?
-eq 0 ] ||
return
817 { b
=`tput bold`; } 2>/dev
/null
818 [ $?
-eq 0 ] ||
return
820 COLOR_ERR_ON
=${saf1}${b} COLOR_ERR_OFF=${sgr0}
821 COLOR_DBGERR_ON
=${saf5} COLOR_DBGERR_OFF
=${sgr0}
822 COLOR_WARN_ON
=${saf3}${b} COLOR_WARN_OFF=${sgr0}
823 COLOR_OK_ON
=${saf2} COLOR_OK_OFF
=${sgr0}
824 unset saf1 saf2 saf3 b
828 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
830 echo "$((${1} + ${2}))"
834 ${awk} 'BEGIN{print '${1}' + '${2}'}'
838 if ( [ "$((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
840 echo "$((${1} % ${2}))"
844 ${awk} 'BEGIN{print '${1}' % '${2}'}'
849 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
850 ${grep} ,+${1}, ) >/dev
/null
2>&1
854 # Absolute Basics {{{
855 t_X_Y_opt_input_go_stack
() {
858 ${cat} <<- '__EOT' > "${BODY}"
866 echo "define mac1 {";\
867 echo " echo mac1-1 via1 \$0";\
869 echo " echo mac1-2";\
871 echo " echo mac1-3";\
874 echo "define mac2 {";\
875 echo " echo mac2-1 via1 \$0";\
877 echo " echo mac2-2";\
883 echo echo 1-1-1 via1 \$0;\
895 # The -X option supports multiline arguments, and those can internally use
896 # reverse solidus newline escaping. And all -X options are joined...
898 < "${BODY}" ${MAILX} ${ARGS} \
913 echo "define mac1 {";\
914 echo " echo mac1-1 via2 \$0";\
916 echo " echo mac1-2";\
918 echo " echo mac1-3";\
921 echo "define mac2 {";\
922 echo " echo mac2-1 via2 \$0";\
924 echo " echo mac2-2";\
930 echo echo 1-1-1 via2 \$0;\
944 check 1 0 "${MBOX}" '1786542668 416'
946 # The -Y option supports multiline arguments, and those can internally use
947 # reverse solidus newline escaping.
949 < "${BODY}" ${MAILX} ${ARGS} \
966 echo "define mac1 {";\
967 echo " echo mac1-1 via2 \$0";\
969 echo " echo mac1-2";\
971 echo " echo mac1-3";\
974 echo "define mac2 {";\
975 echo " echo mac2-1 via2 \$0";\
977 echo " echo mac2-2";\
983 echo echo 1-1-1 via2 \$0;\
996 -Y 'echo LAST_Y' > "${MBOX}"
998 check 2 0 "${MBOX}" '1845176711 440'
1000 # Compose mode, too!
1001 </dev/null ${MAILX} ${ARGS} \
1002 -X 'echo X before compose mode' \
1003 -Y '~s Subject via -Y' \
1004 -Y 'Body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
1005 check
3 0 .
/.tybox
'264636255 125'
1006 check
4 - "${MBOX}" '467429373 22'
1008 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t \
1009 -X 'echo X before compose mode' \
1010 -Y '~s Subject via -Y' \
1011 -Y 'Additional body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
1013 subject
:diet not to be seen
!
1017 check
5 0 .
/.tybox
'3313167452 299'
1018 check
6 - "${MBOX}" '467429373 22'
1021 printf 'this body via stdin pipe.\n' |
${MAILX} ${NOBATCH_ARGS} \
1022 -X 'echo X before compose mode' \
1023 -Y '~s Subject via -Y (not!)' \
1024 -Y 'Additional body via -Y, nobatch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1025 check
7 0 .
/.tybox
'1561798488 476'
1026 check
8 - "${MBOX}" '467429373 22'
1028 printf 'this body via stdin pipe.\n' |
${MAILX} ${ARGS} \
1029 -X 'echo X before compose mode' \
1030 -Y '~s Subject via -Y' \
1031 -Y 'Additional body via -Y, batch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1032 check
9 0 .
/.tybox
'3245082485 650'
1033 check
10 - "${MBOX}" '467429373 22'
1035 # Test for [8412796a] (n_cmd_arg_parse(): FIX token error -> crash, e.g.
1036 # "-RX 'bind;echo $?' -Xx".., 2018-08-02)
1037 ${MAILX} ${ARGS} -RX'call;echo $?' -Xx > .
/.tall
2>&1
1038 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1039 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1040 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1041 check cmdline
0 .
/.tall
'1867586969 8'
1049 if have_feat uistrings
; then :; else
1050 t_echoskip
'[!UISTRINGS]'
1055 ${cat} <<- '__EOT' > "${BODY}"
1061 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1062 -X'echo one' -X' echos nono ' -X'echo two' \
1064 check 1 0 "${MBOX}" '2700500141 51'
1066 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
1068 check 2 0 "${MBOX}" '2700500141 51'
1070 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
1072 check
3 0 "${MBOX}" '2700500141 51'
1076 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1077 -X'echo one' -X' echos nono ' -X'echo two' \
1079 check
4 1 "${MBOX}" '4096689457 47'
1081 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
1083 check 5 1 "${MBOX}" '4096689457 47'
1085 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1087 check
6 1 "${MBOX}" '1669262132 170'
1089 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1091 check 7 1 "${MBOX}" '1669262132 170'
1093 ## Repeat 4-7 with ignerr set
1095 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1097 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1098 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
1100 check
8 0 "${BODY}" '2700500141 51'
1102 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
1104 check 9 0 "${BODY}" '2700500141 51'
1106 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1108 check
10 0 "${BODY}" '2700500141 51'
1110 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1112 check 11 0 "${BODY}" '2700500141 51'
1114 # Ensure "good-injection
" in a deeper indirection does not cause trouble
1115 # This actually only works with MLE and HISTORY, and TODO needs a pseudo TTY
1116 # interaction so that we DO initialize our line editor...
1117 ${cat} <<- '__EOT' > "${BODY}"
1128 printf 'source %s\ncall x\necho au' "${BODY}" |
1129 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1130 check
12 1 "${MBOX}" '2908921993 44'
1132 printf 'source %s\nset on-history-addition=oha\ncall x\necho au' "${BODY}" |
1133 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1134 check 13 1 "${MBOX}" '2908921993 44'
1136 printf 'source %s\ncall x\necho au' "${BODY}" |
1137 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=nowhere > "${MBOX}" 2>&1
1138 check
14 0 "${MBOX}" '2049365617 47'
1146 if have_feat uistrings
; then :; else
1147 t_echoskip
'[!UISTRINGS]'
1152 ${cat} <<- '__EOT' > "${BODY}"
1158 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1159 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1161 check 1 0 "${MBOX}" '2700500141 51'
1163 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Snomemdebug \
1165 check 2 0 "${MBOX}" '2700500141 51'
1169 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1170 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1172 check 3 1 "${MBOX}" '4096689457 47'
1174 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Serrexit -Snomemdebug \
1176 check 4 1 "${MBOX}" '4096689457 47'
1178 ## Repeat 3-4 with ignerr set
1180 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1182 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1183 -Y'echo one' -Y'ignerr echos nono ' -Y'echo two' \
1185 check 5 0 "${BODY}" '2700500141 51'
1187 </dev/null ${MAILX} ${ARGS} -Y'source '"${MBOX}" -Serrexit -Snomemdebug \
1189 check 6 0 "${BODY}" '2700500141 51'
1199 # Test basic assumption
1200 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
1201 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
1202 -Xx > "${MBOX}" 2>&1
1203 check 1 0 "${MBOX}" '270686329 21'
1206 ${cat} <<- '__EOT' > "${BODY}"
1207 echo asksub<$asksub>
1209 echo asksub<$asksub>
1211 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1212 -Snoasksub -Sasksub -Snoasksub \
1213 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
1214 -Xx > "${MBOX}" 2>&1
1215 check
2 0 "${MBOX}" '3182942628 37'
1217 ${cat} <<- '__EOT' > "${BODY}"
1218 echo asksub<$asksub>
1220 echo asksub<$asksub>
1222 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1223 -Snoasksub -Sasksub \
1224 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
1225 -Xx > "${MBOX}" 2>&1
1226 check
3 0 "${MBOX}" '2006554293 39'
1229 ${cat} <<- '__EOT' > "${BODY}"
1230 echo dietcurd<$dietcurd>
1232 echo dietcurd<$dietcurd>
1234 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1235 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
1236 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
1237 -X'echo dietcurd<$dietcurd>' \
1238 -Xx > "${MBOX}" 2>&1
1239 check
4 0 "${MBOX}" '1985768109 65'
1241 ${cat} <<- '__EOT' > "${BODY}"
1242 echo dietcurd<$dietcurd>
1244 echo dietcurd<$dietcurd>
1246 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1247 -Sdietcurd=strawberry
-Snodietcurd \
1248 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
1249 -X'echo dietcurd<$dietcurd>' \
1250 -Xx > "${MBOX}" 2>&1
1251 check
5 0 "${MBOX}" '151574279 51'
1253 # TODO once we have a detached one with env=1..
1254 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
1255 t_echoskip
's_freeze-{6,7}:[shell sets $TERM]'
1257 ${cat} <<- '__EOT' > "${BODY}"
1258 !echo "shell says TERM<$TERM>"
1260 !echo "shell says TERM<$TERM>"
1262 !echo "shell says TERM<$TERM>"
1264 !echo "shell says TERM<$TERM>"
1266 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1267 -STERM=strawberry
-SnoTERM -STERM=vanilla \
1268 -X'echo mail<$TERM>' -X'unset TERM' \
1269 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1270 -Xx > "${MBOX}" 2>&1
1271 check
6 0 "${MBOX}" '1211476036 167'
1273 ${cat} <<- '__EOT' > "${BODY}"
1274 !echo "shell says TERM<$TERM>"
1276 !echo "shell says TERM<$TERM>"
1278 !echo "shell says TERM<$TERM>"
1280 !echo "shell says TERM<$TERM>"
1282 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1283 -STERM=strawberry
-SnoTERM \
1284 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
1285 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1286 -Xx > "${MBOX}" 2>&1
1287 check
7 0 "${MBOX}" '3365080441 132'
1297 t__gen_msg subject f-batch-order
> "${MBOX}"
1299 # This would exit 64 (EX_USAGE) from ? to [fbddb3b3] (FIX: -f: add
1300 # n_PO_f_FLAG to avoid that command line order matters)
1301 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -f -# \
1302 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1303 check
1 0 .
/.tall
'1690247457 86'
1305 # And this ever worked (hopefully)
1306 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -# -f \
1307 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1308 check
2 0 .
/.tall
'1690247457 86'
1313 t_input_inject_semicolon_seq
() {
1316 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1318 echon '(mydeepmac)';
1321 echon this_is_mymac;call mydeepmac;echon ';';
1323 echon one';';call mymac;echon two";";call mymac;echo three$';';
1325 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
1327 echon one';';call mymac;echon two";";call mymac;echo three$';';
1330 check 1 0 "${MBOX}" '512117110 140'
1338 ${cat} <<- '__EOT' > "${BODY}"
1357 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
1358 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
1359 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
1361 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
1362 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
1384 echo a$
'b\U000000'ds
1385 echo a$
'b\U0000000'dt
1386 echo a$
'b\U00000000'du
1396 if [ -z "${UTF8_LOCALE}" ]; then
1397 t_echoskip
'wysh-unicode:[no UTF-8 locale]'
1399 < "${BODY}" DIET
=CURD TIED
= \
1400 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1401 check unicode
0 "${MBOX}" '475805847 317'
1404 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1405 check c 0 "${MBOX}" '1473887148 321'
1407 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1408 wysh
set mager
='\hey\'
1410 wysh set mager="\hey\\"
1412 wysh set mager=$'\hey
\\'
1415 check 3 0 "${MBOX}" '1289698238 69'
1423 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1424 commandalias echo echo hoho
1428 commandalias XxX XxXx
1429 commandalias XxXx XxXxX
1430 commandalias XxXxX XxXxXx
1431 commandalias XxXxXx echo huhu
1432 commandalias XxXxXxX echo huhu
1434 commandalias XxXxXx XxXxXxX
1437 commandalias XxXxXx echo huhu
1441 check 1 0 "${MBOX}" '1638809585 36'
1449 # In POSIX C181 standard order
1450 </dev/null ${MAILX} ${ARGS} \
1451 -Y 'echon alias
/a\
; ? a
; echon group
/g\
; ?g
' \
1452 -Y 'echon alternates
/alt\
; ? alt
' \
1453 -Y 'echon chdir
/ch\
; ? ch
' \
1454 -Y 'echon copy
/c\
; ? c
; echon Copy
/C\
; ?C
' \
1455 -Y 'echon delete
/d\
; ? d
' \
1456 -Y 'echon discard
/di\
; ? di
; echon ignore
/ig\
; ?ig
' \
1457 -Y 'echon echo
/ec\
; ? ec
' \
1458 -Y 'echon edit
/e\
; ? e
' \
1459 -Y 'echon exit
/ex\
; ? ex
; echon xit
/x\
; ?x
' \
1460 -Y 'echon file
/fi\
; ?
fi; echon folder
/fold\
; ?
fold' \
1461 -Y 'echon followup
/fo\
; ? fo
; echon Followup
/F\
; ?F
' \
1462 -Y 'echon from
/f\
; ? f
' \
1463 -Y 'echon headers
/h\
; ? h
' \
1464 -Y 'echon help
/hel\
; ? hel
' \
1465 -Y 'echon hold
/ho\
; ? ho
; echon preserve
/pre\
; ? pre
' \
1466 -Y 'echon if
/i\
; ? i
; echon else
/el\
; ? el
; echon endif
/en\
; ? en
' \
1467 -Y 'echon list
/l\
; ? l
' \
1468 -Y 'echon mail
/m\
; ? m
' \
1469 -Y 'echon mbox
/mb\
; ? mb
' \
1470 -Y 'echon next
/n\
; ? n
' \
1471 -Y 'echon pipe
/pi\
; ? pi
' \
1472 -Y 'echon Print
/P\
; ? P
; echon Type
/T\
; ? T
' \
1473 -Y 'echon print
/p\
; ? p
; echon type
/t\
; ? t
' \
1474 -Y 'echon quit
/q\
; ? q
' \
1475 -Y 'echon Reply
/R\
; ? R
' \
1476 -Y 'echon reply
/r\
; ? r
' \
1477 -Y 'echon retain
/ret\
; ? ret
' \
1478 -Y 'echon save
/s\
; ? s
; echon Save
/S\
; ? S
' \
1479 -Y 'echon set
/se\
; ? se
' \
1480 -Y 'echon shell
/sh\
; ? sh
' \
1481 -Y 'echon size
/si\
; ? si
' \
1482 -Y 'echon source
/so\
; ? so
' \
1483 -Y 'echon touch
/tou\
; ? tou
' \
1484 -Y 'echon unalias
/una\
; ? una
' \
1485 -Y 'echon undelete
/u\
; ? u
' \
1486 -Y 'echon unset
/uns\
; ? uns
' \
1487 -Y 'echon visual
/v\
; ? v
' \
1488 -Y 'echon write
/w\
; ? w
' \
1489 | ${sed} -e 's
/:.
*$
//' > "${MBOX}"
1490 check 1 0 "${MBOX}" '1012680481 968'
1500 # XXX the first needs to be checked, it is quite dumb as such
1501 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1502 commandalias x echo '$?
/$^ERRNAME
'
1515 shcodec e a$'b
'c$'d
'
1517 shcodec d a$'b
'c$'d
'
1531 # same but with vput
1532 commandalias y echo '$?
/$^ERRNAME
$res'
1533 vput shcodec res e abcd
1537 vput shcodec res d abcd
1541 vput shcodec res e a'b
'c'd
'
1545 vput shcodec res d a'b
'c'd
'
1549 vput shcodec res e a"b"c"d"
1553 vput shcodec res d a"b"c"d"
1557 vput shcodec res e a$'b
'c$'d
'
1561 vput shcodec res d a$'b
'c$'d
'
1565 vput shcodec res e 'abcd
'
1569 vput shcodec res d 'abcd
'
1573 vput shcodec res e "abcd"
1577 vput shcodec res d "abcd"
1581 vput shcodec res e $'abcd
'
1585 vput shcodec res d $'abcd
'
1590 vput shcodec res e a b\ c d
1594 vput shcodec res d a b\ c d
1596 vput shcodec res e ab cd
1600 vput shcodec res d 'ab
cd'
1602 vput shcodec res e a 'b c
' d
1606 vput shcodec res d a 'b c
' d
1608 vput shcodec res e a "b c" d
1612 vput shcodec res d a "b c" d
1614 vput shcodec res e a $'b c
' d
1618 vput shcodec res d a $'b c
' d
1621 vput shcodec res e 'a$
`"\'
1625 vput shcodec res d 'a$`"\'
1627 vput shcodec res e "a\$\
`'\"\\"
1631 vput shcodec res d "a\$\`'\"\\"
1633 vput shcodec res e $'a\$
`\'\"\\'
1637 vput shcodec res d $'a\$`\'\"\\'
1639 vput shcodec res e $'a\$
`\'"\\'
1643 vput shcodec res d $'a\$`\'"\\'
1647 vput shcodec res e a${diet}c
1651 eval vput shcodec res e a${diet}c
1655 vput shcodec res e "a
${diet}c
"
1659 eval vput shcodec res e "a
${diet}c
"
1664 check 1 0 "${MBOX}" '3316745312 1241'
1666 if [ -z "${UTF8_LOCALE}" ]; then
1667 t_echoskip 'unicode:[no UTF-8 locale]'
1668 elif have_feat multibyte-charsets; then
1669 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
1670 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1674 shcodec d $'t\u00E4st'
1677 shcodec d $'a\u054Dc'
1680 shcodec d $'a\U0001D542c'
1682 check unicode 0 "${MBOX}" '1175985867 77'
1684 t_echoskip 'unicode:[!MULTIBYTE-CHARSETS]'
1693 # v15compat: old and new tests share the same result files!
1694 # v15compat: i.e., just throw away -old tests one day
1696 # Nestable conditions test
1697 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1719 if $dietcurd == 'yoho'
1724 if $dietcurd ==?
'Yoho'
1729 if $dietcurd == 'Yoho'
1734 if $dietcurd != 'yoho'
1739 if $dietcurd !=?
case 'Yoho'
1744 if $dietcurd != 'Yoho'
1805 if $dietcurd == 'yohu'
1807 elif $dietcurd == 'yoha'
1809 elif $dietcurd == 'yohe'
1811 elif $dietcurd == 'yoho'
1813 if $dietcurd == 'yohu'
1815 elif $dietcurd == 'yoha'
1817 elif $dietcurd == 'yohe'
1819 elif $dietcurd == 'yoho'
1821 if $dietcurd == 'yohu'
1823 elif $dietcurd == 'yoha'
1825 elif $dietcurd == 'yohe'
1827 elif $dietcurd == 'yoho'
1883 if $dietcurd ==?
case aBC
1888 if $dietcurd >=?ca AbC
1893 if $dietcurd <=? ABc
1898 if $dietcurd >=?
case abd
1903 if $dietcurd <=? abb
1931 if $dietcurd =%?
case aB
1976 set diet
=abc curd
=abc
1982 set diet
=abc curd
=abcd
1988 # 1. Shitty grouping capabilities as of today
1989 unset diet curd ndefined
1990 if [ [ false
] ||
[ false
] ||
[ true
] ] && \
1991 [ [ false
] ||
[ true
] ] && \
1997 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
2002 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
2007 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
2012 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
2017 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
2018 && [ no
] ||
[ yes ]
2023 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2028 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2033 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2038 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2043 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
2048 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
2053 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
2058 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
2063 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
2068 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
2074 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2080 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2085 # 2. Shitty grouping capabilities as of today
2086 unset diet curd ndefined
2087 if [ false || false || true
] && [ false || true
] && yes
2092 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
2097 if [ 1 ||
0 ||
0 ||
0 ]
2102 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
2107 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
2112 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
2117 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2122 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2127 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2132 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2137 if 1 ||
0 ||
0 ||
0 && 0
2142 if 1 ||
0 ||
0 ||
0 && 1
2147 if 0 ||
0 ||
0 ||
1 && 0
2152 if 0 ||
0 ||
0 ||
1 && 1
2157 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
2162 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
2168 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2173 if $diet == 'yo' && $curd == 'ho' && $ndefined
2179 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2184 if $diet == 'yo' && $curd == 'ho' && $ndefined
2189 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
2194 # Some more en-braced variables
2196 if ${diet} == ${curd}
2201 if ${diet} != ${curd}
2217 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2222 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2227 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2232 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2237 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2242 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2247 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2252 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
2257 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
2263 if ! 0 && ! ! 1 && ! ! ! 0 && 3
2268 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
2273 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
2278 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
2283 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
2288 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
2293 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
2298 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
2303 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
2310 check normal-old
0 "${MBOX}" '1688759742 719' # pre v15compat
2312 if have_feat regex
; then
2313 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
2315 if $dietcurd =~ '^yo.*'
2320 if $dietcurd =~ '^Yo.*'
2325 if $dietcurd =~?case '^Yo.*'
2330 if $dietcurd =~ '^yOho.+'
2335 if $dietcurd !~? '.*Ho$'
2340 if $dietcurd !~ '.+yohO$'
2345 if [ $dietcurd !~?cas '.+yoho$' ]
2350 if ! [ $dietcurd =~?case '.+yoho$' ]
2355 if ! ! [ $dietcurd !~? '.+yoho$' ]
2360 if ! [ ! [ $dietcurd !~? '.+yoho$' ] ]
2365 if [ ! [ ! [ $dietcurd !~? '.+yoho$' ] ] ]
2370 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2375 if ! ! ! $dietcurd !~ '.+yoho$'
2380 if ! ! ! $dietcurd =~ '.+yoho$'
2385 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2390 set diet=abc curd='^abc$'
2396 set diet=abc curd='^abcd$'
2404 check regex-old 0 "${MBOX}" '1115671789 95' # pre v15compat
2406 t_echoskip 'regex-old:[no regex option]'
2411 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
2412 \
if -N xyz
; echo 1.err-1
; \
2413 \
elif ! -Z xyz
;echo 1.err-2
;\
2414 \
elif -n "$xyz" ; echo 1.err-3
; \
2415 \
elif ! -z "$xyz" ; echo 1.err-4
; \
2419 \
if ! -N xyz
; echo 2.err-1
; \
2420 \
elif -Z xyz
;echo 2.err-2
;\
2421 \
elif -n "$xyz" ; echo 2.err-3
; \
2422 \
elif ! -z "$xyz" ; echo 2.err-4
; \
2426 \
if ! -N xyz
; echo 3.err-1
; \
2427 \
elif -Z xyz
;echo 3.err-2
;\
2428 \
elif ! -n "$xyz";echo 3.err-3
;\
2429 \
elif -z "$xyz";echo 3.err-4
;\
2432 \
if $xyz != notempty
;echo 4.err-1
;else;echo 4.ok
;\end
2433 \
if $xyz == notempty
;echo 5.ok
;else;echo 5.err-1
;\end
2436 check NnZz_whiteout
0 "${MBOX}" '4280687462 25'
2438 # TODO t_ifelse: individual tests as for NnZz_whiteout
2439 # Nestable conditions test
2440 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=x > "${MBOX}"
2451 if [ "$dietcurd" != "" ]
2457 if $'\$dietcurd' != ""
2462 if "$dietcurd" == 'yoho'
2467 if $'\$dietcurd' ==? 'Yoho'
2472 if $dietcurd == 'Yoho'
2477 if $dietcurd != 'yoho'
2482 if $dietcurd !=?case 'Yoho'
2487 if $dietcurd != 'Yoho'
2548 if $dietcurd == 'yohu'
2550 elif $dietcurd == 'yoha'
2552 elif $dietcurd == 'yohe'
2554 elif $dietcurd == 'yoho'
2556 if $dietcurd == 'yohu'
2558 elif $dietcurd == 'yoha'
2560 elif $dietcurd == 'yohe'
2562 elif $dietcurd == 'yoho'
2564 if $dietcurd == 'yohu'
2566 elif $dietcurd == 'yoha'
2568 elif $dietcurd == 'yohe'
2570 elif $dietcurd == 'yoho'
2610 if $dietcurd -ge?satu -0xFFFFFFFFFFFFFFFF1
2626 if $dietcurd ==?case aBC
2631 if $dietcurd >=?ca AbC
2636 if $dietcurd <=? ABc
2641 if $dietcurd >=?case abd
2646 if $dietcurd <=? abb
2674 if $dietcurd =%?case aB
2719 set diet='ab c' curd='ab c'
2720 if "$diet" == "$curd"
2725 set diet='ab c' curd='ab cd'
2726 if "$diet" != "$curd"
2731 # 1. Shitty grouping capabilities as of today
2732 unset diet curd ndefined
2733 if [ [ false ] || [ false ] || [ true ] ] && \
2734 [ [ false ] || [ true ] ] && \
2740 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
2745 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
2750 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
2755 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
2760 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
2761 && [ no ] || [ yes ]
2766 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2771 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2776 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2781 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2786 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
2791 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
2796 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
2801 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
2806 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
2811 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
2817 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2818 [ -N ndefined || -n "$ndefined" || \
2819 ! -Z ndefined || ! -z "$ndefined" ]
2825 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2826 -N ndefined && ! -n "$ndefined" && \
2827 ! -Z ndefined && -z "$ndefined"
2832 # 2. Shitty grouping capabilities as of today
2833 unset diet curd ndefined
2834 if [ false || false || true ] && [ false || true ] && yes
2839 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
2844 if [ 1 || 0 || 0 || 0 ]
2849 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
2854 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
2859 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
2864 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2869 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2874 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2879 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2884 if 1 || 0 || 0 || 0 && 0
2889 if 1 || 0 || 0 || 0 && 1
2894 if 0 || 0 || 0 || 1 && 0
2899 if 0 || 0 || 0 || 1 && 1
2904 if 0 || 0 || 0 || 1 && 0 || 1 && 0
2909 if 0 || 0 || 0 || 1 && 0 || 1 && 1
2915 if [ $diet == 'yo' && $curd == 'ho' ] && \
2916 [ -N ndefined || -n "$ndefined" || \
2917 ! -Z ndefined || ! -z "$ndefined" ]
2922 if [ $diet == 'yo' && $curd == 'ho' && \
2923 [ [ -N ndefined || -n "$ndefined" || \
2924 ! -Z ndefined || ! -z "$ndefined" ] ] ]
2930 if [ $diet == 'yo' && $curd == 'ho' ] && \
2931 -N ndefined && ! -n "$ndefined" && \
2932 ! -Z ndefined && -z "$ndefined"
2937 if $diet == 'yo' && $curd == 'ho' && ! -Z ndefined
2942 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && -N ndefined ] ] ] ] ] ]
2947 # Some more en-braced variables
2949 if ${diet} == ${curd}
2954 if "${diet}" != "${curd}"
2970 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2975 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2980 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2985 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2990 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2995 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
3000 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
3005 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
3010 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
3016 if ! 0 && ! ! 1 && ! ! ! 0 && 3
3021 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
3026 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
3031 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
3036 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
3041 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
3046 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
3051 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
3056 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
3063 check normal 0 "${MBOX}" '1688759742 719'
3065 if have_feat regex; then
3066 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
3068 if $dietcurd =~
'^yo.*'
3073 if "$dietcurd" =~
'^Yo.*'
3078 if $dietcurd =~?
case '^Yo.*'
3083 if $dietcurd =~
'^yOho.+'
3088 if $dietcurd !~?
'.*Ho$'
3093 if $dietcurd !~
'.+yohO$'
3098 if [ $dietcurd !~?cas
'.+yoho$' ]
3103 if ! [ "$dietcurd" =~?
case '.+yoho$' ]
3108 if ! ! [ $
'\$dietcurd' !~?
'.+yoho$' ]
3113 if ! [ ! [ $dietcurd !~?
'.+yoho$' ] ]
3118 if [ ! [ ! [ $dietcurd !~?
'.+yoho$' ] ] ]
3123 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3128 if ! ! ! $dietcurd !~
'.+yoho$'
3133 if ! ! ! $dietcurd =~
'.+yoho$'
3138 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3143 set diet
=abc curd
='^abc$'
3149 set diet
=abc curd
='^abcd$'
3150 if "$diet" !~ $
'\$curd'
3157 check regex
0 "${MBOX}" '1115671789 95'
3159 t_echoskip
'regex:[!REGEX]'
3168 # Nestable conditions test
3169 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3184 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3189 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3190 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
3199 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3201 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3210 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3217 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3224 echo ----- $1: $2 -> $3 -> $4
3232 call llx 'call off' on on on
3233 call llx 'call off' off on on
3234 call llx 'call off' on off on
3235 call llx 'call off' on off off
3236 localopts call-fixate on
3237 call llx 'call-fixate on' on on on
3238 call llx 'call-fixate on' off on on
3239 call llx 'call-fixate on' on off on
3240 call llx 'call-fixate on' on off off
3241 unset x;localopts call on
3242 call llx 'call on' on on on
3243 call llx 'call on' off on on
3244 call llx 'call on' on off on
3245 call llx 'call on' on off off
3250 check 1 0 "${MBOX}" '4016155249 1246'
3258 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3286 echo ------- global-1 du
=$du
3288 echo ------- global-2 du
=$du
3291 echo ------- global-3 du
=$du
3293 echo ------- global-4 du
=$du
3295 echo ------- global-5 du
=$du
3297 check
1 0 "${MBOX}" '2411598140 641'
3300 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3302 echo z-1: x=$x y=$y z=$z crt=$crt
3303 local set z=1 y=2 crt=10
3304 echo z-2: x=$x y=$y z=$z crt=$crt
3307 echo y-1: x=$x y=$y z=$z crt=$crt
3308 local set x=2 y=1 crt=5
3309 echo y-2: x=$x y=$y z=$z crt=$crt
3311 echo y-3: x=$x y=$y z=$z crt=$crt
3314 echo x-1: x=$x y=$y z=$z crt=$crt
3316 echo x-2: x=$x y=$y z=$z crt=$crt
3318 echo x-3: x=$x y=$y z=$z crt=$crt
3321 echo global-1: x=$x y=$y z=$z crt=$crt
3323 echo global-2: x=$x y=$y z=$z crt=$crt
3325 check 2 0 "${MBOX}" '2560788669 216'
3333 ${cat} <<- '__EOT' | EK1=EV1 EK2=EV2 ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3334 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3335 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3336 varshow EK1 EK2 EK3 EK4 NEK5
3338 echo environ
set EK3 EK4
, set NEK5
3339 environ
set EK3
=EV3 EK4
=EV4
3341 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3342 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3343 varshow EK1 EK2 EK3 EK4 NEK5
3345 echo removing NEK5 EK3
3348 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3349 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3350 varshow EK1 EK2 EK3 EK4 NEK5
3352 echo changing EK1
, EK4
3353 set EK1
=EV1_CHANGED EK4
=EV4_CHANGED
3354 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3355 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3356 varshow EK1 EK2 EK3 EK4 NEK5
3358 echo linking EK4
, rechanging EK1
, EK4
3361 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3362 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3363 varshow EK1 EK2 EK3 EK4 NEK5
3367 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3368 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3369 varshow EK1 EK2 EK3 EK4 NEK5
3372 check
1 0 "${MBOX}" '1685686686 1342'
3378 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3380 echo '-------> L4 (environ unlink EK1, own localopts)'
3383 set LK1=LK1_L4 EK1=EK1_L4
3384 echo "we
: L4
: LK1
<$LK1> EK1
<$EK1>"
3385 !echo "shell
: L4
: LK1
<$LK1> EK1
<$EK1>"
3391 set LK1=LK1_L3 EK1=EK1_L3
3392 echo "we
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3393 !echo "shell
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3396 echo "we
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3397 !echo "shell
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3403 set LK1=LK1_L2 EK1=EK1_L2
3404 echo "we
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3405 !echo "shell
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3408 echo "we
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3409 !echo "shell
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3414 echo '-------> L1 (environ link EK1; localopts call-fixate)'
3415 localopts call-fixate yes
3416 set LK1=LK1_L1 EK1=EK1_L1
3418 echo "we
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3419 !echo "shell
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3422 echo "we
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3423 !echo "shell
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3427 echo "we
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3428 !echo "shell
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3431 echo "we
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3432 !echo "shell
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3436 check 2 0 "${MBOX}" '1903030743 1131'
3441 t_macro_param_shift() {
3444 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3447 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3452 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3453 if [ $# > 1 ] || [ $ignerr == '' ]
3458 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3460 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3464 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3469 call t2 1 you get four args
3470 echo t1.1: $?';' ignerr ($ignerr) should not exist
3471 call t2 1 you get 'three args'
3472 echo t1.2: $?';' ignerr ($ignerr) should not exist
3473 call t2 1 you 'get two args'
3474 echo t1.3: $?';' ignerr ($ignerr) should not exist
3475 call t2 1 'you get one arg'
3476 echo t1.4: $?';' ignerr ($ignerr) should not exist
3477 ignerr call t2 '' 'you get one arg'
3478 echo t1.5: $?';' ignerr ($ignerr) should not exist
3483 check 1 0 "${MBOX}" '1402489146 1682'
3491 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3492 commandalias x
echo '$?/$^ERRNAME $res'
3493 vput addrcodec res e
1 <doog@def
>
3495 eval vput addrcodec res d
$res
3497 vput addrcodec res e
2 .
<doog@def
>
3499 eval vput addrcodec res d
$res
3501 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
3503 eval vput addrcodec res d
$res
3505 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
3507 eval vput addrcodec res d
$res
3509 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
3511 eval vput addrcodec res d
$res
3514 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
3516 eval vput addrcodec res d
$res
3518 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
3520 eval vput addrcodec res d
$res
3522 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
3524 eval vput addrcodec res d
$res
3526 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
3528 eval vput addrcodec res d
$res
3530 vput addrcodec res
+e
8 \
3531 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
3533 eval vput addrcodec res d
$res
3535 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
3537 eval vput addrcodec res d
$res
3539 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
3541 eval vput addrcodec res d
$res
3543 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
3545 eval vput addrcodec res d
$res
3547 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
3549 eval vput addrcodec res d
$res
3551 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
3553 eval vput addrcodec res d
$res
3555 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
3557 eval vput addrcodec res d
$res
3559 vput addrcodec res
+e
15 \
3560 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
3562 eval vput addrcodec res d
$res
3564 vput addrcodec res
+e
16 \
3565 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
3567 eval vput addrcodec res d
$res
3569 vput addrcodec res
+e
17 \
3570 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
3572 eval vput addrcodec res d
$res
3574 vput addrcodec res
+e
18 \
3575 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
3577 eval vput addrcodec res d
$res
3579 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3581 eval vput addrcodec res d
$res
3584 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3586 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
3588 eval vput addrcodec res d $res
3591 vput addrcodec res \
3592 +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
3594 eval vput addrcodec res d $res
3597 vput addrcodec res s \
3598 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
3601 # Fix for [f3852f88]
3602 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3604 eval vput addrcodec res d $res
3606 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3608 eval vput addrcodec res d $res
3612 check 1 0 "${MBOX}" '1047317989 2612'
3614 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3615 commandalias x
echo '$?/$^ERRNAME $res'
3617 mlsubscribe isa2@list
3619 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3621 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3623 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3625 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3627 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3629 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3633 check
2 0 "${MBOX}" '1391779299 104'
3635 if have_feat idna
; then
3636 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
3637 commandalias x echo '$?/$^ERRNAME $res'
3638 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
3640 eval vput addrcodec res d $res
3642 vput addrcodec res e <du@blödiän> du
3644 eval vput addrcodec res d $res
3646 vput addrcodec res e du <du@blödiän>
3648 eval vput addrcodec res d $res
3650 vput addrcodec res e <du@blödiän>
3652 eval vput addrcodec res d $res
3654 vput addrcodec res e du@blödiän
3656 eval vput addrcodec res d $res
3660 check idna 0 "${MBOX}" '498775983 326'
3662 t_echoskip 'idna:[!IDNA]'
3671 if have_feat cmd-csop; then :; else
3672 t_echoskip '[!CMD_CSOP]'
3677 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3678 commandalias x
echo '$?/$^ERRNAME :$res:'
3680 vput csop res
find you y
;x
3681 vput csop res
find you o
;x
3682 vput csop res
find you u
;x
3683 vput csop res
find you yo
;x
3684 vput csop res
find you ou
;x
3685 vput csop res
find you you
;x
3687 vput csop res
find you Y
;x
3688 vput csop res
find? you Y
;x
3689 vput csop res
find?
case you O
;x
3690 vput csop res
find? you U
;x
3691 vput csop res
find?ca you yO
;x
3692 vput csop res
find? you oU
;x
3693 vput csop res
find? you YoU
;x
3695 vput csop res
find 'bananarama' 'nana';x
3696 vput csop res
find 'bananarama' 'bana';x
3697 vput csop res
find 'bananarama' 'Bana';x
3698 vput csop res
find 'bananarama' 'rama';x
3700 vput csop res
find?
'bananarama' 'nana';x
3701 vput csop res
find?
'bananarama' 'bana';x
3702 vput csop res
find?
'bananarama' 'Bana';x
3703 vput csop res
find?
'bananarama' 'rama';x
3705 vput csop res substring
'bananarama' 1;x
3706 vput csop res substring
'bananarama' 3;x
3707 vput csop res substring
'bananarama' 5;x
3708 vput csop res substring
'bananarama' 7;x
3709 vput csop res substring
'bananarama' 9;x
3710 vput csop res substring
'bananarama' 10;x
3711 vput csop res substring
'bananarama' 1 3;x
3712 vput csop res substring
'bananarama' 3 3;x
3713 vput csop res substring
'bananarama' 5 3;x
3714 vput csop res substring
'bananarama' 7 3;x
3715 vput csop res substring
'bananarama' 9 3;x
3716 vput csop res substring
'bananarama' 10 3;x
3718 vput csop res substring
'bananarama' -1;x
3719 vput csop res substring
'bananarama' -3;x
3720 vput csop res substring
'bananarama' -5;x
3721 vput csop res substring
'bananarama' -7;x
3722 vput csop res substring
'bananarama' -9;x
3723 vput csop res substring
'bananarama' -10;x
3724 vput csop res substring
'bananarama' 1 -3;x
3725 vput csop res substring
'bananarama' 3 -3;x
3726 vput csop res substring
'bananarama' 5 -3;x
3727 vput csop res substring
'bananarama' 7 -3;x
3728 vput csop res substring
'bananarama' 9 -3;x
3729 vput csop res substring
'bananarama' 10 -3;x
3731 vput csop res trim
'Cocoon Cocoon';x
3732 vput csop res trim
' Cocoon Cocoon ';x
3733 vput csop res trim-front
'Cocoon Cocoon';x
3734 vput csop res trim-front
' Cocoon Cocoon ';x
3735 vput csop res trim-end
'Cocoon Cocoon';x
3736 vput csop res trim-end
' Cocoon Cocoon ';x
3739 check
1 0 "${MBOX}" '1892119538 755'
3747 if have_feat cmd-vexpr
; then :; else
3748 t_echoskip
'[!CMD_VEXPR]'
3753 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3754 commandalias x
echo '$?/$^ERRNAME $res'
3756 vput vexpr res
= 9223372036854775807;x
3757 vput vexpr res
= 9223372036854775808;x
3758 vput vexpr res
= u9223372036854775808
;x
3759 vput vexpr res
=?
9223372036854775808;x
3760 vput vexpr res
= -9223372036854775808;x
3761 vput vexpr res
= -9223372036854775809;x
3762 vput vexpr res
=?saturated
-9223372036854775809;x
3763 vput vexpr res
= U9223372036854775809
;x
3766 0b0111111111111111111111111111111111111111111111111111111111111111
;x
3768 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3770 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3772 U0b1000000000000000000000000000000000000000000000000000000000000000
;x
3774 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3776 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3778 -0b1000000000000000000000000000000000000000000000000000000000000000;x
3780 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3782 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3784 -0b1000000000000000000000000000000000000000000000000000000000000001;x
3786 U0b1000000000000000000000000000000000000000000000000000000000000001
;x
3788 vput vexpr res
= 0777777777777777777777;x
3789 vput vexpr res
= S01000000000000000000000
;x
3790 vput vexpr res
=? S01000000000000000000000
;x
3791 vput vexpr res
= U01000000000000000000000
;x
3792 vput vexpr res
= 01000000000000000000000;x
3793 vput vexpr res
=?satur
01000000000000000000000;x
3794 vput vexpr res
= -01000000000000000000000;x
3795 vput vexpr res
= S01000000000000000000001
;x
3796 vput vexpr res
=?sat S01000000000000000000001
;x
3797 vput vexpr res
= -01000000000000000000001;x
3798 vput vexpr res
= U01000000000000000000001
;x
3800 vput vexpr res
= 0x7FFFFFFFFFFFFFFF;x
3801 vput vexpr res
= S0x8000000000000000
;x
3802 vput vexpr res
=? S0x8000000000000000
;x
3803 vput vexpr res
= U0x8000000000000000
;x
3804 vput vexpr res
= 0x8000000000000000;x
3805 vput vexpr res
=?
0x8000000000000000;x
3806 vput vexpr res
= -0x8000000000000000;x
3807 vput vexpr res
= S0x8000000000000001
;x
3808 vput vexpr res
=? S0x8000000000000001
;x
3809 vput vexpr res
= -0x8000000000000001;x
3810 vput vexpr res
= u0x8000000000000001
;x
3811 vput vexpr res
= 9223372036854775809;x
3812 vput vexpr res
=?
9223372036854775809;x
3813 vput vexpr res
= u9223372036854775809
;x
3815 vput vexpr res ~
0;x
3816 vput vexpr res ~
1;x
3817 vput vexpr res ~
-1;x
3819 vput vexpr res
- 0;x
3820 vput vexpr res
- 1;x
3821 vput vexpr res
- -1;x
3822 vput vexpr res
- -0xAFFE;x
3823 vput vexpr res
- 0xAFFE;x
3824 vput vexpr res
- u0x8000000000000001
;x
3825 vput vexpr res
- 0x8000000000000001;x
3826 vput vexpr res
- 0x8000000000000001;x
3827 vput vexpr res
- 9223372036854775809;x
3828 vput vexpr res
-?
9223372036854775809;x
3830 vput vexpr res
+ 0;x
3831 vput vexpr res
+ 1;x
3832 vput vexpr res
+ -1;x
3833 vput vexpr res
+ -0xAFFE;x
3834 vput vexpr res
+ 0xAFFE;x
3835 vput vexpr res
+ u0x8000000000000001
;x
3836 vput vexpr res
+ 0x8000000000000001;x
3837 vput vexpr res
+ 9223372036854775809;x
3838 vput vexpr res
+?
9223372036854775809;x
3840 vput vexpr res
+ 0 0;x
3841 vput vexpr res
+ 0 1;x
3842 vput vexpr res
+ 1 1;x
3844 vput vexpr res
+ 9223372036854775807 0;x
3845 vput vexpr res
+ 9223372036854775807 1;x
3846 vput vexpr res
+?
9223372036854775807 1;x
3847 vput vexpr res
+ 0 9223372036854775807;x
3848 vput vexpr res
+ 1 9223372036854775807;x
3849 vput vexpr res
+?
1 9223372036854775807;x
3851 vput vexpr res
+ -9223372036854775808 0;x
3852 vput vexpr res
+ -9223372036854775808 -1;x
3853 vput vexpr res
+?
-9223372036854775808 -1;x
3854 vput vexpr res
+ 0 -9223372036854775808;x
3855 vput vexpr res
+ -1 -9223372036854775808;x
3856 vput vexpr res
+?
-1 -9223372036854775808;x
3858 vput vexpr res
- 0 0;x
3859 vput vexpr res
- 0 1;x
3860 vput vexpr res
- 1 1;x
3862 vput vexpr res
- 9223372036854775807 0;x
3863 vput vexpr res
- 9223372036854775807 -1;x
3864 vput vexpr res
-?
9223372036854775807 -1;x
3865 vput vexpr res
- 0 9223372036854775807;x
3866 vput vexpr res
- -1 9223372036854775807;x
3867 vput vexpr res
- -2 9223372036854775807;x
3868 vput vexpr res
-?
-2 9223372036854775807;x
3870 vput vexpr res
- -9223372036854775808 +0;x
3871 vput vexpr res
- -9223372036854775808 +1;x
3872 vput vexpr res
-?
-9223372036854775808 +1;x
3873 vput vexpr res
- 0 -9223372036854775808;x
3874 vput vexpr res
- +1 -9223372036854775808;x
3875 vput vexpr res
-?
+1 -9223372036854775808;x
3877 vput vexpr res
+ -13 -2;x
3878 vput vexpr res
- 0 0;x
3879 vput vexpr res
- 0 1;x
3880 vput vexpr res
- 1 1;x
3881 vput vexpr res
- -13 -2;x
3883 vput vexpr res
* 0 0;x
3884 vput vexpr res
* 0 1;x
3885 vput vexpr res
* 1 1;x
3886 vput vexpr res
* -13 -2;x
3888 vput vexpr res
/ 0 0;x
3889 vput vexpr res
/ 0 1;x
3890 vput vexpr res
/ 1 1;x
3891 vput vexpr res
/ -13 -2;x
3893 vput vexpr res
% 0 0;x
3894 vput vexpr res
% 0 1;x
3895 vput vexpr res
% 1 1;x
3896 vput vexpr res
% -13 -2;x
3898 vput vexpr res pbase
10 u0x8000000000000001
;x
3899 vput vexpr res pbase
16 0x8000000000000001;x
3900 vput vexpr res pbase
16 s0x8000000000000001
;x
3901 vput vexpr res pbase
16 u0x8000000000000001
;x
3902 vput vexpr res pbase
36 0x8000000000000001;x
3903 vput vexpr res pbase
36 u0x8000000000000001
;x
3906 check numeric
0 "${MBOX}" '163128733 2519'
3908 if have_feat regex
; then
3909 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3910 commandalias x echo '$?/$^ERRNAME :$res:'
3912 vput vexpr res regex you y;x
3913 vput vexpr res regex you o;x
3914 vput vexpr res regex you u;x
3915 vput vexpr res regex you yo;x
3916 vput vexpr res regex you ou;x
3917 vput vexpr res regex you you;x
3919 vput vexpr res regex you Y;x
3920 vput vexpr res regex? you Y;x
3921 vput vexpr res regex? you O;x
3922 vput vexpr res regex? you U;x
3923 vput vexpr res regex? you yO;x
3924 vput vexpr res regex? you oU;x
3925 vput vexpr res regex? you YoU;x
3927 vput vexpr res regex 'bananarama' 'nana';x
3928 vput vexpr res regex 'bananarama' 'bana';x
3929 vput vexpr res regex 'bananarama' 'Bana';x
3930 vput vexpr res regex 'bananarama' 'rama';x
3932 vput vexpr res regex? 'bananarama' 'nana';x
3933 vput vexpr res regex? 'bananarama' 'bana';x
3934 vput vexpr res regex? 'bananarama' 'Bana';x
3935 vput vexpr res regex? 'bananarama' 'rama';x
3937 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3938 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3939 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0';x
3940 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0';x
3942 vput vexpr res regex? 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3943 vput vexpr res regex? 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3944 vput vexpr res regex? 'bananarama' 'Bana(.+)' '\$1\$0';x
3945 vput vexpr res regex? 'bananarama' '(.+)rama' '\$1\$0';x
3947 vput vexpr res regex 'banana' '(club )?(.*)(nana)(.*)' \
3948 '\$1\${2}\$4\${3}rama';x
3949 vput vexpr res regex 'Banana' '(club )?(.*)(nana)(.*)' \
3950 '\$1\$2\${2}\$2\$4\${3}rama';x
3951 vput vexpr res regex 'Club banana' '(club )?(.*)(nana)(.*)' \
3952 '\$1\${2}\$4\${3}rama';x
3956 check regex 0 "${MBOX}" '2831099111 542'
3958 t_echoskip 'regex:[!REGEX]'
3967 if have_feat cmd-vexpr; then :; else
3968 t_echoskip '[!CMD_VEXPR]'
3973 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
3978 vput vexpr j
'&' $i 7
3984 vput vexpr j
'&' $i 7
3990 echo ! The end
for $1
3994 # Transport $?/$! up the call chain
4000 wysh
set i
=$? j
=$
! k
=$^ERRNAME
4004 echo ! The end
for $1
4005 return $i $^ERR-BUSY
4009 # Up and down it goes
4016 vput vexpr k
- $1 $2
4020 echo "# <$i/$j> .. "
4024 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
4027 echo ! The end
for $1=$i/$2
4031 return $i $^ERR-BUSY
4037 call w1
0; echo ?
=$?
!=$
!; echo -----;
4038 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
4039 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
4042 check
1 0 "${MBOX}" '1572045517 5922'
4050 if have_feat cmd-vexpr
; then :; else
4051 t_echoskip
'[!CMD_VEXPR]'
4056 ${cat} <<- '__EOT' | \
4057 ${MAILX} ${ARGS} -Snomemdebug \
4058 -Smax=${LOOPS_MAX} \
4063 if [ $i -le "$max" ]
4064 vput vexpr j '&' $i 7
4070 echo ! The end for $1/$2
4072 return $i $^ERR-BUSY
4083 echo ?=$? !=$^ERRNAME
4086 echo ?=$? !=$^ERRNAME
4088 echo ?=$? !=$^ERRNAME
4092 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
4093 check_ex0 1-${LOOPS_BIG} ${i}
4094 check
1-${LOOPS_BIG} - "${MBOX}" '1069764187 47161'
4096 check_ex0
1-${LOOPS_SMALL} ${i}
4097 check
1-${LOOPS_SMALL} - "${MBOX}" '859201011 3894'
4102 if have_feat uistrings
; then
4103 ${cat} <<- '__EOT' > "${BODY}"
4108 vput vexpr j '&' $i 7
4114 echo ! The end for $1
4117 echo would be err with errexit
4126 echo zwei, ?=$? !=$!
4127 localopts yes; set errexit
4129 echo drei, ?=$? !=$^ERRNAME
4131 echo vier, ?=$? !=$^ERRNAME, this is an error
4134 echo outer 1, ?=$? !=$^ERRNAME
4136 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
4138 echo outer 3, ?=$? !=$^ERRNAME
4139 echo this is definitely an error
4142 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
4143 -Snomemdebug > "${MBOX}" 2>&1
4144 check 2 0 "${MBOX}" '4036613316 4184'
4146 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
4147 -Snomemdebug > "${MBOX}" 2>&1
4148 check 3 1 "${MBOX}" '3179757785 2787'
4150 t_echoskip '2-3:[!UISTRINGS]'
4159 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4160 vpospar set hey, "'you ", world!
4161 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4162 vput vpospar x quote; echo x<$x>
4163 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4164 vput vpospar y quote;echo y<$y>
4165 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4166 eval vpospar set ${y};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4167 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4170 echo infun2:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4171 vput vpospar z quote;echo infun2:z<$z>
4175 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4176 vput vpospar y quote;echo infun:y<$y>
4177 eval vpospar set ${x};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4178 vpospar clear;echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4180 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4181 eval vpospar set ${y};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4184 call infun This "in a" fun
4185 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4186 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4188 check 1 0 "${MBOX}" '155175639 866'
4191 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4193 echo ifs<$ifs> ifs-ws<$ifs-ws>
4194 vpospar set hey, "'you ", world!
4195 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4196 vput vpospar x quote; echo x<$x>
4197 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4198 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4201 echo ifs<$ifs> ifs-ws<$ifs-ws>
4202 vpospar set hey, "'you ", world!
4203 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4205 vput vpospar x quote; echo x<$x>
4206 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4207 eval vpospar set ${x};\
4208 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4211 echo ifs<$ifs> ifs-ws<$ifs-ws>
4212 vpospar set hey, "'you ", world!
4213 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4215 vput vpospar x quote; echo x<$x>
4216 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4217 eval vpospar set ${x};\
4218 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4220 check ifs 0 "${MBOX}" '2015927702 706'
4228 ${cat} > ./.t.sh <<- '___'; ${cat} > ./.t.rc <<- '___'
4231 printf " (1/$#: <$1>)"
4233 if [ $# -gt 0 ]; then
4247 printf yyy;yyy 'xxx' "b\$'\t'u ' "
4248 printf xxx;xxx arg ,b u.
4249 printf xxx;xxx arg , .
4250 printf xxx;xxx arg ,ball.
4256 echon " (1/$#: <$1>)"
4271 echon yyy;call yyy '\call xxx' "b\$'\t'u ' "
4272 echon xxx;call xxx arg ,b u.
4273 echon xxx;call xxx arg , .
4274 echon xxx;call xxx arg ,ball.
4277 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
4278 check 1 0 "${MBOX}" '41566293 164'
4280 #${SHELL} ./.t.sh > ./.tshout 2>&1
4281 #check disproof-1 0 ./.tshout '41566293 164'
4289 ${cat} <<- '__EOT' > .tin
4290 hey1, "'you ", world!
4291 hey2, "'you ", bugs bunny!
4296 ${cat} <<- '__EOT' |\
4297 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4298 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4303 unset a b c;read a b c;x
4304 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4306 check 1 0 "${MBOX}" '1527910147 173'
4308 ${cat} <<- '__EOT' > .tin2
4309 hey2.0,:"'you ",:world!:mars.:
4310 hey2.1,:"'you ",:world!
4311 hey2.2,:"'you ",:bugs bunny!
4317 ${cat} <<- '__EOT' |\
4318 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
4319 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4327 unset a b c;read a b c;x
4329 readctl remove 6;echo readctl remove:$?/$^ERRNAME
4331 check ifs 0 "${MBOX}" '890153490 298'
4333 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4334 commandalias x echo '$?/$^ERRNAME / <$d>'
4337 wysh set d;readall d;x
4338 readctl create .tin2
4340 wysh set d;readall d;x
4341 readctl remove .tin;echo $?/$^ERRNAME;\
4342 readctl remove .tin2;echo $?/$^ERRNAME
4343 echo '### now with empty lines'
4344 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
4345 readctl create .temptynl;echo $?/$^ERRNAME
4347 readctl remove .temptynl;echo $?/$^ERRNAME
4349 check readall 0 "${MBOX}" '4113506527 405'
4354 t_readsh() { # TODO not enough
4357 ${cat} <<- '__EOT' > .tin
4358 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4359 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4360 from@exam.ple ' diet spliced <from@exam.ple> ''a'
4361 from@exam.ple' diet spliced <from@exam.ple> ''a'
4364 ${cat} <<- '__EOT' |\
4365 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4366 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4371 unset a b c;read a b c;x
4372 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4374 check 1 0 "${MBOX}" '2955084684 291'
4382 t__x1_msg > ./.tmbox
4385 </dev/null ${MAILX} ${ARGS} -Rf -Y '# Do not care much on error UISTRINGS
4388 \echo --- $?/$^ERRNAME, 2
4390 \echo --- $?/$^ERRNAME, 3
4391 \if "$features" !% +uistrings,
4392 \echoerr reproducible_build: Invalid field name cannot be ignored: ba:l
4394 \headerpick type ignore \
4395 from_ mail-followup-to in-reply-to DATE MESSAGE-ID STATUS ba:l
4396 \echo --- $?/$^ERRNAME, 4
4397 \if "$features" !% +uistrings,
4398 \echo "#headerpick type retain currently covers no fields"
4401 \echo --- $?/$^ERRNAME, 5
4403 \echo --- $?/$^ERRNAME, 6
4404 \unheaderpick type ignore from_ DATE STATUS
4405 \echo --- $?/$^ERRNAME, 7
4406 \if "$features" !% +uistrings,
4407 \echo "#headerpick type retain currently covers no fields"
4410 \echo --- $?/$^ERRNAME, 8
4412 \echo --- $?/$^ERRNAME, 9
4413 \if "$features" =% +uistrings,
4414 \unheaderpick type ignore from_ ba:l
4415 \wysh set x=$? y=$^ERRNAME
4417 \echoerr reproducible_build: Field not ignored: from_
4418 \echoerr reproducible_build: Field not ignored: ba:l
4422 \unheaderpick type ignore *
4423 \echo --- $?/$^ERRNAME, 11
4424 \if "$features" !% +uistrings,
4425 \echo "#headerpick type retain currently covers no fields"
4426 \echo "#headerpick type ignore currently covers no fields"
4429 \echo --- $?/$^ERRNAME, 12
4431 \echo --- $?/$^ERRNAME, 13 ---
4432 # ' ./.tmbox >./.tall 2>&1
4433 check 1 0 ./.tall '2481904228 2273'
4436 if have_feat uistrings; then
4437 have_feat regex && i='3515512395 2378' || i='4201290332 2378'
4438 </dev/null ${MAILX} ${ARGS} -Y '#
4439 \headerpick type retain \
4440 bcc cc date from sender subject to \
4441 message-id mail-followup-to reply-to user-agent
4442 \echo --- $?/$^ERRNAME, 1
4443 \headerpick forward retain \
4444 cc date from message-id list-id sender subject to \
4445 mail-followup-to reply-to
4446 \echo --- $?/$^ERRNAME, 2
4447 \headerpick save ignore ^Original-.*$ ^X-.*$ ^DKIM.*$
4448 \echo --- $?/$^ERRNAME, 3
4449 \headerpick top retain To Cc
4450 \echo --- $?/$^ERRNAME, 4 ---
4452 \echo --- $?/$^ERRNAME, 5
4454 \echo --- $?/$^ERRNAME, 6
4456 \echo --- $?/$^ERRNAME, 7
4458 \echo --- $?/$^ERRNAME, 8
4460 \echo --- $?/$^ERRNAME, 9 ---
4461 \unheaderpick type retain message-id mail-followup-to reply-to user-agent
4462 \echo --- $?/$^ERRNAME, 10
4463 \unheaderpick save ignore ^X-.*$ ^DKIM.*$
4464 \echo --- $?/$^ERRNAME, 11
4465 \unheaderpick forward retain *
4466 \echo --- $?/$^ERRNAME, 12 ---
4468 \echo --- $?/$^ERRNAME, 13
4470 \echo --- $?/$^ERRNAME, 14
4472 \echo --- $?/$^ERRNAME, 15 --
4473 \unheaderpick type retain *
4474 \echo --- $?/$^ERRNAME, 16
4475 \unheaderpick forward retain *
4476 \echo --- $?/$^ERRNAME, 17
4477 \unheaderpick save ignore *
4478 \echo --- $?/$^ERRNAME, 18
4479 \unheaderpick top retain *
4480 \echo --- $?/$^ERRNAME, 19 --
4482 \echo --- $?/$^ERRNAME, 20
4484 check 2 0 ./.tall "${i}"
4486 t_echoskip '2:[!UISTRINGS]'
4493 # Send/RFC absolute basics {{{
4494 t_can_send_rfc() { # {{{
4497 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub.1 \
4500 check 1 0 "${MBOX}" '550126528 126'
4501 check 1-err - .terr
'4294967295 0'
4503 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2 \
4504 -b bcc@no
.1 -b bcc@no
.2 -b bcc@no
.3 \
4505 -c cc@no
.1 -c cc@no
.2 -c cc@no
.3 \
4506 to@no
.1 to@no
.2 to@no
.3 \
4508 check
2 0 "${MBOX}" '3259888945 324'
4509 check
2-err - .terr
'4294967295 0'
4511 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2no \
4512 -b bcc@no
.1\ \ bcc@no
.2 -b bcc@no
.3 \
4513 -c cc@no
.1,cc@no
.2 -c cc@no
.3 \
4514 to@no
.1,to@no
.2 to@no
.3 \
4516 check
2no
4 "${MBOX}" '3350946897 468'
4517 if have_feat uistrings
; then
4518 check
2no-err
- .terr
'3397557940 190'
4520 check
2no-err
- .terr
'4294967295 0'
4523 # XXX NOTE we cannot test "cc@no1 <cc@no.2>" because our stupid parser
4524 # XXX would not treat that as a list but look for "," as a separator
4525 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.3 \
4526 -T 'bcc?single: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4527 -T cc?si\ \
:\ \
'cc@no.1, <cc@no.2>' -T cc
:\ cc@no
.3 \
4528 -T to?
:\ to@no
.1,'<to@no.2>' -T to
:\ to@no
.3 \
4530 check
3 0 "${MBOX}" '1453534480 678'
4531 check
3-err - .terr
'4294967295 0'
4533 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.4 \
4534 -T 'bcc: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4535 -T cc
:\
'cc@no.1, <cc@no.2>' -T cc\ \
:\ \ cc@no
.3 \
4536 -T to\
:to@no
.1,'<to@no.2>' -T to
:\ to@no
.3 \
4538 check
4 0 "${MBOX}" '535767201 882'
4539 check
4-err - .terr
'4294967295 0'
4541 # Two test with a file-based MTA
4542 "${cat}" <<-_EOT > .tmta.sh
4544 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4545 "${cat}" && echo pardauz && echo) > "${MBOX}"
4547 ${chmod} 0755 .tmta.sh
4549 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s Sub.mta-1 \
4550 receiver@number
.1 > .
/.terr
2>&1
4551 check
5 0 "${MBOX}" '2384401657 138'
4552 check
5-err - .terr
'4294967295 0'
4554 </dev
/null
${MAILX} ${ARGS} -Smta=file://.
/.tmta.sh
-s Sub.mta-2 \
4555 receiver@number
.1 > .
/.terr
2>&1
4556 check
6 0 "${MBOX}" '3006460737 138'
4557 check
6-err - .terr
'4294967295 0'
4560 </dev
/null
${MAILX} ${ARGS} -Smta=test \
4569 check
7 0 .
/.tall
'951018449 138'
4571 ## *record*, *outfolder*, with and without *mta-bcc-ok*
4573 xfolder
=`${pwd}`/.tfolder
4575 "${cat}" <<-_EOT > .tmta.sh
4577 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4578 "${cat}" && echo 'ARGS: '"\${@}" && echo) > "${MBOX}"
4580 ${chmod} 0755 .tmta.sh
4583 </dev
/null
${MAILX} ${ARGS} -Smta=./.tmta.sh -Sfolder="${xfolder}" \
4586 -b bcc@no.1 -b bcc@no.2 -b bcc@no.3 \
4587 -c cc@no.1 -c cc@no.2 -c cc@no.3 \
4588 to@no.1 to@no.2 to@no.3 \
4589 receiver@number.1 > ./.terr 2>&1
4594 check 8 0 "${MBOX}" '1365032629 292'
4595 check 8-1 - .terr '4294967295 0'
4597 t_it -Snomta-bcc-ok -Srecord=.trec9
4598 check 9 0 "${MBOX}" '1365032629 292'
4599 check 9-1 - .terr '4294967295 0'
4600 check 9-2 - ./.trec9 '160206230 221'
4602 t_it -Srecord=.trec10
4603 check 10 0 "${MBOX}" '3085765596 326'
4604 check 10-1 - .terr '4294967295 0'
4605 check 10-2 - ./.trec10 '160206230 221'
4607 t_it -Snomta-bcc-ok -Srecord=.trec11 -Soutfolder
4608 check 11 0 "${MBOX}" '1365032629 292'
4609 check 11-1 - .terr '4294967295 0'
4610 check 11-2 - ./.tfolder/.trec11 '160206230 221'
4611 # That is appends to an MBOX
4612 t_it -Srecord=.trec11 -Soutfolder
4613 check 12 0 "${MBOX}" '3085765596 326'
4614 check 12-1 - .terr '4294967295 0'
4615 check 12-2 - ./.tfolder/.trec11 '1618754846 442'
4619 ## From: and Sender:
4620 </dev/null ${MAILX} ${ARGS} -s ubject \
4621 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
4622 to@exam.ple > "${MBOX}" 2>&1
4623 check 13 0 "${MBOX}" '143390417 169'
4625 # ..if From: is single mailbox and Sender: is same, no Sender:
4626 </dev/null ${MAILX} ${ARGS} -s ubject \
4627 -S from=a@b.org -S sender=a@b.org \
4628 to@exam.ple > "${MBOX}" 2>&1
4629 check 14 0 "${MBOX}" '1604962737 135'
4635 # Alternates and ML related address massage etc. somewhere else
4637 XARGS=${ARGS} # TODO v15-compat
4638 ARGS="${ARGS} -Sv15-compat=y
"
4640 t__gen_msg subject reply from 1 to 2 cc 2 > "${MBOX}"
4642 ## Base (does not test "recipient record
")
4644 </dev/null ${MAILX} ${ARGS} -Rf \
4649 set fullnames escape=!; '${1}'
4653 set recipients-in-cc nofullnames; '${1}'
4657 unset recipients-in-cc; '${1}'
4662 "${MBOX}" > ./.tall 2>&1
4667 check 1 0 ./.tall '4164251531 851'
4669 check 2 0 ./.tall '3034955332 591'
4670 t_it reply 'set flipr;'
4671 check 3 0 ./.tall '3034955332 591'
4672 t_it Reply 'set flipr;'
4673 check 4 0 ./.tall '4164251531 851'
4676 t__gen_msg subject reply-no-addr > ./.tnoaddr
4678 # MBOX will deduce addressee from From_ line..
4679 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4681 File ./.tnoaddr; reply # Takes addressee from From_ line :(
4685 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4688 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4689 echo 3:$?/$^ERRNAME; reply # cannot test IO,NOTSUP,INVAL
4695 check 5 0 ./.tall '3088217220 382'
4696 if have_feat uistrings; then
4697 check 6 - ./.terr '2514745519 544'
4699 t_echoskip '6:[!UISTRINGS]'
4702 # ..but Maildir will not
4703 if have_feat maildir; then
4704 ${mkdir} -p .tdir .tdir/tmp .tdir/cur .tdir/new
4705 ${sed} 1d < ./.tnoaddr > .tdir/new/sillyname
4707 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4713 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4716 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4717 echo 3:$?/$^ERRNAME;reply # cannot test IO,NOTSUP,INVAL
4723 check 7 0 ./.tall '3631170341 244'
4724 if have_feat uistrings; then
4725 check 8 - ./.terr '1074346767 629'
4727 t_echoskip '8:[!UISTRINGS]'
4731 ## Ensure action on multiple messages
4732 t__gen_msg subject reply2 from from2@exam.ple body body2 >> "${MBOX}"
4735 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! \
4742 echo 1:$?/$^ERRNAME; '${2}' 1 2
4747 "${MBOX}" > ./.tall 2>&1
4748 check ${3} 0 ./.tall '283309820 502'
4749 if [ ${#} -eq 4 ]; then
4751 check ${3}-1 - ./.tlst '1649520021 12'
4752 check ${3}-2 - ./from1 '1501109193 347'
4753 check ${3}-3 - ./from2 '2154231432 137'
4758 t_it respond Respond 10
4759 t_it followup Followup 11 yes
4760 ${rm} -f from1 from2
4762 ## *record*, *outfolder* (reuses $MBOX)
4766 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4773 echo 1:$?/$^ERRNAME; '${2}' 1 2
4776 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4781 echo 3:$?/$^ERRNAME; '${2}' 1 2
4784 echo 4:$?/$^ERRNAME; set outfolder norecord
4790 echo 1:$?/$^ERRNAME; '${2}' 1 2
4793 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4798 echo 3:$?/$^ERRNAME; '${2}' 1 2
4803 "${MBOX}" > ./.tall 2>&1
4804 check ${3} 0 ./.tall '3410330303 2008'
4805 if [ ${#} -ne 5 ]; then
4806 check ${4} - ./.trec${4} '3044885336 484'
4807 check ${4}-1 - ./.tfolder/.trec${4} '3044885336 484'
4809 [ -f ./.trec${4} ]; check_exn0 ${4}
4811 check ${4}-1 - ./.tlst '1649520021 12'
4812 check ${4}-2 - ./from1 '2668975631 694'
4813 check ${4}-3 - ./from2 '225462887 274'
4814 [ -f ./.tfolder/.trec${4} ]; check_exn0 ${4}-4
4815 ( cd .tfolder && echo * > ./.tlst )
4816 check ${4}-5 - ./.tfolder/.tlst '1649520021 12'
4817 check ${4}-6 - ./.tfolder/from1 '2668975631 694'
4818 check ${4}-7 - ./.tfolder/from2 '225462887 274'
4822 t_it reply Reply 12 13
4823 t_it respond Respond 14 15
4824 t_it followup Followup 16 17 yes
4825 #${rm} -f from1 from2
4827 ## Quoting (if not cmd_escapes related)
4829 t__x2_msg > ./.tmbox
4832 set indentprefix=" |
" quote
4836 set quote=noheading quote-inject-head
4840 headerpick type retain cc date from message-id reply-to subject to
4845 set quote=allheaders
4849 set quote-inject-head=%% quote-inject-tail=%% quote=headers
4854 quote-inject-head='"\$
'"'\\
4855 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4857 quote-inject-tail='"\$
'"'\\
4858 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4863 set showname datefield=%%y nodatefield-markout-older indentprefix=\\ :
4867 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
4868 -Sescape=! -Sindentprefix=' >' \
4869 ./.tmbox >./.tall 2>&1
4871 ${cat} ./.tall >> "${MBOX}"
4872 check 18 - "${MBOX}" '385267528 3926'
4874 # quote-as-attachment, fullnames
4875 </dev/null ${MAILX} ${ARGS} -Rf \
4877 -S quote-as-attachment \
4878 -Y reply -Y yb1 -Y !. \
4879 -Y 'unset quote-as-attachment' \
4880 -Y 'reply;yb2' -Y !. \
4881 -Y 'set quote-as-attachment fullnames' \
4882 -Y ';reply;yb3' -Y !. \
4883 ./.tmbox >./.tall 2>&1
4884 check 19 0 ./.tall '2774517283 2571'
4886 # Moreover, quoting of several parts with all*
4887 t__gen_mimemsg from 'ex1@am.ple' subject for-repl > ./.tmbox
4888 check 20 0 ./.tmbox '1874764424 668'
4890 have_feat filter-html-tagsoup && ck='946925637 1105' || ck='3587432511 1165'
4891 </dev/null ${MAILX} ${ARGS} -Rf \
4892 -Sescape=! -Sindentprefix=' |' \
4893 -Y 'set quote=allheaders' \
4895 -Y 'set quote=allbodies' \
4898 ./.tmbox >./.tall 2>&1
4899 check 21 0 ./.tall "${ck}"
4901 ARGS=${XARGS} # TODO v15-compat
4908 ARGS="${ARGS} -Sv15-compat=y
"
4910 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
4911 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
4913 ## Base (does not test "recipient record
")
4915 </dev/null ${MAILX} ${ARGS} -Rf \
4916 -Y ${1}' . "du
<ex1@am.ple
>"
4919 echo 1:$?/$^ERRNAME; echoerr 1:done
4920 set fullnames escape=!
4921 '${1}' 1 "du
<ex2@am.ple
>"
4924 echo 2:$?/$^ERRNAME; echoerr 2:done
4926 set nofullnames ea=$expandaddr expandaddr=-all
4927 '${1}' ` "du
<ex3@am.ple
>"
4930 echo 3:$?/$^ERRNAME; echoerr 3:done
4932 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
4935 echo 4:$?/$^ERRNAME; echoerr 4:done
4936 '${1}' # TODO not yet possible b5 !.
4937 echo 5:$?/$^ERRNAME; echoerr 5:done
4939 '${1}' 1 2 ex6@am.ple
4944 echo 6:$?/$^ERRNAME; echoerr 6:done
4945 set forward-add-cc fullnames
4949 echo 7:$?/$^ERRNAME; echoerr 7:done
4954 echo 8:$?/$^ERRNAME; echoerr 8:done
4956 "${MBOX}" > ./.tall 2>./.terr
4961 check 1 0 ./.tall '2356713156 2219'
4962 if have_feat uistrings && have_feat docstrings; then
4963 check 2 - ./.terr '3273108824 335'
4965 t_echoskip '2:[!UISTRINGS]'
4969 check 3 0 ./.tall '2356713156 2219'
4970 if have_feat uistrings && have_feat docstrings; then
4971 check 4 - ./.terr '447176534 355'
4973 t_echoskip '4:[!UISTRINGS]'
4977 ## *record*, *outfolder* (reuses $MBOX)
4981 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4986 echo 1:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 1 ex2@am.ple
4989 echo 2:$?/$^ERRNAME; set outfolder norecord; '${1}' 2 ex1@am.ple
4992 echo 3:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 2 ex2@am.ple
4997 "${MBOX}" > ./.tall 2>&1
4998 check ${2} 0 ./.tall '3180366037 1212'
4999 if [ ${#} -ne 4 ]; then
5000 check ${3}-1 - ./.trec${2} '1769129556 304'
5001 check ${3}-2 - ./.tfolder/.trec${2} '2335391111 284'
5003 [ -f ./.trec${2} ]; check_exn0 ${3}
5005 check ${3}-1 - ./.tlst '2020171298 8'
5006 check ${3}-2 - ./ex1 '1512529673 304'
5007 check ${3}-3 - ./ex2 '1769129556 304'
5008 [ -f ./.tfolder/.trec${2} ]; check_exn0 ${3}-4
5009 ( cd .tfolder && echo * > ./.tlst )
5010 check ${3}-5 - ./.tfolder/.tlst '2020171298 8'
5011 check ${3}-6 - ./.tfolder/ex1 '2016773910 284'
5012 check ${3}-7 - ./.tfolder/ex2 '2335391111 284'
5017 t_it Forward 7 8 yes
5020 ## Injections, headerpick selection
5022 t__x2_msg > ./.tmbox
5025 set quote=noheading forward-inject-head
5026 forward 1 ex1@am.ple
5029 headerpick forward retain cc from subject to
5030 forward 1 ex1@am.ple
5033 unheaderpick forward retain *
5034 forward 1 ex1@am.ple
5037 headerpick forward ignore in-reply-to reply-to message-id status
5038 set forward-inject-head=%% forward-inject-tail=%%
5039 forward 1 ex1@am.ple
5042 set forward-inject-head='"\$
'"'\\
5043 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5045 forward-inject-tail='"\$
'"'\\
5046 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5048 forward 1 ex1@am.ple
5051 set showname datefield=%%y nodatefield-markout-older
5052 forward 1 ex1@am.ple
5055 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
5057 ./.tmbox >./.tall 2>&1
5059 ${cat} ./.tall >> "${MBOX}"
5060 check 9 - "${MBOX}" '2976943913 2916'
5062 # forward-as-attachment
5063 </dev/null ${MAILX} ${ARGS} -Rf \
5065 -S forward-inject-head=.head. \
5066 -S forward-inject-tail=.tail. \
5067 -S forward-as-attachment \
5068 -Y 'headerpick forward retain subject to from' \
5069 -Y 'forward ex1@am.ple' -Y b1 -Y !. \
5070 -Y 'unset forward-as-attachment' \
5071 -Y 'forward ex1@am.ple;b2' -Y !. \
5072 ./.tmbox >./.tall 2>&1
5073 check 10 0 ./.tall '799103633 1250'
5082 ARGS="${ARGS} -Sv15-compat=y
"
5084 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
5085 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
5089 </dev/null ${MAILX} ${ARGS} -Rf \
5090 -Y ${1}' . "du
<ex1@am.ple
>"
5091 echo 1:$?/$^ERRNAME; echoerr 1:done
5092 set fullnames escape=!
5093 '${1}' 1 "du
, da
<ex2@am.ple
>"
5094 echo 2:$?/$^ERRNAME; echoerr 2:done
5096 set nofullnames ea=$expandaddr expandaddr=-all
5097 '${1}' ` "du
<ex3@am.ple
>"
5098 echo 3:$?/$^ERRNAME; echoerr 3:done
5100 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
5101 echo 4:$?/$^ERRNAME; echoerr 4:done
5102 '${1}' # TODO not yet possible b5 !.
5103 echo 5:$?/$^ERRNAME; echoerr 5:done
5105 '${1}' 1 2 ex6@am.ple
5106 echo 6:$?/$^ERRNAME; echoerr 6:done
5108 "${MBOX}" > ./.tall 2>./.terr
5113 check 1 0 ./.tall '1461006932 1305'
5114 if have_feat uistrings; then
5115 check 2 - ./.terr '138360532 210'
5117 t_echoskip '2:[!UISTRINGS]'
5121 check 3 0 ./.tall '3674535444 958'
5122 if have_feat uistrings; then
5123 check 4 - ./.terr '138360532 210'
5125 t_echoskip '4:[!UISTRINGS]'
5128 ## *record*, *outfolder* (reuses $MBOX)
5132 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
5134 set record=.trec'${2}'; '${1}' 1 ex1@am.ple
5135 echo 1:$?/$^ERRNAME; set record-resent; '${1}' 1 ex2@am.ple
5136 echo 2:$?/$^ERRNAME; set outfolder norecord-resent; '${1}' 2 ex1@am.ple
5137 echo 3:$?/$^ERRNAME; set record-resent; '${1}' 2 ex2@am.ple
5140 "${MBOX}" > ./.tall 2>&1
5142 if [ ${#} -ne 3 ]; then
5143 check ${2} - ./.tall '1711347390 992'
5144 check ${3}-1 - ./.trec${2} '2840978700 249'
5145 check ${3}-2 - ./.tfolder/.trec${2} '3219997964 229'
5147 check ${2} - ./.tall '1391418931 724'
5148 check ${3}-1 - ./.trec${2} '473817710 182'
5149 check ${3}-2 - ./.tfolder/.trec${2} '2174632404 162'
5165 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5166 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5167 check 1 - "${MBOX}" '137107341 324' # for flag test
5170 </dev/null ${MAILX} ${ARGS} -f \
5179 copy .tf1 # no auto-advance
5188 !'"${chmod}"' 0444 .tf3
5192 "${MBOX}" > ./.tallx 2>./.terr
5195 if have_feat uistrings; then # TODO
5196 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5197 ${sed} '$d' < ./.tallx > ./.tall
5199 ${mv} ./.tallx ./.tall
5201 if [ -n "${HONOURS_READONLY}" ]; then
5202 n2_1=2-1 cs2_1='1913702840 1121'
5203 n2_4=2-4 cs2_4='3642131968 344'
5204 n2_5=2-5 cs2_5='2617612897 112'
5206 n2_1=2-1-nrdonly cs2_1='1962556153 1146'
5207 n2_4=2-4-nrdonly cs2_4='3733058190 688'
5208 n2_5=2-5-nrdonly cs2_5='3989834342 80'
5210 check ${n2_1} - ./.tall "${cs2_1}"
5211 check 2-2 - ./.tf1 '686654461 334'
5212 check 2-3 - ./.tf2 '1931512953 162'
5213 check ${n2_4} - ./.tf3 "${cs2_4}"
5214 if have_feat uistrings; then
5215 check ${n2_5} - ./.terr "${cs2_5}"
5217 t_echoskip '2-5:[!UISTRINGS]'
5221 check 3 - "${MBOX}" '1477662071 346'
5225 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5226 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5227 t__gen_msg subject Copy3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5228 check ${1} - "${MBOX}" '2667292819 473' # for flag test
5230 </dev/null ${MAILX} ${ARGS} -f \
5249 "${MBOX}" > ./.tallx 2>&1
5255 if have_feat uistrings; then # TODO
5256 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5257 ${sed} '$d' < ./.tallx > ./.tall
5259 ${mv} ./.tallx ./.tall
5262 check 5-2 - ./.tlst '1058655452 9'
5263 check 5-3 - ./.tall '1543702808 1617'
5264 check 5-4 - ./from1 '1031912635 999'
5265 check 5-5 - ./ex '2400630246 149'
5266 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5269 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5271 if have_feat uistrings; then # TODO
5272 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5273 ${sed} '$d' < ./.tallx > ./.tall
5275 ${mv} ./.tallx ./.tall
5277 echo * .tfolder/* > ./.tlst
5278 check 6-2 - ./.tlst '1865898363 29'
5279 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5280 check 6-4 - .tfolder/from1 '1031912635 999'
5281 check 6-5 - .tfolder/ex '2400630246 149'
5284 t__x2_msg > ./.tmbox
5290 headerpick save retain cc date from subject to
5293 unheaderpick save retain *
5296 headerpick save ignore status in-reply-to
5299 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5305 check 7-1 - ./.tall '3805176908 152'
5306 check 7-2 - ./.tout '2447734879 1316'
5311 check 8-1 - ./.tall '1044700686 136'
5312 check 8-2 - ./mr2 '2447734879 1316'
5313 check 8-3 - ./.tlst '3190056903 4'
5321 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5322 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5323 check 1 - "${MBOX}" '3634443864 324' # for flag test
5326 </dev/null ${MAILX} ${ARGS} -f \
5335 save .tf1 # no auto-advance
5344 !'"${chmod}"' 0444 .tf3
5348 "${MBOX}" > ./.tallx 2>./.terr
5351 if have_feat uistrings; then # TODO
5352 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5353 ${sed} '$d' < ./.tallx > ./.tall
5355 ${mv} ./.tallx ./.tall
5357 if [ -n "${HONOURS_READONLY}" ]; then
5358 n2_1=2-1 cs2_1='2335843514 1121'
5359 n2_4=2-4 cs2_4='970407001 344'
5360 n2_5=2-5 cs2_5='45116475 112'
5362 n2_1=2-1-nrdonly cs2_1='1736244784 1146'
5363 n2_4=2-4-nrdonly cs2_4='3903872811 688'
5364 n2_5=2-5-nrdonly cs2_5='720724138 80'
5366 check ${n2_1} - ./.tall "${cs2_1}"
5367 check 2-2 - ./.tf1 '2435434321 334'
5368 check 2-3 - ./.tf2 '920652966 162'
5369 check ${n2_4} - ./.tf3 "${cs2_4}"
5370 if have_feat uistrings; then
5371 check ${n2_5} - ./.terr "${cs2_5}"
5373 t_echoskip '2-5:[!UISTRINGS]'
5377 check 3 - "${MBOX}" '1219692400 346'
5381 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5382 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5383 t__gen_msg subject Save3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5384 check ${1} - "${MBOX}" '1391391227 473' # for flag test
5386 </dev/null ${MAILX} ${ARGS} -f \
5405 "${MBOX}" > ./.tallx 2>&1
5411 if have_feat uistrings; then # TODO
5412 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5413 ${sed} '$d' < ./.tallx > ./.tall
5415 ${mv} ./.tallx ./.tall
5418 check 5-2 - ./.tlst '1058655452 9'
5419 check 5-3 - ./.tall '3418590770 1617'
5420 check 5-4 - ./from1 '1462882526 999'
5421 check 5-5 - ./ex '2153575326 149'
5422 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5425 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5427 if have_feat uistrings; then # TODO
5428 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5429 ${sed} '$d' < ./.tallx > ./.tall
5431 ${mv} ./.tallx ./.tall
5433 echo * .tfolder/* > ./.tlst
5434 check 6-2 - ./.tlst '1865898363 29'
5435 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5436 check 6-4 - .tfolder/from1 '1462882526 999'
5437 check 6-5 - .tfolder/ex '2153575326 149'
5442 t__x2_msg > ./.tmbox
5443 check ${1} - ./.tmbox '561523988 397'
5446 [ ${#} -gt 2 ] && a='-S MBOX=./.tmboxx'
5447 [ ${#} -gt 3 ] && a="${a}"' -S inbox=./.tmbox'
5453 headerpick save retain cc date from subject to
5456 unheaderpick save retain *
5459 headerpick save ignore status in-reply-to
5462 #' | ${MAILX} ${ARGS} -f ${a} ./.tmbox > ./.tall 2>&1
5466 t_it 7 'save ./.tout'
5468 check 7-1 - ./.tall '4190949581 312'
5469 check 7-2 - ./.tout '2447734879 1316'
5470 check 7-3 - ./.tmbox '561523988 397'
5475 check 8-1 - ./.tall '2109832180 296'
5476 check 8-2 - ./mr2 '2447734879 1316'
5477 check 8-3 - ./.tlst '3190056903 4'
5478 check 8-3 - ./.tmbox '561523988 397'
5480 # saves in $MBOX without argument
5483 check 9-1 - ./.tall '652005824 320'
5484 check 9-2 - ./.tmboxx '2447734879 1316'
5485 check 9-3 - ./.tmbox '561523988 397'
5487 # and deletes if editing a primary mailbox
5489 t_it 10 save yes yes
5491 check 10-1 - ./.tall '652005824 320'
5492 check 10-2 - ./.tmboxx '2447734879 1316'
5493 [ -f ./.tmbox ]; check_exn0 10-3
5501 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5502 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5503 check 1 - "${MBOX}" '2967134193 324' # for flag test
5506 </dev/null ${MAILX} ${ARGS} -f \
5515 !touch .tf2; '"${chmod}"' 0444 .tf2
5518 !'"${chmod}"' 0644 .tf2
5523 "${MBOX}" > ./.tallx 2>./.terr
5526 if have_feat uistrings; then # TODO
5527 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5528 ${sed} '$d' < ./.tallx > ./.tall
5530 ${mv} ./.tallx ./.tall
5532 if [ -n "${HONOURS_READONLY}" ]; then
5533 n2_1=2-1 cs2_1='1641443074 491'
5534 n2_4=2-4 cs2_4='602144474 155'
5536 n2_1=2-1-nrdonly cs2_1='3045412111 492'
5537 n2_4=2-4-nrdonly cs2_4='2197157669 201'
5539 check ${n2_1} - ./.tall "${cs2_1}"
5540 check 2-2 - ./.tf1 '1473857906 162'
5541 check 2-3 - ./.tf2 '331229810 162'
5542 if have_feat uistrings; then
5543 check ${n2_4} - ./.terr "${cs2_4}"
5545 t_echoskip '2-4:[!UISTRINGS]'
5549 check 3 - "${MBOX}" '4294967295 0'
5553 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5554 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5555 t__gen_msg subject Move3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5556 check ${1} - "${MBOX}" '2826896131 473' # for flag test
5558 </dev/null ${MAILX} ${ARGS} -f \
5577 "${MBOX}" > ./.tallx 2>./.terr
5583 if have_feat uistrings; then # TODO
5584 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5585 ${sed} '$d' < ./.tallx > ./.tall
5587 ${mv} ./.tallx ./.tall
5590 check 5-2 - ./.tlst '1058655452 9'
5591 check 5-3 - ./.tall '419037676 870'
5592 if have_feat uistrings; then
5593 check 5-4 - ./.terr '1383646464 86'
5595 t_echoskip '5-4:[!UISTRINGS]'
5597 check 5-5 - ./from1 '3719268580 827'
5598 check 5-6 - ./ex '4262925856 149'
5599 ${rm} -f ./.tlst ./.tall ./.terr ./from1 ./ex
5602 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5604 if have_feat uistrings; then # TODO
5605 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5606 ${sed} '$d' < ./.tallx > ./.tall
5608 ${mv} ./.tallx ./.tall
5610 echo * .tfolder/* > ./.tlst
5611 check 6-2 - ./.tlst '1865898363 29'
5612 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5613 check 6-4 - .tfolder/from1 '3719268580 827'
5614 check 6-5 - .tfolder/ex '4262925856 149'
5617 t__x2_msg > ./.tmbox
5623 headerpick save retain cc date from subject to
5626 unheaderpick save retain *
5629 headerpick save ignore status in-reply-to
5632 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5638 check 7-1 - ./.tall '3805176908 152'
5639 check 7-2 - ./.tout '2447734879 1316'
5644 check 8-1 - ./.tall '1044700686 136'
5645 check 8-2 - ./mr2 '2447734879 1316'
5646 check 8-3 - ./.tlst '3190056903 4'
5656 while [ ${i} -lt 113 ]; do
5657 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5658 "${MBOX}" "${i}" "${i}"
5661 ) | ${MAILX} ${ARGS} > .tall 2>&1
5662 check 1 0 "${MBOX}" '1785801373 13336'
5663 check 1-outerr - ./.tall '4294967295 0' # empty file
5665 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
5666 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
5667 check 2 0 .tall '3467540956 8991'
5669 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
5670 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5671 check
3 0 .tall
'2410946529 8998'
5673 # copy only the odd (but the first), move the even
5675 printf 'File "file://%s"\ncopy ' .tmbox2
5677 while [ ${i} -lt 113 ]; do
5681 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
5682 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5683 check
4 0 .tmbox3
'2554734733 6666'
5684 check
5 - .tall
'2062382804 4517'
5687 printf 'file "file://%s"\nmove ' .tmbox2
5689 while [ ${i} -lt 113 ]; do
5693 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
5694 .tmbox3 .tmbox3 .tmbox2
5695 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
5696 check
6 0 .tmbox3
'1429216753 13336'
5697 if have_feat uistrings
; then
5698 ${sed} 2d
< .tall
> .tallx
5702 check
7 - .tallx
'169518319 13477'
5704 # Invalid MBOXes (after [f4db93b3])
5706 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5707 check 8 0 .tinvmbox '2848412822 118'
5708 check 9 - ./.tall '461280182 33'
5710 echo ' ' > .tinvmbox
5711 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
5712 check
10 0 .tinvmbox
'624770486 120'
5713 check
11 - .
/.tall
'461280182 33'
5715 { echo; echo; } > .tinvmbox
# (not invalid)
5716 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5717 check 12 0 .tinvmbox '1485640875 119'
5718 check 13 - ./.tall '461280182 33'
5720 # *mbox-rfc4155*, plus
5721 ${cat} <<-_EOT > ./.tinv1
5724 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
5725 Date: Wed, 02 Oct 1996 01:50:07 +0000
5727 Subject: Bad bad message 1
5729 From me to you, blinde Kuh!
5731 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5732 Date: Wed, 02 Oct 1996 01:50:07 +0000
5734 Subject: Bad bad message 2
5736 From me to you, blindes Kalb!
5738 ${cp} ./.tinv1 ./.tinv2
5742 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
5743 \\eval copy * "${2}"
5745 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
5747 ${cat} ./.tinv1 ./.tok >> .tall
5748 check 14 - ./.tall '739301109 616'
5751 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
5752 wysh File ./.tok # Just move away to nowhere
5754 wysh file ./.tinv2 # Fully repaired
5755 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5757 # Equal since [Auto-fix when MBOX had From_ errors on read (Dr. Werner
5759 check 15-1 - ./.tinv1 '4151504442 314'
5760 check 15-2 - ./.tinv2 '4151504442 314'
5762 # *mbox-fcc-and-pcc*
5763 ${cat} > ./.ttmpl <<-'_EOT'
5765 Bcc: | cat >> ./.tpcc1
5767 Subject: fcc and pcc, and *mbox-fcc-and-pcc*
5772 < ./.ttmpl ${MAILX} ${ARGS} -t > "${MBOX}" 2>&1
5773 check
16 0 "${MBOX}" '4294967295 0'
5774 check
17 - .
/.tfcc1
'2301294938 148'
5775 check
18 - .
/.tfcc2
'2301294938 148'
5776 check
19 - .
/.tpcc1
'2301294938 148'
5778 < .
/.ttmpl
${MAILX} ${ARGS} -t -Snombox-fcc-and-pcc > "${MBOX}" 2>&1
5779 check 20 0 "${MBOX}" '4294967295 0'
5780 check 21 - ./.tfcc1 '3629108107 98'
5781 check 22 - ./.tfcc2 '3629108107 98'
5782 check 23 - ./.tpcc1 '2373220256 246'
5784 # More invalid: since in "copy
* X
" messages will be copied in `sort' order,
5785 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5786 # ensure pre-v15 MBOX separation "in between
" messages.., 2019-08-07) that
5787 # could still have created invalid MBOX files!
5788 ${cat} <<-_EOT > ./.tinv1
5791 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5792 Date: Sun, 04 Oct 1998 01:50:07 +0000
5797 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5798 Date: Nix, 01 Oct BAD 01:50:07 +0000
5803 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5804 Date: Fri, 03 Oct 1997 01:50:07 +0000
5809 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5810 Date: Sun, 01 Oct 1995 01:50:07 +0000
5816 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5817 Date: Wed, 02 Oct 1996 01:50:07 +0000
5828 file ./.tinv1' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5829 check 24 0 ./.tinv1 '104184185 560'
5830 check 25 - ./.tinv2 '853754737 510'
5838 if have_feat maildir; then :; else
5839 t_echoskip '[!MAILDIR]'
5846 while [ ${i} -lt 112 ]; do
5847 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5848 "${MBOX}" "${i}" "${i}"
5851 ) | ${MAILX} ${ARGS}
5852 check 1 0 "${MBOX}" '2366902811 13332'
5858 ' "${MBOX}" .tmdir1 .tmdir1 |
5859 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
5860 check 2 0 .tlst '3442251309 8991'
5863 copy * "maildir
://%s
"
5866 ' "${MBOX}" .tmdir2 .tmdir2 |
5867 ${MAILX} ${ARGS} -Sshowlast > .tlst
5868 check 3 0 .tlst '3524806062 9001'
5870 printf 'File "maildir
://%s
"
5874 ' .tmdir2 .tmbox1 .tmbox1 |
5875 ${MAILX} ${ARGS} -Sshowlast > .tlst
5876 check 4 0 .tmbox1 '4096198846 12772'
5877 check 5 - .tlst '1262452287 8998'
5879 # only the odd (even)
5881 printf 'File "maildir
://%s
"
5884 while [ ${i} -lt 112 ]; do
5886 [ ${j} -eq 1 ] && printf '%s ' "${i}"
5893 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
5894 check 6 0 .tmbox2 '4228337024 6386'
5895 check 7 - .tlst '2078821439 4517'
5898 printf 'file "maildir
://%s
"
5901 while [ ${i} -lt 112 ]; do
5903 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
5911 ' .tmbox2 .tmbox2 .tmdir2
5912 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
5913 check
8 0 .tmbox2
'978751761 12656'
5914 ${sed} 2d
< .tlst
> .tlstx
5915 check
9 - .tlstx
'2172297531 13477'
5917 # More invalid: since in "copy * X" messages will be copied in `sort' order,
5918 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5919 # ensure pre-v15 MBOX separation "in between" messages.., 2019-08-07) that
5920 # could still have created invalid MBOX files!
5921 ${cat} <<-_EOT > ./.tinv1
5924 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5925 Date: Sun, 04 Oct 1998 01:50:07 +0000
5930 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5931 Date: Nix, 01 Oct BAD 01:50:07 +0000
5936 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5937 Date: Fri, 03 Oct 1997 01:50:07 +0000
5942 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5943 Date: Sun, 01 Oct 1995 01:50:07 +0000
5949 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5950 Date: Wed, 02 Oct 1996 01:50:07 +0000
5959 copy * maildir://./.tmdir10
5960 !{ for f in ./.tmdir10/new/*; do echo ===; %s $f; done; } > ./.t11
5964 ' "${cat}" | ${MAILX} ${ARGS} >>${ERR} 2>&1
5965 # Note that substdate() fixes all but one From_ line to $SOURCE_DATE_EPOCH!
5966 check 10 0 ./.t10warp '3551111321 502'
5967 check 11 - ./.t11 '642719592 302'
5973 # MIME and RFC basics {{{
5974 t_mime_if_not_ascii() {
5977 </dev/null ${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
5978 check
1 0 "${MBOX}" '3647956381 106'
5980 </dev
/null
${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
5982 check 2 0 "${MBOX}" '3964303752 274'
5991 printf 'Hey, you.\nFrom me to you\nCiao\n' |
5992 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5994 check
1 0 "${MBOX}" '3835153597 136'
5995 printf 'Hey, you.\n\nFrom me to you\nCiao.\n' |
5996 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5998 check 2 0 "${MBOX}" '63875210 275'
6001 printf 'Hey, you.\n From me to you\nCiao\n' |
6002 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
6004 check
3 0 "${MBOX}" '465798521 412'
6005 printf 'Hey, you.\nFrom me to you\nCiao\n' |
6006 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
6008 check 4 0 "${MBOX}" '2075263697 655'
6011 printf 'Hey, you.\n From me to you\nCiao\n' |
6012 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6014 check
5 0 "${MBOX}" '601672771 792'
6015 printf 'Hey, you.\nFrom me to you\nCiao\n' |
6016 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6018 check 6 0 "${MBOX}" '3926760595 1034'
6023 t_xxxheads_rfc2047() {
6026 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
6027 -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̲' \
6029 check 1 0 "${MBOX}" '3422562347 371'
6031 # Single word (overlong line split -- bad standard! Requires injection of
6032 # artificial data!! But can be prevented by using RFC 2047 encoding)
6034 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
6035 echo | ${MAILX} ${ARGS} -s "${i}" "${MBOX}"
6036 check
2 0 "${MBOX}" '3317256266 1714'
6038 # Combination of encoded words, space and tabs of varying sort
6040 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6041 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
6042 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
6043 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
6044 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
6045 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
6047 check
3 0 "${MBOX}" '786672837 587'
6049 # Overlong multibyte sequence that must be forcefully split
6050 # todo This works even before v15.0, but only by accident
6052 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6053 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6054 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6055 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
6057 check
4 0 "${MBOX}" '2889557767 655'
6061 echo |
${MAILX} ${ARGS} \
6062 -s "1-1 B2 B3 B4 B5 B6 B\
6063 1-2 B2 B3 B4 B5 B6 B\
6064 1-3 B2 B3 B4 B5 B6 B\
6065 1-4 B2 B3 B4 B5 B6 B\
6066 1-5 B2 B3 B4 B5 B6 B\
6067 1-6 B2 B3 B4 B5 B6 " \
6069 check
5 0 "${MBOX}" '3135161683 293'
6071 # Leading and trailing WS
6073 echo |
${MAILX} ${ARGS} \
6074 -s " 2-1 B2 B3 B4 B5 B6 B\
6075 1-2 B2 B3 B4 B5 B6 B\
6076 1-3 B2 B3 B4 B5 B6 B\
6077 1-4 B2 B3 B4 B5 B6 " \
6079 check
6 0 "${MBOX}" '3221845405 232'
6081 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
6083 echo "Dat Früchtchen riecht häußlich" |
6084 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=test://"$MBOX" \
6086 'Schnödes "Früchtchen" <do@du> (Hä!)'
6087 check
7 0 "${MBOX}" '3681801246 373'
6089 # RFC 2047 in an address field, and iconv involved
6090 if have_feat
iconv; then
6092 ${cat} > .
/.trebox
<<_EOT
6093 From zaza@exam.ple Fri Mar 2 21:31:56 2018
6094 Date: Fri, 2 Mar 2018 20:31:45 +0000
6095 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
6096 To: dude <dude@exam.ple>
6097 Subject: houston(...)
6098 Message-ID: <abra@1>
6100 Content-Type: text/plain; charset=iso-8859-1
6101 Content-Disposition: inline
6102 Content-Transfer-Encoding: 8bit
6105 echo reply |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6106 -Sfullnames -Sreply-in-same-charset \
6107 -Smta=test://"$MBOX" -Rf .
/.trebox
6108 check
8 0 "${MBOX}" '3499372945 285'
6110 t_echoskip
'8:[!ICONV]'
6116 t_iconv_mbyte_base64
() { # TODO uses sed(1) and special *headline*!!
6119 if [ -n "${UTF8_LOCALE}" ] && have_feat multibyte-charsets
&&
6120 have_feat
iconv; then
6121 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1 ||
6122 (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
6125 t_echoskip
'[ICONV/iconv(1):missing conversion(s)]'
6130 t_echoskip
'[no UTF-8 locale or !MULTIBYTE-CHARSETS or !ICONV]'
6135 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1; then
6136 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6137 -Smta=test://"$MBOX" \
6138 -Sescape=! -Smime-encoding=base64
2>.
/.terr
6139 set ttycharset
=utf-8 sendcharsets
=iso-2022-jp
6141 !s Japanese from UTF-8 to ISO-2022-JP
6142 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6144 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6147 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6149 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6152 set ttycharset
=iso-2022-jp charset-7bit
=iso-2022-jp sendcharsets
=utf-8
6154 !s Japanese from ISO-2022-JP to UTF-8
, eh
, no
, also ISO-2022-JP
6155 \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
6157 \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
6160 \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
6162 \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
6165 # May not presume iconv output as long as roundtrip possible [489a7122]
6167 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6168 < "${MBOX}" > ./.tcksum
6169 check 1 - ./.tcksum '3314001564 516'
6170 check 2 - ./.terr '4294967295 0'
6172 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6173 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6174 -S headline="%>%a%m %-18f %-16d %i%-s" \
6175 -Rf "${MBOX}" >./.tlog 2>&1
6176 check 3 0 ./.twrite '1259742080 686'
6177 #check 4 - ./.tlog '3214068822 2123'
6178 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6179 check 4 - ./.txlog '4083300132 2030'
6181 t_echoskip '1-4:[ICONV/iconv(1):ISO-2022-JP unsupported]'
6184 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
6185 ${rm} -f "${MBOX}" ./.twrite
6186 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6187 -Smta=test://"$MBOX" \
6188 -Sescape=! -Smime-encoding=base64 2>./.terr
6189 set ttycharset=utf-8 sendcharsets=euc-jp
6191 !s Japanese from UTF-8 to EUC-JP
6192 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6194 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6197 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6199 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6202 set ttycharset=EUC-JP sendcharsets=utf-8
6204 !s Japanese from EUC-JP to UTF-8
6205 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6207 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6210 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6212 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6216 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6217 < "${MBOX}" > ./.tcksum
6218 check 5 - ./.tcksum '1754179361 469'
6219 check 6 - ./.terr '4294967295 0'
6221 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6222 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6223 -S headline="%>%a%m %-18f %-16d %i%-s" \
6224 -Rf "${MBOX}" >./.tlog 2>&1
6225 check 7 0 ./.twrite '1259742080 686'
6226 #check 8 - ./.tlog '2506063395 2075'
6227 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6228 check 8 - ./.txlog '3192017734 1983'
6230 t_echoskip '5-8:[ICONV/iconv(1):EUC-JP unsupported]'
6236 t_iconv_mainbody() {
6239 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then :; else
6240 t_echoskip '[no UTF-8 locale or !ICONV]'
6245 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6246 -S charset-7bit=us-ascii -S charset-8bit=utf-8 \
6247 -s '–' over-the@rain.bow 2>./.terr
6248 check 1 0 "${MBOX}" '3559538297 250'
6249 check 2 - ./.terr '4294967295 0'
6251 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6252 -S charset-7bit=us-ascii -S charset-8bit=us-ascii \
6253 -s '–' over-the@rain.bow 2>./.terr
6255 check 3 - "${MBOX}" '3559538297 250'
6256 if have_feat uistrings; then
6257 check 4 - ./.terr '271380835 121'
6259 t_echoskip '4:[!UISTRINGS]'
6262 # The different iconv(3) implementations use different replacement sequence
6263 # types (character-wise, byte-wise, and the character(s) used differ)
6264 i="${MAILX_ICONV_MODE}"
6265 if [ -n "${i}" ]; then
6266 printf 'p\nx\n' | ${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
6268 check_ex0 5-1-estat ${j}
6269 check 5-1 - ./.terr '4294967295 0'
6270 if [ ${i} -eq 13 ]; then
6271 check 5-2 - ./.tout '189327996 283' # XXX old (before test MTA)
6272 elif [ ${i} -eq 12 ]; then
6273 check 5-3 - ./.tout '1959197095 283' # XXX old (before test MTA)
6274 elif [ ${i} -eq 3 ]; then
6275 check 5-4 - ./.tout '3544755786 278'
6277 check 5-5 - ./.tout '2381160335 278'
6280 t_echoskip '5:[test unsupported]'
6286 t_binary_mainbody() {
6289 printf 'abra\0\nka\r\ndabra' |
6290 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
6292 check 1 0 "${MBOX}" '1629827 239'
6293 check 2 - ./.terr '4294967295 0'
6295 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
6296 ${MAILX} ${ARGS} -Rf \
6297 -Spipe-application/octet-stream="?* ${cat} > ./.tcat" \
6298 "${MBOX}" >./.tall 2>&1
6299 check 3 0 ./.tall '733582513 319'
6300 check 4 - ./.tcat '3817108933 15'
6301 check 5 - ./.twrite '3817108933 15'
6306 t_mime_force_sendout() {
6309 if have_feat iconv; then :; else
6310 t_echoskip '[!ICONV]'
6315 printf '\150\303\274' > ./.tmba
6316 printf 'ha' > ./.tsba
6317 printf '' > "${MBOX}"
6319 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6321 over-the@rain.bow 2>>${ERR}
6322 check 1 4 "${MBOX}" '4294967295 0'
6324 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6325 -s go -Smime-force-sendout \
6326 over-the@rain.bow 2>>${ERR}
6327 check 2 0 "${MBOX}" '1866273282 219'
6329 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6331 -a ./.tmba over-the@rain.bow 2>>${ERR}
6332 check 3 4 "${MBOX}" '1866273282 219'
6334 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6335 -s go -Smime-force-sendout \
6336 -a ./.tmba over-the@rain.bow 2>>${ERR}
6337 check 4 0 "${MBOX}" '644433809 880'
6339 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6341 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6342 check 5 4 "${MBOX}" '644433809 880'
6344 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6345 -s go -Smime-force-sendout \
6346 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6347 check 6 0 "${MBOX}" '3172365123 1729'
6349 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6351 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6352 check 7 4 "${MBOX}" '3172365123 1729'
6354 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6355 -s go -Smime-force-sendout \
6356 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6357 check 8 0 "${MBOX}" '4002905306 2565'
6362 t_C_opt_customhdr() {
6366 ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6367 -C 'C-One : Custom One Body' \
6368 -C 'C-Two:CustomTwoBody' \
6369 -C 'C-Three: CustomThreeBody ' \
6370 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body, chdr3: chdr3 body ' \
6371 this-goes@nowhere >./.tall 2>&1
6373 ${cat} ./.tall >> "${MBOX}"
6374 check 1 0 "${MBOX}" '2535463301 238'
6377 printf 'm this-goes@nowhere\nbody\n!.
6379 m this-goes2@nowhere\nbody2\n!.
6380 set customhdr=%ccustom1 : custom1 body%c
6381 m this-goes3@nowhere\nbody3\n!.
6382 set customhdr=%ccustom1 : custom1\\, body , \\
6383 custom2: custom2 body , custom-3 : custom3 body ,\\
6384 custom-4:custom4-body %c
6385 m this-goes4@nowhere\nbody4\n!.
6387 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
6388 -C 'C-One : Custom One Body' \
6389 -C 'C-Two:CustomTwoBody' \
6390 -C 'C-Three: CustomThreeBody ' \
6391 -C ' C-Four:CustomFourBody ' \
6392 -C 'C-Five:CustomFiveBody' \
6393 -S customhdr='ch1: b1 , ch2:b2, ch3:b3 ,ch4:b4, ch5: b5 ' \
6396 ${cat} ./.tall >> "${MBOX}"
6397 check 2 0 "${MBOX}" '544085062 1086'
6403 # Operational basics with trivial tests {{{
6407 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
6409 alias a1 ex2@a1.ple "EX3 <ex3@a1.ple>"
6411 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
6413 alias a4 a5 ex1@a4.ple
6415 alias a6 a7 ex1@a6.ple
6429 check 1 0 "${MBOX}" '139467786 277'
6430 check 2 - .tall '1598893942 133'
6432 if have_feat uistrings; then
6433 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6434 commandalias x echo '$?/$^ERRNAME'
6436 alias a:bra! ha@m beb@ra ha@m '' zeb@ra ha@m; x
6438 alias ha@m ham-expansion ha@m '';x
6440 alias beb@ra ceb@ra beb@ra1;x
6442 alias ceb@ra ceb@ra1;x
6460 \alias noexpa@and this@error1;x
6461 \alias ha@m '\noexp@and' expa@and \\noexp@and2;x
6464 \alias noexpa@and2 this@error2;x
6465 \alias expa1@and this@error3;x
6466 \alias expa@and \\expa1@and;x
6471 check 3 0 "${MBOX}" '1513155156 796'
6473 t_echoskip '3:[!UISTRINGS]'
6476 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
6477 # TODO need to somehow provide its contents to the test, then test
6485 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6486 commandalias x echo '$?/$^ERRNAME'
6488 charsetalias latin1 latin15;x
6489 charsetalias latin1;x
6490 charsetalias - latin1;x
6492 charsetalias cp1252 latin1 latin15 utf8 utf8 utf16;x
6493 charsetalias cp1252;x
6494 charsetalias latin15;x
6497 charsetalias - cp1252;x
6498 charsetalias - latin15;x
6499 charsetalias - utf8;x
6501 charsetalias latin1;x
6502 charsetalias - latin1;x
6503 uncharsetalias latin15;x
6504 charsetalias latin1;x
6505 charsetalias - latin1;x
6507 check 1 0 "${MBOX}" '3551595280 433'
6515 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6516 commandalias x echo '$?/$^ERRNAME'
6518 shortcut file1 expansion-of-file1;x
6519 shortcut file2 expansion-of-file2;x
6520 shortcut file3 expansion-of-file3;x
6521 shortcut file4 'expansion of file4' 'file 5' 'expansion of file5';x
6531 check 1 0 "${MBOX}" '1970515669 430'
6539 if have_feat netrc; then :; else
6540 t_echoskip '[!NETRC]'
6546 machine x.local login a1 machine x.local login a2 password p2
6547 machine x.local login a3 password "p 3"
6554 machine *.x.local login a2 password p2-any!
6555 machine y.local login ausr password apass
6559 # and unused default
6560 default login defacc password defpass
6562 ${chmod} 0600 ./.tnetrc
6564 printf 'netrc;echo =$?;netrc c;echo =$?;netr loa;echo =$?;netr s;echo =$?' |
6565 NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6566 check 1 0 "${MBOX}" '2911708535 542'
6568 have_feat uistrings && i='3076722625 893' || i='3808149439 645'
6574 echo ==(re)load cache
6575 netrc load;echo $?/$^ERRNAME
6577 netrc loo a1@x.local
6578 netrc loo a2@x.local
6579 netrc loo a3@x.local
6580 netrc loo a4@x.local
6582 netrc clear;echo $?/$^ERRNAME
6584 netrc loo a2@pop.x.local
6585 netrc loo a2@imap.x.local
6586 netrc loo a2@smtp.x.local
6588 netrc loo a2@nono.smtp.x.local
6589 echo ==[usr@]unknown-host
6591 netrc loo defacc@a.local
6592 netrc loo a1@a.local
6593 ' | NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6594 check 2 0 "${MBOX}" "${i}"
6600 # Operational basics with easy tests {{{
6603 # MTA alias specific part in t_mta_aliases()
6604 # This only tests from command line, rest later on (iff any)
6607 if have_feat uistrings; then :; else
6608 t_echoskip '[!UISTRINGS]'
6613 echo "${cat}" > ./.tcat
6614 ${chmod} 0755 ./.tcat
6617 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6618 -X'alias talias talias@exam.ple' \
6619 './.tfile' ' | ./.tcat > ./.tpipe' 'talias' 'taddr@exam.ple' \
6621 check 1 4 "${MBOX}" '1216011460 138'
6622 check 2 - .tall '4169590008 162'
6625 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6627 -X'alias talias talias@exam.ple' \
6628 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6630 check 3 0 "${MBOX}" '847567042 276'
6631 check 4 - .tall '4294967295 0'
6632 check 5 - .tfile '1216011460 138'
6633 check 6 - .tpipe '1216011460 138'
6636 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6637 -Sexpandaddr=-all,+file,+pipe,+name,+addr \
6638 -X'alias talias talias@exam.ple' \
6639 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6641 check 7 0 "${MBOX}" '3682360102 414'
6642 check 8 - .tall '4294967295 0'
6643 check 9 - .tfile '847567042 276'
6644 check 10 - .tpipe '1216011460 138'
6647 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6648 -Sexpandaddr=-all,+file,-file,+pipe,+name,+addr \
6649 -X'alias talias talias@exam.ple' \
6650 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6652 check 11 4 "${MBOX}" '1010907786 552'
6653 check 12 - .tall '673208446 70'
6654 check 13 - .tfile '847567042 276'
6655 check 14 - .tpipe '1216011460 138'
6657 printf '' > ./.tpipe
6658 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6659 -Sexpandaddr=fail,-all,+file,-file,+pipe,+name,+addr \
6660 -X'alias talias talias@exam.ple' \
6661 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6663 check 15 4 "${MBOX}" '1010907786 552'
6664 check 16 - .tall '3280630252 179'
6665 check 17 - .tfile '847567042 276'
6666 check 18 - .tpipe '4294967295 0'
6669 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6670 -Sexpandaddr=-all,+file,+pipe,-pipe,+name,+addr \
6671 -X'alias talias talias@exam.ple' \
6672 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6674 check 19 4 "${MBOX}" '3359494254 690'
6675 check 20 - .tall '4052857227 91'
6676 check 21 - .tfile '3682360102 414'
6677 check 22 - .tpipe '4294967295 0'
6679 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6680 -Sexpandaddr=fail,-all,+file,+pipe,-pipe,+name,+addr \
6681 -X'alias talias talias@exam.ple' \
6682 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6684 check 23 4 "${MBOX}" '3359494254 690'
6685 check 24 - .tall '2168069102 200'
6686 check 25 - .tfile '3682360102 414'
6687 check 26 - .tpipe '4294967295 0'
6690 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6691 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6692 -X'alias talias talias@exam.ple' \
6693 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6695 check 27 0 "${MBOX}" '3735108703 828'
6696 check 28 - .tall '4294967295 0'
6697 check 29 - .tfile '1010907786 552'
6698 check 30 - .tpipe '1216011460 138'
6700 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6701 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6702 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6704 check 31 4 "${MBOX}" '4225234603 949'
6705 check 32 - .tall '3486613973 73'
6706 check 33 - .tfile '452731060 673'
6707 check 34 - .tpipe '1905076731 121'
6709 printf '' > ./.tpipe
6710 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6711 -Sexpandaddr=fail,-all,+file,+pipe,+name,-name,+addr \
6712 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6714 check 35 4 "${MBOX}" '4225234603 949'
6715 check 36 - .tall '3032065285 182'
6716 check 37 - .tfile '452731060 673'
6717 check 38 - .tpipe '4294967295 0'
6720 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6721 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6722 -X'alias talias talias@exam.ple' \
6723 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6725 check 39 4 "${MBOX}" '4225234603 949'
6726 check 40 - .tall '3863610168 169'
6727 check 41 - .tfile '1975297706 775'
6728 check 42 - .tpipe '130065764 102'
6730 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6731 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6732 -Sadd-file-recipients \
6733 -X'alias talias talias@exam.ple' \
6734 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6736 check 43 4 "${MBOX}" '4225234603 949'
6737 check 44 - .tall '3863610168 169'
6738 check 45 - .tfile '3291831864 911'
6739 check 46 - .tpipe '4072000848 136'
6741 printf '' > ./.tpipe
6742 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6743 -Sexpandaddr=fail,-all,+file,+pipe,+name,+addr,-addr \
6744 -Sadd-file-recipients \
6745 -X'alias talias talias@exam.ple' \
6746 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6748 check 47 4 "${MBOX}" '4225234603 949'
6749 check 48 - .tall '851041772 278'
6750 check 49 - .tfile '3291831864 911'
6751 check 50 - .tpipe '4294967295 0'
6754 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6755 -Sexpandaddr=-all,+addr \
6756 'taddr@exam.ple' 'this@@c.example' \
6758 check 51 4 "${MBOX}" '473729143 1070'
6759 check 52 - .tall '2646392129 66'
6761 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6762 -Sexpandaddr=-all,failinvaddr \
6763 'taddr@exam.ple' 'this@@c.example' \
6765 check 53 4 "${MBOX}" '473729143 1070'
6766 check 54 - .tall '887391555 175'
6769 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6770 -Sthis=taddr@exam.ple -Sexpandaddr \
6771 -c '\$this' -b '\$this' '\$this' \
6773 check 55 4 "${MBOX}" '473729143 1070'
6774 check 56 - .tall '1144578880 139'
6776 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6777 -Sthis=taddr@exam.ple -Sexpandaddr=shquote \
6778 -c '\$this' -b '\$this' '\$this' \
6780 check 57 0 "${MBOX}" '398243793 1191'
6781 check 58 - .tall '4294967295 0'
6784 printf '' > "${MBOX}"
6786 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6787 -Sadd-file-recipients \
6788 -Sexpandaddr=-all,+fcc \
6793 check 59 0 "${MBOX}" '4294967295 0'
6794 check 60 - .tall '4294967295 0'
6795 check 61 - .tfile1 '1067276522 124'
6796 check 62 - .tfile2 '1067276522 124'
6798 printf '' > "${MBOX}"
6800 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6801 -Sadd-file-recipients \
6802 -Sexpandaddr=-all,+file \
6807 check 63 0 "${MBOX}" '4294967295 0'
6808 check 64 - .tall '4294967295 0'
6809 check 65 - .tfile1 '2677253527 248'
6810 check 66 - .tfile2 '2677253527 248'
6812 printf '' > "${MBOX}"
6814 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6815 -Sadd-file-recipients \
6816 -Sexpandaddr=-all,+file,-fcc \
6821 check 67 0 "${MBOX}" '4294967295 0'
6822 check 68 - .tall '4294967295 0'
6823 check 69 - .tfile1 '3493511004 372'
6824 check 70 - .tfile2 '3493511004 372'
6826 printf '' > "${MBOX}"
6828 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6829 -Sadd-file-recipients \
6830 -Sexpandaddr=-all,+fcc,-file \
6835 check 71 4 "${MBOX}" '4294967295 0'
6836 check 72 - .tall '203687556 223'
6837 check 73 - .tfile1 '3493511004 372'
6838 check 74 - .tfile2 '3493511004 372'
6840 printf '' > "${MBOX}"
6842 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6843 -Sadd-file-recipients \
6844 -Sexpandaddr=-all,fail,+addr \
6850 check 75 4 "${MBOX}" '4294967295 0'
6851 check 76 - .tall '4060426468 247'
6852 check 77 - .tfile1 '3493511004 372'
6853 check 78 - .tfile2 '3493511004 372'
6856 printf '' > "${MBOX}"
6858 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6859 -Sexpandaddr=fail,domaincheck \
6863 check 79 0 "${MBOX}" '171635532 120'
6864 check 80 - .tall '4294967295 0'
6867 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6868 -Sexpandaddr=domaincheck \
6870 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6872 check 81 4 "${MBOX}" '2659464839 240'
6873 check 82 - .tall '1119895397 158'
6876 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6877 -Sexpandaddr=fail,domaincheck \
6879 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6881 check 83 4 "${MBOX}" '2659464839 240'
6882 check 84 - .tall '1577313789 267'
6885 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6886 -Sexpandaddr=fail,domaincheck \
6887 -Sexpandaddr-domaincheck=exam.ple,tro.uble \
6889 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6891 check 85 0 "${MBOX}" '1670655701 410'
6892 check 86 - .tall '4294967295 0'
6898 # after: t_expandaddr
6901 if have_feat mta-aliases; then :; else
6902 t_echoskip '[!MTA_ALIASES]'
6907 ${cat} > ./.tali <<- '__EOT'
6913 ex2@a1.ple, <ex3@a1.ple> ,
6915 a2: ex1@a2.ple , ex2@a2.ple,a2_2
6916 a2_2:ex3@a2.ple,ex4@a2.ple
6929 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6930 -Smta-aliases=./.tali \
6931 -b a3 -c a2 a1 > ./.tall 2>&1
6932 check 1 0 "${MBOX}" '1172368381 238'
6933 check 2 - .tall '4294967295 0'
6935 ## xxx The following are actually *expandaddr* tests!!
6937 # May not send plain names over SMTP!
6939 if have_feat smtp; then
6940 echo | ${MAILX} ${ARGS} \
6941 -Smta=smtp://laber.backe -Ssmtp-auth=none \
6942 -Smta-aliases=./.tali \
6943 -b a3 -c a2 a1 > ./.tall 2>&1
6945 check 4 - "${MBOX}" '1172368381 238'
6948 if [ -n "${mtaali}" ] && have_feat uistrings; then
6949 check 5 - .tall '771616226 179'
6951 t_echoskip '5:[!SMTP/!UISTRINGS]'
6954 # xxx for false-positive SMTP test we would need some mocking
6955 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6956 -Sexpandaddr=fail,-name \
6957 -Smta-aliases=./.tali \
6958 -b a3 -c a2 a1 > ./.tall 2>&1
6960 check 7 - "${MBOX}" '1172368381 238'
6961 if have_feat uistrings; then
6962 check 8 - .tall '2834389894 178'
6964 t_echoskip '8:[!UISTRINGS]'
6967 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6968 -Sexpandaddr=-name \
6969 -Smta-aliases=./.tali \
6970 -b a3 -c a2 a1 > ./.tall 2>&1
6971 check 9 4 "${MBOX}" '2322273994 472'
6972 if have_feat uistrings; then
6973 check 10 - .tall '2136559508 69'
6975 t_echoskip '10:[!UISTRINGS]'
6978 echo 'a9:nine@nine.nine' >> ./.tali
6980 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6981 -Sexpandaddr=fail,-name \
6982 -Smta-aliases=./.tali \
6983 -b a3 -c a2 a1 > ./.tall 2>&1
6984 check 11 0 "${MBOX}" '2422268299 722'
6985 check 12 - .tall '4294967295 0'
6988 set expandaddr=-name
6992 !^header insert bcc a3
6998 !^header insert bcc a3
7001 echo and, once again, check that cache is updated
7002 # Enclose one pipe in quotes: immense stress for our stupid address parser:(
7003 !echo "a10:./.tf1,|%s>./.tp1,\\"|%s > ./.tp2\\",./.tf2" >> ./.tali
7008 !^header insert bcc a3
7011 echo trigger happiness
7015 !^header insert bcc "a3 a10"
7018 ' "${cat}" "${cat}" | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7019 -Smta-aliases=./.tali \
7021 check 13 0 "${MBOX}" '550955032 1469'
7022 if have_feat uistrings; then
7023 check 14 - .tall '1795496020 473'
7025 t_echoskip '14:[!UISTRINGS]'
7027 check 15 - .tf1 '3056269950 249'
7028 check 16 - .tp1 '3056269950 249'
7029 check 17 - .tp2 '3056269950 249'
7030 check 18 - .tf2 '3056269950 249'
7032 # TODO t_mta_aliases: n_ALIAS_MAXEXP is compile-time constant,
7033 # TODO need to somehow provide its contents to the test, then test
7041 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
7042 "${TOPDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=test://"$MBOX"
7043 check 1 0 "${MBOX}" '1314354444 13536'
7045 if (echo | gzip -c) >/dev/null 2>&1; then
7047 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
7048 "${MBOX}" | ${MAILX} ${ARGS} \
7049 -X'filetype gz gzip\ -dc gzip\ -c'
7050 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7051 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
7053 check 2 - ./.t.mbox '1314354444 13536'
7054 check 3 - ./.t.out '635961640 103'
7056 t_echoskip '2:[missing gzip(1)]'
7057 t_echoskip '3:[missing gzip(1)]'
7062 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
7068 -X'filetype gz gzip\ -dc gzip\ -c' \
7069 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
7070 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
7071 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7073 -X'filetype gz gzip\ -dc gzip\ -c' \
7074 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
7076 check 4 - ./.t.mbox '2687765142 27092'
7077 check 5 - ./.t.out '2230192693 173'
7086 ${MAILX} ${ARGS} -ef ./.t.mbox
7087 echo ${?} > "${MBOX}"
7089 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
7090 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7091 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
7092 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7094 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
7095 echo ${?} >> "${MBOX}"
7096 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
7097 echo ${?} >> "${MBOX}"
7098 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
7099 echo ${?} >> "${MBOX}"
7100 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
7101 echo ${?} >> "${MBOX}"
7102 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
7103 echo ${?} >> "${MBOX}"
7104 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
7105 echo ${?} >> "${MBOX}"
7106 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
7107 echo ${?} >> "${MBOX}"
7109 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
7110 echo ${?} >> "${MBOX}"
7111 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
7112 echo ${?} >> "${MBOX}"
7113 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
7114 echo ${?} >> "${MBOX}"
7115 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
7116 echo ${?} >> "${MBOX}"
7117 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
7118 echo ${?} >> "${MBOX}"
7119 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
7120 echo ${?} >> "${MBOX}"
7121 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
7122 echo ${?} >> "${MBOX}"
7124 check 1 - "${MBOX}" '1369201287 670'
7128 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
7129 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7130 -r '' -X 'wysh set from=pony1@$LOGNAME'
7131 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
7132 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7133 -r '' -X 'wysh set from=pony2@$LOGNAME'
7134 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
7135 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7136 -r '' -X 'wysh set from=pony3@$LOGNAME'
7138 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7139 echo fh-test size; set autosort=size showname showto
7140 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7141 check 2 0 "${MBOX}" '4286438644 413'
7143 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7144 echo fh-test subject; set autosort=subject showname showto
7145 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7146 check 3 0 "${MBOX}" '3208053922 416'
7148 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7149 echo fh-test from; set autosort=from showto
7150 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7151 check 4 0 "${MBOX}" '4209767839 413'
7153 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7154 echo fh-test to; set autosort=to showto
7155 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7156 check 5 0 "${MBOX}" '2785342736 411'
7162 # Simple, if we need more here, place in a later vim fold!
7165 # Three tests for MIME encoding and (a bit) content classification.
7166 # At the same time testing -q FILE, < FILE and -t FILE
7167 t__put_body > ./.tin
7169 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
7170 -a ./.tin -s "`t__put_subject
`" "${MBOX}"
7171 check 1 0 "${MBOX}" '1088822685 6642'
7174 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
7175 -a ./.tin -s "`t__put_subject
`" -q ./.tin "${MBOX}"
7176 check 2 0 "${MBOX}" '1088822685 6642'
7179 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject
`" && echo &&
7181 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
7182 check 3 0 "${MBOX}" '1088822685 6642'
7184 # Check comments in the header
7186 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
7189 # Noch ein Kommentar
7191 # Nachgestelltes Kommentar
7195 check 4 0 "${MBOX}" '4161555890 124'
7198 printf '' > "${MBOX}"
7199 ( echo 'To?single : ./.tout1 .tout2 ' &&
7200 echo 'CC: ./.tcc1 ./.tcc2' &&
7201 echo 'BcC?sin : ./.tbcc1 .tbcc2 ' &&
7202 echo 'To? : ./.tout3 .tout4 ' &&
7205 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -t -Smta=test://"$MBOX"
7206 check 5 0 './.tout1 .tout2' '2948857341 94'
7207 check 6 - ./.tcc1 '2948857341 94'
7208 check 7 - ./.tcc2 '2948857341 94'
7209 check 8 - './.tbcc1 .tbcc2' '2948857341 94'
7210 check 9 - './.tout3 .tout4' '2948857341 94'
7211 check 10 - "${MBOX}" '4294967295 0'
7216 t_message_injections() {
7217 # Simple, if we need more here, place in a later vim fold!
7220 echo mysig > ./.tmysig
7222 echo some-body | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7223 -Smessage-inject-head=head-inject \
7224 -Smessage-inject-tail="`${cat} .
/.tmysig
`"'\ntail-inject' \
7225 ex@am.ple > ./.tall 2>&1
7226 check 1 0 "${MBOX}" '701778583 143'
7227 check 2 - .tall '4294967295 0' # empty file
7230 ${cat} <<-_EOT > ./.template
7234 Subject: This subject is
7236 Body, body, body me.
7238 < ./.template ${MAILX} ${ARGS} -t -Smta=test://"$MBOX" \
7239 -Smessage-inject-head=head-inject \
7240 -Smessage-inject-tail="`${cat} .
/.tmysig
`\n"'tail-inject' \
7242 check 3 0 "${MBOX}" '2189109479 207'
7243 check 4 - .tall '4294967295 0' # empty file
7249 # TODO More should be in compose mode stuff aka digmsg
7252 ${cat} <<-_EOT > ./.tx
7253 From steffen Sun Feb 18 02:48:40 2018
7254 Date: Sun, 18 Feb 2018 02:48:40 +0100
7257 User-Agent: s-nail v14.9.7
7260 From steffen Sun Feb 18 02:48:42 2018
7261 Date: Sun, 18 Feb 2018 02:48:42 +0100
7264 User-Agent: s-nail v14.9.7
7269 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
7270 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
7271 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
7274 '!@ ./.t3 "./.t 4" ""
7282 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
7283 -a ./.t1 -a './.t 2' \
7284 -s attachment-test \
7285 ex@am.ple > ./.tall 2>&1
7286 check 1 0 "${MBOX}" '2484200149 644'
7287 if have_feat uistrings; then
7288 check 2 - .tall '1928331872 720'
7290 t_echoskip '2:[!UISTRINGS]'
7296 !s This the subject is
7297 !@ ./.t3 "#2" "./.t 4" "#1" ""
7307 !@ ./.t3 "#2" "./.t 4" "#1" ""
7315 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7324 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7338 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7340 check 3 0 "${MBOX}" '3637385058 2335'
7341 if have_feat uistrings; then
7342 check 4 - .tall '2526106274 1910'
7344 t_echoskip '4:[!UISTRINGS]'
7373 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7375 check 5 0 "${MBOX}" '1604688179 2316'
7376 if have_feat uistrings; then
7377 check 6 - .tall '1210753005 508'
7379 t_echoskip '6:[!UISTRINGS]'
7385 </dev/null ${MAILX} ${ARGS} -Smta=test \
7386 -Sstealthmua=noagent -Shostname \
7387 -a ./.t1 -a './.t 2' \
7388 -a ./.t3 -a './.t 4' \
7390 ex@am.ple > ./.tall 2>&1
7391 check 7 0 .tall '1003537919 1262'
7394 </dev/null ${MAILX} ${ARGS} -Smta=test -Sttycharset=utf8 \
7395 -a ./.t1=ascii -a './.t 2'=LATin1 \
7396 -a ./.t3=UTF-8 -a './.t 4'=- \
7398 ex@am.ple > ./.tall 2>&1
7399 check 8 0 .tall '361641281 921'
7401 # input+output charset, no iconv
7402 </dev/null ${MAILX} ${ARGS} -Smta=test \
7403 -a ./.t1=ascii#- -a './.t 2'=LATin1#- \
7404 -a ./.t3=UTF-8#- -a './.t 4'=utf8#- \
7406 ex@am.ple > ./.tall 2>&1
7407 check 9 0 .tall '1357456844 933'
7409 if have_feat iconv; then
7410 printf 'ein \303\244ffchen und ein pferd\n' > .t10-f1
7411 if (< .t10-f1 iconv -f ascii -t utf8) >/dev/null 2>&1; then
7412 </dev/null ${MAILX} ${ARGS} --set mta=test \
7413 --set stealthmua=noagent --set hostname \
7414 --attach ./.t1=-#utf8 \
7415 --attach ./.t10-f1=utf8#latin1 \
7417 ex@am.ple > ./.tall 2>&1
7418 check 10 0 .tall '1257664842 877'
7420 t_echoskip '10:[ICONV/iconv(1):missing conversion(1)]'
7423 t_echoskip '10:[!ICONV]'
7430 # (after attachments)
7434 mkdir ./.ttt || exit 1
7438 : > 'diet\ is \curd.txt'
7439 : > 'diet "is" curd.txt'
7441 : > 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
7442 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
7443 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
7444 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
7446 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
7447 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
7448 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
7449 -a ./.ttt/höde-tröge.txt \
7450 -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 \
7451 -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 \
7452 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
7453 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
7455 check 1 0 "${MBOX}" '3720896054 3088'
7457 # `resend
' test, reusing $MBOX
7458 printf "Resend ./.t2\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7459 check 2 0 ./.t2 '3720896054 3088'
7461 printf "resend ./.t3\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7462 check 3 0 ./.t3 '3979736592 3133'
7464 # And a primitive test for reading messages with invalid parameters
7465 ${cat} <<-_EOT > ./.tinv
7466 From a@b.invalid Wed May 15 12:43:00 2018
7468 Content-Type: multipart/mixed; boundary="1"
7470 This is a multi-part message in MIME format.
7472 Content-Type: text/plain; charset=UTF-8
7473 Content-Transfer-Encoding: quoted-printable
7477 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7478 Content-Transfer-Encoding: 7bit
7479 Content-Disposition: inline
7484 From a@b.invalid Wed May 15 12:43:00 2018
7486 Content-Type: multipart/mixed; boundary="2"
7488 This is a multi-part message in MIME format.
7490 Content-Type: text/plain; charset=UTF-8
7491 Content-Transfer-Encoding: quoted-printable
7495 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7496 Content-Transfer-Encoding: 7bit
7497 Content-Disposition: inline;
7499 filename*998999999999999999999999999999="me-c-d"
7504 From a@b.invalid Wed May 15 12:43:00 2018
7506 Content-Type: multipart/mixed; boundary="3"
7508 This is a multi-part message in MIME format.
7510 Content-Type: text/plain; charset=UTF-8
7511 Content-Transfer-Encoding: quoted-printable
7515 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7516 Content-Transfer-Encoding: 7bit
7517 Content-Disposition: inline;
7518 filename*0="na"; filename*998="me-c-d"
7525 \\headerpick
type ignore Content-Type Content-Disposition
7528 ' | ${MAILX} ${ARGS} -Rf ./.tinv > ./.tall 2> ./.terr
7529 check 4 0 ./.tall '4094731083 905'
7530 if have_feat uistrings && have_feat iconv; then
7531 check 5 - ./.terr '3713266499 473'
7533 t_echoskip '5:[!UISTRINGS or
!ICONV
]'
7539 t_mime_types_load_control() {
7542 if have_feat uistrings; then :; else
7543 t_echoskip '[!UISTRINGS
]'
7548 ${cat} <<-_EOT > ./.tmts1
7549 ? application/mathml+xml mathml
7551 ${cat} <<-_EOT > ./.tmts2
7552 ? x-conference/x-cooltalk ice
7554 ? application/aga-aga aga
7557 ${cat} <<-_EOT > ./.tmts1.mathml
7558 <head>nonsense ML</head>
7560 ${cat} <<-_EOT > ./.tmts2.ice
7563 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.doom
7564 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.aga
7578 ' "${MBOX}" "${MBOX}" |
7580 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
7583 ${cat} "${MBOX}" >> ./.tout
7584 check 1 - ./.tout '2128819500 2441'
7586 echo type | ${MAILX} ${ARGS} -R \
7587 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
7588 -f "${MBOX}" >> ./.tout 2>&1
7589 check 2 0 ./.tout '1125106528 3642'
7595 # Around state machine, after basics {{{
7599 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
7600 commandalias x echo '$?
/$^ERRNAME
'
7601 commandalias y echo '$?
/$^ERRNAME
<$rv>'
7604 alternates a1@b1 a2@b2 a3@b3;x
7606 vput alternates rv;y
7610 vput alternates rv;y
7612 vput alternates rv;y
7614 vput alternates rv;y
7618 alternates a1@b1 a2@b2 a3@b3
7620 vput alternates rv;y
7622 vput alternates rv;y
7624 vput alternates rv;y
7627 alternates a1@b1 a2@b2 a3@b3
7629 vput alternates rv;y
7631 vput alternates rv;y
7633 vput alternates rv;y
7637 alternates a1@b1 a2@b2 a3@b3
7639 vput alternates rv;y
7643 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
7645 ~s all alternates, only a1@b1 remains
7647 ~b a3@b3 a3@c3 a3@d3
7656 alternates a1@b1 a1@c1 a2@b2 a3@b3
7658 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
7660 ~b a3@b3 a3@c3 a3@d3
7667 alternates a1@b1 a2@b2 a3; set allnet
7669 ~s all alternates via allnet, only a1@b1 remains
7671 ~b a3@b3 a3@c3 a3@d3
7680 vput alternates rv;y
7682 vput alternates rv;y
7684 vput alternates rv;y
7686 vput alternates rv;y
7689 vput alternates rv;y
7693 alternates a1@b1 a2@b2;x
7694 vput alternates rv;y
7695 alternates a3@b3 a4@b4;x
7696 vput alternates rv;y
7699 check 1 0 "${MBOX}" '3901995195 542'
7700 if have_feat uistrings; then
7701 check 2 - .tall '1878598364 505'
7703 t_echoskip '2:[!UISTRINGS
]'
7706 # Automatic alternates, also from command line (freezing etc.)
7708 ${cat} <<- __EOT > ./.tin
7709 From trouble-report@desy Wed Jun 6 20:19:28 2018
7710 Date: Wed, 06 Jun 2018 19:58:02 +0200
7711 From: a@b.org, b@b.org, c@c.org
7714 Cc: a@b.org, c@c.org
7716 Message-ID: <20180606175802.dw-cn%a@b.org>
7726 !^header remove subject
7727 !^header insert to b@b.org
7728 !^header insert cc
"a@b.org b@b.org c@c.org"
7731 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7732 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
7733 -Rf ./.tin > ./.tall 2>&1
7734 check 3 0 "${MBOX}" '3184203976 265'
7735 check 4 - .tall '3604001424 44'
7739 set from
=a@b.org
,b@b.org
,c@c.org sender
=a@b.org
7743 !^header remove subject
7744 !^header insert to b@b.org
7745 !^header insert cc
"a@b.org b@b.org c@c.org"
7748 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7749 -Rf ./.tin > ./.tall 2>&1
7750 check 5 0 "${MBOX}" '98184290 530'
7751 check 6 - .tall '3604001424 44'
7753 # And more, with/out -r (and that Sender: vanishs as necessary)
7754 # TODO -r should be the Sender:, which should automatically propagate to
7755 # TODO From: if possible and/or necessary. It should be possible to
7756 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
7757 # TODO arg as appropriate.
7758 # TODO For now we are a bit messy
7761 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7762 -c a@b.example -c b@b.example -c c@c.example \
7763 -S from=a@b.example,b@b.example,c@c.example \
7764 -S sender=a@b.example \
7765 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7766 check 7 0 "${MBOX}" '4275947318 181'
7767 check 8 - .tout '4275947318 181'
7768 check 9 - .tall '4294967295 0'
7770 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7771 -c a@b.example -c b@b.example -c c@c.example \
7772 -S from=a@b.example,b@b.example,c@c.example \
7773 -S sender=a2@b.example \
7774 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7775 check 10 0 "${MBOX}" '1189494079 383'
7776 check 11 - .tout '1189494079 383'
7777 check 12 - .tall '4294967295 0'
7779 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7780 -c a@b.example -c b@b.example -c c@c.example \
7781 -S from=a@b.example,b@b.example,c@c.example \
7782 -S sender=a@b.example \
7783 b@b.example >./.tall 2>&1
7784 check 13 0 "${MBOX}" '2253033142 610'
7785 check 14 - .tall '4294967295 0'
7791 # quote and cmd escapes because this (since Mail times) is worked in the
7792 # big collect() monster of functions
7795 echo 'included
file' > ./.ttxt
7796 { t__x1_msg && t__x2_msg && t__x3_msg &&
7797 t__gen_msg from 'ex4@am.ple
' subject sub4 &&
7798 t__gen_msg from 'eximan
<ex5@am.ple
>' subject sub5 &&
7799 t__gen_mimemsg from 'ex6@am.ple
' subject sub6; } > ./.tmbox
7800 check 1 - ./.tmbox '517368276 2182'
7802 # ~@ is tested with other attachment stuff, ~^ is in compose_edits + digmsg
7804 set Sign
=SignVar sign
=signvar DEAD
=.
/.ttxt
7805 set forward-inject-head quote-inject-head
7806 headerpick
type retain Subject
7807 headerpick forward retain Subject To
7809 !!1 Not escaped. And shell
test last
, right before
!..
7811 !: echo 2 only echoed via colon
7812 !:echo 2:$?
/$^ERRNAME
7813 !_
echo 3 only echoed via underscore
7814 !:echo 3:$?
/$^ERRNAME
7816 !:echo 4:$?
/$^ERRNAME
7817 !<! echo 5 shell
echo included
7818 !:echo 5:$?
/$^ERRNAME
7819 !|
echo 6 pipecmd-pre
; cat; echo 6 pipecmd-post
7820 !:echo 6:$?
/$^ERRNAME
7821 7 and
8 are ~A and ~a
:
7823 !:echo 7:$?
/$^ERRNAME
7825 !:echo 8:$?
/$^ERRNAME
7826 !b
9 added ~b cc
<ex1@am.ple
>
7827 !:echo 9:$?
/$^ERRNAME
7828 !c
10 added ~c c
<ex2@am.ple
>
7829 !:echo 10:$?
/$^ERRNAME
7832 !:echo 11:$?
/$^ERRNAME
7835 !:echo 12:$?
/$^ERRNAME
7838 !:echo 13:$?
/$^ERRNAME
7840 !:echo 13-1:$?
/$^ERRNAME
; set posix
7841 14: ~f
(headerpick
: subject
)
7843 !:echo 14:$?
/$^ERRNAME
; unset posix forward-inject-head quote-inject-head
7844 14.1: ~f
(!posix
: injections
; headerpick
: subject to
)
7846 !:echo 14.1:$?
/$^ERRNAME
; set forward-add-cc
7847 14.2: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr3
)
7849 !:echo 14.2:$?
/$^ERRNAME
; set fullnames
7850 14.3: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr1 fullname
)
7852 !:echo 14.3:$?
/$^ERRNAME
; set nofullnames noforward-add-cc posix
7855 !:echo 15:$?
/$^ERRNAME
7858 !:echo 15.5-1:$?
/$^ERRNAME
7860 !:echo 15.5-2:$?
/$^ERRNAME
7861 16, 17: ~I Sign
, ~i Sign
7863 !:echo 16:$?
/$^ERRNAME
7865 !:echo 17:$?
/$^ERRNAME
7868 !:echo 18:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7871 !:echo 19:$?
/$^ERRNAME
7874 !:echo 20:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7877 !:echo 21:$?
/$^ERRNAME
7878 !: # Initially ~Q was _exactly_ like
7879 28,29 nothing
, 30-34: ~Q
7880 !:echo quote
=<$quote>
7883 !:echo 30:$?
/$^ERRNAME
7886 !:echo 31:$?
/$^ERRNAME
7887 set quote-inject-head quote-inject-tail indentprefix
7888 !:wysh
set quote-inject-head
=%%a quote-inject-tail
=--%%r
7891 !:echo 32:$?
/$^ERRNAME
7892 set noquote-inject-head noquote-inject-tail quote-add-cc
7893 !:set noquote-inject-head noquote-inject-tail quote-add-cc
7896 !:echo 33:$?
/$^ERRNAME
7901 !:echo 34:$?
/$^ERRNAME
7902 unset fullnames
, quote stuff
7903 !:unset quote quote-add-cc fullnames
7906 !:echo 22:$?
/$^ERRNAME
7909 !:echo 23:$?
/$^ERRNAME
7910 24: ~s this new subject
7911 !s
24 did new ~s ubject
7912 !:echo 24:$?
/$^ERRNAME
7913 !t
25 added ~t o
<ex3@am.ple
>
7914 !:echo 25:$?
/$^ERRNAME
7917 !:echo 26.1:$?
/$^ERRNAME
7920 !:echo 26.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7923 !:echo 27.1:$?
/$^ERRNAME
7926 !:echo 27.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7927 and i ~w rite this out to .
/.tmsg
7929 !:echo i ~w
:$?
/$^ERRNAME
7930 !:wysh
set x
=$escape;set escape
=~
7931 ~
!echo shell
command output
7932 ~
:echo shell
:$?
/$^ERRNAME
7933 ~
:wysh
set escape
=$x
7936 !:echo 50 was F
:$?
/$^ERRNAME
7939 !:echo 51 was f
:$?
/$^ERRNAME
7942 !:echo 52 was M
:$?
/$^ERRNAME
7945 !:echo 53 was m
:$?
/$^ERRNAME
; set quote
7948 !:echo 54 was Q
:$?
/$^ERRNAME
7951 !:echo 55 was U
:$?
/$^ERRNAME
7954 !:echo 56 was u
:$?
/$^ERRNAME
7956 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
7957 -Sescape=! -Sindentprefix=' |
' \
7958 ./.tmbox >./.tall 2>./.terr
7960 ${cat} ./.tall >> "${MBOX}"
7961 have_feat filter-html-tagsoup && ck='3877629593 7699' ||
7962 ck='2138694045 7943'
7963 check 2 - "${MBOX}" "${ck}"
7965 if have_feat uistrings && have_feat iconv; then
7966 check 2-err - ./.terr '3575876476 49'
7968 t_echoskip '2-err:[!UISTRINGS or
!ICONV
]'
7970 check 3 - ./.tmsg '3502750368 4445'
7972 # Simple return/error value after *expandaddr* failure test
7973 have_feat filter-html-tagsoup && ck='115245837 7900' ||
7974 ck='2245417271 8144'
7977 !s This a new subject is
7978 !:set expandaddr
=-name
7987 !:alias abcc one@bcc.invalid
7990 !:set expandaddr
=+addr
7992 !:echo $
!/$?
/$^ERRNAME
7994 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7996 -s testsub one@to.invalid >./.tall 2>&1
7997 check 4 0 "${MBOX}" "${ck}"
7998 if have_feat uistrings; then
7999 check 5 - ./.tall '2336041127 212'
8001 check 5 - ./.tall '1818580177 59'
8004 # Modifiers and whitespace indulgence
8006 !:remove
'"${MBOX}"'
8019 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8022 -s testsub one@to.invalid >./.tall 2>./.terr
8023 check 6 4 ./.tall '686767281 95'
8024 [ -f "${MBOX}" ]; check_exn0 7
8025 if have_feat uistrings; then
8026 check 8 - ./.terr '1304637795 199'
8028 t_echoskip '8:[!UISTRINGS
]'
8034 t_compose_edits() { # XXX very rudimentary
8035 # after: t_cmd_escapes
8038 # Something to use as "editor"
8039 ${cat} <<-_EOT > ./.ted.sh
8041 ${cat} <<-__EOT > \${1}
8052 ${chmod} 0755 .ted.sh
8054 # > All these are in-a-row!
8056 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~.
' |
8057 ${MAILX} ${ARGS} -Seditheaders >./.tall 2>&1
8058 check 1 0 ./.tout '3993703854 127'
8059 check 2 - ./.tall '4294967295 0'
8061 ${mv} ./.tall ./.tout
8062 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~e
\n~.
' |
8063 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=./.ted.sh >./.tall 2>&1
8064 check 3 0 ./.tout1 '285981670 116'
8065 check 4 - ./.tout2 '285981670 116'
8066 check 5 - ./.tout3 '285981670 116'
8067 check 6 - ./.tout '4294967295 0'
8068 check 7 - ./.tall '4294967295 0'
8069 ${rm} ./.tout1 ./.tout2 ./.tout3
8071 # Note t_compose_hooks adds ~^ stress tests
8072 ${mv} ./.tout ./.tout1
8073 ${mv} ./.tall ./.tout2
8075 mail .
/.tout
\n!s This subject is
\nThis body is
8081 !^header insert fcc .
/.tout
8082 !^header insert fcc .tout1
8083 !^header insert fcc .
/.tout2
8086 !^header remove-at fcc
2
8087 !^header remove-at fcc
2
8091 !^header insert fcc .
/.tout
8095 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8096 check 8 0 ./.tout '3993703854 127'
8097 check 9 - ./.tout1 '4294967295 0'
8098 check 10 - ./.tout2 '4294967295 0'
8099 check 11 - ./.tall '1857504914 342'
8101 # < No longer in-a-row
8103 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >./.tall 2>&1
8105 Subject: Fcc via -t test
8109 check 12 0 ./.ttout '1289478830 122'
8110 check 13 - ./.tall '4294967295 0'
8112 # This test assumes code of `^' and
`digmsg' is shared: see t_digmsg()
8113 echo 'b 1' > ./.t' x 1'
8114 echo 'b 2' > ./.t' x 2'
8117 !^header insert subject subject
8123 !^attachment insert "$i"
8129 !^attachment insert '"'"'./.t x 2'"'"'
8133 !^attachment remove "$i"
8137 !^attachment insert $'"'"'\\$i'"'"'
8145 !^a attribute-set "$i" filenames " cannot wait for you "
8149 !^a attribute-set "$i" filename " cannot wait for you "
8155 !^a attribute-set-at 2 "filename" "private eyes"
8159 !^a attribute-set-at 2 content-description "private c-desc"
8163 !^a attribute-set-at 2 content-ID "priv invd c-id"
8167 !^a attribute-set-at 2 content-TyPE tExT/mARkLO
8171 !^a attribute-set-at 2 content-TyPE ""
8176 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8177 check 14 0 ./.tall '3491667030 1565'
8178 check 15 - ./.tatt '1685063733 636'
8183 t_digmsg() { # XXX rudimentary; <> compose_edits()?
8187 mail ./.tout\n!s This subject is\nThis body is
8190 !:digmsg - header list
8191 !:digmsg - header show subject
8192 !:digmsg - header show to
8193 !:digmsg - header remove to
8194 !:digmsg - header list
8195 !:digmsg - header show to
8199 !:digmsg - header list; readall x; echon "<$x>";
8200 !:digmsg - header show subject;readall x;echon "<$x>";;
8203 !: # nothing here as is comment
8204 !^header insert fcc ./.tbox
8207 !:digmsg - header list
8208 !:digmsg - header show fcc
8212 !:digmsg - header list
8213 !:digmsg - header show fcc
8214 !:digmsg - header insert fcc ./.tfcc
8223 digmsg 1 header list
8224 digmsg 1 header show subject
8229 digmsg 1 header list; echo $?/$^ERRNAME
8230 digmsg create -; echo $?/$^ERRNAME
8232 ! %s ./.tfcc > ./.tcat
8233 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
8235 mail nowhere@exam.ple
8237 !:digmsg create -; echo $?/$^ERRNAME;\\
8238 digmsg create 1; echo $?/$^ERRNAME;\\
8239 digmsg create 2; echo $?/$^ERRNAME
8241 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8243 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8247 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8249 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8251 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8255 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8257 !:digmsg remove -; echo $?/$^ERRNAME;\\
8258 digmsg remove 1; echo $?/$^ERRNAME;\\
8259 digmsg remove 2; echo $?/$^ERRNAME;
8261 echo ======= new game new fun!
8264 !:set expandaddr=-name
8266 !^ header insert to two@to.invalid
8269 !^ header insert cc no-name-allowed
8271 !^ header insert cc one@cc.invalid
8274 !:alias abcc one@bcc.invalid
8275 !^ header insert bcc abcc
8277 !:set expandaddr=+addr
8278 !^ header insert bcc abcc
8279 !:echo $!/$?/$^ERRNAME
8282 ' "${cat}" "${sed}" |
8283 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8284 check 1 0 "$MBOX" '665881681 179'
8285 have_feat uistrings && i='4159482825 1372' || i='2254509488 1103'
8286 check 2 - ./.tall "${i}"
8287 check 3 - ./.tfcc '3993703854 127'
8288 check 4 - ./.tempty '4294967295 0'
8289 check 5 - ./.tcat '2157992522 256'
8294 t_on_main_loop_tick() {
8297 if have_feat cmd-vexpr; then :; else
8298 t_echoskip '[!CMD_VEXPR]'
8314 set on-main-loop-tick=omlt
8317 echo calling bla;call bla
8320 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8321 check 1 0 ./.tall '3697651500 130'
8326 t_on_program_exit() {
8330 -X 'define x {' -X 'echo jay' -X '}' -X x -Son-program-exit=x \
8332 check 1 0 ./.tall '2820891503 4'
8335 -X 'define x {' -X 'echo jay' -X '}' -X q -Son-program-exit=x \
8337 check 2 0 ./.tall '2820891503 4'
8339 </dev/null ${MAILX} ${ARGS} \
8340 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8342 check 3 0 ./.tall '2820891503 4'
8344 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8345 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8346 -s subject -. hey@you \
8348 check 4 0 ./.tall '2820891503 4'
8349 check 5 - "$MBOX" '561900352 118'
8355 # Heavy use of/rely on state machine (behaviour) and basics {{{
8356 t_compose_hooks() { # {{{ TODO monster
8359 if have_feat uistrings &&
8360 have_feat cmd-csop && have_feat cmd-vexpr; then :; else
8361 t_echoskip '[!UISTRINGS/!CMD_CSOP/!CMD_VEXPR]'
8366 (echo line one&&echo line two&&echo line three) > ./.treadctl
8367 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
8369 # Supposed to extend t_compose_edits with ~^ stress tests!
8370 ${cat} <<'__EOT__' > ./.trc
8372 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8375 vput csop es substr "$1" 0 1
8380 define read_mline_res {
8381 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8382 echo $len/$es/$^ERRNAME: $hl
8383 if [ $es -ne $^ERR-NONE ]
8384 xcall bail read_mline_res
8386 \xcall read_mline_res
8391 echo "~^header list"; read hl; echo $hl;\
8392 call xerr "$hl" "in_addr ($xh) 0-1"
8394 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8395 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
8396 echo "~^header insert $xh <${xh}2@exam.ple>";\
8397 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
8398 echo "~^header insert $xh ${xh}3@exam.ple";\
8399 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
8400 echo "~^header list $xh"; read hl; echo $hl;\
8401 call xerr "$hl" "ins_addr $xh 1-4"
8402 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
8405 if [ "$t_remove" == "" ]
8409 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
8410 echo "~^header remove $xh"; read es; vput csop es substr $es 0 3
8412 xcall bail "ins_addr $xh 2-2"
8414 echo "~^header list $xh"; read es; vput csop es substr $es 0 3
8416 xcall bail "ins_addr $xh 2-3"
8418 echo "~^header show $xh"; read es; vput csop es substr $es 0 3
8420 xcall bail "ins_addr $xh 2-4"
8424 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8425 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
8426 echo "~^header insert $xh <${xh}2@exam.ple>";\
8427 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
8428 echo "~^header insert $xh ${xh}3@exam.ple";\
8429 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
8430 echo "~^header list $xh"; read hl; echo $hl;\
8431 call xerr "$hl" "ins_addr $xh 3-4"
8432 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
8435 echo "~^header remove-at $xh 1"; read es;\
8436 call xerr $es "ins_addr $xh 3-6"
8437 echo "~^header remove-at $xh 1"; read es;\
8438 call xerr $es "ins_addr $xh 3-7"
8439 echo "~^header remove-at $xh 1"; read es;\
8440 call xerr $es "ins_addr $xh 3-8"
8441 echo "~^header remove-at $xh 1"; read es;\
8442 vput csop es substr $es 0 3
8444 xcall bail "ins_addr $xh 3-9"
8446 echo "~^header remove-at $xh T"; read es;\
8447 vput csop es substr $es 0 3
8449 xcall bail "ins_addr $xh 3-10"
8451 echo "~^header list $xh"; read es;\
8452 vput csop es substr $es 0 3
8454 xcall bail "ins_addr $xh 3-11"
8456 echo "~^header show $xh"; read es;\
8457 vput csop es substr $es 0 3
8459 xcall bail "ins_addr $xh 3-12"
8463 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8464 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
8465 echo "~^header insert $xh <${xh}2@exam.ple>\ (comment)\ \\\"Quot(e)d\\\"";\
8466 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
8467 echo "~^header insert $xh ${xh}3@exam.ple";\
8468 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
8469 echo "~^header list $xh"; read hl; echo $hl;\
8470 call xerr "$hl" "header list $xh 3-4"
8471 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
8474 echo "~^header remove-at $xh 3"; read es;\
8475 call xerr $es "ins_addr $xh 4-6"
8476 echo "~^header remove-at $xh 2"; read es;\
8477 call xerr $es "ins_addr $xh 4-7"
8478 echo "~^header remove-at $xh 1"; read es;\
8479 call xerr $es "ins_addr $xh 4-8"
8480 echo "~^header remove-at $xh 1"; read es;\
8481 vput csop es substr $es 0 3
8483 xcall bail "ins_addr $xh 4-9"
8485 echo "~^header remove-at $xh T"; read es;\
8486 vput csop es substr $es 0 3
8488 xcall bail "ins_addr $xh 4-10"
8490 echo "~^header list $xh"; read es;\
8491 vput csop es substr $es 0 3
8493 xcall bail "ins_addr $xh 4-11"
8495 echo "~^header show $xh"; read es;\
8496 vput csop es substr $es 0 3
8498 xcall bail "ins_addr $xh 4-12"
8502 wysh set xh=$1 mult=$2
8503 echo "~^header list"; read hl; echo $hl;\
8504 call xerr "$hl" "ins_ref ($xh) 0-1"
8506 echo "~^header insert $xh <$xh@exam.ple>";\
8507 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
8509 echo "~^header insert $xh <${xh}2@exam.ple>";\
8510 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
8511 echo "~^header insert $xh ${xh}3@exam.ple";\
8512 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
8514 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
8515 vput csop es substr $es 0 3
8517 xcall bail "ins_ref $xh 1-4"
8521 echo "~^header list $xh"; read hl; echo $hl;\
8522 call xerr "$hl" "ins_ref $xh 1-5"
8523 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
8526 if [ "$t_remove" == "" ]
8530 echo "~^header remove $xh"; read es;\
8531 call xerr $es "ins_ref $xh 2-1"
8532 echo "~^header remove $xh"; read es;\
8533 vput csop es substr $es 0 3
8535 xcall bail "ins_ref $xh 2-2"
8537 echo "~^header list $xh"; read es;\
8538 vput csop es substr $es 0 3
8540 xcall bail "$es ins_ref $xh 2-3"
8542 echo "~^header show $xh"; read es;\
8543 vput csop es substr $es 0 3
8545 xcall bail "ins_ref $xh 2-4"
8549 echo "~^header insert $xh <$xh@exam.ple>";\
8550 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
8552 echo "~^header insert $xh <${xh}2@exam.ple>";\
8553 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
8554 echo "~^header insert $xh ${xh}3@exam.ple";\
8555 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
8557 echo "~^header list $xh";\
8558 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
8559 echo "~^header show $xh";\
8560 read es; call xerr $es "ins_ref $xh 3-5"
8563 echo "~^header remove-at $xh 1"; read es;\
8564 call xerr $es "ins_ref $xh 3-6"
8565 if [ $mult -ne 0 ] && [ $xh != subject ]
8566 echo "~^header remove-at $xh 1"; read es;\
8567 call xerr $es "ins_ref $xh 3-7"
8568 echo "~^header remove-at $xh 1"; read es;\
8569 call xerr $es "ins_ref $xh 3-8"
8571 echo "~^header remove-at $xh 1"; read es;\
8572 vput csop es substr $es 0 3
8574 xcall bail "ins_ref $xh 3-9"
8576 echo "~^header remove-at $xh T"; read es;\
8577 vput csop es substr $es 0 3
8579 xcall bail "ins_ref $xh 3-10"
8581 echo "~^header show $xh"; read es;\
8582 vput csop es substr $es 0 3
8584 xcall bail "ins_ref $xh 3-11"
8588 echo "~^header insert $xh <$xh@exam.ple> ";\
8589 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
8591 echo "~^header insert $xh <${xh}2@exam.ple> ";\
8592 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
8593 echo "~^header insert $xh ${xh}3@exam.ple";\
8594 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
8596 echo "~^header list $xh"; read hl; echo $hl;\
8597 call xerr "$hl" "ins_ref $xh 4-4"
8598 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
8601 if [ $mult -ne 0 ] && [ $xh != subject ]
8602 echo "~^header remove-at $xh 3"; read es;\
8603 call xerr $es "ins_ref $xh 4-6"
8604 echo "~^header remove-at $xh 2"; read es;\
8605 call xerr $es "ins_ref $xh 4-7"
8607 echo "~^header remove-at $xh 1"; read es;\
8608 call xerr $es "ins_ref $xh 4-8"
8609 echo "~^header remove-at $xh 1"; read es;\
8610 vput csop es substr $es 0 3
8612 xcall bail "ins_ref $xh 4-9"
8614 echo "~^header remove-at $xh T"; read es;\
8615 vput csop es substr $es 0 3
8617 xcall bail "ins_ref $xh 4-10"
8619 echo "~^header show $xh"; read es;\
8620 vput csop es substr $es 0 3
8622 xcall bail "ins_ref $xh 4-11"
8627 # In collect.c order
8629 call ins_ref sender 0 # Not a "ref", but works
8633 call ins_addr reply-To
8634 call ins_addr mail-Followup-to
8635 call ins_ref messAge-id 0
8636 call ins_ref rEfErEncEs 1
8637 call ins_ref in-Reply-to 1
8638 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
8639 call ins_addr freeForm1
8640 call ins_addr freeform2
8642 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
8644 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
8652 echo "~^attachment";\
8653 read hl; echo $hl; vput csop es substr "$hl" 0 3
8655 xcall bail "attach 0-1"
8658 echo "~^attach attribute ./.treadctl";\
8659 read hl; echo $hl; vput csop es substr "$hl" 0 3
8661 xcall bail "attach 0-2"
8663 echo "~^attachment attribute-at 1";\
8664 read hl; echo $hl; vput csop es substr "$hl" 0 3
8666 xcall bail "attach 0-3"
8669 echo "~^attachment insert ./.treadctl=ascii";\
8670 read hl; echo $hl; call xerr "$hl" "attach 1-1"
8671 echo "~^attachment list";\
8672 read es; echo $es;call xerr "$es" "attach 1-2"
8674 echo "~^attachment attribute ./.treadctl";\
8675 read es; echo $es;call xerr "$es" "attach 1-3"
8677 echo "~^attachment attribute .treadctl";\
8678 read es; echo $es;call xerr "$es" "attach 1-4"
8680 echo "~^attachment attribute-at 1";\
8681 read es; echo $es;call xerr "$es" "attach 1-5"
8684 echo "~^attachment attribute-set ./.treadctl filename rctl";\
8685 read es; echo $es;call xerr "$es" "attach 1-6"
8686 echo "~^attachment attribute-set .treadctl content-description Au";\
8687 read es; echo $es;call xerr "$es" "attach 1-7"
8688 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
8689 read es; echo $es;call xerr "$es" "attach 1-8"
8691 echo "~^attachment attribute ./.treadctl";\
8692 read es; echo $es;call xerr "$es" "attach 1-9"
8694 echo "~^attachment attribute .treadctl";\
8695 read es; echo $es;call xerr "$es" "attach 1-10"
8697 echo "~^attachment attribute rctl";\
8698 read es; echo $es;call xerr "$es" "attach 1-11"
8700 echo "~^attachment attribute-at 1";\
8701 read es; echo $es;call xerr "$es" "attach 1-12"
8705 echo "~^attachment insert ./.tattach=latin1";\
8706 read hl; echo $hl; call xerr "$hl" "attach 2-1"
8707 echo "~^attachment list";\
8708 read es; echo $es;call xerr "$es" "attach 2-2"
8710 echo "~^attachment attribute ./.tattach";\
8711 read es; echo $es;call xerr "$es" "attach 2-3"
8713 echo "~^attachment attribute .tattach";\
8714 read es; echo $es;call xerr "$es" "attach 2-4"
8716 echo "~^attachment attribute-at 2";\
8717 read es; echo $es;call xerr "$es" "attach 2-5"
8720 echo "~^attachment attribute-set ./.tattach filename tat";\
8721 read es; echo $es;call xerr "$es" "attach 2-6"
8723 "~^attachment attribute-set .tattach content-description Au2";\
8724 read es; echo $es;call xerr "$es" "attach 2-7"
8725 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
8726 read es; echo $es;call xerr "$es" "attach 2-8"
8728 "~^attachment attribute-set-at 2 content-type application/x-sh";\
8729 read es; echo $es;call xerr "$es" "attach 2-9"
8731 echo "~^attachment attribute ./.tattach";\
8732 read es; echo $es;call xerr "$es" "attach 2-10"
8734 echo "~^attachment attribute .tattach";\
8735 read es; echo $es;call xerr "$es" "attach 2-11"
8737 echo "~^attachment attribute tat";\
8738 read es; echo $es;call xerr "$es" "attach 2-12"
8740 echo "~^attachment attribute-at 2";\
8741 read es; echo $es;call xerr "$es" "attach 2-13"
8745 if [ "$t_remove" == "" ]
8749 echo "~^attachment remove ./.treadctl"; read es;\
8750 call xerr $es "attach 3-1"
8751 echo "~^attachment remove ./.tattach"; read es;\
8752 call xerr $es "attach 3-2"
8753 echo "~^ attachment remove ./.treadctl"; read es;\
8754 vput csop es substr $es 0 3
8756 xcall bail "attach 3-3"
8758 echo "~^ attachment remove ./.tattach"; read es;\
8759 vput csop es substr $es 0 3
8761 xcall bail "attach 3-4"
8763 echo "~^attachment list"; read es;\
8764 vput csop es substr $es 0 3
8766 xcall bail "attach 3-5"
8770 echo "~^attachment insert ./.tattach=latin1";\
8771 read hl; echo $hl; call xerr "$hl" "attach 4-1"
8772 echo "~^attachment insert ./.tattach=latin1";\
8773 read hl; echo $hl; call xerr "$hl" "attach 4-2"
8774 echo "~^attachment list";\
8775 read es; echo $es;call xerr "$es" "attach 4-3"
8777 echo "~^ attachment remove .tattach"; read es;\
8778 vput csop es substr $es 0 3
8780 xcall bail "attach 4-4 $es"
8782 echo "~^attachment remove-at T"; read es;\
8783 vput csop es substr $es 0 3
8785 xcall bail "attach 4-5"
8787 echo "~^attachment remove ./.tattach"; read es;\
8788 call xerr $es "attach 4-6"
8789 echo "~^attachment remove ./.tattach"; read es;\
8790 call xerr $es "attach 4-7"
8791 echo "~^ attachment remove ./.tattach"; read es;\
8792 vput csop es substr $es 0 3
8794 xcall bail "attach 4-8 $es"
8796 echo "~^attachment list"; read es;\
8797 vput csop es substr $es 0 3
8799 xcall bail "attach 4-9"
8803 echo "~^attachment insert ./.tattach=latin1";\
8804 read hl; echo $hl; call xerr "$hl" "attach 5-1"
8805 echo "~^attachment insert ./.tattach=latin1";\
8806 read hl; echo $hl; call xerr "$hl" "attach 5-2"
8807 echo "~^attachment insert ./.tattach=latin1";\
8808 read hl; echo $hl; call xerr "$hl" "attach 5-3"
8809 echo "~^attachment list";\
8810 read es; echo $es;call xerr "$es" "attach 5-4"
8813 echo "~^attachment remove-at 3"; read es;\
8814 call xerr $es "attach 5-5"
8815 echo "~^attachment remove-at 3"; read es;\
8816 vput csop es substr $es 0 3
8818 xcall bail "attach 5-6"
8820 echo "~^attachment remove-at 2"; read es;\
8821 call xerr $es "attach 5-7"
8822 echo "~^attachment remove-at 2"; read es;\
8823 vput csop es substr $es 0 3
8825 xcall bail "attach 5-8"
8827 echo "~^attachment remove-at 1"; read es;\
8828 call xerr $es "attach 5-9"
8829 echo "~^attachment remove-at 1"; read es;\
8830 vput csop es substr $es 0 3
8832 xcall bail "attach 5-10"
8835 echo "~^attachment list"; read es;\
8836 vput csop es substr $es 0 3
8838 xcall bail "attach 5-11"
8842 echo "~^attachment insert ./.tattach=latin1";\
8843 read hl; echo $hl; call xerr "$hl" "attach 6-1"
8844 echo "~^attachment insert ./.tattach=latin1";\
8845 read hl; echo $hl; call xerr "$hl" "attach 6-2"
8846 echo "~^attachment insert ./.tattach=latin1";\
8847 read hl; echo $hl; call xerr "$hl" "attach 6-3"
8848 echo "~^attachment list";\
8849 read es; echo $es;call xerr "$es" "attach 6-4"
8852 echo "~^attachment remove-at 1"; read es;\
8853 call xerr $es "attach 6-5"
8854 echo "~^attachment remove-at 1"; read es;\
8855 call xerr $es "attach 6-6"
8856 echo "~^attachment remove-at 1"; read es;\
8857 call xerr $es "attach 6-7"
8858 echo "~^attachment remove-at 1"; read es;\
8859 vput csop es substr $es 0 3
8861 xcall bail "attach 6-8"
8864 echo "~^attachment list"; read es;\
8865 vput csop es substr $es 0 3
8867 xcall bail "attach 6-9"
8879 echo on-compose-enter, mailx-command<$mailx-command>
8880 alternates alter1@exam.ple alter2@exam.ple
8882 set autocc='alter1@exam.ple alter2@exam.ple'
8883 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8884 echo mailx-subject<$mailx-subject>
8885 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8886 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8887 mailx-raw-bcc<$mailx-raw-bcc>
8888 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8889 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8890 digmsg create - -;echo $?/$!/$^ERRNAME;\
8891 digmsg - header list;\
8892 digmsg remove -;echo $?/$!/$^ERRNAME
8893 digmsg create -;echo $?/$!/$^ERRNAME;\
8894 digmsg - header list;readall x;echon $x;\
8895 digmsg remove -;echo $?/$!/$^ERRNAME
8898 echo on-compose-leave, mailx-command<$mailx-command>
8900 eval alternates $al alter3@exam.ple alter4@exam.ple
8902 set autobcc='alter3@exam.ple alter4@exam.ple'
8903 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8904 echo mailx-subject<$mailx-subject>
8905 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8906 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8907 mailx-raw-bcc<$mailx-raw-bcc>
8908 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8909 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8910 digmsg create - -;echo $?/$!/$^ERRNAME;\
8911 digmsg - header list;\
8912 digmsg remove -;echo $?/$!/$^ERRNAME
8913 digmsg create -;echo $?/$!/$^ERRNAME;\
8914 digmsg - header list;readall x;echon $x;\
8915 digmsg remove -;echo $?/$!/$^ERRNAME
8918 echo on-compose-cleanup, mailx-command<$mailx-command>
8921 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8922 echo mailx-subject<$mailx-subject>
8923 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8924 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8925 mailx-raw-bcc<$mailx-raw-bcc>
8926 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8927 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8928 # XXX error message variable digmsg create - -;echo $?/$!/$^ERRNAME;\
8929 digmsg - header list;\
8930 digmsg remove -;echo $?/$!/$^ERRNAME
8931 # ditto digmsg create -;echo $?/$!/$^ERRNAME;\
8932 digmsg - header list;readall x;echon $x;\
8933 digmsg remove -;echo $?/$!/$^ERRNAME
8935 wysh set on-compose-splice=t_ocs \
8936 on-compose-enter=t_oce on-compose-leave=t_ocl \
8937 on-compose-cleanup=t_occ
8940 printf 'm this-goes@nowhere\nbody\n!.\n' |
8941 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8942 -X'source ./.trc' -Smta=test://"$MBOX" \
8944 ${cat} ./.tall >> "${MBOX}"
8945 check 1 0 "${MBOX}" '1646284089 10565'
8948 printf 'm this-goes@nowhere\nbody\n!.\n' |
8949 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8950 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
8952 ${cat} ./.tall >> "${MBOX}"
8953 check 2 0 "${MBOX}" '700681006 12851'
8957 # Some state machine stress, shell compose hook, localopts for hook, etc.
8958 # readctl in child. ~r as HERE document
8960 printf 'm ex@am.ple\nbody\n!.
8961 echon ${mailx-command}${mailx-subject}
8962 echon ${mailx-from}${mailx-sender}
8963 echon ${mailx-to}${mailx-cc}${mailx-bcc}
8964 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
8965 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
8966 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
8967 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
8968 -Smta=test://"$MBOX" \
8971 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8974 vput csop es substr "$1" 0 1
8979 define read_mline_res {
8980 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8981 echo $len/$es/$^ERRNAME: $hl
8982 if [ $es -ne $^ERR-NONE ]
8983 xcall bail read_mline_res
8985 \xcall read_mline_res
8989 vput vexpr i + 1 "$2"
8991 vput vexpr j % $i 10
8998 eval \\$j _work $1 $i
9001 vput vexpr i + $i "$1"
9005 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
9006 echo read:$es/$en: $line
9007 if [ "${es}" -ne -1 ]
9010 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
9015 echo "~^header list"; read hl; echo $hl;\
9016 vput csop es substr "$hl" 0 1
9018 xcall bail "header list"
9021 call _work 1; echo $?
9022 echo "~^header insert cc splicy\ diet\ <splice@exam.ple>\ spliced";\
9023 read es; echo $es; vput csop es substr "$es" 0 1
9025 xcall bail "be diet"
9027 echo "~^header insert cc <splice2@exam.ple>";\
9028 read es; echo $es; vput csop es substr "$es" 0 1
9030 xcall bail "be diet2"
9033 call _work 2; echo $?
9034 echo "~^header insert bcc juicy\ juice\ <juice@exam.ple>\ spliced";\
9035 read es; echo $es;vput csop es substr "$es" 0 1
9037 xcall bail "be juicy"
9039 echo "~^header insert bcc juice2@exam.ple";\
9040 read es; echo $es;vput csop es substr "$es" 0 1
9042 xcall bail "be juicy2"
9044 echo "~^header insert bcc juice3\ <juice3@exam.ple>";\
9045 read es; echo $es;vput csop es substr "$es" 0 1
9047 xcall bail "be juicy3"
9049 echo "~^header insert bcc juice4@exam.ple";\
9050 read es; echo $es;vput csop es substr "$es" 0 1
9052 xcall bail "be juicy4"
9055 echo "~^header remove-at bcc 3";\
9056 read es; echo $es;vput csop es substr "$es" 0 1
9058 xcall bail "remove juicy5"
9060 echo "~^header remove-at bcc 2";\
9061 read es; echo $es;vput csop es substr "$es" 0 1
9063 xcall bail "remove juicy6"
9065 echo "~^header remove-at bcc 3";\
9066 read es; echo $es;vput csop es substr "$es" 0 3
9068 xcall bail "failed to remove-at"
9070 # Add duplicates which ought to be removed!
9071 echo "~^header insert bcc juice4@exam.ple";\
9072 read es; echo $es;vput csop es substr "$es" 0 1
9074 xcall bail "be juicy4-1"
9076 echo "~^header insert bcc juice4@exam.ple";\
9077 read es; echo $es;vput csop es substr "$es" 0 1
9079 xcall bail "be juicy4-2"
9081 echo "~^header insert bcc juice4@exam.ple";\
9082 read es; echo $es;vput csop es substr "$es" 0 1
9084 xcall bail "be juicy4-3"
9089 call _work 3; echo $?
9091 vput ! i echo just knock if you can hear me;\
9093 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
9095 echon shell-cmd says $?/$^ERRNAME: $i
9096 echo "~x will not become interpreted, we are reading until __EOT"
9098 read r_status; echo "~~r status output: $r_status"
9099 echo "~:echo $? $! $^ERRNAME"
9101 echo "~~r status from parent: $r_status"
9104 call _work 4; echo $?
9105 vput cwd cwd;echo cwd:$?
9106 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
9110 call _work 5; echo $?
9111 echo "~^header show MAILX-Command"; read es;\
9112 call xerr $es "t_header 1000"; call read_mline_res
9113 echo "~^header show MAILX-raw-TO"; read es;\
9114 call xerr $es "t_header 1001"; xcall read_mline_res
9116 echoerr IT IS WRONG IF YOU SEE THIS
9119 echo on-compose-enter, mailx-command<$mailx-command>
9120 set t_oce autobcc=oce@exam.ple
9121 alternates alter1@exam.ple alter2@exam.ple
9123 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9124 echo mailx-subject<$mailx-subject>
9125 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9126 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9127 mailx-raw-bcc<$mailx-raw-bcc>
9128 echo mailx-orig-from<$mailx-orig-from> \
9129 mailx-orig-to<$mailx-orig-to> \
9130 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9133 echo on-compose-leave, mailx-command<$mailx-command>
9134 set t_ocl autocc=ocl@exam.ple
9136 alternates alter3@exam.ple alter4@exam.ple
9138 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9139 echo mailx-subject<$mailx-subject>
9140 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9141 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9142 mailx-raw-bcc<$mailx-raw-bcc>
9143 echo mailx-orig-from<$mailx-orig-from> \
9144 mailx-orig-to<$mailx-orig-to> \
9145 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9148 echo on-compose-cleanup, mailx-command<$mailx-command>
9149 set t_occ autocc=occ@exam.ple
9152 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9153 echo mailx-subject<$mailx-subject>
9154 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9155 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9156 mailx-raw-bcc<$mailx-raw-bcc>
9157 echo mailx-orig-from<$mailx-orig-from> \
9158 mailx-orig-to<$mailx-orig-to> \
9159 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9161 wysh set on-compose-splice=t_ocs \
9162 on-compose-splice-shell="read ver;echo t_ocs-shell;\
9163 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
9164 on-compose-enter=t_oce on-compose-leave=t_ocl \
9165 on-compose-cleanup=t_occ
9168 ${cat} ./.tnotes >> "${MBOX}"
9169 check 3 - "${MBOX}" '3986011319 2437'
9171 # Reply, forward, resend, Resend
9179 set from="du <f2@z>" stealthmua=noagent
9183 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Snomemdebug -Sescape=! \
9185 check_ex0 4-intro-estat
9188 echo start: $? $! $^ERRNAME
9190 echo File: $? $! $^ERRNAME;echo;echo
9192 this is content of reply 1
9194 echo reply 1: $? $! $^ERRNAME;echo;echo
9196 this is content of Reply 1 2
9198 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
9199 forward 1 fwdex@am.ple
9200 this is content of forward 1
9202 echo forward 1: $? $! $^ERRNAME;echo;echo
9203 wysh set forward-inject-head=$'"'"'-- \\
9204 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
9205 wysh set forward-inject-tail=$'"'"'-- \\
9206 end of forward (%%i) --\\n'"'"'
9207 forward 2 fwdex@am.ple
9208 this is content of forward 2
9210 echo forward 2: $? $! $^ERRNAME;echo;echo
9212 forward 2 fwdex2@am.ple
9213 this is content of forward 2, 2nd, with showname set
9215 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
9216 resend 1 2 resendex@am.ple
9217 echo resend 1 2: $? $! $^ERRNAME;echo;echo
9218 Resend 1 2 Resendex@am.ple
9219 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
9221 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
9222 -Smta=test://"$MBOX" \
9225 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9228 vput csop es substr "$1" 0 1
9233 define read_mline_res {
9234 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
9235 echo mline_res:$len/$es/$^ERRNAME: $hl
9236 if [ $es -ne $^ERR-NONE ]
9237 xcall bail read_mline_res
9239 \xcall read_mline_res
9243 echo "~^header show $1"; read es;\
9244 call xerr $es "work_hl $1"; echo $1; call read_mline_res
9252 echo t_ocs version $ver
9253 echo "~^header list"; read hl; echo $hl;\
9254 echoerr the header list is $hl;\
9255 call xerr "$hl" "header list"
9256 eval vpospar set $hl
9259 echoerr IT IS WRONG IF YOU SEE THIS
9262 echo on-XY-enter, mailx-command<$mailx-command>
9263 set t_oce autobcc=oce@exam.ple
9264 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9265 echo mailx-subject<$mailx-subject>
9266 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9267 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9268 mailx-raw-bcc<$mailx-raw-bcc>
9269 echo mailx-orig-from<$mailx-orig-from> \
9270 mailx-orig-to<$mailx-orig-to> \
9271 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9274 echo on-XY-leave, mailx-command<$mailx-command>
9275 set t_ocl autocc=ocl@exam.ple
9276 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9277 echo mailx-subject<$mailx-subject>
9278 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9279 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9280 mailx-raw-bcc<$mailx-raw-bcc>
9281 echo mailx-orig-from<$mailx-orig-from> \
9282 mailx-orig-to<$mailx-orig-to> \
9283 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9286 echo on-XY-cleanup, mailx-command<$mailx-command>
9287 set t_occ autocc=occ@exam.ple
9288 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9289 echo mailx-subject<$mailx-subject>
9290 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9291 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9292 mailx-raw-bcc<$mailx-raw-bcc>
9293 echo mailx-orig-from<$mailx-orig-from> \
9294 mailx-orig-to<$mailx-orig-to> \
9295 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9297 wysh set on-compose-splice=t_ocs \
9298 on-compose-enter=t_oce on-compose-leave=t_ocl \
9299 on-compose-cleanup=t_occ \
9300 on-resend-enter=t_oce on-resend-cleanup=t_occ
9303 ${cat} ./.tnotes >> "${MBOX}"
9304 check 4 - "${MBOX}" '1850092468 11799'
9309 t_mass_recipients() {
9312 if have_feat cmd-vexpr; then :; else
9313 t_echoskip '[!CMD_VEXPR]'
9318 ${cat} <<'__EOT__' > ./.trc
9320 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9323 wysh set nr=$1 hn=$2
9324 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
9326 xcall bail "ins_addr $hn 1-$nr"
9328 vput vexpr nr + $nr 1
9329 if [ "$nr" -le "$maximum" ]
9330 xcall ins_addr $nr $hn
9334 wysh set nr=$1 hn=$2
9335 alternates $hn$nr@$hn
9336 vput vexpr nr + $nr 2
9337 if [ "$nr" -le "$maximum" ]
9338 xcall bld_alter $nr $hn
9348 if [ "$t_remove" != '' ]
9353 set on-compose-splice=t_ocs on-compose-leave=t_ocl
9356 printf 'm this-goes@nowhere\nbody\n!.\n' |
9357 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9358 -X'source ./.trc' -Smta=test://"$MBOX" -Smaximum=${LOOPS_MAX} \
9361 ${cat} ./.tall >> "${MBOX}"
9362 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9363 check 1-${LOOPS_BIG} - "${MBOX}" '3835365533 51534'
9364 elif [ ${LOOPS_MAX} -eq ${LOOPS_SMALL} ]; then
9365 check 1-${LOOPS_SMALL} - "${MBOX}" '3647549277 4686'
9369 printf 'm this-goes@nowhere\nbody\n!.\n' |
9370 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9371 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
9372 -Smaximum=${LOOPS_MAX} \
9375 ${cat} ./.tall >> "${MBOX}"
9376 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9377 check 2-${LOOPS_BIG} - "${MBOX}" '3768249992 34402'
9378 elif [ $LOOPS_MAX -eq ${LOOPS_SMALL} ]; then
9379 check 2-${LOOPS_SMALL} - "${MBOX}" '4042568441 3170'
9385 t_lreply_futh_rth_etc() {
9388 ${cat} <<-_EOT > ./.tmbox
9389 From neverneverland Sun Jul 23 13:46:25 2017
9390 Subject: Bugstop: five miles out 1
9391 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9392 From: mister originator <mr@originator>
9393 To: bugstop-commit@five.miles.out, laber@backe.eu
9395 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
9396 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
9397 Date: Wed, 19 Jul 2017 09:22:57 -0400
9398 Message-Id: <20170719132257.766AF781267@originator>
9401 > |Sorry, I think I misunderstand something. I would think that
9405 From neverneverland Fri Jul 7 22:39:11 2017
9406 Subject: Bugstop: five miles out 2
9407 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
9408 Content-Transfer-Encoding: 7bit
9409 From: mister originator <mr@originator>
9410 To: bugstop-commit@five.miles.out
9412 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
9413 Date: Fri, 07 Jul 2017 16:33:59 -0400
9416 capable of changing back.
9418 From neverneverland Fri Jul 7 22:42:00 2017
9419 Subject: Bugstop: five miles out 3
9420 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9421 Content-Transfer-Encoding: 7bit
9422 From: mister originator <mr@originator>
9423 To: bugstop-commit@five.miles.out
9425 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
9426 Date: Fri, 07 Jul 2017 16:33:59 -0400
9427 List-Post: <mailto:bugstop@five.miles.out>
9430 are you ready, boots?
9432 From neverneverland Sat Aug 19 23:15:00 2017
9433 Subject: Bugstop: five miles out 4
9434 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9435 Content-Transfer-Encoding: 7bit
9436 From: mister originator <mr@originator>
9437 To: bugstop@five.miles.out
9439 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
9440 Date: Fri, 07 Jul 2017 16:33:59 -0400
9441 List-Post: <mailto:bugstop@five.miles.out>
9444 are you ready, boots?
9449 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
9450 -Rf ./.tmbox >> "${MBOX}" 2>&1
9452 wysh set m="This is text of \"reply ${1}."
9463 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
9466 wysh set m="This is text of \"Reply ${1}."
9472 echo -----After Reply $1.$2: $?/$^ERRNAME
9481 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
9485 # We need two indirections for this test: one for the case that Lreply
9486 # fails because of missing recipients: we need to read EOF next, thus
9487 # place this in _Ls last; and second for the succeeding cases EOF is
9488 # not what these should read, so go over the backside and splice it in!
9489 # (A shame we do not have redirection++ as a Bourne/K/POSIX shell!)
9491 echo -----After Lreply $1.$2: $?/$^ERRNAME
9494 localopts call-fixate yes
9496 call R $1 1; call R $1 2; call R $1 3; call R $1 4
9497 call L $1 1; call L $1 2; call L $1 3
9500 echo;echo '===== CHANGING === '"$*"' =====';echo
9504 set from=laber@backe.eu
9507 call tweak set reply-to-honour
9509 call tweak set followup-to
9511 call tweak set followup-to-honour
9513 call tweak mlist bugstop@five.miles.out
9515 call tweak mlsubscribe bugstop@five.miles.out
9517 call tweak set recipients-in-cc
9519 # While here, test that *fullnames* works (also here)
9520 call tweak set fullnames
9522 This message should have *fullnames* in the header.
9525 call tweak unmlsubscribe bugstop@five.miles.out';' \
9526 set followup-to-add-cc nofullnames
9528 call tweak mlsubscribe bugstop@five.miles.out
9533 if have_feat uistrings; then
9534 check 1 - "${MBOX}" '1519985418 39828'
9536 t_echoskip '1:[!UISTRINGS]'
9541 ${cat} <<-_EOT > ./.tmbox
9542 From tom@i-i.example Thu Oct 26 03:15:55 2017
9543 Date: Wed, 25 Oct 2017 21:15:46 -0400
9544 From: tom <tom@i-i.example>
9545 To: Steffen Nurpmeso <steffen@sdaoden.eu>
9546 Cc: tom <tom@i-i.example>
9547 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
9548 Message-ID: <20171026011546.GA11643@i-i.example>
9549 Reply-To: tom@i-i.example
9550 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
9551 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
9554 The report's useful :-)
9557 # Let us test In-Reply-To: removal starts a new thread..
9558 # This needs adjustment of *stealthmua*
9559 argadd='-Sstealthmua=noagent -Shostname'
9562 printf 'reply 1\nthread\n!.\n' |
9563 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9564 ${argadd} -Rf ./.tmbox > .tall 2>&1
9565 check 2 0 "${MBOX}" '841868335 433'
9566 check 3 - .tall '4294967295 0'
9568 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
9569 "${sed}" '/^In-Reply-To:/d' |
9570 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9571 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9572 check 4 0 "${MBOX}" '3136957908 771'
9573 check 5 - .tall '4294967295 0'
9575 printf 'reply 2\nold <- new <- thread!\n!.\n' |
9576 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9577 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9578 check 6 0 "${MBOX}" '3036449053 1231'
9579 check 7 - .tall '4294967295 0'
9581 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
9582 "${sed}" '/^In-Reply-To:/d' |
9583 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9584 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9585 check 8 0 "${MBOX}" '2069841383 1583'
9586 check 9 - .tall '4294967295 0'
9588 # And follow-up testing whether changing In-Reply-To: to - starts a new
9589 # thread with only the message being replied-to.
9591 printf 'reply 1\nthread with only one ref!\n!||%s -e "%s"\n!.\n' \
9592 "${sed}" 's/^In-Reply-To:.*$/In-Reply-To:-/' |
9593 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9594 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9595 check 10 0 "${MBOX}" '3155846378 2047'
9596 check 11 - .tall '4294967295 0'
9604 if have_feat cmd-vexpr; then :; else
9605 t_echoskip '[!CMD_VEXPR]'
9610 # "Test for" [d6f316a] (Gavin Troy)
9611 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
9612 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="?* ${cat}" > "${BODY}"
9613 check 1 0 "${MBOX}" '3942990636 118'
9614 check 2 - "${BODY}" '3951695530 170'
9617 printf "m %s\n~s subject2\n~@%s\nBody2\n~.\nFi %s\nmimeview\nx\n" \
9618 "${MBOX}" "${TOPDIR}snailmail.jpg" "${MBOX}" |
9619 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9620 -S 'pipe-text/plain=?' \
9621 -S 'pipe-image/jpeg=?=&?'\
9622 'trap \"'"${rm}"' -f '\ '\\"${MAILX_FILENAME_TEMPORARY}\\"\" EXIT;'\
9623 'trap \"trap \\\"\\\" INT QUIT TERM; exit 1\" INT QUIT TERM;'\
9624 '{ echo C=$MAILX_CONTENT;'\
9625 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9626 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9627 'echo F=$MAILX_FILENAME;'\
9628 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9629 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9630 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9631 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"; } > ./.tax 2>&1;'"${mv}"' ./.tax ./.tay' \
9633 check 3 0 "${MBOX}" '1933681911 13435'
9634 check 4 - "${BODY}" '2036666633 493'
9635 check 4-hdl - ./.tay '144517347 151' async
9638 if [ -z "${ln}" ]; then
9639 t_echoskip '5:[ln(1) not found]'
9641 # Let us fill in tmpfile, test auto-deletion
9642 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9643 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9644 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9645 -S 'pipe-text/plain=?' \
9646 -S 'pipe-image/jpeg=?=++?'\
9647 'echo C=$MAILX_CONTENT;'\
9648 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9649 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9650 'echo F=$MAILX_FILENAME;'\
9651 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9652 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9653 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9654 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9655 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9657 check 5 0 "${BODY}" '4260004050 661'
9659 # Fill in ourselfs, test auto-deletion
9660 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9661 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9662 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9663 -S 'pipe-text/plain=?' \
9664 -S 'pipe-image/jpeg=?++?'\
9665 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9666 'echo C=$MAILX_CONTENT;'\
9667 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9668 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9669 'echo F=$MAILX_FILENAME;'\
9670 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9671 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9672 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9673 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9675 check 6 0 "${BODY}" '4260004050 661'
9677 # And the same, via copiousoutput (fake)
9678 printf 'Fi %s\np\nvput vexpr v file-stat .t.one-link\n'\
9679 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9680 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9681 -S 'pipe-text/plain=?' \
9682 -S 'pipe-image/jpeg=?*++?'\
9683 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9684 'echo C=$MAILX_CONTENT;'\
9685 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9686 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9687 'echo F=$MAILX_FILENAME;'\
9688 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9689 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9690 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9691 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9692 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9694 check 7 0 "${BODY}" '709946464 677'
9703 if have_feat mailcap; then :; else
9704 t_echoskip '[!MAILCAP]'
9709 ${cat} <<-'_EOT' > ./.tmailcap
9710 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
9711 application/pdf; /Applications/Preview.app/Contents/MacOS/Preview %s;\
9712 nametemplate=%s.pdf;\
9713 test = [ "${OSTYPE}" = darwin ]
9716 trap "rm -f ${infile}" EXIT\;\
9717 trap "exit 75" INT QUIT TERM\;\
9719 test = [ -n "${DISPLAY}" ];\
9720 nametemplate = %s.pdf; x-mailx-async
9721 application/pdf; pdftotext -layout %s -; nametemplate=%s.pdf; copiousoutput
9722 application/*; echo "This is \\"%t\\" but \
9723 is 50 \% Greek to me" \; < %s head -c 1024 | cat -vet; \
9724 description=" this is\;a \"wildcard\" match, no trailing quote! ;\
9725 copiousoutput; x-mailx-noquote
9730 application/postscript; ps-to-terminal %s;\ needsterminal
9731 application/postscript; ps-to-terminal %s; \compose=idraw %s
9732 x-be2; the-cmd %s; \
9733 print=print-cmd %s ; \
9735 compose=compose-cmd -d %s ; \
9737 composetyped = composetyped-cmd -dd %s ; \
9739 edit=edit-cmd -ddd %s; \
9740 description = a\;desc;\
9741 nametemplate=%s.be2;\
9742 test = this is "a" test ; \
9743 x-mailx-test-once ;\
9744 x11-bitmap = x11-bitmap.bpm;;;;;
9745 application/*; echo "is \"%t\" \
9746 50 \% Greek" \; cat %s; copiousoutput; \; description="catch-all buddy";
9747 audio/*; showaudio;compose=%n
9748 image/jpeg; showpicture -viewer xv %s
9749 image/*; showpicture %s
9750 message/partial; showpartial %s %{id} %{number} %{total}
9751 application/postscript ; lpr %s ; label="PS File";\
9752 compose="getx PS %s"
9753 application/atomicmail; atomicmail %s ; needsterminal
9754 application/andrew-inset; ezview %s ; copiousoutput;\
9755 edit=ez -d %s; compose="ez -d %s"; label="Andrew i/d"
9756 text/richtext; xy iso-8859-1 -e richtext -p %s; \
9757 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9758 text/plain; xy iso-8859-1 %s;\
9759 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9760 text/richtext; rich %s %{not-closed; copiousoutput
9761 default; cat %s; copiousoutput
9763 ${chmod} 0644 ./.tmailcap
9765 printf 'm;echo =1/$?;m c;echo =2/$?;
9766 mailca loa;echo =3/$?;mailc s;echo =4/$?' |
9767 MAILCAPS=./.tmailcap ${MAILX} -X'commandalias m mailcap' ${ARGS} \
9769 check 1 0 ./.tall '2012114724 3064'
9770 have_feat uistrings && i='3903313993 2338' || i='4294967295 0'
9771 check 2 - ./.terr "${i}"
9775 echo 'From me with love' | ${MAILX} ${ARGS} -s sub1 "${MBOX}"
9776 check 3 0 "${MBOX}" '4224630386 228'
9778 # For reproducability, one pseudo check with cat(1) and mv(1)
9780 text/plain; echo p-1-1\\;< %%s cat\\;echo p-1-2;\\
9781 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9782 text/plain; echo p-2-1\\;< %%s cat\\;echo p-2-2;\\
9783 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9784 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9785 </dev/null cat %%s\\;echo p-3-2\\; } > ./.tx\\; mv -f ./.tx ./.tasy;\\
9786 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9787 text/plain; echo p-4-1\\;cat\\;echo p-4-2;copiousoutput
9790 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9791 ${MAILX} ${ARGS} -Snomailcap-disable \
9793 -Rf "${MBOX}" > ./.tall 2>./.terr
9794 check 4.pre 0 ./.tall '1428075831 455'
9796 # Same with real programs
9798 text/plain; echo p-1-1\\;< %%s %s\\;echo p-1-2;\\
9799 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9800 text/plain; echo p-2-1\\;< %%s %s\\;echo p-2-2;\\
9801 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9802 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9803 </dev/null %s %%s\\;echo p-3-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9804 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9805 text/plain; echo p-4-1\\;%s\\;echo p-4-2;copiousoutput
9806 ' "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" > ./.tmailcap
9808 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9809 ${MAILX} ${ARGS} -Snomailcap-disable \
9820 -Rf "${MBOX}" > ./.tall 2>./.terr
9821 check 4 0 ./.tall '1912261831 831'
9822 check 5 - ./.terr '4294967295 0'
9823 check 6 - ./.terrmc '2376112102 6'
9824 check 7 - ./.tasy '3913344578 37' async
9826 # "Binary data"; ensure all possible temporary file / nametemplate
9827 # etc. paths are taken: avoid 2nd e7a60732c1906aefe4755fd61c5ffa81eeca0af0
9830 printf 'du\x7fbo€o\bm' > ./.tatt.pdf
9831 printf 'du' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9832 check 8 0 "${MBOX}" '3444709420 644'
9836 application/pdf; echo p-1-1\\;%s\\;echo p-1-2; test=[ "$XY" = "" ]
9837 # tmpfile, no template
9838 application/pdf; echo p-2-1\\;< %%s %s\\;echo p-2-2; test = [ "$XY" = two ]
9840 application/pdf; echo p-3-1\\;< %%s %s\\;echo p-3-2; test=[ "$XY" = three ];\\
9841 nametemplate=%%s.txt
9842 # tmpfile, template, async
9843 application/pdf; { file=%%s \\; echo p-4-1 = ${file##*.}\\;\\
9844 </dev/null %s %%s\\;echo p-4-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9845 test=[ "$XY" = four ] ; nametemplate = %%s.txt ; x-mailx-async
9847 application/pdf; echo p-5-1\\;%s\\;echo p-5-2; test=[ "$XY" = 1 ];\\
9849 # copious, tmpfile, no template
9850 application/pdf; echo p-6-1\\;< %%s %s\\;echo p-6-2; test = [ "$XY" = 2 ];\\
9852 # copious, tmpfile, template
9853 application/pdf; echo p-7-1\\;< %%s %s\\;echo p-7-2;test = [ "$XY" = 3 ];\\
9854 nametemplate=%%s.txt; copiousoutput
9855 ' "${cat}" "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" "${cat}" "${cat}" \
9858 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9859 ${MAILX} ${ARGS} -Snomailcap-disable \
9867 \environ set XY=three
9870 \environ set XY=four
9883 -Rf "${MBOX}" > ./.tall 2>./.terr
9884 check 9 0 ./.tall '2388630345 3850'
9885 check 10 - ./.terr '4294967295 0'
9886 check 11 - ./.tasy '842146666 27' async
9888 # x-mailx-last-resort, x-mailx-ignore
9891 printf 'in a pdf\n' > ./.tatt.pdf
9892 printf 'du\n' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9893 check 12 0 "${MBOX}" '3968874750 579'
9897 application/pdf;echo hidden;x-mailx-ignore
9898 application/pdf;echo hidden;copiousoutput;x-mailx-ignore
9899 application/pdf; echo pre\\;%s\\;echo post; x-mailx-last-resort
9900 ' "${cat}" > ./.tmailcap
9902 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9903 ${MAILX} ${ARGS} -Snomailcap-disable \
9908 \mimetype ?t application/pdf pdf
9913 \unmimetype application/pdf
9917 -Rf "${MBOX}" > ./.tall 2>./.terr
9918 check 13 0 ./.tall '759843612 1961'
9919 check 14 - ./.terr '4294967295 0'
9925 # Unclassified rest {{{
9929 t__gen_msg subject top1 to 1 from 1 cc 1 body 'body1-1
9938 t__gen_msg subject top2 to 1 from 1 cc 1 body 'body2-1
9949 ${MAILX} ${ARGS} -Rf -Y '#
9951 \echo --- $?/$^ERRNAME, 1; \set toplines=10
9953 \echo --- $?/$^ERRNAME, 2; \set toplines=5
9954 \headerpick top retain subject # For top
9955 \headerpick type retain to subject # For Top
9957 \echo --- $?/$^ERRNAME, 3; \set topsqueeze
9959 \echo --- $?/$^ERRNAME, 4
9961 \echo --- $?/$^ERRNAME, 5
9962 # ' "${MBOX}" > ./.tall 2>&1
9963 check 1 0 ./.tall '2556125754 705'
9971 if have_feat smime; then :; else
9972 t_echoskip '[!SMIME]'
9977 ${cat} <<-_EOT > ./.t.conf
9979 x509_extensions = extensions
9980 distinguished_name = req_distinguished_name
9981 attributes = req_attributes
9983 output_password = Pacem_in_terris
9986 basicConstraints = CA:FALSE
9987 # Needs a CA for that keyUsage = digitalSignature
9988 extendedKeyUsage = emailProtection
9990 [req_distinguished_name]
9997 emailAddress = test@localhost
10000 challengePassword = hi ca it is me me me
10006 if [ "${_z}" = 0 ]; then
10011 _pass=Pacem_in_terris
10013 _ossl='-passin pass:'${_pass}
10016 ${rm} -f ./.VERIFY ./.ENCRYPT ./.DECRYPT
10018 openssl req ${_osslreq} ${_ossl} -x509 -days 3650 -config ./.t.conf \
10019 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
10023 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
10026 echo bla | ${MAILX} ${ARGS} \
10027 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10028 -Ssmime-sign-digest=sha1 \
10029 -S password-test@localhost.smime-cert-key=${_pass} \
10030 -s 'S/MIME test' ./.VERIFY >>${ERR} 2>&1
10031 check_ex0 ${_z}-estat
10034 /^Content-Description: /{ skip = 2; print; next }
10035 /^$/{ if(skip) --skip }
10036 { if(!skip) print }
10038 < ./.VERIFY > "${MBOX}"
10039 check ${_z} - "${MBOX}" '335634014 644'
10042 printf 'verify\nx\n' |
10043 ${MAILX} ${ARGS} -Ssmime-ca-file=./.tcert.pem -Serrexit \
10044 -R -f ./.VERIFY >>${ERR} 2>&1
10045 check_ex0 ${_z} # XXX pipe
10048 openssl smime -verify -CAfile ./.tcert.pem -in ./.VERIFY >>${ERR} 2>&1
10052 # (signing +) encryption / decryption
10055 -Smta=test://./.ENCRYPT \
10056 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10057 -Ssmime-sign-digest=sha1 \
10058 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10059 -S password-test@localhost.smime-cert-key=${_pass} \
10060 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10061 check_ex0 ${_z}-estat
10062 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10063 check ${_z} - "${MBOX}" '2359655411 336'
10066 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
10068 -Smta=test://./.ENCRYPT \
10069 -Ssmime-ca-file=./.tcert.pem \
10070 -Ssmime-sign-cert=./.tpair.pem \
10071 -Sfrom=test@localhost \
10072 -S password-test@localhost.smime-cert-key=${_pass} \
10073 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10074 check_ex0 ${_z}-estat
10077 /^Content-Description: /{ skip = 2; print; next }
10078 /^$/{ if(skip) --skip }
10079 { if(!skip) print }
10081 < ./.DECRYPT > "${MBOX}"
10082 check ${_z} - "${MBOX}" '2602978204 940'
10085 (openssl smime -decrypt ${_ossl} -inkey ./.tkey.pem -in ./.ENCRYPT |
10086 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1
10087 check_ex0 ${_z} # XXX pipe..
10091 echo bla | ${MAILX} ${ARGS} \
10092 -Smta=test://./.ENCRYPT \
10093 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10094 -Sfrom=test@localhost \
10095 -S password-test@localhost.smime-cert-key=${_pass} \
10096 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10097 check_ex0 ${_z}-estat
10098 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10099 check ${_z} - "${MBOX}" '2359655411 336'
10103 # Note: deduce from *sign-cert*, not from *from*!
10104 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
10105 -Smta=test://./.ENCRYPT \
10106 -Ssmime-sign-cert-recei@ver.com=./.tpair.pem \
10107 -S password-recei@ver.com.smime-cert-key=${_pass} \
10108 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10109 check ${_z} 0 ./.DECRYPT '2453471323 431'
10112 openssl smime ${_ossl} -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT \
10116 unset _z _pass _osslreq _ossl
10126 # xxx Note: t_z() was the first test (series) written. Today many
10127 # xxx aspects are (better) covered by other tests above, some are not.
10128 # xxx At some future date and time, convert the last remains not covered
10129 # xxx elsewhere to a real t_* test and drop it
10133 # Test for [260e19d] (Juergen Daubert)
10134 echo body | ${MAILX} ${ARGS} "${MBOX}"
10135 check 4 0 "${MBOX}" '2948857341 94'
10137 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
10140 for(i = 0; i < 10000; ++i)
10142 #printf "\xF0\x90\x87\x90"
10143 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
10144 check 7 0 "${MBOX}" '1707496413 61812'
10151 t___gen_msg '' "${@}"
10155 t___gen_msg 1 "${@}"
10167 while [ ${___hi} -le ${3} ]; do
10168 [ ${___hi} -gt 1 ] && printf ', '
10169 printf '%s%s <%s%s@exam.ple>' ${1} ${___hi} ${2} ${___hi}
10170 ___hi=`add
${___hi} 1`
10180 printf 'From reproducible_build Wed Oct 2 01:50:07 1996
10181 Date: Wed, 02 Oct 1996 01:50:07 +0000
10185 while [ ${#} -ge 2 ]; do
10187 from) t___header From from "${2}";;
10188 to) t___header To to "${2}";;
10189 cc) t___header Cc cc "${2}";;
10190 bcc) t___header Bcc bcc "${2}";;
10191 subject) printf 'Subject: %s\n' "${2}";;
10192 body) body="${2}";;
10197 if [ -z "${ismime}" ]; then
10198 printf '\n%s\n\n' "${body}"
10200 printf 'MIME-Version: 1.0
10201 Message-ID: <20200204225307.FaKeD%%bo@oo>
10202 Content-Type: multipart/mixed; boundary="=BOUNDOUT="
10205 Content-Type: multipart/alternative; boundary==BOUNDIN=
10208 Content-Type: text/plain; charset=utf-8
10209 Content-Transfer-Encoding: 8-bit
10214 Content-Type: text/html; charset=utf-8
10215 Content-Transfer-Encoding: 8-bit
10217 <HTML><BODY>%s<BR></BODY></HTML>
10222 Content-Type: text/troff
10227 Content-Type: text/x-uuencode
10229 Aprendimos a quererte
10232 ' "${body}" "${body}"
10238 From neverneverland Sun Jul 23 13:46:25 2017
10239 Subject: Bugstop: five miles out 1
10240 Reply-To: mister originator1 <mr1@originator>
10241 From: mister originator1 <mr1@originator>
10242 To: bugstop-commit@five.miles.out
10244 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
10245 Date: Wed, 19 Jul 2017 09:22:57 -0400
10246 Message-Id: <20170719132257.766AF781267-1@originator>
10247 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
10250 That's appalling, I.
10257 From neverneverland Sun Jul 23 13:47:25 2017
10258 Subject: Bugstop: five miles out 2
10259 Reply-To: mister originator2 <mr2@originator>
10260 From: mister originator2 <mr2@originator>
10261 To: bugstop-commit@five.miles.out
10263 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
10264 Date: Wed, 19 Jul 2017 09:23:57 -0400
10265 Message-Id: <20170719132257.766AF781267-2@originator>
10268 That's appalling, II.
10275 From neverneverland Sun Jul 23 13:48:25 2017
10276 Subject: Bugstop: five miles out 3
10277 Reply-To: mister originator3 <mr3@originator>
10278 From: mister originator3 <mr3@originator>
10279 To: bugstop-commit@five.miles.out
10281 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
10282 Date: Wed, 19 Jul 2017 09:24:57 -0400
10283 Message-Id: <20170719132257.766AF781267-3@originator>
10286 That's appalling, III.
10292 # MIME encoding (QP) stress message subject
10293 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
10294 'adadaddsssssssddddddddddddddddddddd'\
10295 'ddddddddddddddddddddddddddddddddddd'\
10296 'ddddddddddddddddddddddddddddddddddd'\
10297 'dddddddddddddddddddd Hallelulja? Od'\
10298 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10299 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10300 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
10301 'fffffffffffffffffffffffffffffffffff'\
10302 'fffffffffffffffffffff ggggggggggggg'\
10303 'ggggggggggggggggggggggggggggggggggg'\
10304 'ggggggggggggggggggggggggggggggggggg'\
10305 'ggggggggggggggggggggggggggggggggggg'\
10310 # MIME encoding (QP) stress message body
10312 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
10313 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
10314 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
10315 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
10316 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
10317 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
10318 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
10319 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
10320 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
10321 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
10322 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
10323 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
10324 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
10325 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
10326 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
10327 "auf den zeilen vorher.\r\n"\
10328 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
10330 "Die letzte Zeile war nur ein Punkt.\r\n"\
10332 "Das waren deren zwei.\r\n"\
10334 "Die letzte Zeile war ein Leerschritt.\n"\
10335 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
10336 "Prösterchen.\r\n"\
10338 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
10340 "Das waren deren zwei. ditto.\n"\
10342 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
10343 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
10344 "auf den zeilen vorher.\n"\
10346 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
10347 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
10349 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10351 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10353 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10355 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10357 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10359 "QP am Zeilenende über soft-nl hinweg\n"\
10360 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10362 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10364 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10366 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10368 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
10370 "Die letzte Zeile war ein Leerschritt.\n"\
10375 # cc_all_configs() {{{
10376 # Test all configs TODO doesn't cover all *combinations*, stupid!
10378 if [ ${MAXJOBS} -gt 1 ]; then
10379 MAXJOBS='-j '${MAXJOBS}
10383 if [ -n "${NOCOLOUR}" ] || [ -n "${MAILX_CC_TEST_NO_COLOUR}" ]; then
10384 MAILX_CC_TEST_NO_COLOUR=1
10385 export MAILX_CC_TEST_NO_COLOUR
10390 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
10391 NOTME["OPT_AUTOCC_STACKPROT"] = 1
10392 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
10393 NOTME["OPT_CROSS_BUILD"] = 1
10394 NOTME["OPT_AUTOCC"] = 1
10395 NOTME["OPT_AMALGAMATION"] = 1
10396 NOTME["OPT_DEBUG"] = 1
10397 NOTME["OPT_DEVEL"] = 1
10398 NOTME["OPT_ASAN_ADDRESS"] = 1
10399 NOTME["OPT_ASAN_MEMORY"] = 1
10400 NOTME["OPT_USAN"] = 1
10401 NOTME["OPT_NOMEMDBG"] = 1
10406 MULCHOICE["OPT_ICONV"] = "VAL_ICONV"
10407 MULVALS["VAL_ICONV"] = 1
10408 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
10409 MULVALS["VAL_IDNA"] = 1
10411 #VALKEYS[0] = "VAL_RANDOM"
10412 VALVALS["VAL_RANDOM"] = 1
10417 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
10418 # does not seem to be a compliant escape for =
10420 $1 = substr($1, 1, index($1, "=") - 1)
10422 OPTVALS[OPTNO++] = $1
10427 val = substr($0, index($0, "=") + 1)
10429 val = substr(val, 2)
10430 val = substr(val, 1, length(val) - 1)
10432 $1 = substr($1, 1, index($1, "=") - 1)
10435 else if(VALVALS[$1]){
10436 VALKEYS[VALNO++] = $1
10441 function onepass(addons){
10442 a_onepass__worker(addons, "1", "0")
10443 a_onepass__worker(addons, "0", "1")
10445 function a_onepass__worker(addons, b0, b1){
10446 # Doing this completely sequentially and not doing make distclean in
10447 # between runs should effectively result in lesser compilations.
10448 # It is completely dumb nonetheless... TODO
10449 for(ono = 0; ono < OPTNO; ++ono){
10451 for(i = 0; i < ono; ++i){
10452 myconf = myconf " " OPTVALS[i] "=" b0 " "
10454 j = MULCHOICE[OPTVALS[i]]
10459 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10463 for(i = ono; i < OPTNO; ++i){
10464 myconf = myconf " " OPTVALS[i] "=" b1 " "
10466 j = MULCHOICE[OPTVALS[i]]
10471 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10477 myconf = VALKEYS[i] "=any " myconf
10479 myconf = myconf " " ALWAYS " " addons
10484 i = split(MULVALS[mula], ia)
10488 print mula "=\"" j "\" " myconf
10494 # We cannot test NULL because of missing UI strings, which will end
10495 # up with different checksums
10496 print "CONFIG=NULLI OPT_AUTOCC=1"
10498 j = split(VALVALS[VALKEYS[i]], ia)
10502 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
10505 print "CONFIG=MINIMAL OPT_AUTOCC=1"
10506 print "CONFIG=NETSEND OPT_AUTOCC=1"
10507 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
10509 j = split(VALVALS[VALKEYS[i]], ia)
10513 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
10516 print "CONFIG=DEVEL OPT_AUTOCC=1"
10517 print "CONFIG=ODEVEL OPT_AUTOCC=1"
10521 onepass("OPT_DEBUG=1")
10524 ' | while read c; do
10525 if [ "$c" = split_here ]; then
10526 printf 'Predefined configs done, now OPT_ combinations\n'
10527 printf 'Predefined configs done, now OPT_ combinations\n' >&2
10528 ${SHELL} -c "cd ../ && ${MAKE} distclean"
10531 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
10532 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n"
10533 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n" >&2
10534 ${SHELL} -c "cd .. && ${MAKE} ${MAXJOBS} config ${c}"
10535 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
10536 printf 'Skipping after config, nothing changed\n'
10537 printf 'Skipping after config, nothing changed\n' >&2
10540 ${SHELL} -c "cd ../ && ${MAKE} ${MAXJOBS} build test"
10543 cd .. && ${MAKE} distclean
10548 if [ -z "${CHECK}${RUN_TEST}" ]; then
10552 if have_feat debug; then
10553 if have_feat devel; then
10557 ARGS="${ARGS} -Smemdebug"
10558 JOBWAIT=`add
$JOBWAIT $JOBWAIT`
10560 elif have_feat devel; then
10563 LOOPS_MAX=${LOOPS_BIG}
10567 if [ -z "${RUN_TEST}" ] || [ ${#} -eq 0 ]; then
10569 printf 'Will do up to %s tests in parallel, with a %s second timeout\n' \
10570 ${MAXJOBS} ${JOBWAIT}
10576 printf 'Tests have a %s second timeout\n' ${JOBWAIT}
10578 while [ ${#} -gt 0 ]; do
10588 printf '%u tests: %s%u ok%s, %s%u failure(s)%s. %s%u test(s) skipped%s\n' \
10589 "${TESTS_PERFORMED}" "${COLOR_OK_ON}" "${TESTS_OK}" "${COLOR_OK_OFF}" \
10590 "${COLOR_ERR_ON}" "${TESTS_FAILED}" "${COLOR_ERR_OFF}" \
10591 "${COLOR_WARN_ON}" "${TESTS_SKIPPED}" "${COLOR_WARN_OFF}"
10592 if [ -n "${ssec}" ] && [ -n "${esec}" ]; then
10593 ( echo 'Elapsed seconds: '`$awk 'BEGIN{print '"${esec}"' - '"${ssec}"'}'` )