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 i
=`</dev/null LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
287 \if "${ttycharset}" =%?case utf
294 \xcall cset_test "${@}"
298 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
299 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
301 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
304 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
305 echo 'Trying to detect UTF-8 locale via locale -a'
306 UTF8_LOCALE
=`locale -a | { m=
309 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
312 ${grep} -e POSIX -e en_EN -e en_US; } \
313 >/dev/null 2>&1; then
323 if [ -n "${UTF8_LOCALE}" ]; then
324 echo 'Using Unicode locale '"${UTF8_LOCALE}"
326 echo 'No Unicode locale found, disabling Unicode tests'
329 if [ -z "${HONOURS_READONLY}" ]; then
330 trap "${rm} -f ./.tisrdonly" EXIT
331 trap "exit 1" HUP INT TERM
332 printf '' > .
/.tisrdonly
333 ${chmod} 0444 .
/.tisrdonly
334 if (printf 'no\n' > .
/.tisrdonly
) >/dev
/null
2>&1 &&
335 test -s .
/.tisrdonly
; then
340 ${rm} -f .
/.tisrdonly
341 trap '' EXIT HUP INT TERM
345 export UTF8_LOCALE HONOURS_READONLY
348 TESTS_PERFORMED
=0 TESTS_OK
=0 TESTS_FAILED
=0 TESTS_SKIPPED
=0
349 JOBS
=0 JOBLIST
= JOBREAPER
= JOBSYNC
=
351 ( sleep .1 ) >/dev
/null
2>&1 && SUBSECOND_SLEEP
=y
353 COLOR_ERR_ON
= COLOR_ERR_OFF
=
354 COLOR_WARN_ON
= COLOR_WARN_OFF
=
355 COLOR_OK_ON
= COLOR_OK_OFF
=
361 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
362 ${rm} -rf ./t.*.d ./t.*.io ./t.*.result ./t.time.out
364 trap "exit 1" HUP INT QUIT TERM
367 if [ -n "${NOJOBS}" ]; then
371 # The user desired variant
372 if ( echo "${MAKEFLAGS}" |
${grep} -- -j ) >/dev
/null
2>&1; then
373 i
=`echo "${MAKEFLAGS}" |
374 ${sed} -e 's/^.*-j[ ]*\([0-9]\{1,\}\).*$/\1/'`
375 if ( echo "${i}" |
grep -q -e '^[0-9]\{1,\}$' ); then
376 printf 'Job number derived from MAKEFLAGS: %s\n' ${i}
378 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
383 # The actual hardware
384 printf 'all:\n' > t.mk.io
385 if ( ${MAKE} -j 10 -f t.mk.io
) >/dev
/null
2>&1; then
386 if command -v nproc
>/dev
/null
2>&1; then
387 i
=`nproc 2>/dev/null`
388 [ ${?} -eq 0 ] && MAXJOBS
=${i}
390 i
=`getconf _NPROCESSORS_ONLN 2>/dev/null`
392 if [ ${j} -ne 0 ]; then
393 i
=`getconf NPROCESSORS_ONLN 2>/dev/null`
396 if [ ${j} -ne 0 ]; then
398 if command -v kstat
>/dev
/null
2>&1; then
399 i
=`PERL5OPT= kstat -p cpu | ${awk} '
401 {if($2 > no) max = $2; next}
407 if [ ${j} -eq 0 ] && [ -n "${i}" ]; then
408 printf 'Job number derived from CPU number: %s\n' ${i}
412 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
420 # There were problems when using monitor mode with mksh
421 i
=`env -i ${SHELL} -c 'echo $KSH_VERSION'`
422 if [ -n "${i}" ]; then
423 if [ "${i}" != "${i#*MIRBSD}" ]; then
428 if [ -n "${JOBMON}" ]; then
429 ( set -m ) </dev
/null
>/dev
/null
2>&1 || JOBMON
=
431 printf >&2 '%s! $JOBMON: $SHELL %s incapable, disabled!%s\n' \
432 "${COLOR_ERR_ON}" "${SHELL}" "${COLOR_ERR_OFF}"
433 printf >&2 '%s! No process groups available, killed tests may '\
434 'leave process "zombies"!%s\n' \
435 "${COLOR_ERR_ON}" "${COLOR_ERR_OFF}"
445 if [ ${JOBS} -gt 0 ]; then
446 echo 'Cleaning up running jobs'
447 [ -n "${JOBREAPER}" ] && kill -KILL ${JOBREAPER} >/dev
/null
2>&1
455 if [ -n "${CHECK}" ] && [ -n "${SKIPTEST}" ]; then
461 while [ ${#} -gt 0 ]; do
462 if [ "${1}" != "${j}" ]; then
463 SKIPTEST
="${SKIPTEST} ${1}"
464 elif [ -z "${k}" ]; then
470 [ -n "${k}" ] && return
474 if [ ${MAXJOBS} -gt 1 ]; then
475 # We are spawning multiple jobs..
476 [ ${JOBS} -eq 0 ] && printf '...'
478 printf ' [%s=%s]' ${JOBS} "${1}"
481 # Assume problems exist, do not let user keep hanging on terminal
482 if [ -n "${RUN_TEST}" ]; then
483 printf '... [%s]\n' "${1}"
487 [ -n "${JOBMON}" ] && set -m >/dev
/null
2>&1
488 ( # Place the job in its own directory to ease file management
489 trap '' EXIT HUP INT QUIT TERM USR1 USR2
490 ${mkdir} t.${JOBS}.d && cd t.${JOBS}.d
&&
491 eval t_
${1} ${JOBS} ${1} &&
492 ${rm} -f ..
/t.
${JOBS}.id
493 ) > t.
${JOBS}.io
</dev
/null
& # 2>&1 </dev/null &
495 [ -n "${JOBMON}" ] && set +m
>/dev
/null
2>&1
496 JOBLIST
="${JOBLIST} ${i}"
497 printf '%s\n%s\n' ${i} ${1} > t.${JOBS}.id
499 # ..until we should sync or reach the maximum concurrent number
500 [ ${JOBS} -lt ${MAXJOBS} ] && return
506 if [ ${JOBS} -eq 0 ]; then
507 [ -n "${TEST_ANY}" ] && printf '\n'
511 [ -z "${JOBSYNC}" ] && [ ${#} -eq 0 ] && return
513 [ ${MAXJOBS} -ne 1 ] && printf ' .. waiting\n'
515 # Start an asynchronous notify process
516 ${rm} -f .
/t.
time.out
520 trap "kill -TERM ${sleeper}; exit 1" HUP INT TERM
523 printf '' > .
/t.
time.out
524 ) </dev
/null
>/dev
/null
2>&1 &
527 # Then loop a while, looking out for collecting tests
530 [ -f .
/t.
time.out
] && break
533 while [ ${i} -lt ${JOBS} ]; do
535 [ -f t.
${i}.id
] ||
continue
539 [ -n "${alldone}" ] && break
541 if [ -z "${SUBSECOND_SLEEP}" ]; then
542 loops
=`add ${loops} 1`
543 [ ${loops} -lt 111 ] && continue
551 if [ -f .
/t.
time.out
]; then
552 ${rm} -f .
/t.
time.out
555 kill -TERM ${JOBREAPER} >/dev
/null
2>&1
560 # Now collect the zombies
564 # Update global counters
566 while [ ${i} -lt ${JOBS} ]; do
569 [ -s t.
${i}.io ] && ${cat} t.${i}.io
570 if [ -n "${DUMPERR}" ] && [ -s ./t.${i}.d/${ERR} ]; then
571 printf '%s [Debug/Devel: nullified errors]\n' "${COLOR_ERR_ON}"
573 printf ' %s\n' "${l}"
574 done < t.${i}.d/${ERR}
575 printf '%s' "${COLOR_ERR_OFF}"
578 if [ -f t.${i}.id ]; then
579 { read pid; read desc; } < t.${i}.id
580 desc=${desc#${desc%%[! ]*}}
581 desc=${desc%${desc##*[! ]}}
582 [ -s t.${i}.io ] && printf >&2 '\n'
583 printf >&2 '%s!! Timeout: reaped job %s [%s]%s\n' \
584 "${COLOR_ERR_ON}" ${i} "${desc}" "${COLOR_ERR_OFF}"
585 TESTS_FAILED=`add ${TESTS_FAILED} 1`
586 elif [ -s t.${i}.result ]; then
587 read es tp to tf ts < t.${i}.result
588 TESTS_PERFORMED=`add ${TESTS_PERFORMED} ${tp}`
589 TESTS_OK=`add ${TESTS_OK} ${to}`
590 TESTS_FAILED=`add ${TESTS_FAILED} ${tf}`
591 TESTS_SKIPPED=`add ${TESTS_SKIPPED} ${ts}`
592 [ "${es}" != 0 ] && ESTAT=${es}
594 TESTS_FAILED=`add ${TESTS_FAILED} 1`
599 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
600 ${rm} -rf ./t.*.d ./t.*.id ./t.*.io t.*.result ./t.time.out
607 while [ ${i} -lt ${JOBS} ]; do
609 if [ -f t.${i}.id ] &&
610 read pid < t.${i}.id >/dev/null 2>&1 &&
611 kill -0 ${pid} >/dev/null 2>&1; then
613 [ -n "${JOBMON}" ] && j=-${j}
614 kill -KILL ${j} >/dev/null 2>&1
622 # echoes, checks, etc. {{{
626 ESTAT=0 TESTS_PERFORMED=0 TESTS_OK=0 TESTS_FAILED=0 TESTS_SKIPPED=0 \
627 TEST_NAME=${1} TEST_ANY=
629 printf '%s[%s]%s\n' "" "${TEST_NAME}" ""
633 [ -n "${TEST_ANY}" ] && printf '\n'
635 printf '%s %s %s %s %s\n' \
637 ${TESTS_PERFORMED} ${TESTS_OK} ${TESTS_FAILED} ${TESTS_SKIPPED} \
642 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
643 printf "${__i__}"'%s' "${*}"
648 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
649 printf "${__i__}"'%s%s:ok%s' "${COLOR_OK_ON}" "${*}" "${COLOR_OK_OFF}"
659 [ -n "${TEST_ANY}" ] && __i__="\n" || __i__=
660 printf "${__i__}"'%sERROR: %s%s\n' \
661 "${COLOR_ERR_ON}" "${*}" "${COLOR_ERR_OFF}"
666 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
667 printf "${__i__}"'%s%s%s' "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
672 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
673 printf "${__i__}"'%s%s[skip]%s' \
674 "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
676 TESTS_SKIPPED=`add ${TESTS_SKIPPED} 1`
680 restat=${?} tid=${1} eestat=${2} f=${3} s=${4} optmode=${5}
682 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
687 [ "$eestat" = - ] || exit 200
689 [ -f "${f}" ] && break
690 t_echowarn "[${tid}:async
=wait]"
698 check__bad= check__runx=
700 if [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ]; then
702 t_echoerr "${tid}: bad-status: ${restat} != ${eestat}"
706 csum="`${cksum} < "${f}" | ${sed} -e 's/[ ]\{1,\}/ /g'`"
707 if [ "${csum}" = "${s}" ]; then
709 check__runx=${DEVELDIFF}
712 t_echoerr "${tid}: checksum mismatch
(got
${csum})"
713 check__bad=1 check__runx=1
716 if [ -z "${check__bad}" ]; then
717 TESTS_OK=`add ${TESTS_OK} 1`
719 TESTS_FAILED=`add ${TESTS_FAILED} 1`
722 if [ -n "${CHECK}${RUN_TEST}" ]; then
723 x="t.
${TEST_NAME}-${tid}"
724 if [ -n "${RUN_TEST}" ] ||
725 [ -n "${check__runx}" -a -n "${GIT_REPO}" ]; then
726 ${cp} -f "${f}" ../"${x}"
729 if [ -n "${check__runx}" ] && [ -n "${GIT_REPO}" ] &&
730 command -v diff >/dev
/null
2>&1; then
732 if (git rev-parse
--verify $y) >/dev
/null
2>&1; then :; else
733 y
=refs
/remotes
/origin
/test-out
734 (git rev-parse
--verify $y) >/dev
/null
2>&1 || y
=
736 if [ -n "${y}" ]; then
737 if GIT_CONFIG
=/dev
/null git show
"${y}":"${x}" > \
738 ..
/"${x}".old
2>/dev
/null
; then
739 diff -ru ..
/"${x}".old ../"${x}" > ../"${x}".
diff
740 if [ ${?} -eq 0 ]; then
741 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
742 ${rm} -f ../"${x}" ../"${x}".old ../"${x}".diff
743 elif [ -n "${MAILX_CC_ALL_TESTS_DUMPERR}" ]; then
745 printf 'ERROR-DIFF %s\n' "${l}"
746 done < ../"${x}".diff
749 t_echo0err "${tid}: misses
[test-out
] template
"
757 # $1=test name [$2=status]
759 [ ${#} -gt 1 ] && __qm__=${2}
761 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
763 if [ ${__qm__} -ne 0 ]; then
765 t_echoerr "${1}: unexpected non-0
exit status
: ${__qm__}"
766 TESTS_FAILED=`add ${TESTS_FAILED} 1`
769 TESTS_OK=`add ${TESTS_OK} 1`
774 # $1=test name [$2=status]
776 [ ${#} -gt 1 ] && __qm__=${2}
777 [ ${#} -gt 2 ] && __expect__=${3} || __expect__=
779 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
781 if [ ${__qm__} -eq 0 ]; then
783 t_echoerr "${1}: unexpected
0 exit status
: ${__qm__}"
784 TESTS_FAILED=`add ${TESTS_FAILED} 1`
785 elif [ -n "${__expect__}" ] && [ ${__expect__} -ne ${__qm__} ]; then
787 t_echoerr
"${1}: unexpected exit status: ${__qm__} != ${__expected__}"
788 TESTS_FAILED
=`add ${TESTS_FAILED} 1`
791 TESTS_OK
=`add ${TESTS_OK} 1`
797 [ -n "${NOCOLOUR}" ] && return
798 [ -n "${MAILX_CC_TEST_NO_COLOUR}" ] && return
799 # We do not want color for "make test > .LOG"!
800 if command -v stty
>/dev
/null
2>&1 && command -v tput >/dev
/null
2>&1 &&
801 (<&1 >/dev
/null stty
-a) 2>/dev
/null
; then
802 { sgr0
=`tput sgr0`; } 2>/dev
/null
803 [ $?
-eq 0 ] ||
return
804 { saf1
=`tput setaf 1`; } 2>/dev
/null
805 [ $?
-eq 0 ] ||
return
806 { saf2
=`tput setaf 2`; } 2>/dev
/null
807 [ $?
-eq 0 ] ||
return
808 { saf3
=`tput setaf 3`; } 2>/dev
/null
809 [ $?
-eq 0 ] ||
return
810 { b
=`tput bold`; } 2>/dev
/null
811 [ $?
-eq 0 ] ||
return
813 COLOR_ERR_ON
=${saf1}${b} COLOR_ERR_OFF=${sgr0}
814 COLOR_WARN_ON
=${saf3}${b} COLOR_WARN_OFF=${sgr0}
815 COLOR_OK_ON
=${saf2} COLOR_OK_OFF
=${sgr0}
816 unset saf1 saf2 saf3 b
820 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
822 echo "$((${1} + ${2}))"
826 ${awk} 'BEGIN{print '${1}' + '${2}'}'
830 if ( [ "$((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
832 echo "$((${1} % ${2}))"
836 ${awk} 'BEGIN{print '${1}' % '${2}'}'
841 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
842 ${grep} ,+${1}, ) >/dev
/null
2>&1
846 # Absolute Basics {{{
847 t_X_Y_opt_input_go_stack
() {
850 ${cat} <<- '__EOT' > "${BODY}"
858 echo "define mac1 {";\
859 echo " echo mac1-1 via1 \$0";\
861 echo " echo mac1-2";\
863 echo " echo mac1-3";\
866 echo "define mac2 {";\
867 echo " echo mac2-1 via1 \$0";\
869 echo " echo mac2-2";\
875 echo echo 1-1-1 via1 \$0;\
887 # The -X option supports multiline arguments, and those can internally use
888 # reverse solidus newline escaping. And all -X options are joined...
890 < "${BODY}" ${MAILX} ${ARGS} \
905 echo "define mac1 {";\
906 echo " echo mac1-1 via2 \$0";\
908 echo " echo mac1-2";\
910 echo " echo mac1-3";\
913 echo "define mac2 {";\
914 echo " echo mac2-1 via2 \$0";\
916 echo " echo mac2-2";\
922 echo echo 1-1-1 via2 \$0;\
936 check 1 0 "${MBOX}" '1786542668 416'
938 # The -Y option supports multiline arguments, and those can internally use
939 # reverse solidus newline escaping.
941 < "${BODY}" ${MAILX} ${ARGS} \
958 echo "define mac1 {";\
959 echo " echo mac1-1 via2 \$0";\
961 echo " echo mac1-2";\
963 echo " echo mac1-3";\
966 echo "define mac2 {";\
967 echo " echo mac2-1 via2 \$0";\
969 echo " echo mac2-2";\
975 echo echo 1-1-1 via2 \$0;\
988 -Y 'echo LAST_Y' > "${MBOX}"
990 check 2 0 "${MBOX}" '1845176711 440'
993 </dev/null ${MAILX} ${ARGS} \
994 -X 'echo X before compose mode' \
995 -Y '~s Subject via -Y' \
996 -Y 'Body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
997 check
3 0 .
/.tybox
'264636255 125'
998 check
4 - "${MBOX}" '467429373 22'
1000 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t \
1001 -X 'echo X before compose mode' \
1002 -Y '~s Subject via -Y' \
1003 -Y 'Additional body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
1005 subject
:diet not to be seen
!
1009 check
5 0 .
/.tybox
'3313167452 299'
1010 check
6 - "${MBOX}" '467429373 22'
1013 printf 'this body via stdin pipe.\n' |
${MAILX} ${NOBATCH_ARGS} \
1014 -X 'echo X before compose mode' \
1015 -Y '~s Subject via -Y (not!)' \
1016 -Y 'Additional body via -Y, nobatch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1017 check
7 0 .
/.tybox
'1561798488 476'
1018 check
8 - "${MBOX}" '467429373 22'
1020 printf 'this body via stdin pipe.\n' |
${MAILX} ${ARGS} \
1021 -X 'echo X before compose mode' \
1022 -Y '~s Subject via -Y' \
1023 -Y 'Additional body via -Y, batch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1024 check
9 0 .
/.tybox
'3245082485 650'
1025 check
10 - "${MBOX}" '467429373 22'
1027 # Test for [8412796a] (n_cmd_arg_parse(): FIX token error -> crash, e.g.
1028 # "-RX 'bind;echo $?' -Xx".., 2018-08-02)
1029 ${MAILX} ${ARGS} -RX'call;echo $?' -Xx > .
/.tall
2>&1
1030 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1031 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1032 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1033 check cmdline
0 .
/.tall
'1867586969 8'
1041 if have_feat uistrings
; then :; else
1042 t_echoskip
'[!UISTRINGS]'
1047 ${cat} <<- '__EOT' > "${BODY}"
1053 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1054 -X'echo one' -X' echos nono ' -X'echo two' \
1056 check 1 0 "${MBOX}" '2700500141 51'
1058 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
1060 check 2 0 "${MBOX}" '2700500141 51'
1062 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
1064 check
3 0 "${MBOX}" '2700500141 51'
1068 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1069 -X'echo one' -X' echos nono ' -X'echo two' \
1071 check
4 1 "${MBOX}" '4096689457 47'
1073 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
1075 check 5 1 "${MBOX}" '4096689457 47'
1077 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1079 check
6 1 "${MBOX}" '1669262132 170'
1081 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1083 check 7 1 "${MBOX}" '1669262132 170'
1085 ## Repeat 4-7 with ignerr set
1087 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1089 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1090 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
1092 check
8 0 "${BODY}" '2700500141 51'
1094 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
1096 check 9 0 "${BODY}" '2700500141 51'
1098 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1100 check
10 0 "${BODY}" '2700500141 51'
1102 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1104 check 11 0 "${BODY}" '2700500141 51'
1106 # Ensure "good-injection
" in a deeper indirection does not cause trouble
1107 # This actually only works with MLE and HISTORY, and TODO needs a pseudo TTY
1108 # interaction so that we DO initialize our line editor...
1109 ${cat} <<- '__EOT' > "${BODY}"
1120 printf 'source %s\ncall x\necho au' "${BODY}" |
1121 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1122 check
12 1 "${MBOX}" '2908921993 44'
1124 printf 'source %s\nset on-history-addition=oha\ncall x\necho au' "${BODY}" |
1125 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1126 check 13 1 "${MBOX}" '2908921993 44'
1128 printf 'source %s\ncall x\necho au' "${BODY}" |
1129 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=nowhere > "${MBOX}" 2>&1
1130 check
14 0 "${MBOX}" '2049365617 47'
1138 if have_feat uistrings
; then :; else
1139 t_echoskip
'[!UISTRINGS]'
1144 ${cat} <<- '__EOT' > "${BODY}"
1150 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1151 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1153 check 1 0 "${MBOX}" '2700500141 51'
1155 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Snomemdebug \
1157 check 2 0 "${MBOX}" '2700500141 51'
1161 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1162 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1164 check 3 1 "${MBOX}" '4096689457 47'
1166 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Serrexit -Snomemdebug \
1168 check 4 1 "${MBOX}" '4096689457 47'
1170 ## Repeat 3-4 with ignerr set
1172 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1174 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1175 -Y'echo one' -Y'ignerr echos nono ' -Y'echo two' \
1177 check 5 0 "${BODY}" '2700500141 51'
1179 </dev/null ${MAILX} ${ARGS} -Y'source '"${MBOX}" -Serrexit -Snomemdebug \
1181 check 6 0 "${BODY}" '2700500141 51'
1191 # Test basic assumption
1192 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
1193 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
1194 -Xx > "${MBOX}" 2>&1
1195 check 1 0 "${MBOX}" '270686329 21'
1198 ${cat} <<- '__EOT' > "${BODY}"
1199 echo asksub<$asksub>
1201 echo asksub<$asksub>
1203 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1204 -Snoasksub -Sasksub -Snoasksub \
1205 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
1206 -Xx > "${MBOX}" 2>&1
1207 check
2 0 "${MBOX}" '3182942628 37'
1209 ${cat} <<- '__EOT' > "${BODY}"
1210 echo asksub<$asksub>
1212 echo asksub<$asksub>
1214 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1215 -Snoasksub -Sasksub \
1216 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
1217 -Xx > "${MBOX}" 2>&1
1218 check
3 0 "${MBOX}" '2006554293 39'
1221 ${cat} <<- '__EOT' > "${BODY}"
1222 echo dietcurd<$dietcurd>
1224 echo dietcurd<$dietcurd>
1226 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1227 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
1228 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
1229 -X'echo dietcurd<$dietcurd>' \
1230 -Xx > "${MBOX}" 2>&1
1231 check
4 0 "${MBOX}" '1985768109 65'
1233 ${cat} <<- '__EOT' > "${BODY}"
1234 echo dietcurd<$dietcurd>
1236 echo dietcurd<$dietcurd>
1238 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1239 -Sdietcurd=strawberry
-Snodietcurd \
1240 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
1241 -X'echo dietcurd<$dietcurd>' \
1242 -Xx > "${MBOX}" 2>&1
1243 check
5 0 "${MBOX}" '151574279 51'
1245 # TODO once we have a detached one with env=1..
1246 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
1247 t_echoskip
's_freeze-{6,7}:[shell sets $TERM]'
1249 ${cat} <<- '__EOT' > "${BODY}"
1250 !echo "shell says TERM<$TERM>"
1252 !echo "shell says TERM<$TERM>"
1254 !echo "shell says TERM<$TERM>"
1256 !echo "shell says TERM<$TERM>"
1258 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1259 -STERM=strawberry
-SnoTERM -STERM=vanilla \
1260 -X'echo mail<$TERM>' -X'unset TERM' \
1261 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1262 -Xx > "${MBOX}" 2>&1
1263 check
6 0 "${MBOX}" '1211476036 167'
1265 ${cat} <<- '__EOT' > "${BODY}"
1266 !echo "shell says TERM<$TERM>"
1268 !echo "shell says TERM<$TERM>"
1270 !echo "shell says TERM<$TERM>"
1272 !echo "shell says TERM<$TERM>"
1274 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1275 -STERM=strawberry
-SnoTERM \
1276 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
1277 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1278 -Xx > "${MBOX}" 2>&1
1279 check
7 0 "${MBOX}" '3365080441 132'
1289 t__gen_msg subject f-batch-order
> "${MBOX}"
1291 # This would exit 64 (EX_USAGE) from ? to [fbddb3b3] (FIX: -f: add
1292 # n_PO_f_FLAG to avoid that command line order matters)
1293 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -f -# \
1294 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1295 check
1 0 .
/.tall
'1690247457 86'
1297 # And this ever worked (hopefully)
1298 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -# -f \
1299 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1300 check
2 0 .
/.tall
'1690247457 86'
1305 t_input_inject_semicolon_seq
() {
1308 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1310 echon '(mydeepmac)';
1313 echon this_is_mymac;call mydeepmac;echon ';';
1315 echon one';';call mymac;echon two";";call mymac;echo three$';';
1317 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
1319 echon one';';call mymac;echon two";";call mymac;echo three$';';
1322 check 1 0 "${MBOX}" '512117110 140'
1330 ${cat} <<- '__EOT' > "${BODY}"
1349 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
1350 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
1351 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
1353 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
1354 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
1376 echo a$
'b\U000000'ds
1377 echo a$
'b\U0000000'dt
1378 echo a$
'b\U00000000'du
1388 if [ -z "${UTF8_LOCALE}" ]; then
1389 t_echoskip
'wysh-unicode:[no UTF-8 locale]'
1391 < "${BODY}" DIET
=CURD TIED
= \
1392 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1393 check unicode
0 "${MBOX}" '475805847 317'
1396 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1397 check c 0 "${MBOX}" '1473887148 321'
1399 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1400 wysh
set mager
='\hey\'
1402 wysh set mager="\hey\\"
1404 wysh set mager=$'\hey
\\'
1407 check 3 0 "${MBOX}" '1289698238 69'
1415 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1416 commandalias echo echo hoho
1420 commandalias XxX XxXx
1421 commandalias XxXx XxXxX
1422 commandalias XxXxX XxXxXx
1423 commandalias XxXxXx echo huhu
1424 commandalias XxXxXxX echo huhu
1426 commandalias XxXxXx XxXxXxX
1429 commandalias XxXxXx echo huhu
1433 check 1 0 "${MBOX}" '1638809585 36'
1441 # In POSIX C181 standard order
1442 </dev/null ${MAILX} ${ARGS} \
1443 -Y 'echon alias
/a\
; ? a
; echon group
/g\
; ?g
' \
1444 -Y 'echon alternates
/alt\
; ? alt
' \
1445 -Y 'echon chdir
/ch\
; ? ch
' \
1446 -Y 'echon copy
/c\
; ? c
; echon Copy
/C\
; ?C
' \
1447 -Y 'echon delete
/d\
; ? d
' \
1448 -Y 'echon discard
/di\
; ? di
; echon ignore
/ig\
; ?ig
' \
1449 -Y 'echon echo
/ec\
; ? ec
' \
1450 -Y 'echon edit
/e\
; ? e
' \
1451 -Y 'echon exit
/ex\
; ? ex
; echon xit
/x\
; ?x
' \
1452 -Y 'echon file
/fi\
; ?
fi; echon folder
/fold\
; ?
fold' \
1453 -Y 'echon followup
/fo\
; ? fo
; echon Followup
/F\
; ?F
' \
1454 -Y 'echon from
/f\
; ? f
' \
1455 -Y 'echon headers
/h\
; ? h
' \
1456 -Y 'echon help
/hel\
; ? hel
' \
1457 -Y 'echon hold
/ho\
; ? ho
; echon preserve
/pre\
; ? pre
' \
1458 -Y 'echon if
/i\
; ? i
; echon else
/el\
; ? el
; echon endif
/en\
; ? en
' \
1459 -Y 'echon list
/l\
; ? l
' \
1460 -Y 'echon mail
/m\
; ? m
' \
1461 -Y 'echon mbox
/mb\
; ? mb
' \
1462 -Y 'echon next
/n\
; ? n
' \
1463 -Y 'echon pipe
/pi\
; ? pi
' \
1464 -Y 'echon Print
/P\
; ? P
; echon Type
/T\
; ? T
' \
1465 -Y 'echon print
/p\
; ? p
; echon type
/t\
; ? t
' \
1466 -Y 'echon quit
/q\
; ? q
' \
1467 -Y 'echon Reply
/R\
; ? R
' \
1468 -Y 'echon reply
/r\
; ? r
' \
1469 -Y 'echon retain
/ret\
; ? ret
' \
1470 -Y 'echon save
/s\
; ? s
; echon Save
/S\
; ? S
' \
1471 -Y 'echon set
/se\
; ? se
' \
1472 -Y 'echon shell
/sh\
; ? sh
' \
1473 -Y 'echon size
/si\
; ? si
' \
1474 -Y 'echon source
/so\
; ? so
' \
1475 -Y 'echon touch
/tou\
; ? tou
' \
1476 -Y 'echon unalias
/una\
; ? una
' \
1477 -Y 'echon undelete
/u\
; ? u
' \
1478 -Y 'echon unset
/uns\
; ? uns
' \
1479 -Y 'echon visual
/v\
; ? v
' \
1480 -Y 'echon write
/w\
; ? w
' \
1481 | ${sed} -e 's
/:.
*$
//' > "${MBOX}"
1482 check 1 0 "${MBOX}" '1012680481 968'
1492 # XXX the first needs to be checked, it is quite dumb as such
1493 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1494 commandalias x echo '$?
/$^ERRNAME
'
1507 shcodec e a$'b
'c$'d
'
1509 shcodec d a$'b
'c$'d
'
1523 # same but with vput
1524 commandalias y echo '$?
/$^ERRNAME
$res'
1525 vput shcodec res e abcd
1529 vput shcodec res d abcd
1533 vput shcodec res e a'b
'c'd
'
1537 vput shcodec res d a'b
'c'd
'
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 'abcd
'
1561 vput shcodec res d 'abcd
'
1565 vput shcodec res e "abcd"
1569 vput shcodec res d "abcd"
1573 vput shcodec res e $'abcd
'
1577 vput shcodec res d $'abcd
'
1582 vput shcodec res e a b\ c d
1586 vput shcodec res d a b\ c d
1588 vput shcodec res e ab cd
1592 vput shcodec res d 'ab
cd'
1594 vput shcodec res e a 'b c
' d
1598 vput shcodec res d a 'b c
' d
1600 vput shcodec res e a "b c" d
1604 vput shcodec res d a "b c" d
1606 vput shcodec res e a $'b c
' d
1610 vput shcodec res d a $'b c
' d
1613 vput shcodec res e 'a$
`"\'
1617 vput shcodec res d 'a$`"\'
1619 vput shcodec res e "a\$\
`'\"\\"
1623 vput shcodec res d "a\$\`'\"\\"
1625 vput shcodec res e $'a\$
`\'\"\\'
1629 vput shcodec res d $'a\$`\'\"\\'
1631 vput shcodec res e $'a\$
`\'"\\'
1635 vput shcodec res d $'a\$`\'"\\'
1639 vput shcodec res e a${diet}c
1643 eval vput shcodec res e a${diet}c
1647 vput shcodec res e "a
${diet}c
"
1651 eval vput shcodec res e "a
${diet}c
"
1656 check 1 0 "${MBOX}" '3316745312 1241'
1658 if [ -z "${UTF8_LOCALE}" ]; then
1659 t_echoskip 'unicode:[no UTF-8 locale]'
1660 elif have_feat multibyte-charsets; then
1661 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
1662 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1666 shcodec d $'t\u00E4st'
1669 shcodec d $'a\u054Dc'
1672 shcodec d $'a\U0001D542c'
1674 check unicode 0 "${MBOX}" '1175985867 77'
1676 t_echoskip 'unicode:[!MULTIBYTE-CHARSETS]'
1685 # v15compat: old and new tests share the same result files!
1686 # v15compat: i.e., just throw away -old tests one day
1688 # Nestable conditions test
1689 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1711 if $dietcurd == 'yoho'
1716 if $dietcurd ==?
'Yoho'
1721 if $dietcurd == 'Yoho'
1726 if $dietcurd != 'yoho'
1731 if $dietcurd !=?
case 'Yoho'
1736 if $dietcurd != 'Yoho'
1797 if $dietcurd == 'yohu'
1799 elif $dietcurd == 'yoha'
1801 elif $dietcurd == 'yohe'
1803 elif $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'
1875 if $dietcurd ==?
case aBC
1880 if $dietcurd >=?ca AbC
1885 if $dietcurd <=? ABc
1890 if $dietcurd >=?
case abd
1895 if $dietcurd <=? abb
1923 if $dietcurd =%?
case aB
1968 set diet
=abc curd
=abc
1974 set diet
=abc curd
=abcd
1980 # 1. Shitty grouping capabilities as of today
1981 unset diet curd ndefined
1982 if [ [ false
] ||
[ false
] ||
[ true
] ] && \
1983 [ [ false
] ||
[ true
] ] && \
1989 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
1994 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
1999 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
2004 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
2009 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
2010 && [ no
] ||
[ yes ]
2015 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2020 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2025 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2030 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2035 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
2040 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
2045 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
2050 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
2055 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
2060 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
2066 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2072 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2077 # 2. Shitty grouping capabilities as of today
2078 unset diet curd ndefined
2079 if [ false || false || true
] && [ false || true
] && yes
2084 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
2089 if [ 1 ||
0 ||
0 ||
0 ]
2094 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
2099 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
2104 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
2109 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2114 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2119 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2124 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2129 if 1 ||
0 ||
0 ||
0 && 0
2134 if 1 ||
0 ||
0 ||
0 && 1
2139 if 0 ||
0 ||
0 ||
1 && 0
2144 if 0 ||
0 ||
0 ||
1 && 1
2149 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
2154 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
2160 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2165 if $diet == 'yo' && $curd == 'ho' && $ndefined
2171 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2176 if $diet == 'yo' && $curd == 'ho' && $ndefined
2181 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
2186 # Some more en-braced variables
2188 if ${diet} == ${curd}
2193 if ${diet} != ${curd}
2209 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2214 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2219 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2224 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2229 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2234 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2239 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2244 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
2249 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
2255 if ! 0 && ! ! 1 && ! ! ! 0 && 3
2260 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
2265 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
2270 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
2275 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
2280 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
2285 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
2290 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
2295 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
2302 check normal-old
0 "${MBOX}" '1688759742 719' # pre v15compat
2304 if have_feat regex
; then
2305 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
2307 if $dietcurd =~ '^yo.*'
2312 if $dietcurd =~ '^Yo.*'
2317 if $dietcurd =~?case '^Yo.*'
2322 if $dietcurd =~ '^yOho.+'
2327 if $dietcurd !~? '.*Ho$'
2332 if $dietcurd !~ '.+yohO$'
2337 if [ $dietcurd !~?cas '.+yoho$' ]
2342 if ! [ $dietcurd =~?case '.+yoho$' ]
2347 if ! ! [ $dietcurd !~? '.+yoho$' ]
2352 if ! [ ! [ $dietcurd !~? '.+yoho$' ] ]
2357 if [ ! [ ! [ $dietcurd !~? '.+yoho$' ] ] ]
2362 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2367 if ! ! ! $dietcurd !~ '.+yoho$'
2372 if ! ! ! $dietcurd =~ '.+yoho$'
2377 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2382 set diet=abc curd='^abc$'
2388 set diet=abc curd='^abcd$'
2396 check regex-old 0 "${MBOX}" '1115671789 95' # pre v15compat
2398 t_echoskip 'regex-old:[no regex option]'
2403 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
2404 \
if -N xyz
; echo 1.err-1
; \
2405 \
elif ! -Z xyz
;echo 1.err-2
;\
2406 \
elif -n "$xyz" ; echo 1.err-3
; \
2407 \
elif ! -z "$xyz" ; echo 1.err-4
; \
2411 \
if ! -N xyz
; echo 2.err-1
; \
2412 \
elif -Z xyz
;echo 2.err-2
;\
2413 \
elif -n "$xyz" ; echo 2.err-3
; \
2414 \
elif ! -z "$xyz" ; echo 2.err-4
; \
2418 \
if ! -N xyz
; echo 3.err-1
; \
2419 \
elif -Z xyz
;echo 3.err-2
;\
2420 \
elif ! -n "$xyz";echo 3.err-3
;\
2421 \
elif -z "$xyz";echo 3.err-4
;\
2424 \
if $xyz != notempty
;echo 4.err-1
;else;echo 4.ok
;\end
2425 \
if $xyz == notempty
;echo 5.ok
;else;echo 5.err-1
;\end
2428 check NnZz_whiteout
0 "${MBOX}" '4280687462 25'
2430 # TODO t_ifelse: individual tests as for NnZz_whiteout
2431 # Nestable conditions test
2432 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=x > "${MBOX}"
2443 if [ "$dietcurd" != "" ]
2449 if $'\$dietcurd' != ""
2454 if "$dietcurd" == 'yoho'
2459 if $'\$dietcurd' ==? 'Yoho'
2464 if $dietcurd == 'Yoho'
2469 if $dietcurd != 'yoho'
2474 if $dietcurd !=?case 'Yoho'
2479 if $dietcurd != 'Yoho'
2540 if $dietcurd == 'yohu'
2542 elif $dietcurd == 'yoha'
2544 elif $dietcurd == 'yohe'
2546 elif $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'
2602 if $dietcurd -ge?satu -0xFFFFFFFFFFFFFFFF1
2618 if $dietcurd ==?case aBC
2623 if $dietcurd >=?ca AbC
2628 if $dietcurd <=? ABc
2633 if $dietcurd >=?case abd
2638 if $dietcurd <=? abb
2666 if $dietcurd =%?case aB
2711 set diet='ab c' curd='ab c'
2712 if "$diet" == "$curd"
2717 set diet='ab c' curd='ab cd'
2718 if "$diet" != "$curd"
2723 # 1. Shitty grouping capabilities as of today
2724 unset diet curd ndefined
2725 if [ [ false ] || [ false ] || [ true ] ] && \
2726 [ [ false ] || [ true ] ] && \
2732 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
2737 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
2742 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
2747 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
2752 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
2753 && [ no ] || [ yes ]
2758 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2763 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2768 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2773 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2778 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
2783 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
2788 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
2793 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
2798 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
2803 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
2809 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2810 [ -N ndefined || -n "$ndefined" || \
2811 ! -Z ndefined || ! -z "$ndefined" ]
2817 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2818 -N ndefined && ! -n "$ndefined" && \
2819 ! -Z ndefined && -z "$ndefined"
2824 # 2. Shitty grouping capabilities as of today
2825 unset diet curd ndefined
2826 if [ false || false || true ] && [ false || true ] && yes
2831 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
2836 if [ 1 || 0 || 0 || 0 ]
2841 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
2846 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
2851 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
2856 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2861 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2866 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2871 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2876 if 1 || 0 || 0 || 0 && 0
2881 if 1 || 0 || 0 || 0 && 1
2886 if 0 || 0 || 0 || 1 && 0
2891 if 0 || 0 || 0 || 1 && 1
2896 if 0 || 0 || 0 || 1 && 0 || 1 && 0
2901 if 0 || 0 || 0 || 1 && 0 || 1 && 1
2907 if [ $diet == 'yo' && $curd == 'ho' ] && \
2908 [ -N ndefined || -n "$ndefined" || \
2909 ! -Z ndefined || ! -z "$ndefined" ]
2914 if [ $diet == 'yo' && $curd == 'ho' && \
2915 [ [ -N ndefined || -n "$ndefined" || \
2916 ! -Z ndefined || ! -z "$ndefined" ] ] ]
2922 if [ $diet == 'yo' && $curd == 'ho' ] && \
2923 -N ndefined && ! -n "$ndefined" && \
2924 ! -Z ndefined && -z "$ndefined"
2929 if $diet == 'yo' && $curd == 'ho' && ! -Z ndefined
2934 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && -N ndefined ] ] ] ] ] ]
2939 # Some more en-braced variables
2941 if ${diet} == ${curd}
2946 if "${diet}" != "${curd}"
2962 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2967 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2972 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2977 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2982 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2987 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2992 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2997 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
3002 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
3008 if ! 0 && ! ! 1 && ! ! ! 0 && 3
3013 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
3018 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
3023 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
3028 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
3033 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
3038 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
3043 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
3048 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
3055 check normal 0 "${MBOX}" '1688759742 719'
3057 if have_feat regex; then
3058 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
3060 if $dietcurd =~
'^yo.*'
3065 if "$dietcurd" =~
'^Yo.*'
3070 if $dietcurd =~?
case '^Yo.*'
3075 if $dietcurd =~
'^yOho.+'
3080 if $dietcurd !~?
'.*Ho$'
3085 if $dietcurd !~
'.+yohO$'
3090 if [ $dietcurd !~?cas
'.+yoho$' ]
3095 if ! [ "$dietcurd" =~?
case '.+yoho$' ]
3100 if ! ! [ $
'\$dietcurd' !~?
'.+yoho$' ]
3105 if ! [ ! [ $dietcurd !~?
'.+yoho$' ] ]
3110 if [ ! [ ! [ $dietcurd !~?
'.+yoho$' ] ] ]
3115 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3120 if ! ! ! $dietcurd !~
'.+yoho$'
3125 if ! ! ! $dietcurd =~
'.+yoho$'
3130 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3135 set diet
=abc curd
='^abc$'
3141 set diet
=abc curd
='^abcd$'
3142 if "$diet" !~ $
'\$curd'
3149 check regex
0 "${MBOX}" '1115671789 95'
3151 t_echoskip
'regex:[!REGEX]'
3160 # Nestable conditions test
3161 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3176 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3181 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3182 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
3191 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3193 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3202 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3209 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3216 echo ----- $1: $2 -> $3 -> $4
3224 call llx 'call off' on on on
3225 call llx 'call off' off on on
3226 call llx 'call off' on off on
3227 call llx 'call off' on off off
3228 localopts call-fixate on
3229 call llx 'call-fixate on' on on on
3230 call llx 'call-fixate on' off on on
3231 call llx 'call-fixate on' on off on
3232 call llx 'call-fixate on' on off off
3233 unset x;localopts call on
3234 call llx 'call on' on on on
3235 call llx 'call on' off on on
3236 call llx 'call on' on off on
3237 call llx 'call on' on off off
3242 check 1 0 "${MBOX}" '4016155249 1246'
3250 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3278 echo ------- global-1 du
=$du
3280 echo ------- global-2 du
=$du
3283 echo ------- global-3 du
=$du
3285 echo ------- global-4 du
=$du
3287 echo ------- global-5 du
=$du
3289 check
1 0 "${MBOX}" '2411598140 641'
3292 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3294 echo z-1: x=$x y=$y z=$z crt=$crt
3295 local set z=1 y=2 crt=10
3296 echo z-2: x=$x y=$y z=$z crt=$crt
3299 echo y-1: x=$x y=$y z=$z crt=$crt
3300 local set x=2 y=1 crt=5
3301 echo y-2: x=$x y=$y z=$z crt=$crt
3303 echo y-3: x=$x y=$y z=$z crt=$crt
3306 echo x-1: x=$x y=$y z=$z crt=$crt
3308 echo x-2: x=$x y=$y z=$z crt=$crt
3310 echo x-3: x=$x y=$y z=$z crt=$crt
3313 echo global-1: x=$x y=$y z=$z crt=$crt
3315 echo global-2: x=$x y=$y z=$z crt=$crt
3317 check 2 0 "${MBOX}" '2560788669 216'
3325 ${cat} <<- '__EOT' | EK1=EV1 EK2=EV2 ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3326 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3327 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3328 varshow EK1 EK2 EK3 EK4 NEK5
3330 echo environ
set EK3 EK4
, set NEK5
3331 environ
set EK3
=EV3 EK4
=EV4
3333 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3334 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3335 varshow EK1 EK2 EK3 EK4 NEK5
3337 echo removing NEK5 EK3
3340 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3341 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3342 varshow EK1 EK2 EK3 EK4 NEK5
3344 echo changing EK1
, EK4
3345 set EK1
=EV1_CHANGED EK4
=EV4_CHANGED
3346 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3347 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3348 varshow EK1 EK2 EK3 EK4 NEK5
3350 echo linking EK4
, rechanging EK1
, EK4
3353 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3354 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3355 varshow EK1 EK2 EK3 EK4 NEK5
3359 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3360 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3361 varshow EK1 EK2 EK3 EK4 NEK5
3364 check
1 0 "${MBOX}" '1685686686 1342'
3370 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3372 echo '-------> L4 (environ unlink EK1, own localopts)'
3375 set LK1=LK1_L4 EK1=EK1_L4
3376 echo "we
: L4
: LK1
<$LK1> EK1
<$EK1>"
3377 !echo "shell
: L4
: LK1
<$LK1> EK1
<$EK1>"
3383 set LK1=LK1_L3 EK1=EK1_L3
3384 echo "we
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3385 !echo "shell
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3388 echo "we
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3389 !echo "shell
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3395 set LK1=LK1_L2 EK1=EK1_L2
3396 echo "we
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3397 !echo "shell
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3400 echo "we
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3401 !echo "shell
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3406 echo '-------> L1 (environ link EK1; localopts call-fixate)'
3407 localopts call-fixate yes
3408 set LK1=LK1_L1 EK1=EK1_L1
3410 echo "we
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3411 !echo "shell
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3414 echo "we
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3415 !echo "shell
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3419 echo "we
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3420 !echo "shell
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3423 echo "we
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3424 !echo "shell
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3428 check 2 0 "${MBOX}" '1903030743 1131'
3433 t_macro_param_shift() {
3436 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3439 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3444 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3445 if [ $# > 1 ] || [ $ignerr == '' ]
3450 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3452 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3456 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3461 call t2 1 you get four args
3462 echo t1.1: $?';' ignerr ($ignerr) should not exist
3463 call t2 1 you get 'three args'
3464 echo t1.2: $?';' ignerr ($ignerr) should not exist
3465 call t2 1 you 'get two args'
3466 echo t1.3: $?';' ignerr ($ignerr) should not exist
3467 call t2 1 'you get one arg'
3468 echo t1.4: $?';' ignerr ($ignerr) should not exist
3469 ignerr call t2 '' 'you get one arg'
3470 echo t1.5: $?';' ignerr ($ignerr) should not exist
3475 check 1 0 "${MBOX}" '1402489146 1682'
3483 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3484 commandalias x
echo '$?/$^ERRNAME $res'
3485 vput addrcodec res e
1 <doog@def
>
3487 eval vput addrcodec res d
$res
3489 vput addrcodec res e
2 .
<doog@def
>
3491 eval vput addrcodec res d
$res
3493 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
3495 eval vput addrcodec res d
$res
3497 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
3499 eval vput addrcodec res d
$res
3501 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
3503 eval vput addrcodec res d
$res
3506 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
3508 eval vput addrcodec res d
$res
3510 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
3512 eval vput addrcodec res d
$res
3514 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
3516 eval vput addrcodec res d
$res
3518 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
3520 eval vput addrcodec res d
$res
3522 vput addrcodec res
+e
8 \
3523 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
3525 eval vput addrcodec res d
$res
3527 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
3529 eval vput addrcodec res d
$res
3531 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
3533 eval vput addrcodec res d
$res
3535 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
3537 eval vput addrcodec res d
$res
3539 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
3541 eval vput addrcodec res d
$res
3543 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
3545 eval vput addrcodec res d
$res
3547 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
3549 eval vput addrcodec res d
$res
3551 vput addrcodec res
+e
15 \
3552 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
3554 eval vput addrcodec res d
$res
3556 vput addrcodec res
+e
16 \
3557 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
3559 eval vput addrcodec res d
$res
3561 vput addrcodec res
+e
17 \
3562 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
3564 eval vput addrcodec res d
$res
3566 vput addrcodec res
+e
18 \
3567 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
3569 eval vput addrcodec res d
$res
3571 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3573 eval vput addrcodec res d
$res
3576 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3578 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
3580 eval vput addrcodec res d $res
3583 vput addrcodec res \
3584 +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
3586 eval vput addrcodec res d $res
3589 vput addrcodec res s \
3590 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
3593 # Fix for [f3852f88]
3594 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3596 eval vput addrcodec res d $res
3598 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3600 eval vput addrcodec res d $res
3604 check 1 0 "${MBOX}" '1047317989 2612'
3606 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3607 commandalias x
echo '$?/$^ERRNAME $res'
3609 mlsubscribe isa2@list
3611 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3613 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3615 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3617 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3619 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3621 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3625 check
2 0 "${MBOX}" '1391779299 104'
3627 if have_feat idna
; then
3628 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
3629 commandalias x echo '$?/$^ERRNAME $res'
3630 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
3632 eval vput addrcodec res d $res
3634 vput addrcodec res e <du@blödiän> du
3636 eval vput addrcodec res d $res
3638 vput addrcodec res e du <du@blödiän>
3640 eval vput addrcodec res d $res
3642 vput addrcodec res e <du@blödiän>
3644 eval vput addrcodec res d $res
3646 vput addrcodec res e du@blödiän
3648 eval vput addrcodec res d $res
3652 check idna 0 "${MBOX}" '498775983 326'
3654 t_echoskip 'idna:[!IDNA]'
3663 if have_feat cmd-csop; then :; else
3664 t_echoskip '[!CMD_CSOP]'
3669 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3670 commandalias x
echo '$?/$^ERRNAME :$res:'
3672 vput csop res
find you y
;x
3673 vput csop res
find you o
;x
3674 vput csop res
find you u
;x
3675 vput csop res
find you yo
;x
3676 vput csop res
find you ou
;x
3677 vput csop res
find you you
;x
3679 vput csop res
find you Y
;x
3680 vput csop res
find? you Y
;x
3681 vput csop res
find?
case you O
;x
3682 vput csop res
find? you U
;x
3683 vput csop res
find?ca you yO
;x
3684 vput csop res
find? you oU
;x
3685 vput csop res
find? you YoU
;x
3687 vput csop res
find 'bananarama' 'nana';x
3688 vput csop res
find 'bananarama' 'bana';x
3689 vput csop res
find 'bananarama' 'Bana';x
3690 vput csop res
find 'bananarama' 'rama';x
3692 vput csop res
find?
'bananarama' 'nana';x
3693 vput csop res
find?
'bananarama' 'bana';x
3694 vput csop res
find?
'bananarama' 'Bana';x
3695 vput csop res
find?
'bananarama' 'rama';x
3697 vput csop res substring
'bananarama' 1;x
3698 vput csop res substring
'bananarama' 3;x
3699 vput csop res substring
'bananarama' 5;x
3700 vput csop res substring
'bananarama' 7;x
3701 vput csop res substring
'bananarama' 9;x
3702 vput csop res substring
'bananarama' 10;x
3703 vput csop res substring
'bananarama' 1 3;x
3704 vput csop res substring
'bananarama' 3 3;x
3705 vput csop res substring
'bananarama' 5 3;x
3706 vput csop res substring
'bananarama' 7 3;x
3707 vput csop res substring
'bananarama' 9 3;x
3708 vput csop res substring
'bananarama' 10 3;x
3710 vput csop res substring
'bananarama' -1;x
3711 vput csop res substring
'bananarama' -3;x
3712 vput csop res substring
'bananarama' -5;x
3713 vput csop res substring
'bananarama' -7;x
3714 vput csop res substring
'bananarama' -9;x
3715 vput csop res substring
'bananarama' -10;x
3716 vput csop res substring
'bananarama' 1 -3;x
3717 vput csop res substring
'bananarama' 3 -3;x
3718 vput csop res substring
'bananarama' 5 -3;x
3719 vput csop res substring
'bananarama' 7 -3;x
3720 vput csop res substring
'bananarama' 9 -3;x
3721 vput csop res substring
'bananarama' 10 -3;x
3723 vput csop res trim
'Cocoon Cocoon';x
3724 vput csop res trim
' Cocoon Cocoon ';x
3725 vput csop res trim-front
'Cocoon Cocoon';x
3726 vput csop res trim-front
' Cocoon Cocoon ';x
3727 vput csop res trim-end
'Cocoon Cocoon';x
3728 vput csop res trim-end
' Cocoon Cocoon ';x
3731 check
1 0 "${MBOX}" '1892119538 755'
3739 if have_feat cmd-vexpr
; then :; else
3740 t_echoskip
'[!CMD_VEXPR]'
3745 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3746 commandalias x
echo '$?/$^ERRNAME $res'
3748 vput vexpr res
= 9223372036854775807;x
3749 vput vexpr res
= 9223372036854775808;x
3750 vput vexpr res
= u9223372036854775808
;x
3751 vput vexpr res
=?
9223372036854775808;x
3752 vput vexpr res
= -9223372036854775808;x
3753 vput vexpr res
= -9223372036854775809;x
3754 vput vexpr res
=?saturated
-9223372036854775809;x
3755 vput vexpr res
= U9223372036854775809
;x
3758 0b0111111111111111111111111111111111111111111111111111111111111111
;x
3760 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3762 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3764 U0b1000000000000000000000000000000000000000000000000000000000000000
;x
3766 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3768 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3770 -0b1000000000000000000000000000000000000000000000000000000000000000;x
3772 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3774 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3776 -0b1000000000000000000000000000000000000000000000000000000000000001;x
3778 U0b1000000000000000000000000000000000000000000000000000000000000001
;x
3780 vput vexpr res
= 0777777777777777777777;x
3781 vput vexpr res
= S01000000000000000000000
;x
3782 vput vexpr res
=? S01000000000000000000000
;x
3783 vput vexpr res
= U01000000000000000000000
;x
3784 vput vexpr res
= 01000000000000000000000;x
3785 vput vexpr res
=?satur
01000000000000000000000;x
3786 vput vexpr res
= -01000000000000000000000;x
3787 vput vexpr res
= S01000000000000000000001
;x
3788 vput vexpr res
=?sat S01000000000000000000001
;x
3789 vput vexpr res
= -01000000000000000000001;x
3790 vput vexpr res
= U01000000000000000000001
;x
3792 vput vexpr res
= 0x7FFFFFFFFFFFFFFF;x
3793 vput vexpr res
= S0x8000000000000000
;x
3794 vput vexpr res
=? S0x8000000000000000
;x
3795 vput vexpr res
= U0x8000000000000000
;x
3796 vput vexpr res
= 0x8000000000000000;x
3797 vput vexpr res
=?
0x8000000000000000;x
3798 vput vexpr res
= -0x8000000000000000;x
3799 vput vexpr res
= S0x8000000000000001
;x
3800 vput vexpr res
=? S0x8000000000000001
;x
3801 vput vexpr res
= -0x8000000000000001;x
3802 vput vexpr res
= u0x8000000000000001
;x
3803 vput vexpr res
= 9223372036854775809;x
3804 vput vexpr res
=?
9223372036854775809;x
3805 vput vexpr res
= u9223372036854775809
;x
3807 vput vexpr res ~
0;x
3808 vput vexpr res ~
1;x
3809 vput vexpr res ~
-1;x
3811 vput vexpr res
- 0;x
3812 vput vexpr res
- 1;x
3813 vput vexpr res
- -1;x
3814 vput vexpr res
- -0xAFFE;x
3815 vput vexpr res
- 0xAFFE;x
3816 vput vexpr res
- u0x8000000000000001
;x
3817 vput vexpr res
- 0x8000000000000001;x
3818 vput vexpr res
- 0x8000000000000001;x
3819 vput vexpr res
- 9223372036854775809;x
3820 vput vexpr res
-?
9223372036854775809;x
3822 vput vexpr res
+ 0;x
3823 vput vexpr res
+ 1;x
3824 vput vexpr res
+ -1;x
3825 vput vexpr res
+ -0xAFFE;x
3826 vput vexpr res
+ 0xAFFE;x
3827 vput vexpr res
+ u0x8000000000000001
;x
3828 vput vexpr res
+ 0x8000000000000001;x
3829 vput vexpr res
+ 9223372036854775809;x
3830 vput vexpr res
+?
9223372036854775809;x
3832 vput vexpr res
+ 0 0;x
3833 vput vexpr res
+ 0 1;x
3834 vput vexpr res
+ 1 1;x
3836 vput vexpr res
+ 9223372036854775807 0;x
3837 vput vexpr res
+ 9223372036854775807 1;x
3838 vput vexpr res
+?
9223372036854775807 1;x
3839 vput vexpr res
+ 0 9223372036854775807;x
3840 vput vexpr res
+ 1 9223372036854775807;x
3841 vput vexpr res
+?
1 9223372036854775807;x
3843 vput vexpr res
+ -9223372036854775808 0;x
3844 vput vexpr res
+ -9223372036854775808 -1;x
3845 vput vexpr res
+?
-9223372036854775808 -1;x
3846 vput vexpr res
+ 0 -9223372036854775808;x
3847 vput vexpr res
+ -1 -9223372036854775808;x
3848 vput vexpr res
+?
-1 -9223372036854775808;x
3850 vput vexpr res
- 0 0;x
3851 vput vexpr res
- 0 1;x
3852 vput vexpr res
- 1 1;x
3854 vput vexpr res
- 9223372036854775807 0;x
3855 vput vexpr res
- 9223372036854775807 -1;x
3856 vput vexpr res
-?
9223372036854775807 -1;x
3857 vput vexpr res
- 0 9223372036854775807;x
3858 vput vexpr res
- -1 9223372036854775807;x
3859 vput vexpr res
- -2 9223372036854775807;x
3860 vput vexpr res
-?
-2 9223372036854775807;x
3862 vput vexpr res
- -9223372036854775808 +0;x
3863 vput vexpr res
- -9223372036854775808 +1;x
3864 vput vexpr res
-?
-9223372036854775808 +1;x
3865 vput vexpr res
- 0 -9223372036854775808;x
3866 vput vexpr res
- +1 -9223372036854775808;x
3867 vput vexpr res
-?
+1 -9223372036854775808;x
3869 vput vexpr res
+ -13 -2;x
3870 vput vexpr res
- 0 0;x
3871 vput vexpr res
- 0 1;x
3872 vput vexpr res
- 1 1;x
3873 vput vexpr res
- -13 -2;x
3875 vput vexpr res
* 0 0;x
3876 vput vexpr res
* 0 1;x
3877 vput vexpr res
* 1 1;x
3878 vput vexpr res
* -13 -2;x
3880 vput vexpr res
/ 0 0;x
3881 vput vexpr res
/ 0 1;x
3882 vput vexpr res
/ 1 1;x
3883 vput vexpr res
/ -13 -2;x
3885 vput vexpr res
% 0 0;x
3886 vput vexpr res
% 0 1;x
3887 vput vexpr res
% 1 1;x
3888 vput vexpr res
% -13 -2;x
3890 vput vexpr res pbase
10 u0x8000000000000001
;x
3891 vput vexpr res pbase
16 0x8000000000000001;x
3892 vput vexpr res pbase
16 s0x8000000000000001
;x
3893 vput vexpr res pbase
16 u0x8000000000000001
;x
3894 vput vexpr res pbase
36 0x8000000000000001;x
3895 vput vexpr res pbase
36 u0x8000000000000001
;x
3898 check numeric
0 "${MBOX}" '163128733 2519'
3900 if have_feat regex
; then
3901 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3902 commandalias x echo '$?/$^ERRNAME :$res:'
3904 vput vexpr res regex you y;x
3905 vput vexpr res regex you o;x
3906 vput vexpr res regex you u;x
3907 vput vexpr res regex you yo;x
3908 vput vexpr res regex you ou;x
3909 vput vexpr res regex you you;x
3911 vput vexpr res regex you Y;x
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 'bananarama' 'nana';x
3920 vput vexpr res regex 'bananarama' 'bana';x
3921 vput vexpr res regex 'bananarama' 'Bana';x
3922 vput vexpr res regex 'bananarama' 'rama';x
3924 vput vexpr res regex? 'bananarama' 'nana';x
3925 vput vexpr res regex? 'bananarama' 'bana';x
3926 vput vexpr res regex? 'bananarama' 'Bana';x
3927 vput vexpr res regex? 'bananarama' 'rama';x
3929 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3930 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3931 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0';x
3932 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0';x
3934 vput vexpr res regex? 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3935 vput vexpr res regex? 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3936 vput vexpr res regex? 'bananarama' 'Bana(.+)' '\$1\$0';x
3937 vput vexpr res regex? 'bananarama' '(.+)rama' '\$1\$0';x
3939 vput vexpr res regex 'banana' '(club )?(.*)(nana)(.*)' \
3940 '\$1\${2}\$4\${3}rama';x
3941 vput vexpr res regex 'Banana' '(club )?(.*)(nana)(.*)' \
3942 '\$1\$2\${2}\$2\$4\${3}rama';x
3943 vput vexpr res regex 'Club banana' '(club )?(.*)(nana)(.*)' \
3944 '\$1\${2}\$4\${3}rama';x
3948 check regex 0 "${MBOX}" '2831099111 542'
3950 t_echoskip 'regex:[!REGEX]'
3959 if have_feat cmd-vexpr; then :; else
3960 t_echoskip '[!CMD_VEXPR]'
3965 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
3970 vput vexpr j
'&' $i 7
3976 vput vexpr j
'&' $i 7
3982 echo ! The end
for $1
3986 # Transport $?/$! up the call chain
3992 wysh
set i
=$? j
=$
! k
=$^ERRNAME
3996 echo ! The end
for $1
3997 return $i $^ERR-BUSY
4001 # Up and down it goes
4008 vput vexpr k
- $1 $2
4012 echo "# <$i/$j> .. "
4016 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
4019 echo ! The end
for $1=$i/$2
4023 return $i $^ERR-BUSY
4029 call w1
0; echo ?
=$?
!=$
!; echo -----;
4030 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
4031 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
4034 check
1 0 "${MBOX}" '1572045517 5922'
4042 if have_feat cmd-vexpr
; then :; else
4043 t_echoskip
'[!CMD_VEXPR]'
4048 ${cat} <<- '__EOT' | \
4049 ${MAILX} ${ARGS} -Snomemdebug \
4050 -Smax=${LOOPS_MAX} \
4055 if [ $i -le "$max" ]
4056 vput vexpr j '&' $i 7
4062 echo ! The end for $1/$2
4064 return $i $^ERR-BUSY
4075 echo ?=$? !=$^ERRNAME
4078 echo ?=$? !=$^ERRNAME
4080 echo ?=$? !=$^ERRNAME
4084 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
4085 check_ex0 1-${LOOPS_BIG} ${i}
4086 check
1-${LOOPS_BIG} - "${MBOX}" '1069764187 47161'
4088 check_ex0
1-${LOOPS_SMALL} ${i}
4089 check
1-${LOOPS_SMALL} - "${MBOX}" '859201011 3894'
4094 if have_feat uistrings
; then
4095 ${cat} <<- '__EOT' > "${BODY}"
4100 vput vexpr j '&' $i 7
4106 echo ! The end for $1
4109 echo would be err with errexit
4118 echo zwei, ?=$? !=$!
4119 localopts yes; set errexit
4121 echo drei, ?=$? !=$^ERRNAME
4123 echo vier, ?=$? !=$^ERRNAME, this is an error
4126 echo outer 1, ?=$? !=$^ERRNAME
4128 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
4130 echo outer 3, ?=$? !=$^ERRNAME
4131 echo this is definitely an error
4134 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
4135 -Snomemdebug > "${MBOX}" 2>&1
4136 check 2 0 "${MBOX}" '4036613316 4184'
4138 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
4139 -Snomemdebug > "${MBOX}" 2>&1
4140 check 3 1 "${MBOX}" '3179757785 2787'
4142 t_echoskip '2-3:[!UISTRINGS]'
4151 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4152 vpospar set hey, "'you ", world!
4153 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4154 vput vpospar x quote; echo x<$x>
4155 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4156 vput vpospar y quote;echo y<$y>
4157 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4158 eval vpospar set ${y};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4159 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4162 echo infun2:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4163 vput vpospar z quote;echo infun2:z<$z>
4167 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4168 vput vpospar y quote;echo infun:y<$y>
4169 eval vpospar set ${x};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4170 vpospar clear;echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4172 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4173 eval vpospar set ${y};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4176 call infun This "in a" fun
4177 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4178 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4180 check 1 0 "${MBOX}" '155175639 866'
4183 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4185 echo ifs<$ifs> ifs-ws<$ifs-ws>
4186 vpospar set hey, "'you ", world!
4187 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4188 vput vpospar x quote; echo x<$x>
4189 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4190 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4193 echo ifs<$ifs> ifs-ws<$ifs-ws>
4194 vpospar set hey, "'you ", world!
4195 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4197 vput vpospar x quote; echo x<$x>
4198 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4199 eval vpospar set ${x};\
4200 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4203 echo ifs<$ifs> ifs-ws<$ifs-ws>
4204 vpospar set hey, "'you ", world!
4205 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4207 vput vpospar x quote; echo x<$x>
4208 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4209 eval vpospar set ${x};\
4210 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4212 check ifs 0 "${MBOX}" '2015927702 706'
4220 ${cat} > ./.t.sh <<- '___'; ${cat} > ./.t.rc <<- '___'
4223 printf " (1/$#: <$1>)"
4225 if [ $# -gt 0 ]; then
4239 printf yyy;yyy 'xxx' "b\$'\t'u ' "
4240 printf xxx;xxx arg ,b u.
4241 printf xxx;xxx arg , .
4242 printf xxx;xxx arg ,ball.
4248 echon " (1/$#: <$1>)"
4263 echon yyy;call yyy '\call xxx' "b\$'\t'u ' "
4264 echon xxx;call xxx arg ,b u.
4265 echon xxx;call xxx arg , .
4266 echon xxx;call xxx arg ,ball.
4269 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
4270 check 1 0 "${MBOX}" '41566293 164'
4272 #${SHELL} ./.t.sh > ./.tshout 2>&1
4273 #check disproof-1 0 ./.tshout '41566293 164'
4281 ${cat} <<- '__EOT' > .tin
4282 hey1, "'you ", world!
4283 hey2, "'you ", bugs bunny!
4288 ${cat} <<- '__EOT' |\
4289 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4290 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4295 unset a b c;read a b c;x
4296 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4298 check 1 0 "${MBOX}" '1527910147 173'
4300 ${cat} <<- '__EOT' > .tin2
4301 hey2.0,:"'you ",:world!:mars.:
4302 hey2.1,:"'you ",:world!
4303 hey2.2,:"'you ",:bugs bunny!
4309 ${cat} <<- '__EOT' |\
4310 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
4311 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4319 unset a b c;read a b c;x
4321 readctl remove 6;echo readctl remove:$?/$^ERRNAME
4323 check ifs 0 "${MBOX}" '890153490 298'
4325 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4326 commandalias x echo '$?/$^ERRNAME / <$d>'
4329 wysh set d;readall d;x
4330 readctl create .tin2
4332 wysh set d;readall d;x
4333 readctl remove .tin;echo $?/$^ERRNAME;\
4334 readctl remove .tin2;echo $?/$^ERRNAME
4335 echo '### now with empty lines'
4336 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
4337 readctl create .temptynl;echo $?/$^ERRNAME
4339 readctl remove .temptynl;echo $?/$^ERRNAME
4341 check readall 0 "${MBOX}" '4113506527 405'
4346 t_readsh() { # TODO not enough
4349 ${cat} <<- '__EOT' > .tin
4350 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4351 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4352 from@exam.ple ' diet spliced <from@exam.ple> ''a'
4353 from@exam.ple' diet spliced <from@exam.ple> ''a'
4356 ${cat} <<- '__EOT' |\
4357 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4358 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4363 unset a b c;read a b c;x
4364 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4366 check 1 0 "${MBOX}" '2955084684 291'
4374 t__x1_msg > ./.tmbox
4377 </dev/null ${MAILX} ${ARGS} -Rf -Y '# Do not care much on error UISTRINGS
4380 \echo --- $?/$^ERRNAME, 2
4382 \echo --- $?/$^ERRNAME, 3
4383 \if "$features" !% +uistrings,
4384 \echoerr reproducible_build: Invalid field name cannot be ignored: ba:l
4386 \headerpick type ignore \
4387 from_ mail-followup-to in-reply-to DATE MESSAGE-ID STATUS ba:l
4388 \echo --- $?/$^ERRNAME, 4
4389 \if "$features" !% +uistrings,
4390 \echo "#headerpick type retain currently covers no fields"
4393 \echo --- $?/$^ERRNAME, 5
4395 \echo --- $?/$^ERRNAME, 6
4396 \unheaderpick type ignore from_ DATE STATUS
4397 \echo --- $?/$^ERRNAME, 7
4398 \if "$features" !% +uistrings,
4399 \echo "#headerpick type retain currently covers no fields"
4402 \echo --- $?/$^ERRNAME, 8
4404 \echo --- $?/$^ERRNAME, 9
4405 \if "$features" =% +uistrings,
4406 \unheaderpick type ignore from_ ba:l
4407 \wysh set x=$? y=$^ERRNAME
4409 \echoerr reproducible_build: Field not ignored: from_
4410 \echoerr reproducible_build: Field not ignored: ba:l
4414 \unheaderpick type ignore *
4415 \echo --- $?/$^ERRNAME, 11
4416 \if "$features" !% +uistrings,
4417 \echo "#headerpick type retain currently covers no fields"
4418 \echo "#headerpick type ignore currently covers no fields"
4421 \echo --- $?/$^ERRNAME, 12
4423 \echo --- $?/$^ERRNAME, 13 ---
4424 # ' ./.tmbox >./.tall 2>&1
4425 check 1 0 ./.tall '2481904228 2273'
4428 if have_feat uistrings; then
4429 have_feat regex && i='3515512395 2378' || i='4201290332 2378'
4430 </dev/null ${MAILX} ${ARGS} -Y '#
4431 \headerpick type retain \
4432 bcc cc date from sender subject to \
4433 message-id mail-followup-to reply-to user-agent
4434 \echo --- $?/$^ERRNAME, 1
4435 \headerpick forward retain \
4436 cc date from message-id list-id sender subject to \
4437 mail-followup-to reply-to
4438 \echo --- $?/$^ERRNAME, 2
4439 \headerpick save ignore ^Original-.*$ ^X-.*$ ^DKIM.*$
4440 \echo --- $?/$^ERRNAME, 3
4441 \headerpick top retain To Cc
4442 \echo --- $?/$^ERRNAME, 4 ---
4444 \echo --- $?/$^ERRNAME, 5
4446 \echo --- $?/$^ERRNAME, 6
4448 \echo --- $?/$^ERRNAME, 7
4450 \echo --- $?/$^ERRNAME, 8
4452 \echo --- $?/$^ERRNAME, 9 ---
4453 \unheaderpick type retain message-id mail-followup-to reply-to user-agent
4454 \echo --- $?/$^ERRNAME, 10
4455 \unheaderpick save ignore ^X-.*$ ^DKIM.*$
4456 \echo --- $?/$^ERRNAME, 11
4457 \unheaderpick forward retain *
4458 \echo --- $?/$^ERRNAME, 12 ---
4460 \echo --- $?/$^ERRNAME, 13
4462 \echo --- $?/$^ERRNAME, 14
4464 \echo --- $?/$^ERRNAME, 15 --
4465 \unheaderpick type retain *
4466 \echo --- $?/$^ERRNAME, 16
4467 \unheaderpick forward retain *
4468 \echo --- $?/$^ERRNAME, 17
4469 \unheaderpick save ignore *
4470 \echo --- $?/$^ERRNAME, 18
4471 \unheaderpick top retain *
4472 \echo --- $?/$^ERRNAME, 19 --
4474 \echo --- $?/$^ERRNAME, 20
4476 check 2 0 ./.tall "${i}"
4478 t_echoskip '2:[!UISTRINGS]'
4485 # Send/RFC absolute basics {{{
4486 t_can_send_rfc() { # {{{
4489 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub.1 \
4492 check 1 0 "${MBOX}" '550126528 126'
4493 check 1-err - .terr
'4294967295 0'
4495 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2 \
4496 -b bcc@no
.1 -b bcc@no
.2 -b bcc@no
.3 \
4497 -c cc@no
.1 -c cc@no
.2 -c cc@no
.3 \
4498 to@no
.1 to@no
.2 to@no
.3 \
4500 check
2 0 "${MBOX}" '3259888945 324'
4501 check
2-err - .terr
'4294967295 0'
4503 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2no \
4504 -b bcc@no
.1\ \ bcc@no
.2 -b bcc@no
.3 \
4505 -c cc@no
.1,cc@no
.2 -c cc@no
.3 \
4506 to@no
.1,to@no
.2 to@no
.3 \
4508 check
2no
4 "${MBOX}" '3350946897 468'
4509 if have_feat uistrings
; then
4510 check
2no-err
- .terr
'3397557940 190'
4512 check
2no-err
- .terr
'4294967295 0'
4515 # XXX NOTE we cannot test "cc@no1 <cc@no.2>" because our stupid parser
4516 # XXX would not treat that as a list but look for "," as a separator
4517 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.3 \
4518 -T 'bcc?single: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4519 -T cc?si\ \
:\ \
'cc@no.1, <cc@no.2>' -T cc
:\ cc@no
.3 \
4520 -T to?
:\ to@no
.1,'<to@no.2>' -T to
:\ to@no
.3 \
4522 check
3 0 "${MBOX}" '1453534480 678'
4523 check
3-err - .terr
'4294967295 0'
4525 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.4 \
4526 -T 'bcc: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4527 -T cc
:\
'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
4 0 "${MBOX}" '535767201 882'
4531 check
4-err - .terr
'4294967295 0'
4533 # Two test with a file-based MTA
4534 "${cat}" <<-_EOT > .tmta.sh
4536 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4537 "${cat}" && echo pardauz && echo) > "${MBOX}"
4539 ${chmod} 0755 .tmta.sh
4541 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s Sub.mta-1 \
4542 receiver@number
.1 > .
/.terr
2>&1
4543 check
5 0 "${MBOX}" '2384401657 138'
4544 check
5-err - .terr
'4294967295 0'
4546 </dev
/null
${MAILX} ${ARGS} -Smta=file://.
/.tmta.sh
-s Sub.mta-2 \
4547 receiver@number
.1 > .
/.terr
2>&1
4548 check
6 0 "${MBOX}" '3006460737 138'
4549 check
6-err - .terr
'4294967295 0'
4552 </dev
/null
${MAILX} ${ARGS} -Smta=test \
4561 check
7 0 .
/.tall
'951018449 138'
4563 ## *record*, *outfolder*, with and without *mta-bcc-ok*
4565 xfolder
=`${pwd}`/.tfolder
4567 "${cat}" <<-_EOT > .tmta.sh
4569 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4570 "${cat}" && echo 'ARGS: '"\${@}" && echo) > "${MBOX}"
4572 ${chmod} 0755 .tmta.sh
4575 </dev
/null
${MAILX} ${ARGS} -Smta=./.tmta.sh -Sfolder="${xfolder}" \
4578 -b bcc@no.1 -b bcc@no.2 -b bcc@no.3 \
4579 -c cc@no.1 -c cc@no.2 -c cc@no.3 \
4580 to@no.1 to@no.2 to@no.3 \
4581 receiver@number.1 > ./.terr 2>&1
4586 check 8 0 "${MBOX}" '1365032629 292'
4587 check 8-1 - .terr '4294967295 0'
4589 t_it -Snomta-bcc-ok -Srecord=.trec9
4590 check 9 0 "${MBOX}" '1365032629 292'
4591 check 9-1 - .terr '4294967295 0'
4592 check 9-2 - ./.trec9 '160206230 221'
4594 t_it -Srecord=.trec10
4595 check 10 0 "${MBOX}" '3085765596 326'
4596 check 10-1 - .terr '4294967295 0'
4597 check 10-2 - ./.trec10 '160206230 221'
4599 t_it -Snomta-bcc-ok -Srecord=.trec11 -Soutfolder
4600 check 11 0 "${MBOX}" '1365032629 292'
4601 check 11-1 - .terr '4294967295 0'
4602 check 11-2 - ./.tfolder/.trec11 '160206230 221'
4603 # That is appends to an MBOX
4604 t_it -Srecord=.trec11 -Soutfolder
4605 check 12 0 "${MBOX}" '3085765596 326'
4606 check 12-1 - .terr '4294967295 0'
4607 check 12-2 - ./.tfolder/.trec11 '1618754846 442'
4611 ## From: and Sender:
4612 </dev/null ${MAILX} ${ARGS} -s ubject \
4613 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
4614 to@exam.ple > "${MBOX}" 2>&1
4615 check 13 0 "${MBOX}" '143390417 169'
4617 # ..if From: is single mailbox and Sender: is same, no Sender:
4618 </dev/null ${MAILX} ${ARGS} -s ubject \
4619 -S from=a@b.org -S sender=a@b.org \
4620 to@exam.ple > "${MBOX}" 2>&1
4621 check 14 0 "${MBOX}" '1604962737 135'
4627 # Alternates and ML related address massage etc. somewhere else
4629 XARGS=${ARGS} # TODO v15-compat
4630 ARGS="${ARGS} -Sv15-compat=y
"
4632 t__gen_msg subject reply from 1 to 2 cc 2 > "${MBOX}"
4634 ## Base (does not test "recipient record
")
4636 </dev/null ${MAILX} ${ARGS} -Rf \
4641 set fullnames escape=!; '${1}'
4645 set recipients-in-cc nofullnames; '${1}'
4649 unset recipients-in-cc; '${1}'
4654 "${MBOX}" > ./.tall 2>&1
4659 check 1 0 ./.tall '4164251531 851'
4661 check 2 0 ./.tall '3034955332 591'
4662 t_it reply 'set flipr;'
4663 check 3 0 ./.tall '3034955332 591'
4664 t_it Reply 'set flipr;'
4665 check 4 0 ./.tall '4164251531 851'
4668 t__gen_msg subject reply-no-addr > ./.tnoaddr
4670 # MBOX will deduce addressee from From_ line..
4671 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4673 File ./.tnoaddr; reply # Takes addressee from From_ line :(
4677 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4680 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4681 echo 3:$?/$^ERRNAME; reply # cannot test IO,NOTSUP,INVAL
4687 check 5 0 ./.tall '3088217220 382'
4688 if have_feat uistrings; then
4689 check 6 - ./.terr '2514745519 544'
4691 t_echoskip '6:[!UISTRINGS]'
4694 # ..but Maildir will not
4695 if have_feat maildir; then
4696 ${mkdir} -p .tdir .tdir/tmp .tdir/cur .tdir/new
4697 ${sed} 1d < ./.tnoaddr > .tdir/new/sillyname
4699 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4705 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4708 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4709 echo 3:$?/$^ERRNAME;reply # cannot test IO,NOTSUP,INVAL
4715 check 7 0 ./.tall '3631170341 244'
4716 if have_feat uistrings; then
4717 check 8 - ./.terr '1074346767 629'
4719 t_echoskip '8:[!UISTRINGS]'
4723 ## Ensure action on multiple messages
4724 t__gen_msg subject reply2 from from2@exam.ple body body2 >> "${MBOX}"
4727 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! \
4734 echo 1:$?/$^ERRNAME; '${2}' 1 2
4739 "${MBOX}" > ./.tall 2>&1
4740 check ${3} 0 ./.tall '283309820 502'
4741 if [ ${#} -eq 4 ]; then
4743 check ${3}-1 - ./.tlst '1649520021 12'
4744 check ${3}-2 - ./from1 '1501109193 347'
4745 check ${3}-3 - ./from2 '2154231432 137'
4750 t_it respond Respond 10
4751 t_it followup Followup 11 yes
4752 ${rm} -f from1 from2
4754 ## *record*, *outfolder* (reuses $MBOX)
4758 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4765 echo 1:$?/$^ERRNAME; '${2}' 1 2
4768 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4773 echo 3:$?/$^ERRNAME; '${2}' 1 2
4776 echo 4:$?/$^ERRNAME; set outfolder norecord
4782 echo 1:$?/$^ERRNAME; '${2}' 1 2
4785 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4790 echo 3:$?/$^ERRNAME; '${2}' 1 2
4795 "${MBOX}" > ./.tall 2>&1
4796 check ${3} 0 ./.tall '3410330303 2008'
4797 if [ ${#} -ne 5 ]; then
4798 check ${4} - ./.trec${4} '3044885336 484'
4799 check ${4}-1 - ./.tfolder/.trec${4} '3044885336 484'
4801 [ -f ./.trec${4} ]; check_exn0 ${4}
4803 check ${4}-1 - ./.tlst '1649520021 12'
4804 check ${4}-2 - ./from1 '2668975631 694'
4805 check ${4}-3 - ./from2 '225462887 274'
4806 [ -f ./.tfolder/.trec${4} ]; check_exn0 ${4}-4
4807 ( cd .tfolder && echo * > ./.tlst )
4808 check ${4}-5 - ./.tfolder/.tlst '1649520021 12'
4809 check ${4}-6 - ./.tfolder/from1 '2668975631 694'
4810 check ${4}-7 - ./.tfolder/from2 '225462887 274'
4814 t_it reply Reply 12 13
4815 t_it respond Respond 14 15
4816 t_it followup Followup 16 17 yes
4817 #${rm} -f from1 from2
4819 ## Quoting (if not cmd_escapes related)
4821 t__x2_msg > ./.tmbox
4824 set indentprefix=" |
" quote
4828 set quote=noheading quote-inject-head
4832 headerpick type retain cc date from message-id reply-to subject to
4837 set quote=allheaders
4841 set quote-inject-head=%% quote-inject-tail=%% quote=headers
4846 quote-inject-head='"\$
'"'\\
4847 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4849 quote-inject-tail='"\$
'"'\\
4850 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4855 set showname datefield=%%y nodatefield-markout-older indentprefix=\\ :
4859 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
4860 -Sescape=! -Sindentprefix=' >' \
4861 ./.tmbox >./.tall 2>&1
4863 ${cat} ./.tall >> "${MBOX}"
4864 check 18 - "${MBOX}" '385267528 3926'
4866 # quote-as-attachment, fullnames
4867 </dev/null ${MAILX} ${ARGS} -Rf \
4869 -S quote-as-attachment \
4870 -Y reply -Y yb1 -Y !. \
4871 -Y 'unset quote-as-attachment' \
4872 -Y 'reply;yb2' -Y !. \
4873 -Y 'set quote-as-attachment fullnames' \
4874 -Y ';reply;yb3' -Y !. \
4875 ./.tmbox >./.tall 2>&1
4876 check 19 0 ./.tall '2774517283 2571'
4878 # Moreover, quoting of several parts with all*
4879 t__gen_mimemsg from 'ex1@am.ple' subject for-repl > ./.tmbox
4880 check 20 0 ./.tmbox '1874764424 668'
4882 have_feat filter-html-tagsoup && ck='946925637 1105' || ck='3587432511 1165'
4883 </dev/null ${MAILX} ${ARGS} -Rf \
4884 -Sescape=! -Sindentprefix=' |' \
4885 -Y 'set quote=allheaders' \
4887 -Y 'set quote=allbodies' \
4890 ./.tmbox >./.tall 2>&1
4891 check 21 0 ./.tall "${ck}"
4893 ARGS=${XARGS} # TODO v15-compat
4900 ARGS="${ARGS} -Sv15-compat=y
"
4902 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
4903 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
4905 ## Base (does not test "recipient record
")
4907 </dev/null ${MAILX} ${ARGS} -Rf \
4908 -Y ${1}' . "du
<ex1@am.ple
>"
4911 echo 1:$?/$^ERRNAME; echoerr 1:done
4912 set fullnames escape=!
4913 '${1}' 1 "du
<ex2@am.ple
>"
4916 echo 2:$?/$^ERRNAME; echoerr 2:done
4918 set nofullnames ea=$expandaddr expandaddr=-all
4919 '${1}' ` "du
<ex3@am.ple
>"
4922 echo 3:$?/$^ERRNAME; echoerr 3:done
4924 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
4927 echo 4:$?/$^ERRNAME; echoerr 4:done
4928 '${1}' # TODO not yet possible b5 !.
4929 echo 5:$?/$^ERRNAME; echoerr 5:done
4931 '${1}' 1 2 ex6@am.ple
4936 echo 6:$?/$^ERRNAME; echoerr 6:done
4937 set forward-add-cc fullnames
4941 echo 7:$?/$^ERRNAME; echoerr 7:done
4946 echo 8:$?/$^ERRNAME; echoerr 8:done
4948 "${MBOX}" > ./.tall 2>./.terr
4953 check 1 0 ./.tall '2356713156 2219'
4954 if have_feat uistrings && have_feat docstrings; then
4955 check 2 - ./.terr '3273108824 335'
4957 t_echoskip '2:[!UISTRINGS]'
4961 check 3 0 ./.tall '2356713156 2219'
4962 if have_feat uistrings && have_feat docstrings; then
4963 check 4 - ./.terr '447176534 355'
4965 t_echoskip '4:[!UISTRINGS]'
4969 ## *record*, *outfolder* (reuses $MBOX)
4973 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4978 echo 1:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 1 ex2@am.ple
4981 echo 2:$?/$^ERRNAME; set outfolder norecord; '${1}' 2 ex1@am.ple
4984 echo 3:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 2 ex2@am.ple
4989 "${MBOX}" > ./.tall 2>&1
4990 check ${2} 0 ./.tall '3180366037 1212'
4991 if [ ${#} -ne 4 ]; then
4992 check ${3}-1 - ./.trec${2} '1769129556 304'
4993 check ${3}-2 - ./.tfolder/.trec${2} '2335391111 284'
4995 [ -f ./.trec${2} ]; check_exn0 ${3}
4997 check ${3}-1 - ./.tlst '2020171298 8'
4998 check ${3}-2 - ./ex1 '1512529673 304'
4999 check ${3}-3 - ./ex2 '1769129556 304'
5000 [ -f ./.tfolder/.trec${2} ]; check_exn0 ${3}-4
5001 ( cd .tfolder && echo * > ./.tlst )
5002 check ${3}-5 - ./.tfolder/.tlst '2020171298 8'
5003 check ${3}-6 - ./.tfolder/ex1 '2016773910 284'
5004 check ${3}-7 - ./.tfolder/ex2 '2335391111 284'
5009 t_it Forward 7 8 yes
5012 ## Injections, headerpick selection
5014 t__x2_msg > ./.tmbox
5017 set quote=noheading forward-inject-head
5018 forward 1 ex1@am.ple
5021 headerpick forward retain cc from subject to
5022 forward 1 ex1@am.ple
5025 unheaderpick forward retain *
5026 forward 1 ex1@am.ple
5029 headerpick forward ignore in-reply-to reply-to message-id status
5030 set forward-inject-head=%% forward-inject-tail=%%
5031 forward 1 ex1@am.ple
5034 set forward-inject-head='"\$
'"'\\
5035 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5037 forward-inject-tail='"\$
'"'\\
5038 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5040 forward 1 ex1@am.ple
5043 set showname datefield=%%y nodatefield-markout-older
5044 forward 1 ex1@am.ple
5047 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
5049 ./.tmbox >./.tall 2>&1
5051 ${cat} ./.tall >> "${MBOX}"
5052 check 9 - "${MBOX}" '2976943913 2916'
5054 # forward-as-attachment
5055 </dev/null ${MAILX} ${ARGS} -Rf \
5057 -S forward-inject-head=.head. \
5058 -S forward-inject-tail=.tail. \
5059 -S forward-as-attachment \
5060 -Y 'headerpick forward retain subject to from' \
5061 -Y 'forward ex1@am.ple' -Y b1 -Y !. \
5062 -Y 'unset forward-as-attachment' \
5063 -Y 'forward ex1@am.ple;b2' -Y !. \
5064 ./.tmbox >./.tall 2>&1
5065 check 10 0 ./.tall '799103633 1250'
5074 ARGS="${ARGS} -Sv15-compat=y
"
5076 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
5077 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
5081 </dev/null ${MAILX} ${ARGS} -Rf \
5082 -Y ${1}' . "du
<ex1@am.ple
>"
5083 echo 1:$?/$^ERRNAME; echoerr 1:done
5084 set fullnames escape=!
5085 '${1}' 1 "du
, da
<ex2@am.ple
>"
5086 echo 2:$?/$^ERRNAME; echoerr 2:done
5088 set nofullnames ea=$expandaddr expandaddr=-all
5089 '${1}' ` "du
<ex3@am.ple
>"
5090 echo 3:$?/$^ERRNAME; echoerr 3:done
5092 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
5093 echo 4:$?/$^ERRNAME; echoerr 4:done
5094 '${1}' # TODO not yet possible b5 !.
5095 echo 5:$?/$^ERRNAME; echoerr 5:done
5097 '${1}' 1 2 ex6@am.ple
5098 echo 6:$?/$^ERRNAME; echoerr 6:done
5100 "${MBOX}" > ./.tall 2>./.terr
5105 check 1 0 ./.tall '1461006932 1305'
5106 if have_feat uistrings; then
5107 check 2 - ./.terr '138360532 210'
5109 t_echoskip '2:[!UISTRINGS]'
5113 check 3 0 ./.tall '3674535444 958'
5114 if have_feat uistrings; then
5115 check 4 - ./.terr '138360532 210'
5117 t_echoskip '4:[!UISTRINGS]'
5120 ## *record*, *outfolder* (reuses $MBOX)
5124 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
5126 set record=.trec'${2}'; '${1}' 1 ex1@am.ple
5127 echo 1:$?/$^ERRNAME; set record-resent; '${1}' 1 ex2@am.ple
5128 echo 2:$?/$^ERRNAME; set outfolder norecord-resent; '${1}' 2 ex1@am.ple
5129 echo 3:$?/$^ERRNAME; set record-resent; '${1}' 2 ex2@am.ple
5132 "${MBOX}" > ./.tall 2>&1
5134 if [ ${#} -ne 3 ]; then
5135 check ${2} - ./.tall '1711347390 992'
5136 check ${3}-1 - ./.trec${2} '2840978700 249'
5137 check ${3}-2 - ./.tfolder/.trec${2} '3219997964 229'
5139 check ${2} - ./.tall '1391418931 724'
5140 check ${3}-1 - ./.trec${2} '473817710 182'
5141 check ${3}-2 - ./.tfolder/.trec${2} '2174632404 162'
5157 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5158 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5159 check 1 - "${MBOX}" '137107341 324' # for flag test
5162 </dev/null ${MAILX} ${ARGS} -f \
5171 copy .tf1 # no auto-advance
5180 !'"${chmod}"' 0444 .tf3
5184 "${MBOX}" > ./.tallx 2>./.terr
5187 if have_feat uistrings; then # TODO
5188 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5189 ${sed} '$d' < ./.tallx > ./.tall
5191 ${mv} ./.tallx ./.tall
5193 if [ -n "${HONOURS_READONLY}" ]; then
5194 n2_1=2-1 cs2_1='1913702840 1121'
5195 n2_4=2-4 cs2_4='3642131968 344'
5196 n2_5=2-5 cs2_5='2617612897 112'
5198 n2_1=2-1-nrdonly cs2_1='1962556153 1146'
5199 n2_4=2-4-nrdonly cs2_4='3733058190 688'
5200 n2_5=2-5-nrdonly cs2_5='3989834342 80'
5202 check ${n2_1} - ./.tall "${cs2_1}"
5203 check 2-2 - ./.tf1 '686654461 334'
5204 check 2-3 - ./.tf2 '1931512953 162'
5205 check ${n2_4} - ./.tf3 "${cs2_4}"
5206 if have_feat uistrings; then
5207 check ${n2_5} - ./.terr "${cs2_5}"
5209 t_echoskip '2-5:[!UISTRINGS]'
5213 check 3 - "${MBOX}" '1477662071 346'
5217 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5218 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5219 t__gen_msg subject Copy3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5220 check ${1} - "${MBOX}" '2667292819 473' # for flag test
5222 </dev/null ${MAILX} ${ARGS} -f \
5241 "${MBOX}" > ./.tallx 2>&1
5247 if have_feat uistrings; then # TODO
5248 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5249 ${sed} '$d' < ./.tallx > ./.tall
5251 ${mv} ./.tallx ./.tall
5254 check 5-2 - ./.tlst '1058655452 9'
5255 check 5-3 - ./.tall '1543702808 1617'
5256 check 5-4 - ./from1 '1031912635 999'
5257 check 5-5 - ./ex '2400630246 149'
5258 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5261 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5263 if have_feat uistrings; then # TODO
5264 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5265 ${sed} '$d' < ./.tallx > ./.tall
5267 ${mv} ./.tallx ./.tall
5269 echo * .tfolder/* > ./.tlst
5270 check 6-2 - ./.tlst '1865898363 29'
5271 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5272 check 6-4 - .tfolder/from1 '1031912635 999'
5273 check 6-5 - .tfolder/ex '2400630246 149'
5276 t__x2_msg > ./.tmbox
5282 headerpick save retain cc date from subject to
5285 unheaderpick save retain *
5288 headerpick save ignore status in-reply-to
5291 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5297 check 7-1 - ./.tall '3805176908 152'
5298 check 7-2 - ./.tout '2447734879 1316'
5303 check 8-1 - ./.tall '1044700686 136'
5304 check 8-2 - ./mr2 '2447734879 1316'
5305 check 8-3 - ./.tlst '3190056903 4'
5313 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5314 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5315 check 1 - "${MBOX}" '3634443864 324' # for flag test
5318 </dev/null ${MAILX} ${ARGS} -f \
5327 save .tf1 # no auto-advance
5336 !'"${chmod}"' 0444 .tf3
5340 "${MBOX}" > ./.tallx 2>./.terr
5343 if have_feat uistrings; then # TODO
5344 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5345 ${sed} '$d' < ./.tallx > ./.tall
5347 ${mv} ./.tallx ./.tall
5349 if [ -n "${HONOURS_READONLY}" ]; then
5350 n2_1=2-1 cs2_1='2335843514 1121'
5351 n2_4=2-4 cs2_4='970407001 344'
5352 n2_5=2-5 cs2_5='45116475 112'
5354 n2_1=2-1-nrdonly cs2_1='1736244784 1146'
5355 n2_4=2-4-nrdonly cs2_4='3903872811 688'
5356 n2_5=2-5-nrdonly cs2_5='720724138 80'
5358 check ${n2_1} - ./.tall "${cs2_1}"
5359 check 2-2 - ./.tf1 '2435434321 334'
5360 check 2-3 - ./.tf2 '920652966 162'
5361 check ${n2_4} - ./.tf3 "${cs2_4}"
5362 if have_feat uistrings; then
5363 check ${n2_5} - ./.terr "${cs2_5}"
5365 t_echoskip '2-5:[!UISTRINGS]'
5369 check 3 - "${MBOX}" '1219692400 346'
5373 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5374 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5375 t__gen_msg subject Save3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5376 check ${1} - "${MBOX}" '1391391227 473' # for flag test
5378 </dev/null ${MAILX} ${ARGS} -f \
5397 "${MBOX}" > ./.tallx 2>&1
5403 if have_feat uistrings; then # TODO
5404 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5405 ${sed} '$d' < ./.tallx > ./.tall
5407 ${mv} ./.tallx ./.tall
5410 check 5-2 - ./.tlst '1058655452 9'
5411 check 5-3 - ./.tall '3418590770 1617'
5412 check 5-4 - ./from1 '1462882526 999'
5413 check 5-5 - ./ex '2153575326 149'
5414 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5417 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5419 if have_feat uistrings; then # TODO
5420 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5421 ${sed} '$d' < ./.tallx > ./.tall
5423 ${mv} ./.tallx ./.tall
5425 echo * .tfolder/* > ./.tlst
5426 check 6-2 - ./.tlst '1865898363 29'
5427 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5428 check 6-4 - .tfolder/from1 '1462882526 999'
5429 check 6-5 - .tfolder/ex '2153575326 149'
5434 t__x2_msg > ./.tmbox
5435 check ${1} - ./.tmbox '561523988 397'
5438 [ ${#} -gt 2 ] && a='-S MBOX=./.tmboxx'
5439 [ ${#} -gt 3 ] && a="${a}"' -S inbox=./.tmbox'
5445 headerpick save retain cc date from subject to
5448 unheaderpick save retain *
5451 headerpick save ignore status in-reply-to
5454 #' | ${MAILX} ${ARGS} -f ${a} ./.tmbox > ./.tall 2>&1
5458 t_it 7 'save ./.tout'
5460 check 7-1 - ./.tall '4190949581 312'
5461 check 7-2 - ./.tout '2447734879 1316'
5462 check 7-3 - ./.tmbox '561523988 397'
5467 check 8-1 - ./.tall '2109832180 296'
5468 check 8-2 - ./mr2 '2447734879 1316'
5469 check 8-3 - ./.tlst '3190056903 4'
5470 check 8-3 - ./.tmbox '561523988 397'
5472 # saves in $MBOX without argument
5475 check 9-1 - ./.tall '652005824 320'
5476 check 9-2 - ./.tmboxx '2447734879 1316'
5477 check 9-3 - ./.tmbox '561523988 397'
5479 # and deletes if editing a primary mailbox
5481 t_it 10 save yes yes
5483 check 10-1 - ./.tall '652005824 320'
5484 check 10-2 - ./.tmboxx '2447734879 1316'
5485 [ -f ./.tmbox ]; check_exn0 10-3
5493 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5494 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5495 check 1 - "${MBOX}" '2967134193 324' # for flag test
5498 </dev/null ${MAILX} ${ARGS} -f \
5507 !touch .tf2; '"${chmod}"' 0444 .tf2
5510 !'"${chmod}"' 0644 .tf2
5515 "${MBOX}" > ./.tallx 2>./.terr
5518 if have_feat uistrings; then # TODO
5519 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5520 ${sed} '$d' < ./.tallx > ./.tall
5522 ${mv} ./.tallx ./.tall
5524 if [ -n "${HONOURS_READONLY}" ]; then
5525 n2_1=2-1 cs2_1='1641443074 491'
5526 n2_4=2-4 cs2_4='602144474 155'
5528 n2_1=2-1-nrdonly cs2_1='3045412111 492'
5529 n2_4=2-4-nrdonly cs2_4='2197157669 201'
5531 check ${n2_1} - ./.tall "${cs2_1}"
5532 check 2-2 - ./.tf1 '1473857906 162'
5533 check 2-3 - ./.tf2 '331229810 162'
5534 if have_feat uistrings; then
5535 check ${n2_4} - ./.terr "${cs2_4}"
5537 t_echoskip '2-4:[!UISTRINGS]'
5541 check 3 - "${MBOX}" '4294967295 0'
5545 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5546 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5547 t__gen_msg subject Move3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5548 check ${1} - "${MBOX}" '2826896131 473' # for flag test
5550 </dev/null ${MAILX} ${ARGS} -f \
5569 "${MBOX}" > ./.tallx 2>./.terr
5575 if have_feat uistrings; then # TODO
5576 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5577 ${sed} '$d' < ./.tallx > ./.tall
5579 ${mv} ./.tallx ./.tall
5582 check 5-2 - ./.tlst '1058655452 9'
5583 check 5-3 - ./.tall '419037676 870'
5584 if have_feat uistrings; then
5585 check 5-4 - ./.terr '1383646464 86'
5587 t_echoskip '5-4:[!UISTRINGS]'
5589 check 5-5 - ./from1 '3719268580 827'
5590 check 5-6 - ./ex '4262925856 149'
5591 ${rm} -f ./.tlst ./.tall ./.terr ./from1 ./ex
5594 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5596 if have_feat uistrings; then # TODO
5597 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5598 ${sed} '$d' < ./.tallx > ./.tall
5600 ${mv} ./.tallx ./.tall
5602 echo * .tfolder/* > ./.tlst
5603 check 6-2 - ./.tlst '1865898363 29'
5604 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5605 check 6-4 - .tfolder/from1 '3719268580 827'
5606 check 6-5 - .tfolder/ex '4262925856 149'
5609 t__x2_msg > ./.tmbox
5615 headerpick save retain cc date from subject to
5618 unheaderpick save retain *
5621 headerpick save ignore status in-reply-to
5624 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5630 check 7-1 - ./.tall '3805176908 152'
5631 check 7-2 - ./.tout '2447734879 1316'
5636 check 8-1 - ./.tall '1044700686 136'
5637 check 8-2 - ./mr2 '2447734879 1316'
5638 check 8-3 - ./.tlst '3190056903 4'
5648 while [ ${i} -lt 113 ]; do
5649 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5650 "${MBOX}" "${i}" "${i}"
5653 ) | ${MAILX} ${ARGS} > .tall 2>&1
5654 check 1 0 "${MBOX}" '1785801373 13336'
5655 check 1-outerr - ./.tall '4294967295 0' # empty file
5657 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
5658 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
5659 check 2 0 .tall '3467540956 8991'
5661 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
5662 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5663 check
3 0 .tall
'2410946529 8998'
5665 # copy only the odd (but the first), move the even
5667 printf 'File "file://%s"\ncopy ' .tmbox2
5669 while [ ${i} -lt 113 ]; do
5673 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
5674 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5675 check
4 0 .tmbox3
'2554734733 6666'
5676 check
5 - .tall
'2062382804 4517'
5679 printf 'file "file://%s"\nmove ' .tmbox2
5681 while [ ${i} -lt 113 ]; do
5685 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
5686 .tmbox3 .tmbox3 .tmbox2
5687 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
5688 check
6 0 .tmbox3
'1429216753 13336'
5689 if have_feat uistrings
; then
5690 ${sed} 2d
< .tall
> .tallx
5694 check
7 - .tallx
'169518319 13477'
5696 # Invalid MBOXes (after [f4db93b3])
5698 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5699 check 8 0 .tinvmbox '2848412822 118'
5700 check 9 - ./.tall '461280182 33'
5702 echo ' ' > .tinvmbox
5703 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
5704 check
10 0 .tinvmbox
'624770486 120'
5705 check
11 - .
/.tall
'461280182 33'
5707 { echo; echo; } > .tinvmbox
# (not invalid)
5708 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5709 check 12 0 .tinvmbox '1485640875 119'
5710 check 13 - ./.tall '461280182 33'
5712 # *mbox-rfc4155*, plus
5713 ${cat} <<-_EOT > ./.tinv1
5716 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
5717 Date: Wed, 02 Oct 1996 01:50:07 +0000
5719 Subject: Bad bad message 1
5721 From me to you, blinde Kuh!
5723 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5724 Date: Wed, 02 Oct 1996 01:50:07 +0000
5726 Subject: Bad bad message 2
5728 From me to you, blindes Kalb!
5730 ${cp} ./.tinv1 ./.tinv2
5734 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
5735 \\eval copy * "${2}"
5737 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
5739 ${cat} ./.tinv1 ./.tok >> .tall
5740 check 14 - ./.tall '739301109 616'
5743 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
5744 wysh File ./.tok # Just move away to nowhere
5746 wysh file ./.tinv2 # Fully repaired
5747 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5749 # Equal since [Auto-fix when MBOX had From_ errors on read (Dr. Werner
5751 check 15-1 - ./.tinv1 '4151504442 314'
5752 check 15-2 - ./.tinv2 '4151504442 314'
5754 # *mbox-fcc-and-pcc*
5755 ${cat} > ./.ttmpl <<-'_EOT'
5757 Bcc: | cat >> ./.tpcc1
5759 Subject: fcc and pcc, and *mbox-fcc-and-pcc*
5764 < ./.ttmpl ${MAILX} ${ARGS} -t > "${MBOX}" 2>&1
5765 check
16 0 "${MBOX}" '4294967295 0'
5766 check
17 - .
/.tfcc1
'2301294938 148'
5767 check
18 - .
/.tfcc2
'2301294938 148'
5768 check
19 - .
/.tpcc1
'2301294938 148'
5770 < .
/.ttmpl
${MAILX} ${ARGS} -t -Snombox-fcc-and-pcc > "${MBOX}" 2>&1
5771 check 20 0 "${MBOX}" '4294967295 0'
5772 check 21 - ./.tfcc1 '3629108107 98'
5773 check 22 - ./.tfcc2 '3629108107 98'
5774 check 23 - ./.tpcc1 '2373220256 246'
5776 # More invalid: since in "copy
* X
" messages will be copied in `sort' order,
5777 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5778 # ensure pre-v15 MBOX separation "in between
" messages.., 2019-08-07) that
5779 # could still have created invalid MBOX files!
5780 ${cat} <<-_EOT > ./.tinv1
5783 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5784 Date: Sun, 04 Oct 1998 01:50:07 +0000
5789 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5790 Date: Nix, 01 Oct BAD 01:50:07 +0000
5795 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5796 Date: Fri, 03 Oct 1997 01:50:07 +0000
5801 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5802 Date: Sun, 01 Oct 1995 01:50:07 +0000
5808 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5809 Date: Wed, 02 Oct 1996 01:50:07 +0000
5820 file ./.tinv1' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5821 check 24 0 ./.tinv1 '104184185 560'
5822 check 25 - ./.tinv2 '853754737 510'
5830 if have_feat maildir; then :; else
5831 t_echoskip '[!MAILDIR]'
5838 while [ ${i} -lt 112 ]; do
5839 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5840 "${MBOX}" "${i}" "${i}"
5843 ) | ${MAILX} ${ARGS}
5844 check 1 0 "${MBOX}" '2366902811 13332'
5850 ' "${MBOX}" .tmdir1 .tmdir1 |
5851 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
5852 check 2 0 .tlst '3442251309 8991'
5855 copy * "maildir
://%s
"
5858 ' "${MBOX}" .tmdir2 .tmdir2 |
5859 ${MAILX} ${ARGS} -Sshowlast > .tlst
5860 check 3 0 .tlst '3524806062 9001'
5862 printf 'File "maildir
://%s
"
5866 ' .tmdir2 .tmbox1 .tmbox1 |
5867 ${MAILX} ${ARGS} -Sshowlast > .tlst
5868 check 4 0 .tmbox1 '4096198846 12772'
5869 check 5 - .tlst '1262452287 8998'
5871 # only the odd (even)
5873 printf 'File "maildir
://%s
"
5876 while [ ${i} -lt 112 ]; do
5878 [ ${j} -eq 1 ] && printf '%s ' "${i}"
5885 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
5886 check 6 0 .tmbox2 '4228337024 6386'
5887 check 7 - .tlst '2078821439 4517'
5890 printf 'file "maildir
://%s
"
5893 while [ ${i} -lt 112 ]; do
5895 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
5903 ' .tmbox2 .tmbox2 .tmdir2
5904 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
5905 check
8 0 .tmbox2
'978751761 12656'
5906 ${sed} 2d
< .tlst
> .tlstx
5907 check
9 - .tlstx
'2172297531 13477'
5909 # More invalid: since in "copy * X" messages will be copied in `sort' order,
5910 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5911 # ensure pre-v15 MBOX separation "in between" messages.., 2019-08-07) that
5912 # could still have created invalid MBOX files!
5913 ${cat} <<-_EOT > ./.tinv1
5916 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5917 Date: Sun, 04 Oct 1998 01:50:07 +0000
5922 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5923 Date: Nix, 01 Oct BAD 01:50:07 +0000
5928 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5929 Date: Fri, 03 Oct 1997 01:50:07 +0000
5934 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5935 Date: Sun, 01 Oct 1995 01:50:07 +0000
5941 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5942 Date: Wed, 02 Oct 1996 01:50:07 +0000
5951 copy * maildir://./.tmdir10
5952 !{ for f in ./.tmdir10/new/*; do echo ===; %s $f; done; } > ./.t11
5956 ' "${cat}" | ${MAILX} ${ARGS} >>${ERR} 2>&1
5957 # Note that substdate() fixes all but one From_ line to $SOURCE_DATE_EPOCH!
5958 check 10 0 ./.t10warp '3551111321 502'
5959 check 11 - ./.t11 '642719592 302'
5965 # MIME and RFC basics {{{
5966 t_mime_if_not_ascii() {
5969 </dev/null ${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
5970 check
1 0 "${MBOX}" '3647956381 106'
5972 </dev
/null
${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
5974 check 2 0 "${MBOX}" '3964303752 274'
5983 printf 'Hey, you.\nFrom me to you\nCiao\n' |
5984 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5986 check
1 0 "${MBOX}" '3835153597 136'
5987 printf 'Hey, you.\n\nFrom me to you\nCiao.\n' |
5988 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5990 check 2 0 "${MBOX}" '63875210 275'
5993 printf 'Hey, you.\n From me to you\nCiao\n' |
5994 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
5996 check
3 0 "${MBOX}" '465798521 412'
5997 printf 'Hey, you.\nFrom me to you\nCiao\n' |
5998 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
6000 check 4 0 "${MBOX}" '2075263697 655'
6003 printf 'Hey, you.\n From me to you\nCiao\n' |
6004 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6006 check
5 0 "${MBOX}" '601672771 792'
6007 printf 'Hey, you.\nFrom me to you\nCiao\n' |
6008 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6010 check 6 0 "${MBOX}" '3926760595 1034'
6015 t_xxxheads_rfc2047() {
6018 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
6019 -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̲' \
6021 check 1 0 "${MBOX}" '3422562347 371'
6023 # Single word (overlong line split -- bad standard! Requires injection of
6024 # artificial data!! But can be prevented by using RFC 2047 encoding)
6026 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
6027 echo | ${MAILX} ${ARGS} -s "${i}" "${MBOX}"
6028 check
2 0 "${MBOX}" '3317256266 1714'
6030 # Combination of encoded words, space and tabs of varying sort
6032 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6033 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
6034 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
6035 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
6036 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
6037 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
6039 check
3 0 "${MBOX}" '786672837 587'
6041 # Overlong multibyte sequence that must be forcefully split
6042 # todo This works even before v15.0, but only by accident
6044 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6045 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6046 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6047 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
6049 check
4 0 "${MBOX}" '2889557767 655'
6053 echo |
${MAILX} ${ARGS} \
6054 -s "1-1 B2 B3 B4 B5 B6 B\
6055 1-2 B2 B3 B4 B5 B6 B\
6056 1-3 B2 B3 B4 B5 B6 B\
6057 1-4 B2 B3 B4 B5 B6 B\
6058 1-5 B2 B3 B4 B5 B6 B\
6059 1-6 B2 B3 B4 B5 B6 " \
6061 check
5 0 "${MBOX}" '3135161683 293'
6063 # Leading and trailing WS
6065 echo |
${MAILX} ${ARGS} \
6066 -s " 2-1 B2 B3 B4 B5 B6 B\
6067 1-2 B2 B3 B4 B5 B6 B\
6068 1-3 B2 B3 B4 B5 B6 B\
6069 1-4 B2 B3 B4 B5 B6 " \
6071 check
6 0 "${MBOX}" '3221845405 232'
6073 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
6075 echo "Dat Früchtchen riecht häußlich" |
6076 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=test://"$MBOX" \
6078 'Schnödes "Früchtchen" <do@du> (Hä!)'
6079 check
7 0 "${MBOX}" '3681801246 373'
6081 # RFC 2047 in an address field, and iconv involved
6082 if have_feat
iconv; then
6084 ${cat} > .
/.trebox
<<_EOT
6085 From zaza@exam.ple Fri Mar 2 21:31:56 2018
6086 Date: Fri, 2 Mar 2018 20:31:45 +0000
6087 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
6088 To: dude <dude@exam.ple>
6089 Subject: houston(...)
6090 Message-ID: <abra@1>
6092 Content-Type: text/plain; charset=iso-8859-1
6093 Content-Disposition: inline
6094 Content-Transfer-Encoding: 8bit
6097 echo reply |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6098 -Sfullnames -Sreply-in-same-charset \
6099 -Smta=test://"$MBOX" -Rf .
/.trebox
6100 check
8 0 "${MBOX}" '3499372945 285'
6102 t_echoskip
'8:[!ICONV]'
6108 t_iconv_mbyte_base64
() { # TODO uses sed(1) and special *headline*!!
6111 if [ -n "${UTF8_LOCALE}" ] && have_feat multibyte-charsets
&&
6112 have_feat
iconv; then
6113 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1 ||
6114 (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
6117 t_echoskip
'[ICONV/iconv(1):missing conversion(s)]'
6122 t_echoskip
'[no UTF-8 locale or !MULTIBYTE-CHARSETS or !ICONV]'
6127 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1; then
6128 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6129 -Smta=test://"$MBOX" \
6130 -Sescape=! -Smime-encoding=base64
2>.
/.terr
6131 set ttycharset
=utf-8 sendcharsets
=iso-2022-jp
6133 !s Japanese from UTF-8 to ISO-2022-JP
6134 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6136 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6139 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6141 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6144 set ttycharset
=iso-2022-jp charset-7bit
=iso-2022-jp sendcharsets
=utf-8
6146 !s Japanese from ISO-2022-JP to UTF-8
, eh
, no
, also ISO-2022-JP
6147 \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
6149 \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
6152 \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
6154 \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 # May not presume iconv output as long as roundtrip possible [489a7122]
6159 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6160 < "${MBOX}" > ./.tcksum
6161 check 1 - ./.tcksum '3314001564 516'
6162 check 2 - ./.terr '4294967295 0'
6164 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6165 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6166 -S headline="%>%a%m %-18f %-16d %i%-s" \
6167 -Rf "${MBOX}" >./.tlog 2>&1
6168 check 3 0 ./.twrite '1259742080 686'
6169 #check 4 - ./.tlog '3214068822 2123'
6170 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6171 check 4 - ./.txlog '4083300132 2030'
6173 t_echoskip '1-4:[ICONV/iconv(1):ISO-2022-JP unsupported]'
6176 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
6177 ${rm} -f "${MBOX}" ./.twrite
6178 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6179 -Smta=test://"$MBOX" \
6180 -Sescape=! -Smime-encoding=base64 2>./.terr
6181 set ttycharset=utf-8 sendcharsets=euc-jp
6183 !s Japanese from UTF-8 to EUC-JP
6184 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6186 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6189 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6191 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6194 set ttycharset=EUC-JP sendcharsets=utf-8
6196 !s Japanese from EUC-JP to UTF-8
6197 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6199 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6202 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6204 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6208 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6209 < "${MBOX}" > ./.tcksum
6210 check 5 - ./.tcksum '1754179361 469'
6211 check 6 - ./.terr '4294967295 0'
6213 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6214 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6215 -S headline="%>%a%m %-18f %-16d %i%-s" \
6216 -Rf "${MBOX}" >./.tlog 2>&1
6217 check 7 0 ./.twrite '1259742080 686'
6218 #check 8 - ./.tlog '2506063395 2075'
6219 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6220 check 8 - ./.txlog '3192017734 1983'
6222 t_echoskip '5-8:[ICONV/iconv(1):EUC-JP unsupported]'
6228 t_iconv_mainbody() {
6231 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then :; else
6232 t_echoskip '[no UTF-8 locale or !ICONV]'
6237 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6238 -S charset-7bit=us-ascii -S charset-8bit=utf-8 \
6239 -s '–' over-the@rain.bow 2>./.terr
6240 check 1 0 "${MBOX}" '3559538297 250'
6241 check 2 - ./.terr '4294967295 0'
6243 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6244 -S charset-7bit=us-ascii -S charset-8bit=us-ascii \
6245 -s '–' over-the@rain.bow 2>./.terr
6247 check 3 - "${MBOX}" '3559538297 250'
6248 if have_feat uistrings; then
6249 check 4 - ./.terr '271380835 121'
6251 t_echoskip '4:[!UISTRINGS]'
6254 # The different iconv(3) implementations use different replacement sequence
6255 # types (character-wise, byte-wise, and the character(s) used differ)
6256 i="${MAILX_ICONV_MODE}"
6257 if [ -n "${i}" ]; then
6258 printf 'p\nx\n' | ${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
6260 check_ex0 5-1-estat ${j}
6261 check 5-1 - ./.terr '4294967295 0'
6262 if [ ${i} -eq 13 ]; then
6263 check 5-2 - ./.tout '189327996 283' # XXX old (before test MTA)
6264 elif [ ${i} -eq 12 ]; then
6265 check 5-3 - ./.tout '1959197095 283' # XXX old (before test MTA)
6266 elif [ ${i} -eq 3 ]; then
6267 check 5-4 - ./.tout '3544755786 278'
6269 check 5-5 - ./.tout '2381160335 278'
6272 t_echoskip '5:[test unsupported]'
6278 t_binary_mainbody() {
6281 printf 'abra\0\nka\r\ndabra' |
6282 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
6284 check 1 0 "${MBOX}" '1629827 239'
6285 check 2 - ./.terr '4294967295 0'
6287 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
6288 ${MAILX} ${ARGS} -Rf \
6289 -Spipe-application/octet-stream="?* ${cat} > ./.tcat" \
6290 "${MBOX}" >./.tall 2>&1
6291 check 3 0 ./.tall '733582513 319'
6292 check 4 - ./.tcat '3817108933 15'
6293 check 5 - ./.twrite '3817108933 15'
6298 t_mime_force_sendout() {
6301 if have_feat iconv; then :; else
6302 t_echoskip '[!ICONV]'
6307 printf '\150\303\274' > ./.tmba
6308 printf 'ha' > ./.tsba
6309 printf '' > "${MBOX}"
6311 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6313 over-the@rain.bow 2>>${ERR}
6314 check 1 4 "${MBOX}" '4294967295 0'
6316 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6317 -s go -Smime-force-sendout \
6318 over-the@rain.bow 2>>${ERR}
6319 check 2 0 "${MBOX}" '1866273282 219'
6321 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6323 -a ./.tmba over-the@rain.bow 2>>${ERR}
6324 check 3 4 "${MBOX}" '1866273282 219'
6326 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6327 -s go -Smime-force-sendout \
6328 -a ./.tmba over-the@rain.bow 2>>${ERR}
6329 check 4 0 "${MBOX}" '644433809 880'
6331 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6333 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6334 check 5 4 "${MBOX}" '644433809 880'
6336 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6337 -s go -Smime-force-sendout \
6338 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6339 check 6 0 "${MBOX}" '3172365123 1729'
6341 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6343 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6344 check 7 4 "${MBOX}" '3172365123 1729'
6346 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6347 -s go -Smime-force-sendout \
6348 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6349 check 8 0 "${MBOX}" '4002905306 2565'
6354 t_C_opt_customhdr() {
6358 ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6359 -C 'C-One : Custom One Body' \
6360 -C 'C-Two:CustomTwoBody' \
6361 -C 'C-Three: CustomThreeBody ' \
6362 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body, chdr3: chdr3 body ' \
6363 this-goes@nowhere >./.tall 2>&1
6365 ${cat} ./.tall >> "${MBOX}"
6366 check 1 0 "${MBOX}" '2535463301 238'
6369 printf 'm this-goes@nowhere\nbody\n!.
6371 m this-goes2@nowhere\nbody2\n!.
6372 set customhdr=%ccustom1 : custom1 body%c
6373 m this-goes3@nowhere\nbody3\n!.
6374 set customhdr=%ccustom1 : custom1\\, body , \\
6375 custom2: custom2 body , custom-3 : custom3 body ,\\
6376 custom-4:custom4-body %c
6377 m this-goes4@nowhere\nbody4\n!.
6379 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
6380 -C 'C-One : Custom One Body' \
6381 -C 'C-Two:CustomTwoBody' \
6382 -C 'C-Three: CustomThreeBody ' \
6383 -C ' C-Four:CustomFourBody ' \
6384 -C 'C-Five:CustomFiveBody' \
6385 -S customhdr='ch1: b1 , ch2:b2, ch3:b3 ,ch4:b4, ch5: b5 ' \
6388 ${cat} ./.tall >> "${MBOX}"
6389 check 2 0 "${MBOX}" '544085062 1086'
6395 # Operational basics with trivial tests {{{
6399 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
6401 alias a1 ex2@a1.ple "EX3 <ex3@a1.ple>"
6403 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
6405 alias a4 a5 ex1@a4.ple
6407 alias a6 a7 ex1@a6.ple
6421 check 1 0 "${MBOX}" '139467786 277'
6422 check 2 - .tall '1598893942 133'
6424 if have_feat uistrings; then
6425 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6426 commandalias x echo '$?/$^ERRNAME'
6428 alias a:bra! ha@m beb@ra ha@m '' zeb@ra ha@m; x
6430 alias ha@m ham-expansion ha@m '';x
6432 alias beb@ra ceb@ra beb@ra1;x
6434 alias ceb@ra ceb@ra1;x
6452 \alias noexpa@and this@error1;x
6453 \alias ha@m '\noexp@and' expa@and \\noexp@and2;x
6456 \alias noexpa@and2 this@error2;x
6457 \alias expa1@and this@error3;x
6458 \alias expa@and \\expa1@and;x
6463 check 3 0 "${MBOX}" '1513155156 796'
6465 t_echoskip '3:[!UISTRINGS]'
6468 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
6469 # TODO need to somehow provide its contents to the test, then test
6477 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6478 commandalias x echo '$?/$^ERRNAME'
6480 charsetalias latin1 latin15;x
6481 charsetalias latin1;x
6482 charsetalias - latin1;x
6484 charsetalias cp1252 latin1 latin15 utf8 utf8 utf16;x
6485 charsetalias cp1252;x
6486 charsetalias latin15;x
6489 charsetalias - cp1252;x
6490 charsetalias - latin15;x
6491 charsetalias - utf8;x
6493 charsetalias latin1;x
6494 charsetalias - latin1;x
6495 uncharsetalias latin15;x
6496 charsetalias latin1;x
6497 charsetalias - latin1;x
6499 check 1 0 "${MBOX}" '3551595280 433'
6507 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6508 commandalias x echo '$?/$^ERRNAME'
6510 shortcut file1 expansion-of-file1;x
6511 shortcut file2 expansion-of-file2;x
6512 shortcut file3 expansion-of-file3;x
6513 shortcut file4 'expansion of file4' 'file 5' 'expansion of file5';x
6523 check 1 0 "${MBOX}" '1970515669 430'
6531 if have_feat netrc; then :; else
6532 t_echoskip '[!NETRC]'
6538 machine x.local login a1 machine x.local login a2 password p2
6539 machine x.local login a3 password "p 3"
6546 machine *.x.local login a2 password p2-any!
6547 machine y.local login ausr password apass
6551 # and unused default
6552 default login defacc password defpass
6554 ${chmod} 0600 ./.tnetrc
6556 printf 'netrc;echo =$?;netrc c;echo =$?;netr loa;echo =$?;netr s;echo =$?' |
6557 NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6558 check 1 0 "${MBOX}" '2911708535 542'
6560 have_feat uistrings && i='3076722625 893' || i='3808149439 645'
6566 echo ==(re)load cache
6567 netrc load;echo $?/$^ERRNAME
6569 netrc loo a1@x.local
6570 netrc loo a2@x.local
6571 netrc loo a3@x.local
6572 netrc loo a4@x.local
6574 netrc clear;echo $?/$^ERRNAME
6576 netrc loo a2@pop.x.local
6577 netrc loo a2@imap.x.local
6578 netrc loo a2@smtp.x.local
6580 netrc loo a2@nono.smtp.x.local
6581 echo ==[usr@]unknown-host
6583 netrc loo defacc@a.local
6584 netrc loo a1@a.local
6585 ' | NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6586 check 2 0 "${MBOX}" "${i}"
6592 # Operational basics with easy tests {{{
6595 # MTA alias specific part in t_mta_aliases()
6596 # This only tests from command line, rest later on (iff any)
6599 if have_feat uistrings; then :; else
6600 t_echoskip '[!UISTRINGS]'
6605 echo "${cat}" > ./.tcat
6606 ${chmod} 0755 ./.tcat
6609 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6610 -X'alias talias talias@exam.ple' \
6611 './.tfile' ' | ./.tcat > ./.tpipe' 'talias' 'taddr@exam.ple' \
6613 check 1 4 "${MBOX}" '1216011460 138'
6614 check 2 - .tall '4169590008 162'
6617 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6619 -X'alias talias talias@exam.ple' \
6620 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6622 check 3 0 "${MBOX}" '847567042 276'
6623 check 4 - .tall '4294967295 0'
6624 check 5 - .tfile '1216011460 138'
6625 check 6 - .tpipe '1216011460 138'
6628 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6629 -Sexpandaddr=-all,+file,+pipe,+name,+addr \
6630 -X'alias talias talias@exam.ple' \
6631 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6633 check 7 0 "${MBOX}" '3682360102 414'
6634 check 8 - .tall '4294967295 0'
6635 check 9 - .tfile '847567042 276'
6636 check 10 - .tpipe '1216011460 138'
6639 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6640 -Sexpandaddr=-all,+file,-file,+pipe,+name,+addr \
6641 -X'alias talias talias@exam.ple' \
6642 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6644 check 11 4 "${MBOX}" '1010907786 552'
6645 check 12 - .tall '673208446 70'
6646 check 13 - .tfile '847567042 276'
6647 check 14 - .tpipe '1216011460 138'
6649 printf '' > ./.tpipe
6650 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6651 -Sexpandaddr=fail,-all,+file,-file,+pipe,+name,+addr \
6652 -X'alias talias talias@exam.ple' \
6653 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6655 check 15 4 "${MBOX}" '1010907786 552'
6656 check 16 - .tall '3280630252 179'
6657 check 17 - .tfile '847567042 276'
6658 check 18 - .tpipe '4294967295 0'
6661 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6662 -Sexpandaddr=-all,+file,+pipe,-pipe,+name,+addr \
6663 -X'alias talias talias@exam.ple' \
6664 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6666 check 19 4 "${MBOX}" '3359494254 690'
6667 check 20 - .tall '4052857227 91'
6668 check 21 - .tfile '3682360102 414'
6669 check 22 - .tpipe '4294967295 0'
6671 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6672 -Sexpandaddr=fail,-all,+file,+pipe,-pipe,+name,+addr \
6673 -X'alias talias talias@exam.ple' \
6674 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6676 check 23 4 "${MBOX}" '3359494254 690'
6677 check 24 - .tall '2168069102 200'
6678 check 25 - .tfile '3682360102 414'
6679 check 26 - .tpipe '4294967295 0'
6682 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6683 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6684 -X'alias talias talias@exam.ple' \
6685 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6687 check 27 0 "${MBOX}" '3735108703 828'
6688 check 28 - .tall '4294967295 0'
6689 check 29 - .tfile '1010907786 552'
6690 check 30 - .tpipe '1216011460 138'
6692 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6693 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6694 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6696 check 31 4 "${MBOX}" '4225234603 949'
6697 check 32 - .tall '3486613973 73'
6698 check 33 - .tfile '452731060 673'
6699 check 34 - .tpipe '1905076731 121'
6701 printf '' > ./.tpipe
6702 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6703 -Sexpandaddr=fail,-all,+file,+pipe,+name,-name,+addr \
6704 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6706 check 35 4 "${MBOX}" '4225234603 949'
6707 check 36 - .tall '3032065285 182'
6708 check 37 - .tfile '452731060 673'
6709 check 38 - .tpipe '4294967295 0'
6712 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6713 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6714 -X'alias talias talias@exam.ple' \
6715 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6717 check 39 4 "${MBOX}" '4225234603 949'
6718 check 40 - .tall '3863610168 169'
6719 check 41 - .tfile '1975297706 775'
6720 check 42 - .tpipe '130065764 102'
6722 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6723 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6724 -Sadd-file-recipients \
6725 -X'alias talias talias@exam.ple' \
6726 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6728 check 43 4 "${MBOX}" '4225234603 949'
6729 check 44 - .tall '3863610168 169'
6730 check 45 - .tfile '3291831864 911'
6731 check 46 - .tpipe '4072000848 136'
6733 printf '' > ./.tpipe
6734 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6735 -Sexpandaddr=fail,-all,+file,+pipe,+name,+addr,-addr \
6736 -Sadd-file-recipients \
6737 -X'alias talias talias@exam.ple' \
6738 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6740 check 47 4 "${MBOX}" '4225234603 949'
6741 check 48 - .tall '851041772 278'
6742 check 49 - .tfile '3291831864 911'
6743 check 50 - .tpipe '4294967295 0'
6746 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6747 -Sexpandaddr=-all,+addr \
6748 'taddr@exam.ple' 'this@@c.example' \
6750 check 51 4 "${MBOX}" '473729143 1070'
6751 check 52 - .tall '2646392129 66'
6753 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6754 -Sexpandaddr=-all,failinvaddr \
6755 'taddr@exam.ple' 'this@@c.example' \
6757 check 53 4 "${MBOX}" '473729143 1070'
6758 check 54 - .tall '887391555 175'
6761 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6762 -Sthis=taddr@exam.ple -Sexpandaddr \
6763 -c '\$this' -b '\$this' '\$this' \
6765 check 55 4 "${MBOX}" '473729143 1070'
6766 check 56 - .tall '1144578880 139'
6768 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6769 -Sthis=taddr@exam.ple -Sexpandaddr=shquote \
6770 -c '\$this' -b '\$this' '\$this' \
6772 check 57 0 "${MBOX}" '398243793 1191'
6773 check 58 - .tall '4294967295 0'
6776 printf '' > "${MBOX}"
6778 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6779 -Sadd-file-recipients \
6780 -Sexpandaddr=-all,+fcc \
6785 check 59 0 "${MBOX}" '4294967295 0'
6786 check 60 - .tall '4294967295 0'
6787 check 61 - .tfile1 '1067276522 124'
6788 check 62 - .tfile2 '1067276522 124'
6790 printf '' > "${MBOX}"
6792 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6793 -Sadd-file-recipients \
6794 -Sexpandaddr=-all,+file \
6799 check 63 0 "${MBOX}" '4294967295 0'
6800 check 64 - .tall '4294967295 0'
6801 check 65 - .tfile1 '2677253527 248'
6802 check 66 - .tfile2 '2677253527 248'
6804 printf '' > "${MBOX}"
6806 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6807 -Sadd-file-recipients \
6808 -Sexpandaddr=-all,+file,-fcc \
6813 check 67 0 "${MBOX}" '4294967295 0'
6814 check 68 - .tall '4294967295 0'
6815 check 69 - .tfile1 '3493511004 372'
6816 check 70 - .tfile2 '3493511004 372'
6818 printf '' > "${MBOX}"
6820 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6821 -Sadd-file-recipients \
6822 -Sexpandaddr=-all,+fcc,-file \
6827 check 71 4 "${MBOX}" '4294967295 0'
6828 check 72 - .tall '203687556 223'
6829 check 73 - .tfile1 '3493511004 372'
6830 check 74 - .tfile2 '3493511004 372'
6832 printf '' > "${MBOX}"
6834 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6835 -Sadd-file-recipients \
6836 -Sexpandaddr=-all,fail,+addr \
6842 check 75 4 "${MBOX}" '4294967295 0'
6843 check 76 - .tall '4060426468 247'
6844 check 77 - .tfile1 '3493511004 372'
6845 check 78 - .tfile2 '3493511004 372'
6848 printf '' > "${MBOX}"
6850 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6851 -Sexpandaddr=fail,domaincheck \
6855 check 79 0 "${MBOX}" '171635532 120'
6856 check 80 - .tall '4294967295 0'
6859 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6860 -Sexpandaddr=domaincheck \
6862 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6864 check 81 4 "${MBOX}" '2659464839 240'
6865 check 82 - .tall '1119895397 158'
6868 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6869 -Sexpandaddr=fail,domaincheck \
6871 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6873 check 83 4 "${MBOX}" '2659464839 240'
6874 check 84 - .tall '1577313789 267'
6877 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6878 -Sexpandaddr=fail,domaincheck \
6879 -Sexpandaddr-domaincheck=exam.ple,tro.uble \
6881 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6883 check 85 0 "${MBOX}" '1670655701 410'
6884 check 86 - .tall '4294967295 0'
6890 # after: t_expandaddr
6893 if have_feat mta-aliases; then :; else
6894 t_echoskip '[!MTA_ALIASES]'
6899 ${cat} > ./.tali <<- '__EOT'
6905 ex2@a1.ple, <ex3@a1.ple> ,
6907 a2: ex1@a2.ple , ex2@a2.ple,a2_2
6908 a2_2:ex3@a2.ple,ex4@a2.ple
6921 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6922 -Smta-aliases=./.tali \
6923 -b a3 -c a2 a1 > ./.tall 2>&1
6924 check 1 0 "${MBOX}" '1172368381 238'
6925 check 2 - .tall '4294967295 0'
6927 ## xxx The following are actually *expandaddr* tests!!
6929 # May not send plain names over SMTP!
6931 if have_feat smtp; then
6932 echo | ${MAILX} ${ARGS} \
6933 -Smta=smtp://laber.backe -Ssmtp-auth=none \
6934 -Smta-aliases=./.tali \
6935 -b a3 -c a2 a1 > ./.tall 2>&1
6937 check 4 - "${MBOX}" '1172368381 238'
6940 if [ -n "${mtaali}" ] && have_feat uistrings; then
6941 check 5 - .tall '771616226 179'
6943 t_echoskip '5:[!SMTP/!UISTRINGS]'
6946 # xxx for false-positive SMTP test we would need some mocking
6947 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6948 -Sexpandaddr=fail,-name \
6949 -Smta-aliases=./.tali \
6950 -b a3 -c a2 a1 > ./.tall 2>&1
6952 check 7 - "${MBOX}" '1172368381 238'
6953 if have_feat uistrings; then
6954 check 8 - .tall '2834389894 178'
6956 t_echoskip '8:[!UISTRINGS]'
6959 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6960 -Sexpandaddr=-name \
6961 -Smta-aliases=./.tali \
6962 -b a3 -c a2 a1 > ./.tall 2>&1
6963 check 9 4 "${MBOX}" '2322273994 472'
6964 if have_feat uistrings; then
6965 check 10 - .tall '2136559508 69'
6967 t_echoskip '10:[!UISTRINGS]'
6970 echo 'a9:nine@nine.nine' >> ./.tali
6972 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6973 -Sexpandaddr=fail,-name \
6974 -Smta-aliases=./.tali \
6975 -b a3 -c a2 a1 > ./.tall 2>&1
6976 check 11 0 "${MBOX}" '2422268299 722'
6977 check 12 - .tall '4294967295 0'
6980 set expandaddr=-name
6984 !^header insert bcc a3
6990 !^header insert bcc a3
6993 echo and, once again, check that cache is updated
6994 # Enclose one pipe in quotes: immense stress for our stupid address parser:(
6995 !echo "a10:./.tf1,|%s>./.tp1,\\"|%s > ./.tp2\\",./.tf2" >> ./.tali
7000 !^header insert bcc a3
7003 echo trigger happiness
7007 !^header insert bcc "a3 a10"
7010 ' "${cat}" "${cat}" | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7011 -Smta-aliases=./.tali \
7013 check 13 0 "${MBOX}" '550955032 1469'
7014 if have_feat uistrings; then
7015 check 14 - .tall '1795496020 473'
7017 t_echoskip '14:[!UISTRINGS]'
7019 check 15 - .tf1 '3056269950 249'
7020 check 16 - .tp1 '3056269950 249'
7021 check 17 - .tp2 '3056269950 249'
7022 check 18 - .tf2 '3056269950 249'
7024 # TODO t_mta_aliases: n_ALIAS_MAXEXP is compile-time constant,
7025 # TODO need to somehow provide its contents to the test, then test
7033 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
7034 "${TOPDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=test://"$MBOX"
7035 check 1 0 "${MBOX}" '1314354444 13536'
7037 if (echo | gzip -c) >/dev/null 2>&1; then
7039 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
7040 "${MBOX}" | ${MAILX} ${ARGS} \
7041 -X'filetype gz gzip\ -dc gzip\ -c'
7042 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7043 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
7045 check 2 - ./.t.mbox '1314354444 13536'
7046 check 3 - ./.t.out '635961640 103'
7048 t_echoskip '2:[missing gzip(1)]'
7049 t_echoskip '3:[missing gzip(1)]'
7054 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
7060 -X'filetype gz gzip\ -dc gzip\ -c' \
7061 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
7062 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
7063 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7065 -X'filetype gz gzip\ -dc gzip\ -c' \
7066 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
7068 check 4 - ./.t.mbox '2687765142 27092'
7069 check 5 - ./.t.out '2230192693 173'
7078 ${MAILX} ${ARGS} -ef ./.t.mbox
7079 echo ${?} > "${MBOX}"
7081 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
7082 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7083 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
7084 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7086 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
7087 echo ${?} >> "${MBOX}"
7088 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
7089 echo ${?} >> "${MBOX}"
7090 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
7091 echo ${?} >> "${MBOX}"
7092 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
7093 echo ${?} >> "${MBOX}"
7094 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
7095 echo ${?} >> "${MBOX}"
7096 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
7097 echo ${?} >> "${MBOX}"
7098 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
7099 echo ${?} >> "${MBOX}"
7101 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
7102 echo ${?} >> "${MBOX}"
7103 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
7104 echo ${?} >> "${MBOX}"
7105 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
7106 echo ${?} >> "${MBOX}"
7107 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
7108 echo ${?} >> "${MBOX}"
7109 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
7110 echo ${?} >> "${MBOX}"
7111 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
7112 echo ${?} >> "${MBOX}"
7113 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
7114 echo ${?} >> "${MBOX}"
7116 check 1 - "${MBOX}" '1369201287 670'
7120 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
7121 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7122 -r '' -X 'wysh set from=pony1@$LOGNAME'
7123 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
7124 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7125 -r '' -X 'wysh set from=pony2@$LOGNAME'
7126 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
7127 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7128 -r '' -X 'wysh set from=pony3@$LOGNAME'
7130 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7131 echo fh-test size; set autosort=size showname showto
7132 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7133 check 2 0 "${MBOX}" '4286438644 413'
7135 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7136 echo fh-test subject; set autosort=subject showname showto
7137 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7138 check 3 0 "${MBOX}" '3208053922 416'
7140 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7141 echo fh-test from; set autosort=from showto
7142 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7143 check 4 0 "${MBOX}" '4209767839 413'
7145 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7146 echo fh-test to; set autosort=to showto
7147 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7148 check 5 0 "${MBOX}" '2785342736 411'
7154 # Simple, if we need more here, place in a later vim fold!
7157 # Three tests for MIME encoding and (a bit) content classification.
7158 # At the same time testing -q FILE, < FILE and -t FILE
7159 t__put_body > ./.tin
7161 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
7162 -a ./.tin -s "`t__put_subject
`" "${MBOX}"
7163 check 1 0 "${MBOX}" '1088822685 6642'
7166 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
7167 -a ./.tin -s "`t__put_subject
`" -q ./.tin "${MBOX}"
7168 check 2 0 "${MBOX}" '1088822685 6642'
7171 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject
`" && echo &&
7173 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
7174 check 3 0 "${MBOX}" '1088822685 6642'
7176 # Check comments in the header
7178 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
7181 # Noch ein Kommentar
7183 # Nachgestelltes Kommentar
7187 check 4 0 "${MBOX}" '4161555890 124'
7190 printf '' > "${MBOX}"
7191 ( echo 'To?single : ./.tout1 .tout2 ' &&
7192 echo 'CC: ./.tcc1 ./.tcc2' &&
7193 echo 'BcC?sin : ./.tbcc1 .tbcc2 ' &&
7194 echo 'To? : ./.tout3 .tout4 ' &&
7197 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -t -Smta=test://"$MBOX"
7198 check 5 0 './.tout1 .tout2' '2948857341 94'
7199 check 6 - ./.tcc1 '2948857341 94'
7200 check 7 - ./.tcc2 '2948857341 94'
7201 check 8 - './.tbcc1 .tbcc2' '2948857341 94'
7202 check 9 - './.tout3 .tout4' '2948857341 94'
7203 check 10 - "${MBOX}" '4294967295 0'
7208 t_message_injections() {
7209 # Simple, if we need more here, place in a later vim fold!
7212 echo mysig > ./.tmysig
7214 echo some-body | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7215 -Smessage-inject-head=head-inject \
7216 -Smessage-inject-tail="`${cat} .
/.tmysig
`"'\ntail-inject' \
7217 ex@am.ple > ./.tall 2>&1
7218 check 1 0 "${MBOX}" '701778583 143'
7219 check 2 - .tall '4294967295 0' # empty file
7222 ${cat} <<-_EOT > ./.template
7226 Subject: This subject is
7228 Body, body, body me.
7230 < ./.template ${MAILX} ${ARGS} -t -Smta=test://"$MBOX" \
7231 -Smessage-inject-head=head-inject \
7232 -Smessage-inject-tail="`${cat} .
/.tmysig
`\n"'tail-inject' \
7234 check 3 0 "${MBOX}" '2189109479 207'
7235 check 4 - .tall '4294967295 0' # empty file
7241 # TODO More should be in compose mode stuff aka digmsg
7244 ${cat} <<-_EOT > ./.tx
7245 From steffen Sun Feb 18 02:48:40 2018
7246 Date: Sun, 18 Feb 2018 02:48:40 +0100
7249 User-Agent: s-nail v14.9.7
7252 From steffen Sun Feb 18 02:48:42 2018
7253 Date: Sun, 18 Feb 2018 02:48:42 +0100
7256 User-Agent: s-nail v14.9.7
7261 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
7262 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
7263 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
7266 '!@ ./.t3 "./.t 4" ""
7274 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
7275 -a ./.t1 -a './.t 2' \
7276 -s attachment-test \
7277 ex@am.ple > ./.tall 2>&1
7278 check 1 0 "${MBOX}" '2484200149 644'
7279 if have_feat uistrings; then
7280 check 2 - .tall '1928331872 720'
7282 t_echoskip '2:[!UISTRINGS]'
7288 !s This the subject is
7289 !@ ./.t3 "#2" "./.t 4" "#1" ""
7299 !@ ./.t3 "#2" "./.t 4" "#1" ""
7307 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7316 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7330 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7332 check 3 0 "${MBOX}" '3637385058 2335'
7333 if have_feat uistrings; then
7334 check 4 - .tall '2526106274 1910'
7336 t_echoskip '4:[!UISTRINGS]'
7365 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7367 check 5 0 "${MBOX}" '1604688179 2316'
7368 if have_feat uistrings; then
7369 check 6 - .tall '1210753005 508'
7371 t_echoskip '6:[!UISTRINGS]'
7377 </dev/null ${MAILX} ${ARGS} -Smta=test \
7378 -Sstealthmua=noagent -Shostname \
7379 -a ./.t1 -a './.t 2' \
7380 -a ./.t3 -a './.t 4' \
7382 ex@am.ple > ./.tall 2>&1
7383 check 7 0 .tall '1003537919 1262'
7386 </dev/null ${MAILX} ${ARGS} -Smta=test -Sttycharset=utf8 \
7387 -a ./.t1=ascii -a './.t 2'=LATin1 \
7388 -a ./.t3=UTF-8 -a './.t 4'=- \
7390 ex@am.ple > ./.tall 2>&1
7391 check 8 0 .tall '361641281 921'
7393 # input+output charset, no iconv
7394 </dev/null ${MAILX} ${ARGS} -Smta=test \
7395 -a ./.t1=ascii#- -a './.t 2'=LATin1#- \
7396 -a ./.t3=UTF-8#- -a './.t 4'=utf8#- \
7398 ex@am.ple > ./.tall 2>&1
7399 check 9 0 .tall '1357456844 933'
7401 if have_feat iconv; then
7402 printf 'ein \303\244ffchen und ein pferd\n' > .t10-f1
7403 if (< .t10-f1 iconv -f ascii -t utf8) >/dev/null 2>&1; then
7404 </dev/null ${MAILX} ${ARGS} --set mta=test \
7405 --set stealthmua=noagent --set hostname \
7406 --attach ./.t1=-#utf8 \
7407 --attach ./.t10-f1=utf8#latin1 \
7409 ex@am.ple > ./.tall 2>&1
7410 check 10 0 .tall '1257664842 877'
7412 t_echoskip '10:[ICONV/iconv(1):missing conversion(1)]'
7415 t_echoskip '10:[!ICONV]'
7422 # (after attachments)
7426 mkdir ./.ttt || exit 1
7430 : > 'diet\ is \curd.txt'
7431 : > 'diet "is" curd.txt'
7433 : > 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
7434 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
7435 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
7436 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
7438 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
7439 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
7440 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
7441 -a ./.ttt/höde-tröge.txt \
7442 -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 \
7443 -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 \
7444 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
7445 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
7447 check 1 0 "${MBOX}" '3720896054 3088'
7449 # `resend
' test, reusing $MBOX
7450 printf "Resend ./.t2\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7451 check 2 0 ./.t2 '3720896054 3088'
7453 printf "resend ./.t3\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7454 check 3 0 ./.t3 '3979736592 3133'
7456 # And a primitive test for reading messages with invalid parameters
7457 ${cat} <<-_EOT > ./.tinv
7458 From a@b.invalid Wed May 15 12:43:00 2018
7460 Content-Type: multipart/mixed; boundary="1"
7462 This is a multi-part message in MIME format.
7464 Content-Type: text/plain; charset=UTF-8
7465 Content-Transfer-Encoding: quoted-printable
7469 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7470 Content-Transfer-Encoding: 7bit
7471 Content-Disposition: inline
7476 From a@b.invalid Wed May 15 12:43:00 2018
7478 Content-Type: multipart/mixed; boundary="2"
7480 This is a multi-part message in MIME format.
7482 Content-Type: text/plain; charset=UTF-8
7483 Content-Transfer-Encoding: quoted-printable
7487 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7488 Content-Transfer-Encoding: 7bit
7489 Content-Disposition: inline;
7491 filename*998999999999999999999999999999="me-c-d"
7496 From a@b.invalid Wed May 15 12:43:00 2018
7498 Content-Type: multipart/mixed; boundary="3"
7500 This is a multi-part message in MIME format.
7502 Content-Type: text/plain; charset=UTF-8
7503 Content-Transfer-Encoding: quoted-printable
7507 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7508 Content-Transfer-Encoding: 7bit
7509 Content-Disposition: inline;
7510 filename*0="na"; filename*998="me-c-d"
7517 \\headerpick
type ignore Content-Type Content-Disposition
7520 ' | ${MAILX} ${ARGS} -Rf ./.tinv > ./.tall 2> ./.terr
7521 check 4 0 ./.tall '4094731083 905'
7522 if have_feat uistrings && have_feat iconv; then
7523 check 5 - ./.terr '3713266499 473'
7525 t_echoskip '5:[!UISTRINGS or
!ICONV
]'
7531 t_mime_types_load_control() {
7534 if have_feat uistrings; then :; else
7535 t_echoskip '[!UISTRINGS
]'
7540 ${cat} <<-_EOT > ./.tmts1
7541 ? application/mathml+xml mathml
7543 ${cat} <<-_EOT > ./.tmts2
7544 ? x-conference/x-cooltalk ice
7546 ? application/aga-aga aga
7549 ${cat} <<-_EOT > ./.tmts1.mathml
7550 <head>nonsense ML</head>
7552 ${cat} <<-_EOT > ./.tmts2.ice
7555 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.doom
7556 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.aga
7570 ' "${MBOX}" "${MBOX}" |
7572 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
7575 ${cat} "${MBOX}" >> ./.tout
7576 check 1 - ./.tout '2128819500 2441'
7578 echo type | ${MAILX} ${ARGS} -R \
7579 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
7580 -f "${MBOX}" >> ./.tout 2>&1
7581 check 2 0 ./.tout '1125106528 3642'
7587 # Around state machine, after basics {{{
7591 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
7592 commandalias x echo '$?
/$^ERRNAME
'
7593 commandalias y echo '$?
/$^ERRNAME
<$rv>'
7596 alternates a1@b1 a2@b2 a3@b3;x
7598 vput alternates rv;y
7602 vput alternates rv;y
7604 vput alternates rv;y
7606 vput alternates rv;y
7610 alternates a1@b1 a2@b2 a3@b3
7612 vput alternates rv;y
7614 vput alternates rv;y
7616 vput alternates rv;y
7619 alternates a1@b1 a2@b2 a3@b3
7621 vput alternates rv;y
7623 vput alternates rv;y
7625 vput alternates rv;y
7629 alternates a1@b1 a2@b2 a3@b3
7631 vput alternates rv;y
7635 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
7637 ~s all alternates, only a1@b1 remains
7639 ~b a3@b3 a3@c3 a3@d3
7648 alternates a1@b1 a1@c1 a2@b2 a3@b3
7650 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
7652 ~b a3@b3 a3@c3 a3@d3
7659 alternates a1@b1 a2@b2 a3; set allnet
7661 ~s all alternates via allnet, only a1@b1 remains
7663 ~b a3@b3 a3@c3 a3@d3
7672 vput alternates rv;y
7674 vput alternates rv;y
7676 vput alternates rv;y
7678 vput alternates rv;y
7681 vput alternates rv;y
7685 alternates a1@b1 a2@b2;x
7686 vput alternates rv;y
7687 alternates a3@b3 a4@b4;x
7688 vput alternates rv;y
7691 check 1 0 "${MBOX}" '3901995195 542'
7692 if have_feat uistrings; then
7693 check 2 - .tall '1878598364 505'
7695 t_echoskip '2:[!UISTRINGS
]'
7698 # Automatic alternates, also from command line (freezing etc.)
7700 ${cat} <<- __EOT > ./.tin
7701 From trouble-report@desy Wed Jun 6 20:19:28 2018
7702 Date: Wed, 06 Jun 2018 19:58:02 +0200
7703 From: a@b.org, b@b.org, c@c.org
7706 Cc: a@b.org, c@c.org
7708 Message-ID: <20180606175802.dw-cn%a@b.org>
7718 !^header remove subject
7719 !^header insert to b@b.org
7720 !^header insert cc
"a@b.org b@b.org c@c.org"
7723 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7724 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
7725 -Rf ./.tin > ./.tall 2>&1
7726 check 3 0 "${MBOX}" '3184203976 265'
7727 check 4 - .tall '3604001424 44'
7731 set from
=a@b.org
,b@b.org
,c@c.org sender
=a@b.org
7735 !^header remove subject
7736 !^header insert to b@b.org
7737 !^header insert cc
"a@b.org b@b.org c@c.org"
7740 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7741 -Rf ./.tin > ./.tall 2>&1
7742 check 5 0 "${MBOX}" '98184290 530'
7743 check 6 - .tall '3604001424 44'
7745 # And more, with/out -r (and that Sender: vanishs as necessary)
7746 # TODO -r should be the Sender:, which should automatically propagate to
7747 # TODO From: if possible and/or necessary. It should be possible to
7748 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
7749 # TODO arg as appropriate.
7750 # TODO For now we are a bit messy
7753 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7754 -c a@b.example -c b@b.example -c c@c.example \
7755 -S from=a@b.example,b@b.example,c@c.example \
7756 -S sender=a@b.example \
7757 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7758 check 7 0 "${MBOX}" '4275947318 181'
7759 check 8 - .tout '4275947318 181'
7760 check 9 - .tall '4294967295 0'
7762 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7763 -c a@b.example -c b@b.example -c c@c.example \
7764 -S from=a@b.example,b@b.example,c@c.example \
7765 -S sender=a2@b.example \
7766 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7767 check 10 0 "${MBOX}" '1189494079 383'
7768 check 11 - .tout '1189494079 383'
7769 check 12 - .tall '4294967295 0'
7771 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7772 -c a@b.example -c b@b.example -c c@c.example \
7773 -S from=a@b.example,b@b.example,c@c.example \
7774 -S sender=a@b.example \
7775 b@b.example >./.tall 2>&1
7776 check 13 0 "${MBOX}" '2253033142 610'
7777 check 14 - .tall '4294967295 0'
7783 # quote and cmd escapes because this (since Mail times) is worked in the
7784 # big collect() monster of functions
7787 echo 'included
file' > ./.ttxt
7788 { t__x1_msg && t__x2_msg && t__x3_msg &&
7789 t__gen_msg from 'ex4@am.ple
' subject sub4 &&
7790 t__gen_msg from 'eximan
<ex5@am.ple
>' subject sub5 &&
7791 t__gen_mimemsg from 'ex6@am.ple
' subject sub6; } > ./.tmbox
7792 check 1 - ./.tmbox '517368276 2182'
7794 # ~@ is tested with other attachment stuff, ~^ is in compose_edits + digmsg
7796 set Sign
=SignVar sign
=signvar DEAD
=.
/.ttxt
7797 set forward-inject-head quote-inject-head
7798 headerpick
type retain Subject
7799 headerpick forward retain Subject To
7801 !!1 Not escaped. And shell
test last
, right before
!..
7803 !: echo 2 only echoed via colon
7804 !:echo 2:$?
/$^ERRNAME
7805 !_
echo 3 only echoed via underscore
7806 !:echo 3:$?
/$^ERRNAME
7808 !:echo 4:$?
/$^ERRNAME
7809 !<! echo 5 shell
echo included
7810 !:echo 5:$?
/$^ERRNAME
7811 !|
echo 6 pipecmd-pre
; cat; echo 6 pipecmd-post
7812 !:echo 6:$?
/$^ERRNAME
7813 7 and
8 are ~A and ~a
:
7815 !:echo 7:$?
/$^ERRNAME
7817 !:echo 8:$?
/$^ERRNAME
7818 !b
9 added ~b cc
<ex1@am.ple
>
7819 !:echo 9:$?
/$^ERRNAME
7820 !c
10 added ~c c
<ex2@am.ple
>
7821 !:echo 10:$?
/$^ERRNAME
7824 !:echo 11:$?
/$^ERRNAME
7827 !:echo 12:$?
/$^ERRNAME
7830 !:echo 13:$?
/$^ERRNAME
7832 !:echo 13-1:$?
/$^ERRNAME
; set posix
7833 14: ~f
(headerpick
: subject
)
7835 !:echo 14:$?
/$^ERRNAME
; unset posix forward-inject-head quote-inject-head
7836 14.1: ~f
(!posix
: injections
; headerpick
: subject to
)
7838 !:echo 14.1:$?
/$^ERRNAME
; set forward-add-cc
7839 14.2: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr3
)
7841 !:echo 14.2:$?
/$^ERRNAME
; set fullnames
7842 14.3: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr1 fullname
)
7844 !:echo 14.3:$?
/$^ERRNAME
; set nofullnames noforward-add-cc posix
7847 !:echo 15:$?
/$^ERRNAME
7850 !:echo 15.5-1:$?
/$^ERRNAME
7852 !:echo 15.5-2:$?
/$^ERRNAME
7853 16, 17: ~I Sign
, ~i Sign
7855 !:echo 16:$?
/$^ERRNAME
7857 !:echo 17:$?
/$^ERRNAME
7860 !:echo 18:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7863 !:echo 19:$?
/$^ERRNAME
7866 !:echo 20:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7869 !:echo 21:$?
/$^ERRNAME
7870 !: # Initially ~Q was _exactly_ like
7871 28,29 nothing
, 30-34: ~Q
7872 !:echo quote
=<$quote>
7875 !:echo 30:$?
/$^ERRNAME
7878 !:echo 31:$?
/$^ERRNAME
7879 set quote-inject-head quote-inject-tail indentprefix
7880 !:wysh
set quote-inject-head
=%%a quote-inject-tail
=--%%r
7883 !:echo 32:$?
/$^ERRNAME
7884 set noquote-inject-head noquote-inject-tail quote-add-cc
7885 !:set noquote-inject-head noquote-inject-tail quote-add-cc
7888 !:echo 33:$?
/$^ERRNAME
7893 !:echo 34:$?
/$^ERRNAME
7894 unset fullnames
, quote stuff
7895 !:unset quote quote-add-cc fullnames
7898 !:echo 22:$?
/$^ERRNAME
7901 !:echo 23:$?
/$^ERRNAME
7902 24: ~s this new subject
7903 !s
24 did new ~s ubject
7904 !:echo 24:$?
/$^ERRNAME
7905 !t
25 added ~t o
<ex3@am.ple
>
7906 !:echo 25:$?
/$^ERRNAME
7909 !:echo 26.1:$?
/$^ERRNAME
7912 !:echo 26.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7915 !:echo 27.1:$?
/$^ERRNAME
7918 !:echo 27.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7919 and i ~w rite this out to .
/.tmsg
7921 !:echo i ~w
:$?
/$^ERRNAME
7922 !:wysh
set x
=$escape;set escape
=~
7923 ~
!echo shell
command output
7924 ~
:echo shell
:$?
/$^ERRNAME
7925 ~
:wysh
set escape
=$x
7928 !:echo 50 was F
:$?
/$^ERRNAME
7931 !:echo 51 was f
:$?
/$^ERRNAME
7934 !:echo 52 was M
:$?
/$^ERRNAME
7937 !:echo 53 was m
:$?
/$^ERRNAME
; set quote
7940 !:echo 54 was Q
:$?
/$^ERRNAME
7943 !:echo 55 was U
:$?
/$^ERRNAME
7946 !:echo 56 was u
:$?
/$^ERRNAME
7948 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
7949 -Sescape=! -Sindentprefix=' |
' \
7950 ./.tmbox >./.tall 2>./.terr
7952 ${cat} ./.tall >> "${MBOX}"
7953 have_feat filter-html-tagsoup && ck='3877629593 7699' ||
7954 ck='2138694045 7943'
7955 check 2 - "${MBOX}" "${ck}"
7957 if have_feat uistrings && have_feat iconv; then
7958 check 2-err - ./.terr '3575876476 49'
7960 t_echoskip '2-err:[!UISTRINGS or
!ICONV
]'
7962 check 3 - ./.tmsg '3502750368 4445'
7964 # Simple return/error value after *expandaddr* failure test
7965 have_feat filter-html-tagsoup && ck='115245837 7900' ||
7966 ck='2245417271 8144'
7969 !s This a new subject is
7970 !:set expandaddr
=-name
7979 !:alias abcc one@bcc.invalid
7982 !:set expandaddr
=+addr
7984 !:echo $
!/$?
/$^ERRNAME
7986 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7988 -s testsub one@to.invalid >./.tall 2>&1
7989 check 4 0 "${MBOX}" "${ck}"
7990 if have_feat uistrings; then
7991 check 5 - ./.tall '2336041127 212'
7993 check 5 - ./.tall '1818580177 59'
7996 # Modifiers and whitespace indulgence
7998 !:remove
'"${MBOX}"'
8011 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8014 -s testsub one@to.invalid >./.tall 2>./.terr
8015 check 6 4 ./.tall '686767281 95'
8016 [ -f "${MBOX}" ]; check_exn0 7
8017 if have_feat uistrings; then
8018 check 8 - ./.terr '1304637795 199'
8020 t_echoskip '8:[!UISTRINGS
]'
8026 t_compose_edits() { # XXX very rudimentary
8027 # after: t_cmd_escapes
8030 # Something to use as "editor"
8031 ${cat} <<-_EOT > ./.ted.sh
8033 ${cat} <<-__EOT > \${1}
8044 ${chmod} 0755 .ted.sh
8046 # > All these are in-a-row!
8048 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~.
' |
8049 ${MAILX} ${ARGS} -Seditheaders >./.tall 2>&1
8050 check 1 0 ./.tout '3993703854 127'
8051 check 2 - ./.tall '4294967295 0'
8053 ${mv} ./.tall ./.tout
8054 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~e
\n~.
' |
8055 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=./.ted.sh >./.tall 2>&1
8056 check 3 0 ./.tout1 '285981670 116'
8057 check 4 - ./.tout2 '285981670 116'
8058 check 5 - ./.tout3 '285981670 116'
8059 check 6 - ./.tout '4294967295 0'
8060 check 7 - ./.tall '4294967295 0'
8061 ${rm} ./.tout1 ./.tout2 ./.tout3
8063 # Note t_compose_hooks adds ~^ stress tests
8064 ${mv} ./.tout ./.tout1
8065 ${mv} ./.tall ./.tout2
8067 mail .
/.tout
\n!s This subject is
\nThis body is
8073 !^header insert fcc .
/.tout
8074 !^header insert fcc .tout1
8075 !^header insert fcc .
/.tout2
8078 !^header remove-at fcc
2
8079 !^header remove-at fcc
2
8083 !^header insert fcc .
/.tout
8087 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8088 check 8 0 ./.tout '3993703854 127'
8089 check 9 - ./.tout1 '4294967295 0'
8090 check 10 - ./.tout2 '4294967295 0'
8091 check 11 - ./.tall '1857504914 342'
8093 # < No longer in-a-row
8095 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >./.tall 2>&1
8097 Subject: Fcc via -t test
8101 check 12 0 ./.ttout '1289478830 122'
8102 check 13 - ./.tall '4294967295 0'
8104 # This test assumes code of `^' and
`digmsg' is shared: see t_digmsg()
8105 echo 'b 1' > ./.t' x 1'
8106 echo 'b 2' > ./.t' x 2'
8109 !^header insert subject subject
8115 !^attachment insert "$i"
8121 !^attachment insert '"'"'./.t x 2'"'"'
8125 !^attachment remove "$i"
8129 !^attachment insert $'"'"'\\$i'"'"'
8137 !^a attribute-set "$i" filenames " cannot wait for you "
8141 !^a attribute-set "$i" filename " cannot wait for you "
8147 !^a attribute-set-at 2 "filename" "private eyes"
8151 !^a attribute-set-at 2 content-description "private c-desc"
8155 !^a attribute-set-at 2 content-ID "priv invd c-id"
8159 !^a attribute-set-at 2 content-TyPE tExT/mARkLO
8163 !^a attribute-set-at 2 content-TyPE ""
8168 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8169 check 14 0 ./.tall '3491667030 1565'
8170 check 15 - ./.tatt '1685063733 636'
8175 t_digmsg() { # XXX rudimentary; <> compose_edits()?
8179 mail ./.tout\n!s This subject is\nThis body is
8182 !:digmsg - header list
8183 !:digmsg - header show subject
8184 !:digmsg - header show to
8185 !:digmsg - header remove to
8186 !:digmsg - header list
8187 !:digmsg - header show to
8191 !:digmsg - header list; readall x; echon "<$x>";
8192 !:digmsg - header show subject;readall x;echon "<$x>";;
8195 !: # nothing here as is comment
8196 !^header insert fcc ./.tbox
8199 !:digmsg - header list
8200 !:digmsg - header show fcc
8204 !:digmsg - header list
8205 !:digmsg - header show fcc
8206 !:digmsg - header insert fcc ./.tfcc
8215 digmsg 1 header list
8216 digmsg 1 header show subject
8221 digmsg 1 header list; echo $?/$^ERRNAME
8222 digmsg create -; echo $?/$^ERRNAME
8224 ! %s ./.tfcc > ./.tcat
8225 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
8227 mail nowhere@exam.ple
8229 !:digmsg create -; echo $?/$^ERRNAME;\\
8230 digmsg create 1; echo $?/$^ERRNAME;\\
8231 digmsg create 2; echo $?/$^ERRNAME
8233 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8235 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8239 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8241 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8243 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8247 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8249 !:digmsg remove -; echo $?/$^ERRNAME;\\
8250 digmsg remove 1; echo $?/$^ERRNAME;\\
8251 digmsg remove 2; echo $?/$^ERRNAME;
8253 echo ======= new game new fun!
8256 !:set expandaddr=-name
8258 !^ header insert to two@to.invalid
8261 !^ header insert cc no-name-allowed
8263 !^ header insert cc one@cc.invalid
8266 !:alias abcc one@bcc.invalid
8267 !^ header insert bcc abcc
8269 !:set expandaddr=+addr
8270 !^ header insert bcc abcc
8271 !:echo $!/$?/$^ERRNAME
8274 ' "${cat}" "${sed}" |
8275 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8276 check 1 0 "$MBOX" '665881681 179'
8277 have_feat uistrings && i='4159482825 1372' || i='2254509488 1103'
8278 check 2 - ./.tall "${i}"
8279 check 3 - ./.tfcc '3993703854 127'
8280 check 4 - ./.tempty '4294967295 0'
8281 check 5 - ./.tcat '2157992522 256'
8286 t_on_main_loop_tick() {
8289 if have_feat cmd-vexpr; then :; else
8290 t_echoskip '[!CMD_VEXPR]'
8306 set on-main-loop-tick=omlt
8309 echo calling bla;call bla
8312 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8313 check 1 0 ./.tall '3697651500 130'
8318 t_on_program_exit() {
8322 -X 'define x {' -X 'echo jay' -X '}' -X x -Son-program-exit=x \
8324 check 1 0 ./.tall '2820891503 4'
8327 -X 'define x {' -X 'echo jay' -X '}' -X q -Son-program-exit=x \
8329 check 2 0 ./.tall '2820891503 4'
8331 </dev/null ${MAILX} ${ARGS} \
8332 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8334 check 3 0 ./.tall '2820891503 4'
8336 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8337 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8338 -s subject -. hey@you \
8340 check 4 0 ./.tall '2820891503 4'
8341 check 5 - "$MBOX" '561900352 118'
8347 # Heavy use of/rely on state machine (behaviour) and basics {{{
8348 t_compose_hooks() { # {{{ TODO monster
8351 if have_feat uistrings &&
8352 have_feat cmd-csop && have_feat cmd-vexpr; then :; else
8353 t_echoskip '[!UISTRINGS/!CMD_CSOP/!CMD_VEXPR]'
8358 (echo line one&&echo line two&&echo line three) > ./.treadctl
8359 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
8361 # Supposed to extend t_compose_edits with ~^ stress tests!
8362 ${cat} <<'__EOT__' > ./.trc
8364 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8367 vput csop es substr "$1" 0 1
8372 define read_mline_res {
8373 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8374 echo $len/$es/$^ERRNAME: $hl
8375 if [ $es -ne $^ERR-NONE ]
8376 xcall bail read_mline_res
8378 \xcall read_mline_res
8383 echo "~^header list"; read hl; echo $hl;\
8384 call xerr "$hl" "in_addr ($xh) 0-1"
8386 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8387 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
8388 echo "~^header insert $xh <${xh}2@exam.ple>";\
8389 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
8390 echo "~^header insert $xh ${xh}3@exam.ple";\
8391 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
8392 echo "~^header list $xh"; read hl; echo $hl;\
8393 call xerr "$hl" "ins_addr $xh 1-4"
8394 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
8397 if [ "$t_remove" == "" ]
8401 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
8402 echo "~^header remove $xh"; read es; vput csop es substr $es 0 3
8404 xcall bail "ins_addr $xh 2-2"
8406 echo "~^header list $xh"; read es; vput csop es substr $es 0 3
8408 xcall bail "ins_addr $xh 2-3"
8410 echo "~^header show $xh"; read es; vput csop es substr $es 0 3
8412 xcall bail "ins_addr $xh 2-4"
8416 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8417 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
8418 echo "~^header insert $xh <${xh}2@exam.ple>";\
8419 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
8420 echo "~^header insert $xh ${xh}3@exam.ple";\
8421 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
8422 echo "~^header list $xh"; read hl; echo $hl;\
8423 call xerr "$hl" "ins_addr $xh 3-4"
8424 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
8427 echo "~^header remove-at $xh 1"; read es;\
8428 call xerr $es "ins_addr $xh 3-6"
8429 echo "~^header remove-at $xh 1"; read es;\
8430 call xerr $es "ins_addr $xh 3-7"
8431 echo "~^header remove-at $xh 1"; read es;\
8432 call xerr $es "ins_addr $xh 3-8"
8433 echo "~^header remove-at $xh 1"; read es;\
8434 vput csop es substr $es 0 3
8436 xcall bail "ins_addr $xh 3-9"
8438 echo "~^header remove-at $xh T"; read es;\
8439 vput csop es substr $es 0 3
8441 xcall bail "ins_addr $xh 3-10"
8443 echo "~^header list $xh"; read es;\
8444 vput csop es substr $es 0 3
8446 xcall bail "ins_addr $xh 3-11"
8448 echo "~^header show $xh"; read es;\
8449 vput csop es substr $es 0 3
8451 xcall bail "ins_addr $xh 3-12"
8455 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8456 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
8457 echo "~^header insert $xh <${xh}2@exam.ple>\ (comment)\ \\\"Quot(e)d\\\"";\
8458 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
8459 echo "~^header insert $xh ${xh}3@exam.ple";\
8460 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
8461 echo "~^header list $xh"; read hl; echo $hl;\
8462 call xerr "$hl" "header list $xh 3-4"
8463 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
8466 echo "~^header remove-at $xh 3"; read es;\
8467 call xerr $es "ins_addr $xh 4-6"
8468 echo "~^header remove-at $xh 2"; read es;\
8469 call xerr $es "ins_addr $xh 4-7"
8470 echo "~^header remove-at $xh 1"; read es;\
8471 call xerr $es "ins_addr $xh 4-8"
8472 echo "~^header remove-at $xh 1"; read es;\
8473 vput csop es substr $es 0 3
8475 xcall bail "ins_addr $xh 4-9"
8477 echo "~^header remove-at $xh T"; read es;\
8478 vput csop es substr $es 0 3
8480 xcall bail "ins_addr $xh 4-10"
8482 echo "~^header list $xh"; read es;\
8483 vput csop es substr $es 0 3
8485 xcall bail "ins_addr $xh 4-11"
8487 echo "~^header show $xh"; read es;\
8488 vput csop es substr $es 0 3
8490 xcall bail "ins_addr $xh 4-12"
8494 wysh set xh=$1 mult=$2
8495 echo "~^header list"; read hl; echo $hl;\
8496 call xerr "$hl" "ins_ref ($xh) 0-1"
8498 echo "~^header insert $xh <$xh@exam.ple>";\
8499 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
8501 echo "~^header insert $xh <${xh}2@exam.ple>";\
8502 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
8503 echo "~^header insert $xh ${xh}3@exam.ple";\
8504 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
8506 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
8507 vput csop es substr $es 0 3
8509 xcall bail "ins_ref $xh 1-4"
8513 echo "~^header list $xh"; read hl; echo $hl;\
8514 call xerr "$hl" "ins_ref $xh 1-5"
8515 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
8518 if [ "$t_remove" == "" ]
8522 echo "~^header remove $xh"; read es;\
8523 call xerr $es "ins_ref $xh 2-1"
8524 echo "~^header remove $xh"; read es;\
8525 vput csop es substr $es 0 3
8527 xcall bail "ins_ref $xh 2-2"
8529 echo "~^header list $xh"; read es;\
8530 vput csop es substr $es 0 3
8532 xcall bail "$es ins_ref $xh 2-3"
8534 echo "~^header show $xh"; read es;\
8535 vput csop es substr $es 0 3
8537 xcall bail "ins_ref $xh 2-4"
8541 echo "~^header insert $xh <$xh@exam.ple>";\
8542 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
8544 echo "~^header insert $xh <${xh}2@exam.ple>";\
8545 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
8546 echo "~^header insert $xh ${xh}3@exam.ple";\
8547 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
8549 echo "~^header list $xh";\
8550 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
8551 echo "~^header show $xh";\
8552 read es; call xerr $es "ins_ref $xh 3-5"
8555 echo "~^header remove-at $xh 1"; read es;\
8556 call xerr $es "ins_ref $xh 3-6"
8557 if [ $mult -ne 0 ] && [ $xh != subject ]
8558 echo "~^header remove-at $xh 1"; read es;\
8559 call xerr $es "ins_ref $xh 3-7"
8560 echo "~^header remove-at $xh 1"; read es;\
8561 call xerr $es "ins_ref $xh 3-8"
8563 echo "~^header remove-at $xh 1"; read es;\
8564 vput csop es substr $es 0 3
8566 xcall bail "ins_ref $xh 3-9"
8568 echo "~^header remove-at $xh T"; read es;\
8569 vput csop es substr $es 0 3
8571 xcall bail "ins_ref $xh 3-10"
8573 echo "~^header show $xh"; read es;\
8574 vput csop es substr $es 0 3
8576 xcall bail "ins_ref $xh 3-11"
8580 echo "~^header insert $xh <$xh@exam.ple> ";\
8581 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
8583 echo "~^header insert $xh <${xh}2@exam.ple> ";\
8584 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
8585 echo "~^header insert $xh ${xh}3@exam.ple";\
8586 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
8588 echo "~^header list $xh"; read hl; echo $hl;\
8589 call xerr "$hl" "ins_ref $xh 4-4"
8590 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
8593 if [ $mult -ne 0 ] && [ $xh != subject ]
8594 echo "~^header remove-at $xh 3"; read es;\
8595 call xerr $es "ins_ref $xh 4-6"
8596 echo "~^header remove-at $xh 2"; read es;\
8597 call xerr $es "ins_ref $xh 4-7"
8599 echo "~^header remove-at $xh 1"; read es;\
8600 call xerr $es "ins_ref $xh 4-8"
8601 echo "~^header remove-at $xh 1"; read es;\
8602 vput csop es substr $es 0 3
8604 xcall bail "ins_ref $xh 4-9"
8606 echo "~^header remove-at $xh T"; read es;\
8607 vput csop es substr $es 0 3
8609 xcall bail "ins_ref $xh 4-10"
8611 echo "~^header show $xh"; read es;\
8612 vput csop es substr $es 0 3
8614 xcall bail "ins_ref $xh 4-11"
8619 # In collect.c order
8621 call ins_ref sender 0 # Not a "ref", but works
8625 call ins_addr reply-To
8626 call ins_addr mail-Followup-to
8627 call ins_ref messAge-id 0
8628 call ins_ref rEfErEncEs 1
8629 call ins_ref in-Reply-to 1
8630 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
8631 call ins_addr freeForm1
8632 call ins_addr freeform2
8634 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
8636 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
8644 echo "~^attachment";\
8645 read hl; echo $hl; vput csop es substr "$hl" 0 3
8647 xcall bail "attach 0-1"
8650 echo "~^attach attribute ./.treadctl";\
8651 read hl; echo $hl; vput csop es substr "$hl" 0 3
8653 xcall bail "attach 0-2"
8655 echo "~^attachment attribute-at 1";\
8656 read hl; echo $hl; vput csop es substr "$hl" 0 3
8658 xcall bail "attach 0-3"
8661 echo "~^attachment insert ./.treadctl=ascii";\
8662 read hl; echo $hl; call xerr "$hl" "attach 1-1"
8663 echo "~^attachment list";\
8664 read es; echo $es;call xerr "$es" "attach 1-2"
8666 echo "~^attachment attribute ./.treadctl";\
8667 read es; echo $es;call xerr "$es" "attach 1-3"
8669 echo "~^attachment attribute .treadctl";\
8670 read es; echo $es;call xerr "$es" "attach 1-4"
8672 echo "~^attachment attribute-at 1";\
8673 read es; echo $es;call xerr "$es" "attach 1-5"
8676 echo "~^attachment attribute-set ./.treadctl filename rctl";\
8677 read es; echo $es;call xerr "$es" "attach 1-6"
8678 echo "~^attachment attribute-set .treadctl content-description Au";\
8679 read es; echo $es;call xerr "$es" "attach 1-7"
8680 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
8681 read es; echo $es;call xerr "$es" "attach 1-8"
8683 echo "~^attachment attribute ./.treadctl";\
8684 read es; echo $es;call xerr "$es" "attach 1-9"
8686 echo "~^attachment attribute .treadctl";\
8687 read es; echo $es;call xerr "$es" "attach 1-10"
8689 echo "~^attachment attribute rctl";\
8690 read es; echo $es;call xerr "$es" "attach 1-11"
8692 echo "~^attachment attribute-at 1";\
8693 read es; echo $es;call xerr "$es" "attach 1-12"
8697 echo "~^attachment insert ./.tattach=latin1";\
8698 read hl; echo $hl; call xerr "$hl" "attach 2-1"
8699 echo "~^attachment list";\
8700 read es; echo $es;call xerr "$es" "attach 2-2"
8702 echo "~^attachment attribute ./.tattach";\
8703 read es; echo $es;call xerr "$es" "attach 2-3"
8705 echo "~^attachment attribute .tattach";\
8706 read es; echo $es;call xerr "$es" "attach 2-4"
8708 echo "~^attachment attribute-at 2";\
8709 read es; echo $es;call xerr "$es" "attach 2-5"
8712 echo "~^attachment attribute-set ./.tattach filename tat";\
8713 read es; echo $es;call xerr "$es" "attach 2-6"
8715 "~^attachment attribute-set .tattach content-description Au2";\
8716 read es; echo $es;call xerr "$es" "attach 2-7"
8717 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
8718 read es; echo $es;call xerr "$es" "attach 2-8"
8720 "~^attachment attribute-set-at 2 content-type application/x-sh";\
8721 read es; echo $es;call xerr "$es" "attach 2-9"
8723 echo "~^attachment attribute ./.tattach";\
8724 read es; echo $es;call xerr "$es" "attach 2-10"
8726 echo "~^attachment attribute .tattach";\
8727 read es; echo $es;call xerr "$es" "attach 2-11"
8729 echo "~^attachment attribute tat";\
8730 read es; echo $es;call xerr "$es" "attach 2-12"
8732 echo "~^attachment attribute-at 2";\
8733 read es; echo $es;call xerr "$es" "attach 2-13"
8737 if [ "$t_remove" == "" ]
8741 echo "~^attachment remove ./.treadctl"; read es;\
8742 call xerr $es "attach 3-1"
8743 echo "~^attachment remove ./.tattach"; read es;\
8744 call xerr $es "attach 3-2"
8745 echo "~^ attachment remove ./.treadctl"; read es;\
8746 vput csop es substr $es 0 3
8748 xcall bail "attach 3-3"
8750 echo "~^ attachment remove ./.tattach"; read es;\
8751 vput csop es substr $es 0 3
8753 xcall bail "attach 3-4"
8755 echo "~^attachment list"; read es;\
8756 vput csop es substr $es 0 3
8758 xcall bail "attach 3-5"
8762 echo "~^attachment insert ./.tattach=latin1";\
8763 read hl; echo $hl; call xerr "$hl" "attach 4-1"
8764 echo "~^attachment insert ./.tattach=latin1";\
8765 read hl; echo $hl; call xerr "$hl" "attach 4-2"
8766 echo "~^attachment list";\
8767 read es; echo $es;call xerr "$es" "attach 4-3"
8769 echo "~^ attachment remove .tattach"; read es;\
8770 vput csop es substr $es 0 3
8772 xcall bail "attach 4-4 $es"
8774 echo "~^attachment remove-at T"; read es;\
8775 vput csop es substr $es 0 3
8777 xcall bail "attach 4-5"
8779 echo "~^attachment remove ./.tattach"; read es;\
8780 call xerr $es "attach 4-6"
8781 echo "~^attachment remove ./.tattach"; read es;\
8782 call xerr $es "attach 4-7"
8783 echo "~^ attachment remove ./.tattach"; read es;\
8784 vput csop es substr $es 0 3
8786 xcall bail "attach 4-8 $es"
8788 echo "~^attachment list"; read es;\
8789 vput csop es substr $es 0 3
8791 xcall bail "attach 4-9"
8795 echo "~^attachment insert ./.tattach=latin1";\
8796 read hl; echo $hl; call xerr "$hl" "attach 5-1"
8797 echo "~^attachment insert ./.tattach=latin1";\
8798 read hl; echo $hl; call xerr "$hl" "attach 5-2"
8799 echo "~^attachment insert ./.tattach=latin1";\
8800 read hl; echo $hl; call xerr "$hl" "attach 5-3"
8801 echo "~^attachment list";\
8802 read es; echo $es;call xerr "$es" "attach 5-4"
8805 echo "~^attachment remove-at 3"; read es;\
8806 call xerr $es "attach 5-5"
8807 echo "~^attachment remove-at 3"; read es;\
8808 vput csop es substr $es 0 3
8810 xcall bail "attach 5-6"
8812 echo "~^attachment remove-at 2"; read es;\
8813 call xerr $es "attach 5-7"
8814 echo "~^attachment remove-at 2"; read es;\
8815 vput csop es substr $es 0 3
8817 xcall bail "attach 5-8"
8819 echo "~^attachment remove-at 1"; read es;\
8820 call xerr $es "attach 5-9"
8821 echo "~^attachment remove-at 1"; read es;\
8822 vput csop es substr $es 0 3
8824 xcall bail "attach 5-10"
8827 echo "~^attachment list"; read es;\
8828 vput csop es substr $es 0 3
8830 xcall bail "attach 5-11"
8834 echo "~^attachment insert ./.tattach=latin1";\
8835 read hl; echo $hl; call xerr "$hl" "attach 6-1"
8836 echo "~^attachment insert ./.tattach=latin1";\
8837 read hl; echo $hl; call xerr "$hl" "attach 6-2"
8838 echo "~^attachment insert ./.tattach=latin1";\
8839 read hl; echo $hl; call xerr "$hl" "attach 6-3"
8840 echo "~^attachment list";\
8841 read es; echo $es;call xerr "$es" "attach 6-4"
8844 echo "~^attachment remove-at 1"; read es;\
8845 call xerr $es "attach 6-5"
8846 echo "~^attachment remove-at 1"; read es;\
8847 call xerr $es "attach 6-6"
8848 echo "~^attachment remove-at 1"; read es;\
8849 call xerr $es "attach 6-7"
8850 echo "~^attachment remove-at 1"; read es;\
8851 vput csop es substr $es 0 3
8853 xcall bail "attach 6-8"
8856 echo "~^attachment list"; read es;\
8857 vput csop es substr $es 0 3
8859 xcall bail "attach 6-9"
8871 echo on-compose-enter, mailx-command<$mailx-command>
8872 alternates alter1@exam.ple alter2@exam.ple
8874 set autocc='alter1@exam.ple alter2@exam.ple'
8875 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8876 echo mailx-subject<$mailx-subject>
8877 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8878 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8879 mailx-raw-bcc<$mailx-raw-bcc>
8880 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8881 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8882 digmsg create - -;echo $?/$!/$^ERRNAME;\
8883 digmsg - header list;\
8884 digmsg remove -;echo $?/$!/$^ERRNAME
8885 digmsg create -;echo $?/$!/$^ERRNAME;\
8886 digmsg - header list;readall x;echon $x;\
8887 digmsg remove -;echo $?/$!/$^ERRNAME
8890 echo on-compose-leave, mailx-command<$mailx-command>
8892 eval alternates $al alter3@exam.ple alter4@exam.ple
8894 set autobcc='alter3@exam.ple alter4@exam.ple'
8895 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8896 echo mailx-subject<$mailx-subject>
8897 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8898 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8899 mailx-raw-bcc<$mailx-raw-bcc>
8900 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8901 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8902 digmsg create - -;echo $?/$!/$^ERRNAME;\
8903 digmsg - header list;\
8904 digmsg remove -;echo $?/$!/$^ERRNAME
8905 digmsg create -;echo $?/$!/$^ERRNAME;\
8906 digmsg - header list;readall x;echon $x;\
8907 digmsg remove -;echo $?/$!/$^ERRNAME
8910 echo on-compose-cleanup, mailx-command<$mailx-command>
8913 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8914 echo mailx-subject<$mailx-subject>
8915 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8916 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8917 mailx-raw-bcc<$mailx-raw-bcc>
8918 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8919 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8920 # XXX error message variable digmsg create - -;echo $?/$!/$^ERRNAME;\
8921 digmsg - header list;\
8922 digmsg remove -;echo $?/$!/$^ERRNAME
8923 # ditto digmsg create -;echo $?/$!/$^ERRNAME;\
8924 digmsg - header list;readall x;echon $x;\
8925 digmsg remove -;echo $?/$!/$^ERRNAME
8927 wysh set on-compose-splice=t_ocs \
8928 on-compose-enter=t_oce on-compose-leave=t_ocl \
8929 on-compose-cleanup=t_occ
8932 printf 'm this-goes@nowhere\nbody\n!.\n' |
8933 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8934 -X'source ./.trc' -Smta=test://"$MBOX" \
8936 ${cat} ./.tall >> "${MBOX}"
8937 check 1 0 "${MBOX}" '1646284089 10565'
8940 printf 'm this-goes@nowhere\nbody\n!.\n' |
8941 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8942 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
8944 ${cat} ./.tall >> "${MBOX}"
8945 check 2 0 "${MBOX}" '700681006 12851'
8949 # Some state machine stress, shell compose hook, localopts for hook, etc.
8950 # readctl in child. ~r as HERE document
8952 printf 'm ex@am.ple\nbody\n!.
8953 echon ${mailx-command}${mailx-subject}
8954 echon ${mailx-from}${mailx-sender}
8955 echon ${mailx-to}${mailx-cc}${mailx-bcc}
8956 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
8957 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
8958 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
8959 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
8960 -Smta=test://"$MBOX" \
8963 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8966 vput csop es substr "$1" 0 1
8971 define read_mline_res {
8972 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8973 echo $len/$es/$^ERRNAME: $hl
8974 if [ $es -ne $^ERR-NONE ]
8975 xcall bail read_mline_res
8977 \xcall read_mline_res
8981 vput vexpr i + 1 "$2"
8983 vput vexpr j % $i 10
8990 eval \\$j _work $1 $i
8993 vput vexpr i + $i "$1"
8997 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
8998 echo read:$es/$en: $line
8999 if [ "${es}" -ne -1 ]
9002 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
9007 echo "~^header list"; read hl; echo $hl;\
9008 vput csop es substr "$hl" 0 1
9010 xcall bail "header list"
9013 call _work 1; echo $?
9014 echo "~^header insert cc splicy\ diet\ <splice@exam.ple>\ spliced";\
9015 read es; echo $es; vput csop es substr "$es" 0 1
9017 xcall bail "be diet"
9019 echo "~^header insert cc <splice2@exam.ple>";\
9020 read es; echo $es; vput csop es substr "$es" 0 1
9022 xcall bail "be diet2"
9025 call _work 2; echo $?
9026 echo "~^header insert bcc juicy\ juice\ <juice@exam.ple>\ spliced";\
9027 read es; echo $es;vput csop es substr "$es" 0 1
9029 xcall bail "be juicy"
9031 echo "~^header insert bcc juice2@exam.ple";\
9032 read es; echo $es;vput csop es substr "$es" 0 1
9034 xcall bail "be juicy2"
9036 echo "~^header insert bcc juice3\ <juice3@exam.ple>";\
9037 read es; echo $es;vput csop es substr "$es" 0 1
9039 xcall bail "be juicy3"
9041 echo "~^header insert bcc juice4@exam.ple";\
9042 read es; echo $es;vput csop es substr "$es" 0 1
9044 xcall bail "be juicy4"
9047 echo "~^header remove-at bcc 3";\
9048 read es; echo $es;vput csop es substr "$es" 0 1
9050 xcall bail "remove juicy5"
9052 echo "~^header remove-at bcc 2";\
9053 read es; echo $es;vput csop es substr "$es" 0 1
9055 xcall bail "remove juicy6"
9057 echo "~^header remove-at bcc 3";\
9058 read es; echo $es;vput csop es substr "$es" 0 3
9060 xcall bail "failed to remove-at"
9062 # Add duplicates which ought to be removed!
9063 echo "~^header insert bcc juice4@exam.ple";\
9064 read es; echo $es;vput csop es substr "$es" 0 1
9066 xcall bail "be juicy4-1"
9068 echo "~^header insert bcc juice4@exam.ple";\
9069 read es; echo $es;vput csop es substr "$es" 0 1
9071 xcall bail "be juicy4-2"
9073 echo "~^header insert bcc juice4@exam.ple";\
9074 read es; echo $es;vput csop es substr "$es" 0 1
9076 xcall bail "be juicy4-3"
9081 call _work 3; echo $?
9083 vput ! i echo just knock if you can hear me;\
9085 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
9087 echon shell-cmd says $?/$^ERRNAME: $i
9088 echo "~x will not become interpreted, we are reading until __EOT"
9090 read r_status; echo "~~r status output: $r_status"
9091 echo "~:echo $? $! $^ERRNAME"
9093 echo "~~r status from parent: $r_status"
9096 call _work 4; echo $?
9097 vput cwd cwd;echo cwd:$?
9098 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
9102 call _work 5; echo $?
9103 echo "~^header show MAILX-Command"; read es;\
9104 call xerr $es "t_header 1000"; call read_mline_res
9105 echo "~^header show MAILX-raw-TO"; read es;\
9106 call xerr $es "t_header 1001"; xcall read_mline_res
9108 echoerr IT IS WRONG IF YOU SEE THIS
9111 echo on-compose-enter, mailx-command<$mailx-command>
9112 set t_oce autobcc=oce@exam.ple
9113 alternates alter1@exam.ple alter2@exam.ple
9115 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9116 echo mailx-subject<$mailx-subject>
9117 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9118 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9119 mailx-raw-bcc<$mailx-raw-bcc>
9120 echo mailx-orig-from<$mailx-orig-from> \
9121 mailx-orig-to<$mailx-orig-to> \
9122 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9125 echo on-compose-leave, mailx-command<$mailx-command>
9126 set t_ocl autocc=ocl@exam.ple
9128 alternates alter3@exam.ple alter4@exam.ple
9130 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9131 echo mailx-subject<$mailx-subject>
9132 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9133 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9134 mailx-raw-bcc<$mailx-raw-bcc>
9135 echo mailx-orig-from<$mailx-orig-from> \
9136 mailx-orig-to<$mailx-orig-to> \
9137 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9140 echo on-compose-cleanup, mailx-command<$mailx-command>
9141 set t_occ autocc=occ@exam.ple
9144 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9145 echo mailx-subject<$mailx-subject>
9146 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9147 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9148 mailx-raw-bcc<$mailx-raw-bcc>
9149 echo mailx-orig-from<$mailx-orig-from> \
9150 mailx-orig-to<$mailx-orig-to> \
9151 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9153 wysh set on-compose-splice=t_ocs \
9154 on-compose-splice-shell="read ver;echo t_ocs-shell;\
9155 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
9156 on-compose-enter=t_oce on-compose-leave=t_ocl \
9157 on-compose-cleanup=t_occ
9160 ${cat} ./.tnotes >> "${MBOX}"
9161 check 3 - "${MBOX}" '3986011319 2437'
9163 # Reply, forward, resend, Resend
9171 set from="du <f2@z>" stealthmua=noagent
9175 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Snomemdebug -Sescape=! \
9177 check_ex0 4-intro-estat
9180 echo start: $? $! $^ERRNAME
9182 echo File: $? $! $^ERRNAME;echo;echo
9184 this is content of reply 1
9186 echo reply 1: $? $! $^ERRNAME;echo;echo
9188 this is content of Reply 1 2
9190 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
9191 forward 1 fwdex@am.ple
9192 this is content of forward 1
9194 echo forward 1: $? $! $^ERRNAME;echo;echo
9195 wysh set forward-inject-head=$'"'"'-- \\
9196 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
9197 wysh set forward-inject-tail=$'"'"'-- \\
9198 end of forward (%%i) --\\n'"'"'
9199 forward 2 fwdex@am.ple
9200 this is content of forward 2
9202 echo forward 2: $? $! $^ERRNAME;echo;echo
9204 forward 2 fwdex2@am.ple
9205 this is content of forward 2, 2nd, with showname set
9207 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
9208 resend 1 2 resendex@am.ple
9209 echo resend 1 2: $? $! $^ERRNAME;echo;echo
9210 Resend 1 2 Resendex@am.ple
9211 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
9213 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
9214 -Smta=test://"$MBOX" \
9217 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9220 vput csop es substr "$1" 0 1
9225 define read_mline_res {
9226 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
9227 echo mline_res:$len/$es/$^ERRNAME: $hl
9228 if [ $es -ne $^ERR-NONE ]
9229 xcall bail read_mline_res
9231 \xcall read_mline_res
9235 echo "~^header show $1"; read es;\
9236 call xerr $es "work_hl $1"; echo $1; call read_mline_res
9244 echo t_ocs version $ver
9245 echo "~^header list"; read hl; echo $hl;\
9246 echoerr the header list is $hl;\
9247 call xerr "$hl" "header list"
9248 eval vpospar set $hl
9251 echoerr IT IS WRONG IF YOU SEE THIS
9254 echo on-XY-enter, mailx-command<$mailx-command>
9255 set t_oce autobcc=oce@exam.ple
9256 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9257 echo mailx-subject<$mailx-subject>
9258 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9259 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9260 mailx-raw-bcc<$mailx-raw-bcc>
9261 echo mailx-orig-from<$mailx-orig-from> \
9262 mailx-orig-to<$mailx-orig-to> \
9263 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9266 echo on-XY-leave, mailx-command<$mailx-command>
9267 set t_ocl autocc=ocl@exam.ple
9268 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9269 echo mailx-subject<$mailx-subject>
9270 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9271 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9272 mailx-raw-bcc<$mailx-raw-bcc>
9273 echo mailx-orig-from<$mailx-orig-from> \
9274 mailx-orig-to<$mailx-orig-to> \
9275 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9278 echo on-XY-cleanup, mailx-command<$mailx-command>
9279 set t_occ autocc=occ@exam.ple
9280 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9281 echo mailx-subject<$mailx-subject>
9282 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9283 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9284 mailx-raw-bcc<$mailx-raw-bcc>
9285 echo mailx-orig-from<$mailx-orig-from> \
9286 mailx-orig-to<$mailx-orig-to> \
9287 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9289 wysh set on-compose-splice=t_ocs \
9290 on-compose-enter=t_oce on-compose-leave=t_ocl \
9291 on-compose-cleanup=t_occ \
9292 on-resend-enter=t_oce on-resend-cleanup=t_occ
9295 ${cat} ./.tnotes >> "${MBOX}"
9296 check 4 - "${MBOX}" '1850092468 11799'
9301 t_mass_recipients() {
9304 if have_feat cmd-vexpr; then :; else
9305 t_echoskip '[!CMD_VEXPR]'
9310 ${cat} <<'__EOT__' > ./.trc
9312 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9315 wysh set nr=$1 hn=$2
9316 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
9318 xcall bail "ins_addr $hn 1-$nr"
9320 vput vexpr nr + $nr 1
9321 if [ "$nr" -le "$maximum" ]
9322 xcall ins_addr $nr $hn
9326 wysh set nr=$1 hn=$2
9327 alternates $hn$nr@$hn
9328 vput vexpr nr + $nr 2
9329 if [ "$nr" -le "$maximum" ]
9330 xcall bld_alter $nr $hn
9340 if [ "$t_remove" != '' ]
9345 set on-compose-splice=t_ocs on-compose-leave=t_ocl
9348 printf 'm this-goes@nowhere\nbody\n!.\n' |
9349 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9350 -X'source ./.trc' -Smta=test://"$MBOX" -Smaximum=${LOOPS_MAX} \
9353 ${cat} ./.tall >> "${MBOX}"
9354 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9355 check 1-${LOOPS_BIG} - "${MBOX}" '3835365533 51534'
9356 elif [ ${LOOPS_MAX} -eq ${LOOPS_SMALL} ]; then
9357 check 1-${LOOPS_SMALL} - "${MBOX}" '3647549277 4686'
9361 printf 'm this-goes@nowhere\nbody\n!.\n' |
9362 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9363 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
9364 -Smaximum=${LOOPS_MAX} \
9367 ${cat} ./.tall >> "${MBOX}"
9368 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9369 check 2-${LOOPS_BIG} - "${MBOX}" '3768249992 34402'
9370 elif [ $LOOPS_MAX -eq ${LOOPS_SMALL} ]; then
9371 check 2-${LOOPS_SMALL} - "${MBOX}" '4042568441 3170'
9377 t_lreply_futh_rth_etc() {
9380 ${cat} <<-_EOT > ./.tmbox
9381 From neverneverland Sun Jul 23 13:46:25 2017
9382 Subject: Bugstop: five miles out 1
9383 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9384 From: mister originator <mr@originator>
9385 To: bugstop-commit@five.miles.out, laber@backe.eu
9387 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
9388 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
9389 Date: Wed, 19 Jul 2017 09:22:57 -0400
9390 Message-Id: <20170719132257.766AF781267@originator>
9393 > |Sorry, I think I misunderstand something. I would think that
9397 From neverneverland Fri Jul 7 22:39:11 2017
9398 Subject: Bugstop: five miles out 2
9399 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
9400 Content-Transfer-Encoding: 7bit
9401 From: mister originator <mr@originator>
9402 To: bugstop-commit@five.miles.out
9404 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
9405 Date: Fri, 07 Jul 2017 16:33:59 -0400
9408 capable of changing back.
9410 From neverneverland Fri Jul 7 22:42:00 2017
9411 Subject: Bugstop: five miles out 3
9412 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9413 Content-Transfer-Encoding: 7bit
9414 From: mister originator <mr@originator>
9415 To: bugstop-commit@five.miles.out
9417 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
9418 Date: Fri, 07 Jul 2017 16:33:59 -0400
9419 List-Post: <mailto:bugstop@five.miles.out>
9422 are you ready, boots?
9424 From neverneverland Sat Aug 19 23:15:00 2017
9425 Subject: Bugstop: five miles out 4
9426 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9427 Content-Transfer-Encoding: 7bit
9428 From: mister originator <mr@originator>
9429 To: bugstop@five.miles.out
9431 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
9432 Date: Fri, 07 Jul 2017 16:33:59 -0400
9433 List-Post: <mailto:bugstop@five.miles.out>
9436 are you ready, boots?
9441 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
9442 -Rf ./.tmbox >> "${MBOX}" 2>&1
9444 wysh set m="This is text of \"reply ${1}."
9455 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
9458 wysh set m="This is text of \"Reply ${1}."
9464 echo -----After Reply $1.$2: $?/$^ERRNAME
9473 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
9477 # We need two indirections for this test: one for the case that Lreply
9478 # fails because of missing recipients: we need to read EOF next, thus
9479 # place this in _Ls last; and second for the succeeding cases EOF is
9480 # not what these should read, so go over the backside and splice it in!
9481 # (A shame we do not have redirection++ as a Bourne/K/POSIX shell!)
9483 echo -----After Lreply $1.$2: $?/$^ERRNAME
9486 localopts call-fixate yes
9488 call R $1 1; call R $1 2; call R $1 3; call R $1 4
9489 call L $1 1; call L $1 2; call L $1 3
9492 echo;echo '===== CHANGING === '"$*"' =====';echo
9496 set from=laber@backe.eu
9499 call tweak set reply-to-honour
9501 call tweak set followup-to
9503 call tweak set followup-to-honour
9505 call tweak mlist bugstop@five.miles.out
9507 call tweak mlsubscribe bugstop@five.miles.out
9509 call tweak set recipients-in-cc
9511 # While here, test that *fullnames* works (also here)
9512 call tweak set fullnames
9514 This message should have *fullnames* in the header.
9517 call tweak unmlsubscribe bugstop@five.miles.out';' \
9518 set followup-to-add-cc nofullnames
9520 call tweak mlsubscribe bugstop@five.miles.out
9525 if have_feat uistrings; then
9526 check 1 - "${MBOX}" '1519985418 39828'
9528 t_echoskip '1:[!UISTRINGS]'
9533 ${cat} <<-_EOT > ./.tmbox
9534 From tom@i-i.example Thu Oct 26 03:15:55 2017
9535 Date: Wed, 25 Oct 2017 21:15:46 -0400
9536 From: tom <tom@i-i.example>
9537 To: Steffen Nurpmeso <steffen@sdaoden.eu>
9538 Cc: tom <tom@i-i.example>
9539 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
9540 Message-ID: <20171026011546.GA11643@i-i.example>
9541 Reply-To: tom@i-i.example
9542 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
9543 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
9546 The report's useful :-)
9549 # Let us test In-Reply-To: removal starts a new thread..
9550 # This needs adjustment of *stealthmua*
9551 argadd='-Sstealthmua=noagent -Shostname'
9554 printf 'reply 1\nthread\n!.\n' |
9555 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9556 ${argadd} -Rf ./.tmbox > .tall 2>&1
9557 check 2 0 "${MBOX}" '841868335 433'
9558 check 3 - .tall '4294967295 0'
9560 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
9561 "${sed}" '/^In-Reply-To:/d' |
9562 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9563 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9564 check 4 0 "${MBOX}" '3136957908 771'
9565 check 5 - .tall '4294967295 0'
9567 printf 'reply 2\nold <- new <- thread!\n!.\n' |
9568 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9569 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9570 check 6 0 "${MBOX}" '3036449053 1231'
9571 check 7 - .tall '4294967295 0'
9573 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
9574 "${sed}" '/^In-Reply-To:/d' |
9575 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9576 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9577 check 8 0 "${MBOX}" '2069841383 1583'
9578 check 9 - .tall '4294967295 0'
9580 # And follow-up testing whether changing In-Reply-To: to - starts a new
9581 # thread with only the message being replied-to.
9583 printf 'reply 1\nthread with only one ref!\n!||%s -e "%s"\n!.\n' \
9584 "${sed}" 's/^In-Reply-To:.*$/In-Reply-To:-/' |
9585 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9586 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9587 check 10 0 "${MBOX}" '3155846378 2047'
9588 check 11 - .tall '4294967295 0'
9596 if have_feat cmd-vexpr; then :; else
9597 t_echoskip '[!CMD_VEXPR]'
9602 # "Test for" [d6f316a] (Gavin Troy)
9603 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
9604 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="?* ${cat}" > "${BODY}"
9605 check 1 0 "${MBOX}" '3942990636 118'
9606 check 2 - "${BODY}" '3951695530 170'
9609 printf "m %s\n~s subject2\n~@%s\nBody2\n~.\nFi %s\nmimeview\nx\n" \
9610 "${MBOX}" "${TOPDIR}snailmail.jpg" "${MBOX}" |
9611 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9612 -S 'pipe-text/plain=?' \
9613 -S 'pipe-image/jpeg=?=&?'\
9614 'trap \"'"${rm}"' -f '\ '\\"${MAILX_FILENAME_TEMPORARY}\\"\" EXIT;'\
9615 'trap \"trap \\\"\\\" INT QUIT TERM; exit 1\" INT QUIT TERM;'\
9616 '{ echo C=$MAILX_CONTENT;'\
9617 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9618 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9619 'echo F=$MAILX_FILENAME;'\
9620 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9621 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9622 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9623 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"; } > ./.tax 2>&1;'"${mv}"' ./.tax ./.tay' \
9625 check 3 0 "${MBOX}" '1933681911 13435'
9626 check 4 - "${BODY}" '2036666633 493'
9627 check 4-hdl - ./.tay '144517347 151' async
9630 if [ -z "${ln}" ]; then
9631 t_echoskip '5:[ln(1) not found]'
9633 # Let us fill in tmpfile, test auto-deletion
9634 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9635 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9636 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9637 -S 'pipe-text/plain=?' \
9638 -S 'pipe-image/jpeg=?=++?'\
9639 'echo C=$MAILX_CONTENT;'\
9640 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9641 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9642 'echo F=$MAILX_FILENAME;'\
9643 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9644 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9645 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9646 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9647 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9649 check 5 0 "${BODY}" '4260004050 661'
9651 # Fill in ourselfs, test auto-deletion
9652 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9653 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9654 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9655 -S 'pipe-text/plain=?' \
9656 -S 'pipe-image/jpeg=?++?'\
9657 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9658 'echo C=$MAILX_CONTENT;'\
9659 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9660 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9661 'echo F=$MAILX_FILENAME;'\
9662 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9663 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9664 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9665 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9667 check 6 0 "${BODY}" '4260004050 661'
9669 # And the same, via copiousoutput (fake)
9670 printf 'Fi %s\np\nvput vexpr v file-stat .t.one-link\n'\
9671 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9672 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9673 -S 'pipe-text/plain=?' \
9674 -S 'pipe-image/jpeg=?*++?'\
9675 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9676 'echo C=$MAILX_CONTENT;'\
9677 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9678 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9679 'echo F=$MAILX_FILENAME;'\
9680 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9681 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9682 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9683 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9684 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9686 check 7 0 "${BODY}" '709946464 677'
9695 if have_feat mailcap; then :; else
9696 t_echoskip '[!MAILCAP]'
9701 ${cat} <<-'_EOT' > ./.tmailcap
9702 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
9703 application/pdf; /Applications/Preview.app/Contents/MacOS/Preview %s;\
9704 nametemplate=%s.pdf;\
9705 test = [ "${OSTYPE}" = darwin ]
9708 trap "rm -f ${infile}" EXIT\;\
9709 trap "exit 75" INT QUIT TERM\;\
9711 test = [ -n "${DISPLAY}" ];\
9712 nametemplate = %s.pdf; x-mailx-async
9713 application/pdf; pdftotext -layout %s -; nametemplate=%s.pdf; copiousoutput
9714 application/*; echo "This is \\"%t\\" but \
9715 is 50 \% Greek to me" \; < %s head -c 1024 | cat -vet; \
9716 description=" this is\;a \"wildcard\" match, no trailing quote! ;\
9717 copiousoutput; x-mailx-noquote
9722 application/postscript; ps-to-terminal %s;\ needsterminal
9723 application/postscript; ps-to-terminal %s; \compose=idraw %s
9724 x-be2; the-cmd %s; \
9725 print=print-cmd %s ; \
9727 compose=compose-cmd -d %s ; \
9729 composetyped = composetyped-cmd -dd %s ; \
9731 edit=edit-cmd -ddd %s; \
9732 description = a\;desc;\
9733 nametemplate=%s.be2;\
9734 test = this is "a" test ; \
9735 x-mailx-test-once ;\
9736 x11-bitmap = x11-bitmap.bpm;;;;;
9737 application/*; echo "is \"%t\" \
9738 50 \% Greek" \; cat %s; copiousoutput; \; description="catch-all buddy";
9739 audio/*; showaudio;compose=%n
9740 image/jpeg; showpicture -viewer xv %s
9741 image/*; showpicture %s
9742 message/partial; showpartial %s %{id} %{number} %{total}
9743 application/postscript ; lpr %s ; label="PS File";\
9744 compose="getx PS %s"
9745 application/atomicmail; atomicmail %s ; needsterminal
9746 application/andrew-inset; ezview %s ; copiousoutput;\
9747 edit=ez -d %s; compose="ez -d %s"; label="Andrew i/d"
9748 text/richtext; xy iso-8859-1 -e richtext -p %s; \
9749 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9750 text/plain; xy iso-8859-1 %s;\
9751 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9752 text/richtext; rich %s %{not-closed; copiousoutput
9753 default; cat %s; copiousoutput
9755 ${chmod} 0644 ./.tmailcap
9757 printf 'm;echo =1/$?;m c;echo =2/$?;
9758 mailca loa;echo =3/$?;mailc s;echo =4/$?' |
9759 MAILCAPS=./.tmailcap ${MAILX} -X'commandalias m mailcap' ${ARGS} \
9761 check 1 0 ./.tall '2012114724 3064'
9762 have_feat uistrings && i='3903313993 2338' || i='4294967295 0'
9763 check 2 - ./.terr "${i}"
9767 echo 'From me with love' | ${MAILX} ${ARGS} -s sub1 "${MBOX}"
9768 check 3 0 "${MBOX}" '4224630386 228'
9770 # For reproducability, one pseudo check with cat(1) and mv(1)
9772 text/plain; echo p-1-1\\;< %%s cat\\;echo p-1-2;\\
9773 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9774 text/plain; echo p-2-1\\;< %%s cat\\;echo p-2-2;\\
9775 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9776 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9777 </dev/null cat %%s\\;echo p-3-2\\; } > ./.tx\\; mv -f ./.tx ./.tasy;\\
9778 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9779 text/plain; echo p-4-1\\;cat\\;echo p-4-2;copiousoutput
9782 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9783 ${MAILX} ${ARGS} -Snomailcap-disable \
9785 -Rf "${MBOX}" > ./.tall 2>./.terr
9786 check 4.pre 0 ./.tall '1428075831 455'
9788 # Same with real programs
9790 text/plain; echo p-1-1\\;< %%s %s\\;echo p-1-2;\\
9791 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9792 text/plain; echo p-2-1\\;< %%s %s\\;echo p-2-2;\\
9793 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9794 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9795 </dev/null %s %%s\\;echo p-3-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9796 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9797 text/plain; echo p-4-1\\;%s\\;echo p-4-2;copiousoutput
9798 ' "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" > ./.tmailcap
9800 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9801 ${MAILX} ${ARGS} -Snomailcap-disable \
9812 -Rf "${MBOX}" > ./.tall 2>./.terr
9813 check 4 0 ./.tall '1912261831 831'
9814 check 5 - ./.terr '4294967295 0'
9815 check 6 - ./.terrmc '2376112102 6'
9816 check 7 - ./.tasy '3913344578 37' async
9818 # "Binary data"; ensure all possible temporary file / nametemplate
9819 # etc. paths are taken: avoid 2nd e7a60732c1906aefe4755fd61c5ffa81eeca0af0
9822 printf 'du\x7fbo€o\bm' > ./.tatt.pdf
9823 printf 'du' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9824 check 8 0 "${MBOX}" '3444709420 644'
9828 application/pdf; echo p-1-1\\;%s\\;echo p-1-2; test=[ "$XY" = "" ]
9829 # tmpfile, no template
9830 application/pdf; echo p-2-1\\;< %%s %s\\;echo p-2-2; test = [ "$XY" = two ]
9832 application/pdf; echo p-3-1\\;< %%s %s\\;echo p-3-2; test=[ "$XY" = three ];\\
9833 nametemplate=%%s.txt
9834 # tmpfile, template, async
9835 application/pdf; { file=%%s \\; echo p-4-1 = ${file##*.}\\;\\
9836 </dev/null %s %%s\\;echo p-4-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9837 test=[ "$XY" = four ] ; nametemplate = %%s.txt ; x-mailx-async
9839 application/pdf; echo p-5-1\\;%s\\;echo p-5-2; test=[ "$XY" = 1 ];\\
9841 # copious, tmpfile, no template
9842 application/pdf; echo p-6-1\\;< %%s %s\\;echo p-6-2; test = [ "$XY" = 2 ];\\
9844 # copious, tmpfile, template
9845 application/pdf; echo p-7-1\\;< %%s %s\\;echo p-7-2;test = [ "$XY" = 3 ];\\
9846 nametemplate=%%s.txt; copiousoutput
9847 ' "${cat}" "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" "${cat}" "${cat}" \
9850 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9851 ${MAILX} ${ARGS} -Snomailcap-disable \
9859 \environ set XY=three
9862 \environ set XY=four
9875 -Rf "${MBOX}" > ./.tall 2>./.terr
9876 check 9 0 ./.tall '2388630345 3850'
9877 check 10 - ./.terr '4294967295 0'
9878 check 11 - ./.tasy '842146666 27' async
9880 # x-mailx-last-resort, x-mailx-ignore
9883 printf 'in a pdf\n' > ./.tatt.pdf
9884 printf 'du\n' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9885 check 12 0 "${MBOX}" '3968874750 579'
9889 application/pdf;echo hidden;x-mailx-ignore
9890 application/pdf;echo hidden;copiousoutput;x-mailx-ignore
9891 application/pdf; echo pre\\;%s\\;echo post; x-mailx-last-resort
9892 ' "${cat}" > ./.tmailcap
9894 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9895 ${MAILX} ${ARGS} -Snomailcap-disable \
9900 \mimetype ?t application/pdf pdf
9905 \unmimetype application/pdf
9909 -Rf "${MBOX}" > ./.tall 2>./.terr
9910 check 13 0 ./.tall '759843612 1961'
9911 check 14 - ./.terr '4294967295 0'
9917 # Unclassified rest {{{
9921 t__gen_msg subject top1 to 1 from 1 cc 1 body 'body1-1
9930 t__gen_msg subject top2 to 1 from 1 cc 1 body 'body2-1
9941 ${MAILX} ${ARGS} -Rf -Y '#
9943 \echo --- $?/$^ERRNAME, 1; \set toplines=10
9945 \echo --- $?/$^ERRNAME, 2; \set toplines=5
9946 \headerpick top retain subject # For top
9947 \headerpick type retain to subject # For Top
9949 \echo --- $?/$^ERRNAME, 3; \set topsqueeze
9951 \echo --- $?/$^ERRNAME, 4
9953 \echo --- $?/$^ERRNAME, 5
9954 # ' "${MBOX}" > ./.tall 2>&1
9955 check 1 0 ./.tall '2556125754 705'
9963 if have_feat smime; then :; else
9964 t_echoskip '[!SMIME]'
9969 ${cat} <<-_EOT > ./.t.conf
9971 x509_extensions = extensions
9972 distinguished_name = req_distinguished_name
9973 attributes = req_attributes
9975 output_password = Pacem_in_terris
9978 basicConstraints = CA:FALSE
9979 # Needs a CA for that keyUsage = digitalSignature
9980 extendedKeyUsage = emailProtection
9982 [req_distinguished_name]
9989 emailAddress = test@localhost
9992 challengePassword = hi ca it is me me me
9998 if [ "${_z}" = 0 ]; then
10003 _pass=Pacem_in_terris
10005 _ossl='-passin pass:'${_pass}
10008 ${rm} -f ./.VERIFY ./.ENCRYPT ./.DECRYPT
10010 openssl req ${_osslreq} ${_ossl} -x509 -days 3650 -config ./.t.conf \
10011 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
10015 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
10018 echo bla | ${MAILX} ${ARGS} \
10019 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10020 -Ssmime-sign-digest=sha1 \
10021 -S password-test@localhost.smime-cert-key=${_pass} \
10022 -s 'S/MIME test' ./.VERIFY >>${ERR} 2>&1
10023 check_ex0 ${_z}-estat
10026 /^Content-Description: /{ skip = 2; print; next }
10027 /^$/{ if(skip) --skip }
10028 { if(!skip) print }
10030 < ./.VERIFY > "${MBOX}"
10031 check ${_z} - "${MBOX}" '335634014 644'
10034 printf 'verify\nx\n' |
10035 ${MAILX} ${ARGS} -Ssmime-ca-file=./.tcert.pem -Serrexit \
10036 -R -f ./.VERIFY >>${ERR} 2>&1
10037 check_ex0 ${_z} # XXX pipe
10040 openssl smime -verify -CAfile ./.tcert.pem -in ./.VERIFY >>${ERR} 2>&1
10044 # (signing +) encryption / decryption
10047 -Smta=test://./.ENCRYPT \
10048 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10049 -Ssmime-sign-digest=sha1 \
10050 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10051 -S password-test@localhost.smime-cert-key=${_pass} \
10052 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10053 check_ex0 ${_z}-estat
10054 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10055 check ${_z} - "${MBOX}" '2359655411 336'
10058 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
10060 -Smta=test://./.ENCRYPT \
10061 -Ssmime-ca-file=./.tcert.pem \
10062 -Ssmime-sign-cert=./.tpair.pem \
10063 -Sfrom=test@localhost \
10064 -S password-test@localhost.smime-cert-key=${_pass} \
10065 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10066 check_ex0 ${_z}-estat
10069 /^Content-Description: /{ skip = 2; print; next }
10070 /^$/{ if(skip) --skip }
10071 { if(!skip) print }
10073 < ./.DECRYPT > "${MBOX}"
10074 check ${_z} - "${MBOX}" '2602978204 940'
10077 (openssl smime -decrypt ${_ossl} -inkey ./.tkey.pem -in ./.ENCRYPT |
10078 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1
10079 check_ex0 ${_z} # XXX pipe..
10083 echo bla | ${MAILX} ${ARGS} \
10084 -Smta=test://./.ENCRYPT \
10085 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10086 -Sfrom=test@localhost \
10087 -S password-test@localhost.smime-cert-key=${_pass} \
10088 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10089 check_ex0 ${_z}-estat
10090 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10091 check ${_z} - "${MBOX}" '2359655411 336'
10095 # Note: deduce from *sign-cert*, not from *from*!
10096 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
10097 -Smta=test://./.ENCRYPT \
10098 -Ssmime-sign-cert-recei@ver.com=./.tpair.pem \
10099 -S password-recei@ver.com.smime-cert-key=${_pass} \
10100 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10101 check ${_z} 0 ./.DECRYPT '2453471323 431'
10104 openssl smime ${_ossl} -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT \
10108 unset _z _pass _osslreq _ossl
10118 # xxx Note: t_z() was the first test (series) written. Today many
10119 # xxx aspects are (better) covered by other tests above, some are not.
10120 # xxx At some future date and time, convert the last remains not covered
10121 # xxx elsewhere to a real t_* test and drop it
10125 # Test for [260e19d] (Juergen Daubert)
10126 echo body | ${MAILX} ${ARGS} "${MBOX}"
10127 check 4 0 "${MBOX}" '2948857341 94'
10129 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
10132 for(i = 0; i < 10000; ++i)
10134 #printf "\xF0\x90\x87\x90"
10135 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
10136 check 7 0 "${MBOX}" '1707496413 61812'
10143 t___gen_msg '' "${@}"
10147 t___gen_msg 1 "${@}"
10159 while [ ${___hi} -le ${3} ]; do
10160 [ ${___hi} -gt 1 ] && printf ', '
10161 printf '%s%s <%s%s@exam.ple>' ${1} ${___hi} ${2} ${___hi}
10162 ___hi=`add
${___hi} 1`
10172 printf 'From reproducible_build Wed Oct 2 01:50:07 1996
10173 Date: Wed, 02 Oct 1996 01:50:07 +0000
10177 while [ ${#} -ge 2 ]; do
10179 from) t___header From from "${2}";;
10180 to) t___header To to "${2}";;
10181 cc) t___header Cc cc "${2}";;
10182 bcc) t___header Bcc bcc "${2}";;
10183 subject) printf 'Subject: %s\n' "${2}";;
10184 body) body="${2}";;
10189 if [ -z "${ismime}" ]; then
10190 printf '\n%s\n\n' "${body}"
10192 printf 'MIME-Version: 1.0
10193 Message-ID: <20200204225307.FaKeD%%bo@oo>
10194 Content-Type: multipart/mixed; boundary="=BOUNDOUT="
10197 Content-Type: multipart/alternative; boundary==BOUNDIN=
10200 Content-Type: text/plain; charset=utf-8
10201 Content-Transfer-Encoding: 8-bit
10206 Content-Type: text/html; charset=utf-8
10207 Content-Transfer-Encoding: 8-bit
10209 <HTML><BODY>%s<BR></BODY></HTML>
10214 Content-Type: text/troff
10219 Content-Type: text/x-uuencode
10221 Aprendimos a quererte
10224 ' "${body}" "${body}"
10230 From neverneverland Sun Jul 23 13:46:25 2017
10231 Subject: Bugstop: five miles out 1
10232 Reply-To: mister originator1 <mr1@originator>
10233 From: mister originator1 <mr1@originator>
10234 To: bugstop-commit@five.miles.out
10236 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
10237 Date: Wed, 19 Jul 2017 09:22:57 -0400
10238 Message-Id: <20170719132257.766AF781267-1@originator>
10239 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
10242 That's appalling, I.
10249 From neverneverland Sun Jul 23 13:47:25 2017
10250 Subject: Bugstop: five miles out 2
10251 Reply-To: mister originator2 <mr2@originator>
10252 From: mister originator2 <mr2@originator>
10253 To: bugstop-commit@five.miles.out
10255 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
10256 Date: Wed, 19 Jul 2017 09:23:57 -0400
10257 Message-Id: <20170719132257.766AF781267-2@originator>
10260 That's appalling, II.
10267 From neverneverland Sun Jul 23 13:48:25 2017
10268 Subject: Bugstop: five miles out 3
10269 Reply-To: mister originator3 <mr3@originator>
10270 From: mister originator3 <mr3@originator>
10271 To: bugstop-commit@five.miles.out
10273 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
10274 Date: Wed, 19 Jul 2017 09:24:57 -0400
10275 Message-Id: <20170719132257.766AF781267-3@originator>
10278 That's appalling, III.
10284 # MIME encoding (QP) stress message subject
10285 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
10286 'adadaddsssssssddddddddddddddddddddd'\
10287 'ddddddddddddddddddddddddddddddddddd'\
10288 'ddddddddddddddddddddddddddddddddddd'\
10289 'dddddddddddddddddddd Hallelulja? Od'\
10290 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10291 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10292 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
10293 'fffffffffffffffffffffffffffffffffff'\
10294 'fffffffffffffffffffff ggggggggggggg'\
10295 'ggggggggggggggggggggggggggggggggggg'\
10296 'ggggggggggggggggggggggggggggggggggg'\
10297 'ggggggggggggggggggggggggggggggggggg'\
10302 # MIME encoding (QP) stress message body
10304 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
10305 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
10306 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
10307 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
10308 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
10309 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
10310 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
10311 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
10312 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
10313 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
10314 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
10315 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
10316 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
10317 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
10318 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
10319 "auf den zeilen vorher.\r\n"\
10320 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
10322 "Die letzte Zeile war nur ein Punkt.\r\n"\
10324 "Das waren deren zwei.\r\n"\
10326 "Die letzte Zeile war ein Leerschritt.\n"\
10327 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
10328 "Prösterchen.\r\n"\
10330 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
10332 "Das waren deren zwei. ditto.\n"\
10334 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
10335 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
10336 "auf den zeilen vorher.\n"\
10338 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
10339 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
10341 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10343 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10345 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10347 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10349 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10351 "QP am Zeilenende über soft-nl hinweg\n"\
10352 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10354 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10356 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10358 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10360 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
10362 "Die letzte Zeile war ein Leerschritt.\n"\
10367 # cc_all_configs() {{{
10368 # Test all configs TODO doesn't cover all *combinations*, stupid!
10370 if [ ${MAXJOBS} -gt 1 ]; then
10371 MAXJOBS='-j '${MAXJOBS}
10375 if [ -n "${NOCOLOUR}" ] || [ -n "${MAILX_CC_TEST_NO_COLOUR}" ]; then
10376 MAILX_CC_TEST_NO_COLOUR=1
10377 export MAILX_CC_TEST_NO_COLOUR
10382 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
10383 NOTME["OPT_AUTOCC_STACKPROT"] = 1
10384 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
10385 NOTME["OPT_CROSS_BUILD"] = 1
10386 NOTME["OPT_AUTOCC"] = 1
10387 NOTME["OPT_AMALGAMATION"] = 1
10388 NOTME["OPT_DEBUG"] = 1
10389 NOTME["OPT_DEVEL"] = 1
10390 NOTME["OPT_ASAN_ADDRESS"] = 1
10391 NOTME["OPT_ASAN_MEMORY"] = 1
10392 NOTME["OPT_USAN"] = 1
10393 NOTME["OPT_NOMEMDBG"] = 1
10398 MULCHOICE["OPT_ICONV"] = "VAL_ICONV"
10399 MULVALS["VAL_ICONV"] = 1
10400 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
10401 MULVALS["VAL_IDNA"] = 1
10403 #VALKEYS[0] = "VAL_RANDOM"
10404 VALVALS["VAL_RANDOM"] = 1
10409 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
10410 # does not seem to be a compliant escape for =
10412 $1 = substr($1, 1, index($1, "=") - 1)
10414 OPTVALS[OPTNO++] = $1
10419 val = substr($0, index($0, "=") + 1)
10421 val = substr(val, 2)
10422 val = substr(val, 1, length(val) - 1)
10424 $1 = substr($1, 1, index($1, "=") - 1)
10427 else if(VALVALS[$1]){
10428 VALKEYS[VALNO++] = $1
10433 function onepass(addons){
10434 a_onepass__worker(addons, "1", "0")
10435 a_onepass__worker(addons, "0", "1")
10437 function a_onepass__worker(addons, b0, b1){
10438 # Doing this completely sequentially and not doing make distclean in
10439 # between runs should effectively result in lesser compilations.
10440 # It is completely dumb nonetheless... TODO
10441 for(ono = 0; ono < OPTNO; ++ono){
10443 for(i = 0; i < ono; ++i){
10444 myconf = myconf " " OPTVALS[i] "=" b0 " "
10446 j = MULCHOICE[OPTVALS[i]]
10451 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10455 for(i = ono; i < OPTNO; ++i){
10456 myconf = myconf " " OPTVALS[i] "=" b1 " "
10458 j = MULCHOICE[OPTVALS[i]]
10463 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10469 myconf = VALKEYS[i] "=any " myconf
10471 myconf = myconf " " ALWAYS " " addons
10476 i = split(MULVALS[mula], ia)
10480 print mula "=\"" j "\" " myconf
10486 # We cannot test NULL because of missing UI strings, which will end
10487 # up with different checksums
10488 print "CONFIG=NULLI OPT_AUTOCC=1"
10490 j = split(VALVALS[VALKEYS[i]], ia)
10494 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
10497 print "CONFIG=MINIMAL OPT_AUTOCC=1"
10498 print "CONFIG=NETSEND OPT_AUTOCC=1"
10499 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
10501 j = split(VALVALS[VALKEYS[i]], ia)
10505 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
10508 print "CONFIG=DEVEL OPT_AUTOCC=1"
10509 print "CONFIG=ODEVEL OPT_AUTOCC=1"
10513 onepass("OPT_DEBUG=1")
10516 ' | while read c; do
10517 if [ "$c" = split_here ]; then
10518 printf 'Predefined configs done, now OPT_ combinations\n'
10519 printf 'Predefined configs done, now OPT_ combinations\n' >&2
10520 ${SHELL} -c "cd ../ && ${MAKE} distclean"
10523 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
10524 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n"
10525 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n" >&2
10526 ${SHELL} -c "cd .. && ${MAKE} ${MAXJOBS} config ${c}"
10527 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
10528 printf 'Skipping after config, nothing changed\n'
10529 printf 'Skipping after config, nothing changed\n' >&2
10532 ${SHELL} -c "cd ../ && ${MAKE} ${MAXJOBS} build test"
10535 cd .. && ${MAKE} distclean
10540 if [ -z "${CHECK}${RUN_TEST}" ]; then
10544 if have_feat debug; then
10545 if have_feat devel; then
10549 ARGS="${ARGS} -Smemdebug"
10550 JOBWAIT=`add
$JOBWAIT $JOBWAIT`
10552 elif have_feat devel; then
10555 LOOPS_MAX=${LOOPS_BIG}
10559 if [ -z "${RUN_TEST}" ] || [ ${#} -eq 0 ]; then
10561 printf 'Will do up to %s tests in parallel, with a %s second timeout\n' \
10562 ${MAXJOBS} ${JOBWAIT}
10568 printf 'Tests have a %s second timeout\n' ${JOBWAIT}
10570 while [ ${#} -gt 0 ]; do
10580 printf '%u tests: %s%u ok%s, %s%u failure(s)%s. %s%u test(s) skipped%s\n' \
10581 "${TESTS_PERFORMED}" "${COLOR_OK_ON}" "${TESTS_OK}" "${COLOR_OK_OFF}" \
10582 "${COLOR_ERR_ON}" "${TESTS_FAILED}" "${COLOR_ERR_OFF}" \
10583 "${COLOR_WARN_ON}" "${TESTS_SKIPPED}" "${COLOR_WARN_OFF}"
10584 if [ -n "${ssec}" ] && [ -n "${esec}" ]; then
10585 ( echo 'Elapsed seconds: '`$awk 'BEGIN{print '"${esec}"' - '"${ssec}"'}'` )