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 '
286 \if "${ttycharset}" =%?case utf
291 \wysh set LC_ALL=${1}
293 \xcall cset_test "${@}"
297 \# POSIX last (faulty localedef(1) result of GNU C lib 2.3[24])
298 \call cset_test C.UTF-8 \
299 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8 \
300 POSIX.utf8 POSIX.UTF-8
302 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
305 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
306 echo 'Trying to detect UTF-8 locale via locale -a'
307 UTF8_LOCALE
=`locale -a | { m=
310 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
313 ${grep} -e POSIX -e en_EN -e en_US; } \
314 >/dev/null 2>&1; then
324 if [ -n "${UTF8_LOCALE}" ]; then
325 echo 'Using Unicode locale '"${UTF8_LOCALE}"
327 echo 'No Unicode locale found, disabling Unicode tests'
330 if [ -z "${HONOURS_READONLY}" ]; then
331 trap "${rm} -f ./.tisrdonly" EXIT
332 trap "exit 1" HUP INT TERM
333 printf '' > .
/.tisrdonly
334 ${chmod} 0444 .
/.tisrdonly
335 if (printf 'no\n' > .
/.tisrdonly
) >/dev
/null
2>&1 &&
336 test -s .
/.tisrdonly
; then
341 ${rm} -f .
/.tisrdonly
342 trap '' EXIT HUP INT TERM
346 export UTF8_LOCALE HONOURS_READONLY
349 TESTS_PERFORMED
=0 TESTS_OK
=0 TESTS_FAILED
=0 TESTS_SKIPPED
=0
350 JOBS
=0 JOBLIST
= JOBREAPER
= JOBSYNC
=
352 ( sleep .1 ) >/dev
/null
2>&1 && SUBSECOND_SLEEP
=y
354 COLOR_ERR_ON
= COLOR_ERR_OFF
= COLOR_DBGERR_ON
= COLOR_DBGERR_OFF
=
355 COLOR_WARN_ON
= COLOR_WARN_OFF
=
356 COLOR_OK_ON
= COLOR_OK_OFF
=
362 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
363 ${rm} -rf ./t.*.d ./t.*.io ./t.*.result ./t.time.out
365 trap "exit 1" HUP INT QUIT TERM
368 if [ -n "${NOJOBS}" ]; then
372 # The user desired variant
373 if ( echo "${MAKEFLAGS}" |
${grep} -- -j ) >/dev
/null
2>&1; then
374 i
=`echo "${MAKEFLAGS}" |
375 ${sed} -e 's/^.*-j[ ]*\([0-9]\{1,\}\).*$/\1/'`
376 if ( echo "${i}" |
grep -q -e '^[0-9]\{1,\}$' ); then
377 printf 'Job number derived from MAKEFLAGS: %s\n' ${i}
379 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
384 # The actual hardware
385 printf 'all:\n' > t.mk.io
386 if ( ${MAKE} -j 10 -f t.mk.io
) >/dev
/null
2>&1; then
387 if command -v nproc
>/dev
/null
2>&1; then
388 i
=`nproc 2>/dev/null`
389 [ ${?} -eq 0 ] && MAXJOBS
=${i}
391 i
=`getconf _NPROCESSORS_ONLN 2>/dev/null`
393 if [ ${j} -ne 0 ]; then
394 i
=`getconf NPROCESSORS_ONLN 2>/dev/null`
397 if [ ${j} -ne 0 ]; then
399 if command -v kstat
>/dev
/null
2>&1; then
400 i
=`PERL5OPT= kstat -p cpu | ${awk} '
402 {if($2 > no) max = $2; next}
408 if [ ${j} -eq 0 ] && [ -n "${i}" ]; then
409 printf 'Job number derived from CPU number: %s\n' ${i}
413 [ "${MAXJOBS}" -eq 0 ] && MAXJOBS
=1
421 # There were problems when using monitor mode with mksh
422 i
=`env -i ${SHELL} -c 'echo $KSH_VERSION'`
423 if [ -n "${i}" ]; then
424 if [ "${i}" != "${i#*MIRBSD}" ]; then
429 if [ -n "${JOBMON}" ]; then
430 ( set -m ) </dev
/null
>/dev
/null
2>&1 || JOBMON
=
432 printf >&2 '%s! $JOBMON: $SHELL %s incapable, disabled!%s\n' \
433 "${COLOR_ERR_ON}" "${SHELL}" "${COLOR_ERR_OFF}"
434 printf >&2 '%s! No process groups available, killed tests may '\
435 'leave process "zombies"!%s\n' \
436 "${COLOR_ERR_ON}" "${COLOR_ERR_OFF}"
446 if [ ${JOBS} -gt 0 ]; then
447 echo 'Cleaning up running jobs'
448 [ -n "${JOBREAPER}" ] && kill -KILL ${JOBREAPER} >/dev
/null
2>&1
456 if [ -n "${CHECK}" ] && [ -n "${SKIPTEST}" ]; then
462 while [ ${#} -gt 0 ]; do
463 if [ "${1}" != "${j}" ]; then
464 SKIPTEST
="${SKIPTEST} ${1}"
465 elif [ -z "${k}" ]; then
471 [ -n "${k}" ] && return
475 if [ ${MAXJOBS} -gt 1 ]; then
476 # We are spawning multiple jobs..
477 [ ${JOBS} -eq 0 ] && printf '...'
479 printf ' [%s=%s]' ${JOBS} "${1}"
482 # Assume problems exist, do not let user keep hanging on terminal
483 if [ -n "${RUN_TEST}" ]; then
484 printf '... [%s]\n' "${1}"
488 [ -n "${JOBMON}" ] && set -m >/dev
/null
2>&1
489 ( # Place the job in its own directory to ease file management
490 trap '' EXIT HUP INT QUIT TERM USR1 USR2
491 ${mkdir} t.${JOBS}.d && cd t.${JOBS}.d
&&
492 eval t_
${1} ${JOBS} ${1} &&
493 ${rm} -f ..
/t.
${JOBS}.id
494 ) > t.
${JOBS}.io
</dev
/null
& # 2>&1 </dev/null &
496 [ -n "${JOBMON}" ] && set +m
>/dev
/null
2>&1
497 JOBLIST
="${JOBLIST} ${i}"
498 printf '%s\n%s\n' ${i} ${1} > t.${JOBS}.id
500 # ..until we should sync or reach the maximum concurrent number
501 [ ${JOBS} -lt ${MAXJOBS} ] && return
507 if [ ${JOBS} -eq 0 ]; then
508 [ -n "${TEST_ANY}" ] && printf '\n'
512 [ -z "${JOBSYNC}" ] && [ ${#} -eq 0 ] && return
514 [ ${MAXJOBS} -ne 1 ] && printf ' .. waiting\n'
516 # Start an asynchronous notify process
517 ${rm} -f .
/t.
time.out
521 trap "kill -TERM ${sleeper}; exit 1" HUP INT TERM
524 printf '' > .
/t.
time.out
525 ) </dev
/null
>/dev
/null
2>&1 &
528 # Then loop a while, looking out for collecting tests
531 [ -f .
/t.
time.out
] && break
534 while [ ${i} -lt ${JOBS} ]; do
536 [ -f t.
${i}.id
] ||
continue
540 [ -n "${alldone}" ] && break
542 if [ -z "${SUBSECOND_SLEEP}" ]; then
543 loops
=`add ${loops} 1`
544 [ ${loops} -lt 111 ] && continue
552 if [ -f .
/t.
time.out
]; then
553 ${rm} -f .
/t.
time.out
556 kill -TERM ${JOBREAPER} >/dev
/null
2>&1
561 # Now collect the zombies
565 # Update global counters
567 while [ ${i} -lt ${JOBS} ]; do
570 [ -s t.
${i}.io ] && ${cat} t.${i}.io
571 if [ -n "${DUMPERR}" ] && [ -s ./t.${i}.d/${ERR} ]; then
572 printf '%s [Debug/Devel: nullified errors]\n' "${COLOR_DBGERR_ON}"
574 printf ' %s\n' "${l}"
575 done < t.${i}.d/${ERR}
576 printf '%s' "${COLOR_DBGERR_OFF}"
579 if [ -f t.${i}.id ]; then
580 { read pid; read desc; } < t.${i}.id
581 desc=${desc#${desc%%[! ]*}}
582 desc=${desc%${desc##*[! ]}}
583 [ -s t.${i}.io ] && printf >&2 '\n'
584 printf >&2 '%s!! Timeout: reaped job %s [%s]%s\n' \
585 "${COLOR_ERR_ON}" ${i} "${desc}" "${COLOR_ERR_OFF}"
586 TESTS_FAILED=`add ${TESTS_FAILED} 1`
587 elif [ -s t.${i}.result ]; then
588 read es tp to tf ts < t.${i}.result
589 TESTS_PERFORMED=`add ${TESTS_PERFORMED} ${tp}`
590 TESTS_OK=`add ${TESTS_OK} ${to}`
591 TESTS_FAILED=`add ${TESTS_FAILED} ${tf}`
592 TESTS_SKIPPED=`add ${TESTS_SKIPPED} ${ts}`
593 [ "${es}" != 0 ] && ESTAT=${es}
595 TESTS_FAILED=`add ${TESTS_FAILED} 1`
600 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
601 ${rm} -rf ./t.*.d ./t.*.id ./t.*.io t.*.result ./t.time.out
608 while [ ${i} -lt ${JOBS} ]; do
610 if [ -f t.${i}.id ] &&
611 read pid < t.${i}.id >/dev/null 2>&1 &&
612 kill -0 ${pid} >/dev/null 2>&1; then
614 [ -n "${JOBMON}" ] && j=-${j}
615 kill -KILL ${j} >/dev/null 2>&1
623 # echoes, checks, etc. {{{
627 ESTAT=0 TESTS_PERFORMED=0 TESTS_OK=0 TESTS_FAILED=0 TESTS_SKIPPED=0 \
628 TEST_NAME=${1} TEST_ANY=
630 printf '%s[%s]%s\n' "" "${TEST_NAME}" ""
634 [ -n "${TEST_ANY}" ] && printf '\n'
636 printf '%s %s %s %s %s\n' \
638 ${TESTS_PERFORMED} ${TESTS_OK} ${TESTS_FAILED} ${TESTS_SKIPPED} \
643 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
644 printf "${__i__}"'%s' "${*}"
649 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
650 printf "${__i__}"'%s%s:ok%s' "${COLOR_OK_ON}" "${*}" "${COLOR_OK_OFF}"
660 [ -n "${TEST_ANY}" ] && __i__="\n" || __i__=
661 printf "${__i__}"'%sERROR: %s%s\n' \
662 "${COLOR_ERR_ON}" "${*}" "${COLOR_ERR_OFF}"
667 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
668 printf "${__i__}"'%s%s%s' "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
673 [ -n "${TEST_ANY}" ] && __i__=' ' || __i__=
674 printf "${__i__}"'%s%s[skip]%s' \
675 "${COLOR_WARN_ON}" "${*}" "${COLOR_WARN_OFF}"
677 TESTS_SKIPPED=`add ${TESTS_SKIPPED} 1`
681 restat=${?} tid=${1} eestat=${2} f=${3} s=${4} optmode=${5}
683 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
688 [ "$eestat" = - ] || exit 200
690 [ -f "${f}" ] && break
691 t_echowarn "[${tid}:async
=wait]"
699 check__bad= check__runx=
701 if [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ]; then
703 t_echoerr "${tid}: bad-status: ${restat} != ${eestat}"
707 csum="`${cksum} < "${f}" | ${sed} -e 's/[ ]\{1,\}/ /g'`"
708 if [ "${csum}" = "${s}" ]; then
710 check__runx=${DEVELDIFF}
713 t_echoerr "${tid}: checksum mismatch
(got
${csum})"
714 check__bad=1 check__runx=1
717 if [ -z "${check__bad}" ]; then
718 TESTS_OK=`add ${TESTS_OK} 1`
720 TESTS_FAILED=`add ${TESTS_FAILED} 1`
723 if [ -n "${CHECK}${RUN_TEST}" ]; then
724 x="t.
${TEST_NAME}-${tid}"
725 if [ -n "${RUN_TEST}" ] ||
726 [ -n "${check__runx}" -a -n "${GIT_REPO}" ]; then
727 ${cp} -f "${f}" ../"${x}"
730 if [ -n "${check__runx}" ] && [ -n "${GIT_REPO}" ] &&
731 command -v diff >/dev
/null
2>&1; then
733 if (git rev-parse
--verify $y) >/dev
/null
2>&1; then :; else
734 y
=refs
/remotes
/origin
/test-out
735 (git rev-parse
--verify $y) >/dev
/null
2>&1 || y
=
737 if [ -n "${y}" ]; then
738 if GIT_CONFIG
=/dev
/null git show
"${y}":"${x}" > \
739 ..
/"${x}".old
2>/dev
/null
; then
740 diff -ru ..
/"${x}".old ../"${x}" > ../"${x}".
diff
741 if [ ${?} -eq 0 ]; then
742 [ -z "${MAILX_CC_TEST_NO_CLEANUP}" ] &&
743 ${rm} -f ../"${x}" ../"${x}".old ../"${x}".diff
744 elif [ -n "${MAILX_CC_ALL_TESTS_DUMPERR}" ]; then
746 printf 'ERROR-DIFF %s\n' "${l}"
747 done < ../"${x}".diff
750 t_echo0err "${tid}: misses
[test-out
] template
"
758 # $1=test name [$2=status]
760 [ ${#} -gt 1 ] && __qm__=${2}
762 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
764 if [ ${__qm__} -ne 0 ]; then
766 t_echoerr "${1}: unexpected non-0
exit status
: ${__qm__}"
767 TESTS_FAILED=`add ${TESTS_FAILED} 1`
770 TESTS_OK=`add ${TESTS_OK} 1`
775 # $1=test name [$2=status]
777 [ ${#} -gt 1 ] && __qm__=${2}
778 [ ${#} -gt 2 ] && __expect__=${3} || __expect__=
780 TESTS_PERFORMED=`add ${TESTS_PERFORMED} 1`
782 if [ ${__qm__} -eq 0 ]; then
784 t_echoerr "${1}: unexpected
0 exit status
: ${__qm__}"
785 TESTS_FAILED=`add ${TESTS_FAILED} 1`
786 elif [ -n "${__expect__}" ] && [ ${__expect__} -ne ${__qm__} ]; then
788 t_echoerr
"${1}: unexpected exit status: ${__qm__} != ${__expected__}"
789 TESTS_FAILED
=`add ${TESTS_FAILED} 1`
792 TESTS_OK
=`add ${TESTS_OK} 1`
798 [ -n "${NOCOLOUR}" ] && return
799 [ -n "${MAILX_CC_TEST_NO_COLOUR}" ] && return
800 # We do not want color for "make test > .LOG"!
801 if [ -t 1 ] && command -v tput >/dev
/null
2>&1; 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 { saf5
=`tput setaf 5`; } 2>/dev
/null
811 [ $?
-eq 0 ] ||
return
812 { b
=`tput bold`; } 2>/dev
/null
813 [ $?
-eq 0 ] ||
return
815 COLOR_ERR_ON
=${saf1}${b} COLOR_ERR_OFF=${sgr0}
816 COLOR_DBGERR_ON
=${saf5} COLOR_DBGERR_OFF
=${sgr0}
817 COLOR_WARN_ON
=${saf3}${b} COLOR_WARN_OFF=${sgr0}
818 COLOR_OK_ON
=${saf2} COLOR_OK_OFF
=${sgr0}
819 unset saf1 saf2 saf3 b
823 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
825 echo "$((${1} + ${2}))"
829 ${awk} 'BEGIN{print '${1}' + '${2}'}'
833 if ( [ "$((2 % 3))" = 2 ] ) >/dev/null 2>&1; then
835 echo "$((${1} % ${2}))"
839 ${awk} 'BEGIN{print '${1}' % '${2}'}'
844 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
845 ${grep} ,+${1}, ) >/dev
/null
2>&1
849 # Absolute Basics {{{
850 t_X_Y_opt_input_go_stack
() {
853 ${cat} <<- '__EOT' > "${BODY}"
861 echo "define mac1 {";\
862 echo " echo mac1-1 via1 \$0";\
864 echo " echo mac1-2";\
866 echo " echo mac1-3";\
869 echo "define mac2 {";\
870 echo " echo mac2-1 via1 \$0";\
872 echo " echo mac2-2";\
878 echo echo 1-1-1 via1 \$0;\
890 # The -X option supports multiline arguments, and those can internally use
891 # reverse solidus newline escaping. And all -X options are joined...
893 < "${BODY}" ${MAILX} ${ARGS} \
908 echo "define mac1 {";\
909 echo " echo mac1-1 via2 \$0";\
911 echo " echo mac1-2";\
913 echo " echo mac1-3";\
916 echo "define mac2 {";\
917 echo " echo mac2-1 via2 \$0";\
919 echo " echo mac2-2";\
925 echo echo 1-1-1 via2 \$0;\
939 check 1 0 "${MBOX}" '1786542668 416'
941 # The -Y option supports multiline arguments, and those can internally use
942 # reverse solidus newline escaping.
944 < "${BODY}" ${MAILX} ${ARGS} \
961 echo "define mac1 {";\
962 echo " echo mac1-1 via2 \$0";\
964 echo " echo mac1-2";\
966 echo " echo mac1-3";\
969 echo "define mac2 {";\
970 echo " echo mac2-1 via2 \$0";\
972 echo " echo mac2-2";\
978 echo echo 1-1-1 via2 \$0;\
991 -Y 'echo LAST_Y' > "${MBOX}"
993 check 2 0 "${MBOX}" '1845176711 440'
996 </dev/null ${MAILX} ${ARGS} \
997 -X 'echo X before compose mode' \
998 -Y '~s Subject via -Y' \
999 -Y 'Body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
1000 check
3 0 .
/.tybox
'264636255 125'
1001 check
4 - "${MBOX}" '467429373 22'
1003 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t \
1004 -X 'echo X before compose mode' \
1005 -Y '~s Subject via -Y' \
1006 -Y 'Additional body via -Y' -. .
/.tybox
> "${MBOX}" 2>&1
1008 subject
:diet not to be seen
!
1012 check
5 0 .
/.tybox
'3313167452 299'
1013 check
6 - "${MBOX}" '467429373 22'
1016 printf 'this body via stdin pipe.\n' |
${MAILX} ${NOBATCH_ARGS} \
1017 -X 'echo X before compose mode' \
1018 -Y '~s Subject via -Y (not!)' \
1019 -Y 'Additional body via -Y, nobatch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1020 check
7 0 .
/.tybox
'1561798488 476'
1021 check
8 - "${MBOX}" '467429373 22'
1023 printf 'this body via stdin pipe.\n' |
${MAILX} ${ARGS} \
1024 -X 'echo X before compose mode' \
1025 -Y '~s Subject via -Y' \
1026 -Y 'Additional body via -Y, batch mode' -. .
/.tybox
> "${MBOX}" 2>&1
1027 check
9 0 .
/.tybox
'3245082485 650'
1028 check
10 - "${MBOX}" '467429373 22'
1030 # Test for [8412796a] (n_cmd_arg_parse(): FIX token error -> crash, e.g.
1031 # "-RX 'bind;echo $?' -Xx".., 2018-08-02)
1032 ${MAILX} ${ARGS} -RX'call;echo $?' -Xx > .
/.tall
2>&1
1033 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1034 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1035 ${MAILX} ${ARGS} -RX'call ;echo $?' -Xx >> .
/.tall
2>&1
1036 check cmdline
0 .
/.tall
'1867586969 8'
1044 if have_feat uistrings
; then :; else
1045 t_echoskip
'[!UISTRINGS]'
1050 ${cat} <<- '__EOT' > "${BODY}"
1056 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1057 -X'echo one' -X' echos nono ' -X'echo two' \
1059 check 1 0 "${MBOX}" '2700500141 51'
1061 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
1063 check 2 0 "${MBOX}" '2700500141 51'
1065 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
1067 check
3 0 "${MBOX}" '2700500141 51'
1071 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1072 -X'echo one' -X' echos nono ' -X'echo two' \
1074 check
4 1 "${MBOX}" '4096689457 47'
1076 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
1078 check 5 1 "${MBOX}" '4096689457 47'
1080 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1082 check
6 1 "${MBOX}" '1669262132 170'
1084 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1086 check 7 1 "${MBOX}" '1669262132 170'
1088 ## Repeat 4-7 with ignerr set
1090 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1092 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1093 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
1095 check
8 0 "${BODY}" '2700500141 51'
1097 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
1099 check 9 0 "${BODY}" '2700500141 51'
1101 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
1103 check
10 0 "${BODY}" '2700500141 51'
1105 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
1107 check 11 0 "${BODY}" '2700500141 51'
1109 # Ensure "good-injection
" in a deeper indirection does not cause trouble
1110 # This actually only works with MLE and HISTORY, and TODO needs a pseudo TTY
1111 # interaction so that we DO initialize our line editor...
1112 ${cat} <<- '__EOT' > "${BODY}"
1123 printf 'source %s\ncall x\necho au' "${BODY}" |
1124 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1125 check
12 1 "${MBOX}" '2908921993 44'
1127 printf 'source %s\nset on-history-addition=oha\ncall x\necho au' "${BODY}" |
1128 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=errexit > "${MBOX}" 2>&1
1129 check 13 1 "${MBOX}" '2908921993 44'
1131 printf 'source %s\ncall x\necho au' "${BODY}" |
1132 ${MAILX} ${ARGS} -Snomemdebug -Sxarg=nowhere > "${MBOX}" 2>&1
1133 check
14 0 "${MBOX}" '2049365617 47'
1141 if have_feat uistrings
; then :; else
1142 t_echoskip
'[!UISTRINGS]'
1147 ${cat} <<- '__EOT' > "${BODY}"
1153 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
1154 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1156 check 1 0 "${MBOX}" '2700500141 51'
1158 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Snomemdebug \
1160 check 2 0 "${MBOX}" '2700500141 51'
1164 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1165 -Y'echo one' -Y' echos nono ' -Y'echo two' \
1167 check 3 1 "${MBOX}" '4096689457 47'
1169 </dev/null ${MAILX} ${ARGS} -Y'source '"${BODY}" -Serrexit -Snomemdebug \
1171 check 4 1 "${MBOX}" '4096689457 47'
1173 ## Repeat 3-4 with ignerr set
1175 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
1177 </dev/null ${MAILX} ${ARGS} -Serrexit -Snomemdebug \
1178 -Y'echo one' -Y'ignerr echos nono ' -Y'echo two' \
1180 check 5 0 "${BODY}" '2700500141 51'
1182 </dev/null ${MAILX} ${ARGS} -Y'source '"${MBOX}" -Serrexit -Snomemdebug \
1184 check 6 0 "${BODY}" '2700500141 51'
1194 # Test basic assumption
1195 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
1196 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
1197 -Xx > "${MBOX}" 2>&1
1198 check 1 0 "${MBOX}" '270686329 21'
1201 ${cat} <<- '__EOT' > "${BODY}"
1202 echo asksub<$asksub>
1204 echo asksub<$asksub>
1206 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1207 -Snoasksub -Sasksub -Snoasksub \
1208 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
1209 -Xx > "${MBOX}" 2>&1
1210 check
2 0 "${MBOX}" '3182942628 37'
1212 ${cat} <<- '__EOT' > "${BODY}"
1213 echo asksub<$asksub>
1215 echo asksub<$asksub>
1217 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1218 -Snoasksub -Sasksub \
1219 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
1220 -Xx > "${MBOX}" 2>&1
1221 check
3 0 "${MBOX}" '2006554293 39'
1224 ${cat} <<- '__EOT' > "${BODY}"
1225 echo dietcurd<$dietcurd>
1227 echo dietcurd<$dietcurd>
1229 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1230 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
1231 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
1232 -X'echo dietcurd<$dietcurd>' \
1233 -Xx > "${MBOX}" 2>&1
1234 check
4 0 "${MBOX}" '1985768109 65'
1236 ${cat} <<- '__EOT' > "${BODY}"
1237 echo dietcurd<$dietcurd>
1239 echo dietcurd<$dietcurd>
1241 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1242 -Sdietcurd=strawberry
-Snodietcurd \
1243 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
1244 -X'echo dietcurd<$dietcurd>' \
1245 -Xx > "${MBOX}" 2>&1
1246 check
5 0 "${MBOX}" '151574279 51'
1248 # TODO once we have a detached one with env=1..
1249 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
1250 t_echoskip
's_freeze-{6,7}:[shell sets $TERM]'
1252 ${cat} <<- '__EOT' > "${BODY}"
1253 !echo "shell says TERM<$TERM>"
1255 !echo "shell says TERM<$TERM>"
1257 !echo "shell says TERM<$TERM>"
1259 !echo "shell says TERM<$TERM>"
1261 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1262 -STERM=strawberry
-SnoTERM -STERM=vanilla \
1263 -X'echo mail<$TERM>' -X'unset TERM' \
1264 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1265 -Xx > "${MBOX}" 2>&1
1266 check
6 0 "${MBOX}" '1211476036 167'
1268 ${cat} <<- '__EOT' > "${BODY}"
1269 !echo "shell says TERM<$TERM>"
1271 !echo "shell says TERM<$TERM>"
1273 !echo "shell says TERM<$TERM>"
1275 !echo "shell says TERM<$TERM>"
1277 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
1278 -STERM=strawberry
-SnoTERM \
1279 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
1280 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
1281 -Xx > "${MBOX}" 2>&1
1282 check
7 0 "${MBOX}" '3365080441 132'
1292 t__gen_msg subject f-batch-order
> "${MBOX}"
1294 # This would exit 64 (EX_USAGE) from ? to [fbddb3b3] (FIX: -f: add
1295 # n_PO_f_FLAG to avoid that command line order matters)
1296 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -f -# \
1297 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1298 check
1 0 .
/.tall
'1690247457 86'
1300 # And this ever worked (hopefully)
1301 </dev
/null
${MAILX} ${NOBATCH_ARGS} -R -# -f \
1302 -Y 'echo du;h;echo da;x' "${MBOX}" >.
/.tall
2>&1
1303 check
2 0 .
/.tall
'1690247457 86'
1308 t_input_inject_semicolon_seq
() {
1311 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1313 echon '(mydeepmac)';
1316 echon this_is_mymac;call mydeepmac;echon ';';
1318 echon one';';call mymac;echon two";";call mymac;echo three$';';
1320 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
1322 echon one';';call mymac;echon two";";call mymac;echo three$';';
1325 check 1 0 "${MBOX}" '512117110 140'
1333 ${cat} <<- '__EOT' > "${BODY}"
1352 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
1353 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
1354 echo $
'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
1356 echo a$
'\101\0101\x41\u0041\u41\U00000041\U41'c
1357 echo a$
'\u0041\u41\u0C1\U00000041\U41'c
1379 echo a$
'b\U000000'ds
1380 echo a$
'b\U0000000'dt
1381 echo a$
'b\U00000000'du
1391 if [ -z "${UTF8_LOCALE}" ]; then
1392 t_echoskip
'wysh-unicode:[no UTF-8 locale]'
1394 < "${BODY}" DIET
=CURD TIED
= \
1395 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1396 check unicode
0 "${MBOX}" '475805847 317'
1399 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1400 check c 0 "${MBOX}" '1473887148 321'
1402 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1403 wysh
set mager
='\hey\'
1405 wysh set mager="\hey\\"
1407 wysh set mager=$'\hey
\\'
1410 check 3 0 "${MBOX}" '1289698238 69'
1418 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1419 commandalias echo echo hoho
1423 commandalias XxX XxXx
1424 commandalias XxXx XxXxX
1425 commandalias XxXxX XxXxXx
1426 commandalias XxXxXx echo huhu
1427 commandalias XxXxXxX echo huhu
1429 commandalias XxXxXx XxXxXxX
1432 commandalias XxXxXx echo huhu
1436 check 1 0 "${MBOX}" '1638809585 36'
1444 # In POSIX C181 standard order
1445 </dev/null ${MAILX} ${ARGS} \
1446 -Y 'echon alias
/a\
; ? a
; echon group
/g\
; ?g
' \
1447 -Y 'echon alternates
/alt\
; ? alt
' \
1448 -Y 'echon chdir
/ch\
; ? ch
' \
1449 -Y 'echon copy
/c\
; ? c
; echon Copy
/C\
; ?C
' \
1450 -Y 'echon delete
/d\
; ? d
' \
1451 -Y 'echon discard
/di\
; ? di
; echon ignore
/ig\
; ?ig
' \
1452 -Y 'echon echo
/ec\
; ? ec
' \
1453 -Y 'echon edit
/e\
; ? e
' \
1454 -Y 'echon exit
/ex\
; ? ex
; echon xit
/x\
; ?x
' \
1455 -Y 'echon file
/fi\
; ?
fi; echon folder
/fold\
; ?
fold' \
1456 -Y 'echon followup
/fo\
; ? fo
; echon Followup
/F\
; ?F
' \
1457 -Y 'echon from
/f\
; ? f
' \
1458 -Y 'echon headers
/h\
; ? h
' \
1459 -Y 'echon help
/hel\
; ? hel
' \
1460 -Y 'echon hold
/ho\
; ? ho
; echon preserve
/pre\
; ? pre
' \
1461 -Y 'echon if
/i\
; ? i
; echon else
/el\
; ? el
; echon endif
/en\
; ? en
' \
1462 -Y 'echon list
/l\
; ? l
' \
1463 -Y 'echon mail
/m\
; ? m
' \
1464 -Y 'echon mbox
/mb\
; ? mb
' \
1465 -Y 'echon next
/n\
; ? n
' \
1466 -Y 'echon pipe
/pi\
; ? pi
' \
1467 -Y 'echon Print
/P\
; ? P
; echon Type
/T\
; ? T
' \
1468 -Y 'echon print
/p\
; ? p
; echon type
/t\
; ? t
' \
1469 -Y 'echon quit
/q\
; ? q
' \
1470 -Y 'echon Reply
/R\
; ? R
' \
1471 -Y 'echon reply
/r\
; ? r
' \
1472 -Y 'echon retain
/ret\
; ? ret
' \
1473 -Y 'echon save
/s\
; ? s
; echon Save
/S\
; ? S
' \
1474 -Y 'echon set
/se\
; ? se
' \
1475 -Y 'echon shell
/sh\
; ? sh
' \
1476 -Y 'echon size
/si\
; ? si
' \
1477 -Y 'echon source
/so\
; ? so
' \
1478 -Y 'echon touch
/tou\
; ? tou
' \
1479 -Y 'echon unalias
/una\
; ? una
' \
1480 -Y 'echon undelete
/u\
; ? u
' \
1481 -Y 'echon unset
/uns\
; ? uns
' \
1482 -Y 'echon visual
/v\
; ? v
' \
1483 -Y 'echon write
/w\
; ? w
' \
1484 | ${sed} -e 's
/:.
*$
//' > "${MBOX}"
1485 check 1 0 "${MBOX}" '1012680481 968'
1495 # XXX the first needs to be checked, it is quite dumb as such
1496 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1497 commandalias x echo '$?
/$^ERRNAME
'
1510 shcodec e a$'b
'c$'d
'
1512 shcodec d a$'b
'c$'d
'
1526 # same but with vput
1527 commandalias y echo '$?
/$^ERRNAME
$res'
1528 vput shcodec res e abcd
1532 vput shcodec res d abcd
1536 vput shcodec res e a'b
'c'd
'
1540 vput shcodec res d a'b
'c'd
'
1544 vput shcodec res e a"b"c"d"
1548 vput shcodec res d a"b"c"d"
1552 vput shcodec res e a$'b
'c$'d
'
1556 vput shcodec res d a$'b
'c$'d
'
1560 vput shcodec res e 'abcd
'
1564 vput shcodec res d 'abcd
'
1568 vput shcodec res e "abcd"
1572 vput shcodec res d "abcd"
1576 vput shcodec res e $'abcd
'
1580 vput shcodec res d $'abcd
'
1585 vput shcodec res e a b\ c d
1589 vput shcodec res d a b\ c d
1591 vput shcodec res e ab cd
1595 vput shcodec res d 'ab
cd'
1597 vput shcodec res e a 'b c
' d
1601 vput shcodec res d a 'b c
' d
1603 vput shcodec res e a "b c" d
1607 vput shcodec res d a "b c" d
1609 vput shcodec res e a $'b c
' d
1613 vput shcodec res d a $'b c
' d
1616 vput shcodec res e 'a$
`"\'
1620 vput shcodec res d 'a$`"\'
1622 vput shcodec res e "a\$\
`'\"\\"
1626 vput shcodec res d "a\$\`'\"\\"
1628 vput shcodec res e $'a\$
`\'\"\\'
1632 vput shcodec res d $'a\$`\'\"\\'
1634 vput shcodec res e $'a\$
`\'"\\'
1638 vput shcodec res d $'a\$`\'"\\'
1642 vput shcodec res e a${diet}c
1646 eval vput shcodec res e a${diet}c
1650 vput shcodec res e "a
${diet}c
"
1654 eval vput shcodec res e "a
${diet}c
"
1659 check 1 0 "${MBOX}" '3316745312 1241'
1661 if [ -z "${UTF8_LOCALE}" ]; then
1662 t_echoskip 'unicode:[no UTF-8 locale]'
1663 elif have_feat multibyte-charsets; then
1664 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
1665 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1669 shcodec d $'t\u00E4st'
1672 shcodec d $'a\u054Dc'
1675 shcodec d $'a\U0001D542c'
1677 check unicode 0 "${MBOX}" '1175985867 77'
1679 t_echoskip 'unicode:[!MULTIBYTE-CHARSETS]'
1688 # v15compat: old and new tests share the same result files!
1689 # v15compat: i.e., just throw away -old tests one day
1691 # Nestable conditions test
1692 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1714 if $dietcurd == 'yoho'
1719 if $dietcurd ==?
'Yoho'
1724 if $dietcurd == 'Yoho'
1729 if $dietcurd != 'yoho'
1734 if $dietcurd !=?
case 'Yoho'
1739 if $dietcurd != 'Yoho'
1800 if $dietcurd == 'yohu'
1802 elif $dietcurd == 'yoha'
1804 elif $dietcurd == 'yohe'
1806 elif $dietcurd == 'yoho'
1808 if $dietcurd == 'yohu'
1810 elif $dietcurd == 'yoha'
1812 elif $dietcurd == 'yohe'
1814 elif $dietcurd == 'yoho'
1816 if $dietcurd == 'yohu'
1818 elif $dietcurd == 'yoha'
1820 elif $dietcurd == 'yohe'
1822 elif $dietcurd == 'yoho'
1878 if $dietcurd ==?
case aBC
1883 if $dietcurd >=?ca AbC
1888 if $dietcurd <=? ABc
1893 if $dietcurd >=?
case abd
1898 if $dietcurd <=? abb
1926 if $dietcurd =%?
case aB
1971 set diet
=abc curd
=abc
1977 set diet
=abc curd
=abcd
1983 # 1. Shitty grouping capabilities as of today
1984 unset diet curd ndefined
1985 if [ [ false
] ||
[ false
] ||
[ true
] ] && \
1986 [ [ false
] ||
[ true
] ] && \
1992 if [ [ [ [ 0 ] ||
[ 1 ] ] && [ [ 1 ] ||
[ 0 ] ] ] && [ 1 ] ] && [ yes ]
1997 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ]
2002 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ]
2007 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] && [ no
]
2012 if [ [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ [ 1 ] ] ||
[ 1 ] ] \
2013 && [ no
] ||
[ yes ]
2018 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2023 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2028 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2033 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2038 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 0 ]
2043 if [ 1 ] ||
[ 0 ] ||
[ 0 ] ||
[ 0 ] && [ 1 ]
2048 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ]
2053 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 1 ]
2058 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 0 ]
2063 if [ 0 ] ||
[ 0 ] ||
[ 0 ] ||
[ 1 ] && [ 0 ] ||
[ 1 ] && [ 1 ]
2069 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2075 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
2080 # 2. Shitty grouping capabilities as of today
2081 unset diet curd ndefined
2082 if [ false || false || true
] && [ false || true
] && yes
2087 if [ [ [ 0 ||
1 ] && [ 1 ||
0 ] ] && 1 ] && [ yes ]
2092 if [ 1 ||
0 ||
0 ||
0 ]
2097 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ]
2102 if [ 1 ||
0 ||
0 ||
0 ||
[ 1 ] ||
1 ] && no
2107 if [ 1 ||
0 ||
0 ||
0 ||
1 ||
[ 1 ] ] && no ||
[ yes ]
2112 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2117 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2122 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2127 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2132 if 1 ||
0 ||
0 ||
0 && 0
2137 if 1 ||
0 ||
0 ||
0 && 1
2142 if 0 ||
0 ||
0 ||
1 && 0
2147 if 0 ||
0 ||
0 ||
1 && 1
2152 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 0
2157 if 0 ||
0 ||
0 ||
1 && 0 ||
1 && 1
2163 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2168 if $diet == 'yo' && $curd == 'ho' && $ndefined
2174 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
2179 if $diet == 'yo' && $curd == 'ho' && $ndefined
2184 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
2189 # Some more en-braced variables
2191 if ${diet} == ${curd}
2196 if ${diet} != ${curd}
2212 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2217 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2222 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2227 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2232 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2237 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2242 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2247 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] ||
3
2252 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
2258 if ! 0 && ! ! 1 && ! ! ! 0 && 3
2263 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
2268 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
2273 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
2278 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
2283 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
2288 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
2293 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] ||
3
2298 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
2305 check normal-old
0 "${MBOX}" '1688759742 719' # pre v15compat
2307 if have_feat regex
; then
2308 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
2310 if $dietcurd =~ '^yo.*'
2315 if $dietcurd =~ '^Yo.*'
2320 if $dietcurd =~?case '^Yo.*'
2325 if $dietcurd =~ '^yOho.+'
2330 if $dietcurd !~? '.*Ho$'
2335 if $dietcurd !~ '.+yohO$'
2340 if [ $dietcurd !~?cas '.+yoho$' ]
2345 if ! [ $dietcurd =~?case '.+yoho$' ]
2350 if ! ! [ $dietcurd !~? '.+yoho$' ]
2355 if ! [ ! [ $dietcurd !~? '.+yoho$' ] ]
2360 if [ ! [ ! [ $dietcurd !~? '.+yoho$' ] ] ]
2365 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2370 if ! ! ! $dietcurd !~ '.+yoho$'
2375 if ! ! ! $dietcurd =~ '.+yoho$'
2380 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
2385 set diet=abc curd='^abc$'
2391 set diet=abc curd='^abcd$'
2399 check regex-old 0 "${MBOX}" '1115671789 95' # pre v15compat
2401 t_echoskip 'regex-old:[no regex option]'
2406 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
2407 \
if -N xyz
; echo 1.err-1
; \
2408 \
elif ! -Z xyz
;echo 1.err-2
;\
2409 \
elif -n "$xyz" ; echo 1.err-3
; \
2410 \
elif ! -z "$xyz" ; echo 1.err-4
; \
2414 \
if ! -N xyz
; echo 2.err-1
; \
2415 \
elif -Z xyz
;echo 2.err-2
;\
2416 \
elif -n "$xyz" ; echo 2.err-3
; \
2417 \
elif ! -z "$xyz" ; echo 2.err-4
; \
2421 \
if ! -N xyz
; echo 3.err-1
; \
2422 \
elif -Z xyz
;echo 3.err-2
;\
2423 \
elif ! -n "$xyz";echo 3.err-3
;\
2424 \
elif -z "$xyz";echo 3.err-4
;\
2427 \
if $xyz != notempty
;echo 4.err-1
;else;echo 4.ok
;\end
2428 \
if $xyz == notempty
;echo 5.ok
;else;echo 5.err-1
;\end
2431 check NnZz_whiteout
0 "${MBOX}" '4280687462 25'
2433 # TODO t_ifelse: individual tests as for NnZz_whiteout
2434 # Nestable conditions test
2435 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=x > "${MBOX}"
2446 if [ "$dietcurd" != "" ]
2452 if $'\$dietcurd' != ""
2457 if "$dietcurd" == 'yoho'
2462 if $'\$dietcurd' ==? 'Yoho'
2467 if $dietcurd == 'Yoho'
2472 if $dietcurd != 'yoho'
2477 if $dietcurd !=?case 'Yoho'
2482 if $dietcurd != 'Yoho'
2543 if $dietcurd == 'yohu'
2545 elif $dietcurd == 'yoha'
2547 elif $dietcurd == 'yohe'
2549 elif $dietcurd == 'yoho'
2551 if $dietcurd == 'yohu'
2553 elif $dietcurd == 'yoha'
2555 elif $dietcurd == 'yohe'
2557 elif $dietcurd == 'yoho'
2559 if $dietcurd == 'yohu'
2561 elif $dietcurd == 'yoha'
2563 elif $dietcurd == 'yohe'
2565 elif $dietcurd == 'yoho'
2605 if $dietcurd -ge?satu -0xFFFFFFFFFFFFFFFF1
2621 if $dietcurd ==?case aBC
2626 if $dietcurd >=?ca AbC
2631 if $dietcurd <=? ABc
2636 if $dietcurd >=?case abd
2641 if $dietcurd <=? abb
2669 if $dietcurd =%?case aB
2714 set diet='ab c' curd='ab c'
2715 if "$diet" == "$curd"
2720 set diet='ab c' curd='ab cd'
2721 if "$diet" != "$curd"
2726 # 1. Shitty grouping capabilities as of today
2727 unset diet curd ndefined
2728 if [ [ false ] || [ false ] || [ true ] ] && \
2729 [ [ false ] || [ true ] ] && \
2735 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
2740 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
2745 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
2750 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
2755 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
2756 && [ no ] || [ yes ]
2761 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2766 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
2771 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
2776 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
2781 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
2786 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
2791 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
2796 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
2801 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
2806 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
2812 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2813 [ -N ndefined || -n "$ndefined" || \
2814 ! -Z ndefined || ! -z "$ndefined" ]
2820 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && \
2821 -N ndefined && ! -n "$ndefined" && \
2822 ! -Z ndefined && -z "$ndefined"
2827 # 2. Shitty grouping capabilities as of today
2828 unset diet curd ndefined
2829 if [ false || false || true ] && [ false || true ] && yes
2834 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
2839 if [ 1 || 0 || 0 || 0 ]
2844 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
2849 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
2854 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
2859 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
2864 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
2869 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
2874 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
2879 if 1 || 0 || 0 || 0 && 0
2884 if 1 || 0 || 0 || 0 && 1
2889 if 0 || 0 || 0 || 1 && 0
2894 if 0 || 0 || 0 || 1 && 1
2899 if 0 || 0 || 0 || 1 && 0 || 1 && 0
2904 if 0 || 0 || 0 || 1 && 0 || 1 && 1
2910 if [ $diet == 'yo' && $curd == 'ho' ] && \
2911 [ -N ndefined || -n "$ndefined" || \
2912 ! -Z ndefined || ! -z "$ndefined" ]
2917 if [ $diet == 'yo' && $curd == 'ho' && \
2918 [ [ -N ndefined || -n "$ndefined" || \
2919 ! -Z ndefined || ! -z "$ndefined" ] ] ]
2925 if [ $diet == 'yo' && $curd == 'ho' ] && \
2926 -N ndefined && ! -n "$ndefined" && \
2927 ! -Z ndefined && -z "$ndefined"
2932 if $diet == 'yo' && $curd == 'ho' && ! -Z ndefined
2937 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && -N ndefined ] ] ] ] ] ]
2942 # Some more en-braced variables
2944 if ${diet} == ${curd}
2949 if "${diet}" != "${curd}"
2965 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
2970 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
2975 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2980 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2985 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
2990 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
2995 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
3000 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
3005 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
3011 if ! 0 && ! ! 1 && ! ! ! 0 && 3
3016 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
3021 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
3026 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
3031 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
3036 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
3041 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
3046 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
3051 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
3058 check normal 0 "${MBOX}" '1688759742 719'
3060 if have_feat regex; then
3061 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Sv15-compat=X > "${MBOX}"
3063 if $dietcurd =~
'^yo.*'
3068 if "$dietcurd" =~
'^Yo.*'
3073 if $dietcurd =~?
case '^Yo.*'
3078 if $dietcurd =~
'^yOho.+'
3083 if $dietcurd !~?
'.*Ho$'
3088 if $dietcurd !~
'.+yohO$'
3093 if [ $dietcurd !~?cas
'.+yoho$' ]
3098 if ! [ "$dietcurd" =~?
case '.+yoho$' ]
3103 if ! ! [ $
'\$dietcurd' !~?
'.+yoho$' ]
3108 if ! [ ! [ $dietcurd !~?
'.+yoho$' ] ]
3113 if [ ! [ ! [ $dietcurd !~?
'.+yoho$' ] ] ]
3118 if ! [ ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3123 if ! ! ! $dietcurd !~
'.+yoho$'
3128 if ! ! ! $dietcurd =~
'.+yoho$'
3133 if ! [ ! ! [ ! [ $dietcurd !~
'.+yoho$' ] ] ]
3138 set diet
=abc curd
='^abc$'
3144 set diet
=abc curd
='^abcd$'
3145 if "$diet" !~ $
'\$curd'
3152 check regex
0 "${MBOX}" '1115671789 95'
3154 t_echoskip
'regex:[!REGEX]'
3163 # Nestable conditions test
3164 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3179 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3184 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
3185 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
3194 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3196 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
3205 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3212 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
3219 echo ----- $1: $2 -> $3 -> $4
3227 call llx 'call off' on on on
3228 call llx 'call off' off on on
3229 call llx 'call off' on off on
3230 call llx 'call off' on off off
3231 localopts call-fixate on
3232 call llx 'call-fixate on' on on on
3233 call llx 'call-fixate on' off on on
3234 call llx 'call-fixate on' on off on
3235 call llx 'call-fixate on' on off off
3236 unset x;localopts call on
3237 call llx 'call on' on on on
3238 call llx 'call on' off on on
3239 call llx 'call on' on off on
3240 call llx 'call on' on off off
3245 check 1 0 "${MBOX}" '4016155249 1246'
3253 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3281 echo ------- global-1 du
=$du
3283 echo ------- global-2 du
=$du
3286 echo ------- global-3 du
=$du
3288 echo ------- global-4 du
=$du
3290 echo ------- global-5 du
=$du
3292 check
1 0 "${MBOX}" '2411598140 641'
3295 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3297 echo z-1: x=$x y=$y z=$z crt=$crt
3298 local set z=1 y=2 crt=10
3299 echo z-2: x=$x y=$y z=$z crt=$crt
3302 echo y-1: x=$x y=$y z=$z crt=$crt
3303 local set x=2 y=1 crt=5
3304 echo y-2: x=$x y=$y z=$z crt=$crt
3306 echo y-3: x=$x y=$y z=$z crt=$crt
3309 echo x-1: x=$x y=$y z=$z crt=$crt
3311 echo x-2: x=$x y=$y z=$z crt=$crt
3313 echo x-3: x=$x y=$y z=$z crt=$crt
3316 echo global-1: x=$x y=$y z=$z crt=$crt
3318 echo global-2: x=$x y=$y z=$z crt=$crt
3320 check 2 0 "${MBOX}" '2560788669 216'
3328 ${cat} <<- '__EOT' | EK1=EV1 EK2=EV2 ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3329 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3330 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3331 varshow EK1 EK2 EK3 EK4 NEK5
3333 echo environ
set EK3 EK4
, set NEK5
3334 environ
set EK3
=EV3 EK4
=EV4
3336 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3337 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3338 varshow EK1 EK2 EK3 EK4 NEK5
3340 echo removing NEK5 EK3
3343 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3344 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3345 varshow EK1 EK2 EK3 EK4 NEK5
3347 echo changing EK1
, EK4
3348 set EK1
=EV1_CHANGED EK4
=EV4_CHANGED
3349 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3350 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3351 varshow EK1 EK2 EK3 EK4 NEK5
3353 echo linking EK4
, rechanging EK1
, EK4
3356 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3357 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3358 varshow EK1 EK2 EK3 EK4 NEK5
3362 echo "we: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3363 !echo "shell: EK1<$EK1> EK2<$EK2> EK3<$EK3> EK4<$EK4> NEK5<$NEK5>"
3364 varshow EK1 EK2 EK3 EK4 NEK5
3367 check
1 0 "${MBOX}" '1685686686 1342'
3373 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3375 echo '-------> L4 (environ unlink EK1, own localopts)'
3378 set LK1=LK1_L4 EK1=EK1_L4
3379 echo "we
: L4
: LK1
<$LK1> EK1
<$EK1>"
3380 !echo "shell
: L4
: LK1
<$LK1> EK1
<$EK1>"
3386 set LK1=LK1_L3 EK1=EK1_L3
3387 echo "we
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3388 !echo "shell
: L3-pre
: LK1
<$LK1> EK1
<$EK1>"
3391 echo "we
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3392 !echo "shell
: L3-post
: LK1
<$LK1> EK1
<$EK1>"
3398 set LK1=LK1_L2 EK1=EK1_L2
3399 echo "we
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3400 !echo "shell
: L2-pre
: LK1
<$LK1> EK1
<$EK1>"
3403 echo "we
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3404 !echo "shell
: L2-post
: LK1
<$LK1> EK1
<$EK1>"
3409 echo '-------> L1 (environ link EK1; localopts call-fixate)'
3410 localopts call-fixate yes
3411 set LK1=LK1_L1 EK1=EK1_L1
3413 echo "we
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3414 !echo "shell
: L1-pre
: LK1
<$LK1> EK1
<$EK1>"
3417 echo "we
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3418 !echo "shell
: L1-post
: LK1
<$LK1> EK1
<$EK1>"
3422 echo "we
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3423 !echo "shell
: outer-pre
: LK1
<$LK1> EK1
<$EK1>"
3426 echo "we
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3427 !echo "shell
: outer-post
: LK1
<$LK1> EK1
<$EK1>"
3431 check 2 0 "${MBOX}" '1903030743 1131'
3436 t_macro_param_shift() {
3439 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3442 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3447 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3448 if [ $# > 1 ] || [ $ignerr == '' ]
3453 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3455 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3459 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
3464 call t2 1 you get four args
3465 echo t1.1: $?';' ignerr ($ignerr) should not exist
3466 call t2 1 you get 'three args'
3467 echo t1.2: $?';' ignerr ($ignerr) should not exist
3468 call t2 1 you 'get two args'
3469 echo t1.3: $?';' ignerr ($ignerr) should not exist
3470 call t2 1 'you get one arg'
3471 echo t1.4: $?';' ignerr ($ignerr) should not exist
3472 ignerr call t2 '' 'you get one arg'
3473 echo t1.5: $?';' ignerr ($ignerr) should not exist
3478 check 1 0 "${MBOX}" '1402489146 1682'
3486 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3487 commandalias x
echo '$?/$^ERRNAME $res'
3488 vput addrcodec res e
1 <doog@def
>
3490 eval vput addrcodec res d
$res
3492 vput addrcodec res e
2 .
<doog@def
>
3494 eval vput addrcodec res d
$res
3496 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
3498 eval vput addrcodec res d
$res
3500 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
3502 eval vput addrcodec res d
$res
3504 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
3506 eval vput addrcodec res d
$res
3509 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
3511 eval vput addrcodec res d
$res
3513 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
3515 eval vput addrcodec res d
$res
3517 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
3519 eval vput addrcodec res d
$res
3521 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
3523 eval vput addrcodec res d
$res
3525 vput addrcodec res
+e
8 \
3526 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
3528 eval vput addrcodec res d
$res
3530 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
3532 eval vput addrcodec res d
$res
3534 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
3536 eval vput addrcodec res d
$res
3538 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
3540 eval vput addrcodec res d
$res
3542 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
3544 eval vput addrcodec res d
$res
3546 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
3548 eval vput addrcodec res d
$res
3550 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
3552 eval vput addrcodec res d
$res
3554 vput addrcodec res
+e
15 \
3555 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
3557 eval vput addrcodec res d
$res
3559 vput addrcodec res
+e
16 \
3560 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
3562 eval vput addrcodec res d
$res
3564 vput addrcodec res
+e
17 \
3565 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
3567 eval vput addrcodec res d
$res
3569 vput addrcodec res
+e
18 \
3570 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
3572 eval vput addrcodec res d
$res
3574 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3576 eval vput addrcodec res d
$res
3579 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
3581 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
3583 eval vput addrcodec res d $res
3586 vput addrcodec res \
3587 +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
3589 eval vput addrcodec res d $res
3592 vput addrcodec res s \
3593 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
3596 # Fix for [f3852f88]
3597 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3599 eval vput addrcodec res d $res
3601 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
3603 eval vput addrcodec res d $res
3607 check 1 0 "${MBOX}" '1047317989 2612'
3609 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3610 commandalias x
echo '$?/$^ERRNAME $res'
3612 mlsubscribe isa2@list
3614 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3616 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
3618 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3620 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
3622 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3624 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
3628 check
2 0 "${MBOX}" '1391779299 104'
3630 if have_feat idna
; then
3631 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
3632 commandalias x echo '$?/$^ERRNAME $res'
3633 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
3635 eval vput addrcodec res d $res
3637 vput addrcodec res e <du@blödiän> du
3639 eval vput addrcodec res d $res
3641 vput addrcodec res e du <du@blödiän>
3643 eval vput addrcodec res d $res
3645 vput addrcodec res e <du@blödiän>
3647 eval vput addrcodec res d $res
3649 vput addrcodec res e du@blödiän
3651 eval vput addrcodec res d $res
3655 check idna 0 "${MBOX}" '498775983 326'
3657 t_echoskip 'idna:[!IDNA]'
3666 if have_feat cmd-csop; then :; else
3667 t_echoskip '[!CMD_CSOP]'
3672 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3673 commandalias x
echo '$?/$^ERRNAME :$res:'
3675 vput csop res
find you y
;x
3676 vput csop res
find you o
;x
3677 vput csop res
find you u
;x
3678 vput csop res
find you yo
;x
3679 vput csop res
find you ou
;x
3680 vput csop res
find you you
;x
3682 vput csop res
find you Y
;x
3683 vput csop res
find? you Y
;x
3684 vput csop res
find?
case you O
;x
3685 vput csop res
find? you U
;x
3686 vput csop res
find?ca you yO
;x
3687 vput csop res
find? you oU
;x
3688 vput csop res
find? you YoU
;x
3690 vput csop res
find 'bananarama' 'nana';x
3691 vput csop res
find 'bananarama' 'bana';x
3692 vput csop res
find 'bananarama' 'Bana';x
3693 vput csop res
find 'bananarama' 'rama';x
3695 vput csop res
find?
'bananarama' 'nana';x
3696 vput csop res
find?
'bananarama' 'bana';x
3697 vput csop res
find?
'bananarama' 'Bana';x
3698 vput csop res
find?
'bananarama' 'rama';x
3700 vput csop res substring
'bananarama' 1;x
3701 vput csop res substring
'bananarama' 3;x
3702 vput csop res substring
'bananarama' 5;x
3703 vput csop res substring
'bananarama' 7;x
3704 vput csop res substring
'bananarama' 9;x
3705 vput csop res substring
'bananarama' 10;x
3706 vput csop res substring
'bananarama' 1 3;x
3707 vput csop res substring
'bananarama' 3 3;x
3708 vput csop res substring
'bananarama' 5 3;x
3709 vput csop res substring
'bananarama' 7 3;x
3710 vput csop res substring
'bananarama' 9 3;x
3711 vput csop res substring
'bananarama' 10 3;x
3713 vput csop res substring
'bananarama' -1;x
3714 vput csop res substring
'bananarama' -3;x
3715 vput csop res substring
'bananarama' -5;x
3716 vput csop res substring
'bananarama' -7;x
3717 vput csop res substring
'bananarama' -9;x
3718 vput csop res substring
'bananarama' -10;x
3719 vput csop res substring
'bananarama' 1 -3;x
3720 vput csop res substring
'bananarama' 3 -3;x
3721 vput csop res substring
'bananarama' 5 -3;x
3722 vput csop res substring
'bananarama' 7 -3;x
3723 vput csop res substring
'bananarama' 9 -3;x
3724 vput csop res substring
'bananarama' 10 -3;x
3726 vput csop res trim
'Cocoon Cocoon';x
3727 vput csop res trim
' Cocoon Cocoon ';x
3728 vput csop res trim-front
'Cocoon Cocoon';x
3729 vput csop res trim-front
' Cocoon Cocoon ';x
3730 vput csop res trim-end
'Cocoon Cocoon';x
3731 vput csop res trim-end
' Cocoon Cocoon ';x
3734 check
1 0 "${MBOX}" '1892119538 755'
3742 if have_feat cmd-vexpr
; then :; else
3743 t_echoskip
'[!CMD_VEXPR]'
3748 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
3749 commandalias x
echo '$?/$^ERRNAME $res'
3751 vput vexpr res
= 9223372036854775807;x
3752 vput vexpr res
= 9223372036854775808;x
3753 vput vexpr res
= u9223372036854775808
;x
3754 vput vexpr res
=?
9223372036854775808;x
3755 vput vexpr res
= -9223372036854775808;x
3756 vput vexpr res
= -9223372036854775809;x
3757 vput vexpr res
=?saturated
-9223372036854775809;x
3758 vput vexpr res
= U9223372036854775809
;x
3761 0b0111111111111111111111111111111111111111111111111111111111111111
;x
3763 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3765 S0b1000000000000000000000000000000000000000000000000000000000000000
;x
3767 U0b1000000000000000000000000000000000000000000000000000000000000000
;x
3769 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3771 0b1000000000000000000000000000000000000000000000000000000000000000
;x
3773 -0b1000000000000000000000000000000000000000000000000000000000000000;x
3775 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3777 S0b1000000000000000000000000000000000000000000000000000000000000001
;x
3779 -0b1000000000000000000000000000000000000000000000000000000000000001;x
3781 U0b1000000000000000000000000000000000000000000000000000000000000001
;x
3783 vput vexpr res
= 0777777777777777777777;x
3784 vput vexpr res
= S01000000000000000000000
;x
3785 vput vexpr res
=? S01000000000000000000000
;x
3786 vput vexpr res
= U01000000000000000000000
;x
3787 vput vexpr res
= 01000000000000000000000;x
3788 vput vexpr res
=?satur
01000000000000000000000;x
3789 vput vexpr res
= -01000000000000000000000;x
3790 vput vexpr res
= S01000000000000000000001
;x
3791 vput vexpr res
=?sat S01000000000000000000001
;x
3792 vput vexpr res
= -01000000000000000000001;x
3793 vput vexpr res
= U01000000000000000000001
;x
3795 vput vexpr res
= 0x7FFFFFFFFFFFFFFF;x
3796 vput vexpr res
= S0x8000000000000000
;x
3797 vput vexpr res
=? S0x8000000000000000
;x
3798 vput vexpr res
= U0x8000000000000000
;x
3799 vput vexpr res
= 0x8000000000000000;x
3800 vput vexpr res
=?
0x8000000000000000;x
3801 vput vexpr res
= -0x8000000000000000;x
3802 vput vexpr res
= S0x8000000000000001
;x
3803 vput vexpr res
=? S0x8000000000000001
;x
3804 vput vexpr res
= -0x8000000000000001;x
3805 vput vexpr res
= u0x8000000000000001
;x
3806 vput vexpr res
= 9223372036854775809;x
3807 vput vexpr res
=?
9223372036854775809;x
3808 vput vexpr res
= u9223372036854775809
;x
3810 vput vexpr res ~
0;x
3811 vput vexpr res ~
1;x
3812 vput vexpr res ~
-1;x
3814 vput vexpr res
- 0;x
3815 vput vexpr res
- 1;x
3816 vput vexpr res
- -1;x
3817 vput vexpr res
- -0xAFFE;x
3818 vput vexpr res
- 0xAFFE;x
3819 vput vexpr res
- u0x8000000000000001
;x
3820 vput vexpr res
- 0x8000000000000001;x
3821 vput vexpr res
- 0x8000000000000001;x
3822 vput vexpr res
- 9223372036854775809;x
3823 vput vexpr res
-?
9223372036854775809;x
3825 vput vexpr res
+ 0;x
3826 vput vexpr res
+ 1;x
3827 vput vexpr res
+ -1;x
3828 vput vexpr res
+ -0xAFFE;x
3829 vput vexpr res
+ 0xAFFE;x
3830 vput vexpr res
+ u0x8000000000000001
;x
3831 vput vexpr res
+ 0x8000000000000001;x
3832 vput vexpr res
+ 9223372036854775809;x
3833 vput vexpr res
+?
9223372036854775809;x
3835 vput vexpr res
+ 0 0;x
3836 vput vexpr res
+ 0 1;x
3837 vput vexpr res
+ 1 1;x
3839 vput vexpr res
+ 9223372036854775807 0;x
3840 vput vexpr res
+ 9223372036854775807 1;x
3841 vput vexpr res
+?
9223372036854775807 1;x
3842 vput vexpr res
+ 0 9223372036854775807;x
3843 vput vexpr res
+ 1 9223372036854775807;x
3844 vput vexpr res
+?
1 9223372036854775807;x
3846 vput vexpr res
+ -9223372036854775808 0;x
3847 vput vexpr res
+ -9223372036854775808 -1;x
3848 vput vexpr res
+?
-9223372036854775808 -1;x
3849 vput vexpr res
+ 0 -9223372036854775808;x
3850 vput vexpr res
+ -1 -9223372036854775808;x
3851 vput vexpr res
+?
-1 -9223372036854775808;x
3853 vput vexpr res
- 0 0;x
3854 vput vexpr res
- 0 1;x
3855 vput vexpr res
- 1 1;x
3857 vput vexpr res
- 9223372036854775807 0;x
3858 vput vexpr res
- 9223372036854775807 -1;x
3859 vput vexpr res
-?
9223372036854775807 -1;x
3860 vput vexpr res
- 0 9223372036854775807;x
3861 vput vexpr res
- -1 9223372036854775807;x
3862 vput vexpr res
- -2 9223372036854775807;x
3863 vput vexpr res
-?
-2 9223372036854775807;x
3865 vput vexpr res
- -9223372036854775808 +0;x
3866 vput vexpr res
- -9223372036854775808 +1;x
3867 vput vexpr res
-?
-9223372036854775808 +1;x
3868 vput vexpr res
- 0 -9223372036854775808;x
3869 vput vexpr res
- +1 -9223372036854775808;x
3870 vput vexpr res
-?
+1 -9223372036854775808;x
3872 vput vexpr res
+ -13 -2;x
3873 vput vexpr res
- 0 0;x
3874 vput vexpr res
- 0 1;x
3875 vput vexpr res
- 1 1;x
3876 vput vexpr res
- -13 -2;x
3878 vput vexpr res
* 0 0;x
3879 vput vexpr res
* 0 1;x
3880 vput vexpr res
* 1 1;x
3881 vput vexpr res
* -13 -2;x
3883 vput vexpr res
/ 0 0;x
3884 vput vexpr res
/ 0 1;x
3885 vput vexpr res
/ 1 1;x
3886 vput vexpr res
/ -13 -2;x
3888 vput vexpr res
% 0 0;x
3889 vput vexpr res
% 0 1;x
3890 vput vexpr res
% 1 1;x
3891 vput vexpr res
% -13 -2;x
3893 vput vexpr res pbase
10 u0x8000000000000001
;x
3894 vput vexpr res pbase
16 0x8000000000000001;x
3895 vput vexpr res pbase
16 s0x8000000000000001
;x
3896 vput vexpr res pbase
16 u0x8000000000000001
;x
3897 vput vexpr res pbase
36 0x8000000000000001;x
3898 vput vexpr res pbase
36 u0x8000000000000001
;x
3901 check numeric
0 "${MBOX}" '163128733 2519'
3903 if have_feat regex
; then
3904 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
3905 commandalias x echo '$?/$^ERRNAME :$res:'
3907 vput vexpr res regex you y;x
3908 vput vexpr res regex you o;x
3909 vput vexpr res regex you u;x
3910 vput vexpr res regex you yo;x
3911 vput vexpr res regex you ou;x
3912 vput vexpr res regex you you;x
3914 vput vexpr res regex you Y;x
3915 vput vexpr res regex? you Y;x
3916 vput vexpr res regex? you O;x
3917 vput vexpr res regex? you U;x
3918 vput vexpr res regex? you yO;x
3919 vput vexpr res regex? you oU;x
3920 vput vexpr res regex? you YoU;x
3922 vput vexpr res regex 'bananarama' 'nana';x
3923 vput vexpr res regex 'bananarama' 'bana';x
3924 vput vexpr res regex 'bananarama' 'Bana';x
3925 vput vexpr res regex 'bananarama' 'rama';x
3927 vput vexpr res regex? 'bananarama' 'nana';x
3928 vput vexpr res regex? 'bananarama' 'bana';x
3929 vput vexpr res regex? 'bananarama' 'Bana';x
3930 vput vexpr res regex? 'bananarama' 'rama';x
3932 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3933 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3934 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0';x
3935 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0';x
3937 vput vexpr res regex? 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}';x
3938 vput vexpr res regex? 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2';x
3939 vput vexpr res regex? 'bananarama' 'Bana(.+)' '\$1\$0';x
3940 vput vexpr res regex? 'bananarama' '(.+)rama' '\$1\$0';x
3942 vput vexpr res regex 'banana' '(club )?(.*)(nana)(.*)' \
3943 '\$1\${2}\$4\${3}rama';x
3944 vput vexpr res regex 'Banana' '(club )?(.*)(nana)(.*)' \
3945 '\$1\$2\${2}\$2\$4\${3}rama';x
3946 vput vexpr res regex 'Club banana' '(club )?(.*)(nana)(.*)' \
3947 '\$1\${2}\$4\${3}rama';x
3951 check regex 0 "${MBOX}" '2831099111 542'
3953 t_echoskip 'regex:[!REGEX]'
3962 if have_feat cmd-vexpr; then :; else
3963 t_echoskip '[!CMD_VEXPR]'
3968 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
3973 vput vexpr j
'&' $i 7
3979 vput vexpr j
'&' $i 7
3985 echo ! The end
for $1
3989 # Transport $?/$! up the call chain
3995 wysh
set i
=$? j
=$
! k
=$^ERRNAME
3999 echo ! The end
for $1
4000 return $i $^ERR-BUSY
4004 # Up and down it goes
4011 vput vexpr k
- $1 $2
4015 echo "# <$i/$j> .. "
4019 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
4022 echo ! The end
for $1=$i/$2
4026 return $i $^ERR-BUSY
4032 call w1
0; echo ?
=$?
!=$
!; echo -----;
4033 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
4034 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
4037 check
1 0 "${MBOX}" '1572045517 5922'
4045 if have_feat cmd-vexpr
; then :; else
4046 t_echoskip
'[!CMD_VEXPR]'
4051 ${cat} <<- '__EOT' | \
4052 ${MAILX} ${ARGS} -Snomemdebug \
4053 -Smax=${LOOPS_MAX} \
4058 if [ $i -le "$max" ]
4059 vput vexpr j '&' $i 7
4065 echo ! The end for $1/$2
4067 return $i $^ERR-BUSY
4078 echo ?=$? !=$^ERRNAME
4081 echo ?=$? !=$^ERRNAME
4083 echo ?=$? !=$^ERRNAME
4087 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
4088 check_ex0 1-${LOOPS_BIG} ${i}
4089 check
1-${LOOPS_BIG} - "${MBOX}" '1069764187 47161'
4091 check_ex0
1-${LOOPS_SMALL} ${i}
4092 check
1-${LOOPS_SMALL} - "${MBOX}" '859201011 3894'
4097 if have_feat uistrings
; then
4098 ${cat} <<- '__EOT' > "${BODY}"
4103 vput vexpr j '&' $i 7
4109 echo ! The end for $1
4112 echo would be err with errexit
4121 echo zwei, ?=$? !=$!
4122 localopts yes; set errexit
4124 echo drei, ?=$? !=$^ERRNAME
4126 echo vier, ?=$? !=$^ERRNAME, this is an error
4129 echo outer 1, ?=$? !=$^ERRNAME
4131 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
4133 echo outer 3, ?=$? !=$^ERRNAME
4134 echo this is definitely an error
4137 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
4138 -Snomemdebug > "${MBOX}" 2>&1
4139 check 2 0 "${MBOX}" '4036613316 4184'
4141 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
4142 -Snomemdebug > "${MBOX}" 2>&1
4143 check 3 1 "${MBOX}" '3179757785 2787'
4145 t_echoskip '2-3:[!UISTRINGS]'
4154 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4155 vpospar set hey, "'you ", world!
4156 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4157 vput vpospar x quote; echo x<$x>
4158 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4159 vput vpospar y quote;echo y<$y>
4160 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4161 eval vpospar set ${y};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4162 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4165 echo infun2:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4166 vput vpospar z quote;echo infun2:z<$z>
4170 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4171 vput vpospar y quote;echo infun:y<$y>
4172 eval vpospar set ${x};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4173 vpospar clear;echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4175 echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4176 eval vpospar set ${y};echo infun:$?/$^ERRNAME/$#:$*/"$@"/<$1><$2><$3><$4>
4179 call infun This "in a" fun
4180 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4181 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4183 check 1 0 "${MBOX}" '155175639 866'
4186 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4188 echo ifs<$ifs> ifs-ws<$ifs-ws>
4189 vpospar set hey, "'you ", world!
4190 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4191 vput vpospar x quote; echo x<$x>
4192 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4193 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4196 echo ifs<$ifs> ifs-ws<$ifs-ws>
4197 vpospar set hey, "'you ", world!
4198 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4200 vput vpospar x quote; echo x<$x>
4201 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4202 eval vpospar set ${x};\
4203 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4206 echo ifs<$ifs> ifs-ws<$ifs-ws>
4207 vpospar set hey, "'you ", world!
4208 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4210 vput vpospar x quote; echo x<$x>
4211 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4212 eval vpospar set ${x};\
4213 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
4215 check ifs 0 "${MBOX}" '2015927702 706'
4223 ${cat} > ./.t.sh <<- '___'; ${cat} > ./.t.rc <<- '___'
4226 printf " (1/$#: <$1>)"
4228 if [ $# -gt 0 ]; then
4242 printf yyy;yyy 'xxx' "b\$'\t'u ' "
4243 printf xxx;xxx arg ,b u.
4244 printf xxx;xxx arg , .
4245 printf xxx;xxx arg ,ball.
4251 echon " (1/$#: <$1>)"
4266 echon yyy;call yyy '\call xxx' "b\$'\t'u ' "
4267 echon xxx;call xxx arg ,b u.
4268 echon xxx;call xxx arg , .
4269 echon xxx;call xxx arg ,ball.
4272 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
4273 check 1 0 "${MBOX}" '41566293 164'
4275 #${SHELL} ./.t.sh > ./.tshout 2>&1
4276 #check disproof-1 0 ./.tshout '41566293 164'
4284 ${cat} <<- '__EOT' > .tin
4285 hey1, "'you ", world!
4286 hey2, "'you ", bugs bunny!
4291 ${cat} <<- '__EOT' |\
4292 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4293 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4298 unset a b c;read a b c;x
4299 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4301 check 1 0 "${MBOX}" '1527910147 173'
4303 ${cat} <<- '__EOT' > .tin2
4304 hey2.0,:"'you ",:world!:mars.:
4305 hey2.1,:"'you ",:world!
4306 hey2.2,:"'you ",:bugs bunny!
4312 ${cat} <<- '__EOT' |\
4313 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
4314 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4322 unset a b c;read a b c;x
4324 readctl remove 6;echo readctl remove:$?/$^ERRNAME
4326 check ifs 0 "${MBOX}" '890153490 298'
4328 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
4329 commandalias x echo '$?/$^ERRNAME / <$d>'
4332 wysh set d;readall d;x
4333 readctl create .tin2
4335 wysh set d;readall d;x
4336 readctl remove .tin;echo $?/$^ERRNAME;\
4337 readctl remove .tin2;echo $?/$^ERRNAME
4338 echo '### now with empty lines'
4339 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
4340 readctl create .temptynl;echo $?/$^ERRNAME
4342 readctl remove .temptynl;echo $?/$^ERRNAME
4344 check readall 0 "${MBOX}" '4113506527 405'
4349 t_readsh() { # TODO not enough
4352 ${cat} <<- '__EOT' > .tin
4353 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4354 from@exam.ple ' diet spliced <from@exam.ple> ' 'a'
4355 from@exam.ple ' diet spliced <from@exam.ple> ''a'
4356 from@exam.ple' diet spliced <from@exam.ple> ''a'
4359 ${cat} <<- '__EOT' |\
4360 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
4361 commandalias x echo '$?/$^ERRNAME / <$a><$b><$c>'
4366 unset a b c;read a b c;x
4367 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
4369 check 1 0 "${MBOX}" '2955084684 291'
4377 t__x1_msg > ./.tmbox
4380 </dev/null ${MAILX} ${ARGS} -Rf -Y '# Do not care much on error UISTRINGS
4383 \echo --- $?/$^ERRNAME, 2
4385 \echo --- $?/$^ERRNAME, 3
4386 \if "$features" !% +uistrings,
4387 \echoerr reproducible_build: Invalid field name cannot be ignored: ba:l
4389 \headerpick type ignore \
4390 from_ mail-followup-to in-reply-to DATE MESSAGE-ID STATUS ba:l
4391 \echo --- $?/$^ERRNAME, 4
4392 \if "$features" !% +uistrings,
4393 \echo "#headerpick type retain currently covers no fields"
4396 \echo --- $?/$^ERRNAME, 5
4398 \echo --- $?/$^ERRNAME, 6
4399 \unheaderpick type ignore from_ DATE STATUS
4400 \echo --- $?/$^ERRNAME, 7
4401 \if "$features" !% +uistrings,
4402 \echo "#headerpick type retain currently covers no fields"
4405 \echo --- $?/$^ERRNAME, 8
4407 \echo --- $?/$^ERRNAME, 9
4408 \if "$features" =% +uistrings,
4409 \unheaderpick type ignore from_ ba:l
4410 \wysh set x=$? y=$^ERRNAME
4412 \echoerr reproducible_build: Field not ignored: from_
4413 \echoerr reproducible_build: Field not ignored: ba:l
4417 \unheaderpick type ignore *
4418 \echo --- $?/$^ERRNAME, 11
4419 \if "$features" !% +uistrings,
4420 \echo "#headerpick type retain currently covers no fields"
4421 \echo "#headerpick type ignore currently covers no fields"
4424 \echo --- $?/$^ERRNAME, 12
4426 \echo --- $?/$^ERRNAME, 13 ---
4427 # ' ./.tmbox >./.tall 2>&1
4428 check 1 0 ./.tall '2481904228 2273'
4431 if have_feat uistrings; then
4432 have_feat regex && i='3515512395 2378' || i='4201290332 2378'
4433 </dev/null ${MAILX} ${ARGS} -Y '#
4434 \headerpick type retain \
4435 bcc cc date from sender subject to \
4436 message-id mail-followup-to reply-to user-agent
4437 \echo --- $?/$^ERRNAME, 1
4438 \headerpick forward retain \
4439 cc date from message-id list-id sender subject to \
4440 mail-followup-to reply-to
4441 \echo --- $?/$^ERRNAME, 2
4442 \headerpick save ignore ^Original-.*$ ^X-.*$ ^DKIM.*$
4443 \echo --- $?/$^ERRNAME, 3
4444 \headerpick top retain To Cc
4445 \echo --- $?/$^ERRNAME, 4 ---
4447 \echo --- $?/$^ERRNAME, 5
4449 \echo --- $?/$^ERRNAME, 6
4451 \echo --- $?/$^ERRNAME, 7
4453 \echo --- $?/$^ERRNAME, 8
4455 \echo --- $?/$^ERRNAME, 9 ---
4456 \unheaderpick type retain message-id mail-followup-to reply-to user-agent
4457 \echo --- $?/$^ERRNAME, 10
4458 \unheaderpick save ignore ^X-.*$ ^DKIM.*$
4459 \echo --- $?/$^ERRNAME, 11
4460 \unheaderpick forward retain *
4461 \echo --- $?/$^ERRNAME, 12 ---
4463 \echo --- $?/$^ERRNAME, 13
4465 \echo --- $?/$^ERRNAME, 14
4467 \echo --- $?/$^ERRNAME, 15 --
4468 \unheaderpick type retain *
4469 \echo --- $?/$^ERRNAME, 16
4470 \unheaderpick forward retain *
4471 \echo --- $?/$^ERRNAME, 17
4472 \unheaderpick save ignore *
4473 \echo --- $?/$^ERRNAME, 18
4474 \unheaderpick top retain *
4475 \echo --- $?/$^ERRNAME, 19 --
4477 \echo --- $?/$^ERRNAME, 20
4479 check 2 0 ./.tall "${i}"
4481 t_echoskip '2:[!UISTRINGS]'
4488 # Send/RFC absolute basics {{{
4489 t_can_send_rfc() { # {{{
4492 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub.1 \
4495 check 1 0 "${MBOX}" '550126528 126'
4496 check 1-err - .terr
'4294967295 0'
4498 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2 \
4499 -b bcc@no
.1 -b bcc@no
.2 -b bcc@no
.3 \
4500 -c cc@no
.1 -c cc@no
.2 -c cc@no
.3 \
4501 to@no
.1 to@no
.2 to@no
.3 \
4503 check
2 0 "${MBOX}" '3259888945 324'
4504 check
2-err - .terr
'4294967295 0'
4506 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -s Sub
.2no \
4507 -b bcc@no
.1\ \ bcc@no
.2 -b bcc@no
.3 \
4508 -c cc@no
.1,cc@no
.2 -c cc@no
.3 \
4509 to@no
.1,to@no
.2 to@no
.3 \
4511 check
2no
4 "${MBOX}" '3350946897 468'
4512 if have_feat uistrings
; then
4513 check
2no-err
- .terr
'3397557940 190'
4515 check
2no-err
- .terr
'4294967295 0'
4518 # XXX NOTE we cannot test "cc@no1 <cc@no.2>" because our stupid parser
4519 # XXX would not treat that as a list but look for "," as a separator
4520 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.3 \
4521 -T 'bcc?single: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4522 -T cc?si\ \
:\ \
'cc@no.1, <cc@no.2>' -T cc
:\ cc@no
.3 \
4523 -T to?
:\ to@no
.1,'<to@no.2>' -T to
:\ to@no
.3 \
4525 check
3 0 "${MBOX}" '1453534480 678'
4526 check
3-err - .terr
'4294967295 0'
4528 </dev
/null
${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sfullnames -s Sub
.4 \
4529 -T 'bcc: bcc@no.1, <bcc@no.2>' -T bcc
:\ bcc@no
.3 \
4530 -T cc
:\
'cc@no.1, <cc@no.2>' -T cc\ \
:\ \ cc@no
.3 \
4531 -T to\
:to@no
.1,'<to@no.2>' -T to
:\ to@no
.3 \
4533 check
4 0 "${MBOX}" '535767201 882'
4534 check
4-err - .terr
'4294967295 0'
4536 # Two test with a file-based MTA
4537 "${cat}" <<-_EOT > .tmta.sh
4539 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4540 "${cat}" && echo pardauz && echo) > "${MBOX}"
4542 ${chmod} 0755 .tmta.sh
4544 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s Sub.mta-1 \
4545 receiver@number
.1 > .
/.terr
2>&1
4546 check
5 0 "${MBOX}" '2384401657 138'
4547 check
5-err - .terr
'4294967295 0'
4549 </dev
/null
${MAILX} ${ARGS} -Smta=file://.
/.tmta.sh
-s Sub.mta-2 \
4550 receiver@number
.1 > .
/.terr
2>&1
4551 check
6 0 "${MBOX}" '3006460737 138'
4552 check
6-err - .terr
'4294967295 0'
4555 </dev
/null
${MAILX} ${ARGS} -Smta=test \
4564 check
7 0 .
/.tall
'951018449 138'
4566 ## *record*, *outfolder*, with and without *mta-bcc-ok*
4568 xfolder
=`${pwd}`/.tfolder
4570 "${cat}" <<-_EOT > .tmta.sh
4572 (echo 'From reproducible_build Wed Oct 2 01:50:07 1996' &&
4573 "${cat}" && echo 'ARGS: '"\${@}" && echo) > "${MBOX}"
4575 ${chmod} 0755 .tmta.sh
4578 </dev
/null
${MAILX} ${ARGS} -Smta=./.tmta.sh -Sfolder="${xfolder}" \
4581 -b bcc@no.1 -b bcc@no.2 -b bcc@no.3 \
4582 -c cc@no.1 -c cc@no.2 -c cc@no.3 \
4583 to@no.1 to@no.2 to@no.3 \
4584 receiver@number.1 > ./.terr 2>&1
4589 check 8 0 "${MBOX}" '1365032629 292'
4590 check 8-1 - .terr '4294967295 0'
4592 t_it -Snomta-bcc-ok -Srecord=.trec9
4593 check 9 0 "${MBOX}" '1365032629 292'
4594 check 9-1 - .terr '4294967295 0'
4595 check 9-2 - ./.trec9 '160206230 221'
4597 t_it -Srecord=.trec10
4598 check 10 0 "${MBOX}" '3085765596 326'
4599 check 10-1 - .terr '4294967295 0'
4600 check 10-2 - ./.trec10 '160206230 221'
4602 t_it -Snomta-bcc-ok -Srecord=.trec11 -Soutfolder
4603 check 11 0 "${MBOX}" '1365032629 292'
4604 check 11-1 - .terr '4294967295 0'
4605 check 11-2 - ./.tfolder/.trec11 '160206230 221'
4606 # That is appends to an MBOX
4607 t_it -Srecord=.trec11 -Soutfolder
4608 check 12 0 "${MBOX}" '3085765596 326'
4609 check 12-1 - .terr '4294967295 0'
4610 check 12-2 - ./.tfolder/.trec11 '1618754846 442'
4614 ## From: and Sender:
4615 </dev/null ${MAILX} ${ARGS} -s ubject \
4616 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
4617 to@exam.ple > "${MBOX}" 2>&1
4618 check 13 0 "${MBOX}" '143390417 169'
4620 # ..if From: is single mailbox and Sender: is same, no Sender:
4621 </dev/null ${MAILX} ${ARGS} -s ubject \
4622 -S from=a@b.org -S sender=a@b.org \
4623 to@exam.ple > "${MBOX}" 2>&1
4624 check 14 0 "${MBOX}" '1604962737 135'
4630 # Alternates and ML related address massage etc. somewhere else
4632 XARGS=${ARGS} # TODO v15-compat
4633 ARGS="${ARGS} -Sv15-compat=y
"
4635 t__gen_msg subject reply from 1 to 2 cc 2 > "${MBOX}"
4637 ## Base (does not test "recipient record
")
4639 </dev/null ${MAILX} ${ARGS} -Rf \
4644 set fullnames escape=!; '${1}'
4648 set recipients-in-cc nofullnames; '${1}'
4652 unset recipients-in-cc; '${1}'
4657 "${MBOX}" > ./.tall 2>&1
4662 check 1 0 ./.tall '4164251531 851'
4664 check 2 0 ./.tall '3034955332 591'
4665 t_it reply 'set flipr;'
4666 check 3 0 ./.tall '3034955332 591'
4667 t_it Reply 'set flipr;'
4668 check 4 0 ./.tall '4164251531 851'
4671 t__gen_msg subject reply-no-addr > ./.tnoaddr
4673 # MBOX will deduce addressee from From_ line..
4674 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4676 File ./.tnoaddr; reply # Takes addressee from From_ line :(
4680 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4683 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4684 echo 3:$?/$^ERRNAME; reply # cannot test IO,NOTSUP,INVAL
4690 check 5 0 ./.tall '3088217220 382'
4691 if have_feat uistrings; then
4692 check 6 - ./.terr '2514745519 544'
4694 t_echoskip '6:[!UISTRINGS]'
4697 # ..but Maildir will not
4698 if have_feat maildir; then
4699 ${mkdir} -p .tdir .tdir/tmp .tdir/cur .tdir/new
4700 ${sed} 1d < ./.tnoaddr > .tdir/new/sillyname
4702 </dev/null ${MAILX} ${ARGS} -R -Sescape=! \
4708 File '"${MBOX}"'; set ea=$expandaddr expandaddr=-all; reply
4711 echo 2:$?/$^ERRNAME; set expandaddr=$ea; reply 10 # BADMSG
4712 echo 3:$?/$^ERRNAME;reply # cannot test IO,NOTSUP,INVAL
4718 check 7 0 ./.tall '3631170341 244'
4719 if have_feat uistrings; then
4720 check 8 - ./.terr '1074346767 629'
4722 t_echoskip '8:[!UISTRINGS]'
4726 ## Ensure action on multiple messages
4727 t__gen_msg subject reply2 from from2@exam.ple body body2 >> "${MBOX}"
4730 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! \
4737 echo 1:$?/$^ERRNAME; '${2}' 1 2
4742 "${MBOX}" > ./.tall 2>&1
4743 check ${3} 0 ./.tall '283309820 502'
4744 if [ ${#} -eq 4 ]; then
4746 check ${3}-1 - ./.tlst '1649520021 12'
4747 check ${3}-2 - ./from1 '1501109193 347'
4748 check ${3}-3 - ./from2 '2154231432 137'
4753 t_it respond Respond 10
4754 t_it followup Followup 11 yes
4755 ${rm} -f from1 from2
4757 ## *record*, *outfolder* (reuses $MBOX)
4761 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4768 echo 1:$?/$^ERRNAME; '${2}' 1 2
4771 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4776 echo 3:$?/$^ERRNAME; '${2}' 1 2
4779 echo 4:$?/$^ERRNAME; set outfolder norecord
4785 echo 1:$?/$^ERRNAME; '${2}' 1 2
4788 echo 2:$?/$^ERRNAME; set record=.trec'${4}'; '${1}' 1 2
4793 echo 3:$?/$^ERRNAME; '${2}' 1 2
4798 "${MBOX}" > ./.tall 2>&1
4799 check ${3} 0 ./.tall '3410330303 2008'
4800 if [ ${#} -ne 5 ]; then
4801 check ${4} - ./.trec${4} '3044885336 484'
4802 check ${4}-1 - ./.tfolder/.trec${4} '3044885336 484'
4804 [ -f ./.trec${4} ]; check_exn0 ${4}
4806 check ${4}-1 - ./.tlst '1649520021 12'
4807 check ${4}-2 - ./from1 '2668975631 694'
4808 check ${4}-3 - ./from2 '225462887 274'
4809 [ -f ./.tfolder/.trec${4} ]; check_exn0 ${4}-4
4810 ( cd .tfolder && echo * > ./.tlst )
4811 check ${4}-5 - ./.tfolder/.tlst '1649520021 12'
4812 check ${4}-6 - ./.tfolder/from1 '2668975631 694'
4813 check ${4}-7 - ./.tfolder/from2 '225462887 274'
4817 t_it reply Reply 12 13
4818 t_it respond Respond 14 15
4819 t_it followup Followup 16 17 yes
4820 #${rm} -f from1 from2
4822 ## Quoting (if not cmd_escapes related)
4824 t__x2_msg > ./.tmbox
4827 set indentprefix=" |
" quote
4831 set quote=noheading quote-inject-head
4835 headerpick type retain cc date from message-id reply-to subject to
4840 set quote=allheaders
4844 set quote-inject-head=%% quote-inject-tail=%% quote=headers
4849 quote-inject-head='"\$
'"'\\
4850 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4852 quote-inject-tail='"\$
'"'\\
4853 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
4858 set showname datefield=%%y nodatefield-markout-older indentprefix=\\ :
4862 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
4863 -Sescape=! -Sindentprefix=' >' \
4864 ./.tmbox >./.tall 2>&1
4866 ${cat} ./.tall >> "${MBOX}"
4867 check 18 - "${MBOX}" '385267528 3926'
4869 # quote-as-attachment, fullnames
4870 </dev/null ${MAILX} ${ARGS} -Rf \
4872 -S quote-as-attachment \
4873 -Y reply -Y yb1 -Y !. \
4874 -Y 'unset quote-as-attachment' \
4875 -Y 'reply;yb2' -Y !. \
4876 -Y 'set quote-as-attachment fullnames' \
4877 -Y ';reply;yb3' -Y !. \
4878 ./.tmbox >./.tall 2>&1
4879 check 19 0 ./.tall '2774517283 2571'
4881 # Moreover, quoting of several parts with all*
4882 t__gen_mimemsg from 'ex1@am.ple' subject for-repl > ./.tmbox
4883 check 20 0 ./.tmbox '1874764424 668'
4885 have_feat filter-html-tagsoup && ck='946925637 1105' || ck='3587432511 1165'
4886 </dev/null ${MAILX} ${ARGS} -Rf \
4887 -Sescape=! -Sindentprefix=' |' \
4888 -Y 'set quote=allheaders' \
4890 -Y 'set quote=allbodies' \
4893 ./.tmbox >./.tall 2>&1
4894 check 21 0 ./.tall "${ck}"
4896 ARGS=${XARGS} # TODO v15-compat
4903 ARGS="${ARGS} -Sv15-compat=y
"
4905 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
4906 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
4908 ## Base (does not test "recipient record
")
4910 </dev/null ${MAILX} ${ARGS} -Rf \
4911 -Y ${1}' . "du
<ex1@am.ple
>"
4914 echo 1:$?/$^ERRNAME; echoerr 1:done
4915 set fullnames escape=!
4916 '${1}' 1 "du
<ex2@am.ple
>"
4919 echo 2:$?/$^ERRNAME; echoerr 2:done
4921 set nofullnames ea=$expandaddr expandaddr=-all
4922 '${1}' ` "du
<ex3@am.ple
>"
4925 echo 3:$?/$^ERRNAME; echoerr 3:done
4927 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
4930 echo 4:$?/$^ERRNAME; echoerr 4:done
4931 '${1}' # TODO not yet possible b5 !.
4932 echo 5:$?/$^ERRNAME; echoerr 5:done
4934 '${1}' 1 2 ex6@am.ple
4939 echo 6:$?/$^ERRNAME; echoerr 6:done
4940 set forward-add-cc fullnames
4944 echo 7:$?/$^ERRNAME; echoerr 7:done
4949 echo 8:$?/$^ERRNAME; echoerr 8:done
4951 "${MBOX}" > ./.tall 2>./.terr
4956 check 1 0 ./.tall '2356713156 2219'
4957 if have_feat uistrings && have_feat docstrings; then
4958 check 2 - ./.terr '3273108824 335'
4960 t_echoskip '2:[!UISTRINGS]'
4964 check 3 0 ./.tall '2356713156 2219'
4965 if have_feat uistrings && have_feat docstrings; then
4966 check 4 - ./.terr '447176534 355'
4968 t_echoskip '4:[!UISTRINGS]'
4972 ## *record*, *outfolder* (reuses $MBOX)
4976 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
4981 echo 1:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 1 ex2@am.ple
4984 echo 2:$?/$^ERRNAME; set outfolder norecord; '${1}' 2 ex1@am.ple
4987 echo 3:$?/$^ERRNAME; set record=.trec'${2}'; '${1}' 2 ex2@am.ple
4992 "${MBOX}" > ./.tall 2>&1
4993 check ${2} 0 ./.tall '3180366037 1212'
4994 if [ ${#} -ne 4 ]; then
4995 check ${3}-1 - ./.trec${2} '1769129556 304'
4996 check ${3}-2 - ./.tfolder/.trec${2} '2335391111 284'
4998 [ -f ./.trec${2} ]; check_exn0 ${3}
5000 check ${3}-1 - ./.tlst '2020171298 8'
5001 check ${3}-2 - ./ex1 '1512529673 304'
5002 check ${3}-3 - ./ex2 '1769129556 304'
5003 [ -f ./.tfolder/.trec${2} ]; check_exn0 ${3}-4
5004 ( cd .tfolder && echo * > ./.tlst )
5005 check ${3}-5 - ./.tfolder/.tlst '2020171298 8'
5006 check ${3}-6 - ./.tfolder/ex1 '2016773910 284'
5007 check ${3}-7 - ./.tfolder/ex2 '2335391111 284'
5012 t_it Forward 7 8 yes
5015 ## Injections, headerpick selection
5017 t__x2_msg > ./.tmbox
5020 set quote=noheading forward-inject-head
5021 forward 1 ex1@am.ple
5024 headerpick forward retain cc from subject to
5025 forward 1 ex1@am.ple
5028 unheaderpick forward retain *
5029 forward 1 ex1@am.ple
5032 headerpick forward ignore in-reply-to reply-to message-id status
5033 set forward-inject-head=%% forward-inject-tail=%%
5034 forward 1 ex1@am.ple
5037 set forward-inject-head='"\$
'"'\\
5038 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5040 forward-inject-tail='"\$
'"'\\
5041 (%%%%a
=%%a
%%%%d
=%%d
%%%%f
=%%f
%%%%i
=%%i
%%%%n
=%%n
%%%%r
=%%r
)\\
5043 forward 1 ex1@am.ple
5046 set showname datefield=%%y nodatefield-markout-older
5047 forward 1 ex1@am.ple
5050 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
5052 ./.tmbox >./.tall 2>&1
5054 ${cat} ./.tall >> "${MBOX}"
5055 check 9 - "${MBOX}" '2976943913 2916'
5057 # forward-as-attachment
5058 </dev/null ${MAILX} ${ARGS} -Rf \
5060 -S forward-inject-head=.head. \
5061 -S forward-inject-tail=.tail. \
5062 -S forward-as-attachment \
5063 -Y 'headerpick forward retain subject to from' \
5064 -Y 'forward ex1@am.ple' -Y b1 -Y !. \
5065 -Y 'unset forward-as-attachment' \
5066 -Y 'forward ex1@am.ple;b2' -Y !. \
5067 ./.tmbox >./.tall 2>&1
5068 check 10 0 ./.tall '799103633 1250'
5077 ARGS="${ARGS} -Sv15-compat=y
"
5079 t__gen_msg subject fwd1 body origb1 from 1 to 2 > "${MBOX}"
5080 t__gen_msg subject fwd2 body origb2 from 1 to 1 >> "${MBOX}"
5084 </dev/null ${MAILX} ${ARGS} -Rf \
5085 -Y ${1}' . "du
<ex1@am.ple
>"
5086 echo 1:$?/$^ERRNAME; echoerr 1:done
5087 set fullnames escape=!
5088 '${1}' 1 "du
, da
<ex2@am.ple
>"
5089 echo 2:$?/$^ERRNAME; echoerr 2:done
5091 set nofullnames ea=$expandaddr expandaddr=-all
5092 '${1}' ` "du
<ex3@am.ple
>"
5093 echo 3:$?/$^ERRNAME; echoerr 3:done
5095 '${1}' ` ex4-nono@am.ple ex4@am.ple # the first is a non-match msglist
5096 echo 4:$?/$^ERRNAME; echoerr 4:done
5097 '${1}' # TODO not yet possible b5 !.
5098 echo 5:$?/$^ERRNAME; echoerr 5:done
5100 '${1}' 1 2 ex6@am.ple
5101 echo 6:$?/$^ERRNAME; echoerr 6:done
5103 "${MBOX}" > ./.tall 2>./.terr
5108 check 1 0 ./.tall '1461006932 1305'
5109 if have_feat uistrings; then
5110 check 2 - ./.terr '138360532 210'
5112 t_echoskip '2:[!UISTRINGS]'
5116 check 3 0 ./.tall '3674535444 958'
5117 if have_feat uistrings; then
5118 check 4 - ./.terr '138360532 210'
5120 t_echoskip '4:[!UISTRINGS]'
5123 ## *record*, *outfolder* (reuses $MBOX)
5127 </dev/null ${MAILX} ${ARGS} -Rf -Sescape=! -Sfolder=`${pwd}`/.tfolder \
5129 set record=.trec'${2}'; '${1}' 1 ex1@am.ple
5130 echo 1:$?/$^ERRNAME; set record-resent; '${1}' 1 ex2@am.ple
5131 echo 2:$?/$^ERRNAME; set outfolder norecord-resent; '${1}' 2 ex1@am.ple
5132 echo 3:$?/$^ERRNAME; set record-resent; '${1}' 2 ex2@am.ple
5135 "${MBOX}" > ./.tall 2>&1
5137 if [ ${#} -ne 3 ]; then
5138 check ${2} - ./.tall '1711347390 992'
5139 check ${3}-1 - ./.trec${2} '2840978700 249'
5140 check ${3}-2 - ./.tfolder/.trec${2} '3219997964 229'
5142 check ${2} - ./.tall '1391418931 724'
5143 check ${3}-1 - ./.trec${2} '473817710 182'
5144 check ${3}-2 - ./.tfolder/.trec${2} '2174632404 162'
5160 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5161 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5162 check 1 - "${MBOX}" '137107341 324' # for flag test
5165 </dev/null ${MAILX} ${ARGS} -f \
5174 copy .tf1 # no auto-advance
5183 !'"${chmod}"' 0444 .tf3
5187 "${MBOX}" > ./.tallx 2>./.terr
5190 if have_feat uistrings; then # TODO
5191 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5192 ${sed} '$d' < ./.tallx > ./.tall
5194 ${mv} ./.tallx ./.tall
5196 if [ -n "${HONOURS_READONLY}" ]; then
5197 n2_1=2-1 cs2_1='1913702840 1121'
5198 n2_4=2-4 cs2_4='3642131968 344'
5199 n2_5=2-5 cs2_5='2617612897 112'
5201 n2_1=2-1-nrdonly cs2_1='1962556153 1146'
5202 n2_4=2-4-nrdonly cs2_4='3733058190 688'
5203 n2_5=2-5-nrdonly cs2_5='3989834342 80'
5205 check ${n2_1} - ./.tall "${cs2_1}"
5206 check 2-2 - ./.tf1 '686654461 334'
5207 check 2-3 - ./.tf2 '1931512953 162'
5208 check ${n2_4} - ./.tf3 "${cs2_4}"
5209 if have_feat uistrings; then
5210 check ${n2_5} - ./.terr "${cs2_5}"
5212 t_echoskip '2-5:[!UISTRINGS]'
5216 check 3 - "${MBOX}" '1477662071 346'
5220 t__gen_msg subject Copy1 from 1 to 1 body 'Body1' > "${MBOX}"
5221 t__gen_msg subject Copy2 from 1 to 1 body 'Body2' >> "${MBOX}"
5222 t__gen_msg subject Copy3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5223 check ${1} - "${MBOX}" '2667292819 473' # for flag test
5225 </dev/null ${MAILX} ${ARGS} -f \
5244 "${MBOX}" > ./.tallx 2>&1
5250 if have_feat uistrings; then # TODO
5251 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5252 ${sed} '$d' < ./.tallx > ./.tall
5254 ${mv} ./.tallx ./.tall
5257 check 5-2 - ./.tlst '1058655452 9'
5258 check 5-3 - ./.tall '1543702808 1617'
5259 check 5-4 - ./from1 '1031912635 999'
5260 check 5-5 - ./ex '2400630246 149'
5261 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5264 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5266 if have_feat uistrings; then # TODO
5267 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5268 ${sed} '$d' < ./.tallx > ./.tall
5270 ${mv} ./.tallx ./.tall
5272 echo * .tfolder/* > ./.tlst
5273 check 6-2 - ./.tlst '1865898363 29'
5274 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5275 check 6-4 - .tfolder/from1 '1031912635 999'
5276 check 6-5 - .tfolder/ex '2400630246 149'
5279 t__x2_msg > ./.tmbox
5285 headerpick save retain cc date from subject to
5288 unheaderpick save retain *
5291 headerpick save ignore status in-reply-to
5294 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5300 check 7-1 - ./.tall '3805176908 152'
5301 check 7-2 - ./.tout '2447734879 1316'
5306 check 8-1 - ./.tall '1044700686 136'
5307 check 8-2 - ./mr2 '2447734879 1316'
5308 check 8-3 - ./.tlst '3190056903 4'
5316 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5317 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5318 check 1 - "${MBOX}" '3634443864 324' # for flag test
5321 </dev/null ${MAILX} ${ARGS} -f \
5330 save .tf1 # no auto-advance
5339 !'"${chmod}"' 0444 .tf3
5343 "${MBOX}" > ./.tallx 2>./.terr
5346 if have_feat uistrings; then # TODO
5347 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5348 ${sed} '$d' < ./.tallx > ./.tall
5350 ${mv} ./.tallx ./.tall
5352 if [ -n "${HONOURS_READONLY}" ]; then
5353 n2_1=2-1 cs2_1='2335843514 1121'
5354 n2_4=2-4 cs2_4='970407001 344'
5355 n2_5=2-5 cs2_5='45116475 112'
5357 n2_1=2-1-nrdonly cs2_1='1736244784 1146'
5358 n2_4=2-4-nrdonly cs2_4='3903872811 688'
5359 n2_5=2-5-nrdonly cs2_5='720724138 80'
5361 check ${n2_1} - ./.tall "${cs2_1}"
5362 check 2-2 - ./.tf1 '2435434321 334'
5363 check 2-3 - ./.tf2 '920652966 162'
5364 check ${n2_4} - ./.tf3 "${cs2_4}"
5365 if have_feat uistrings; then
5366 check ${n2_5} - ./.terr "${cs2_5}"
5368 t_echoskip '2-5:[!UISTRINGS]'
5372 check 3 - "${MBOX}" '1219692400 346'
5376 t__gen_msg subject Save1 from 1 to 1 body 'Body1' > "${MBOX}"
5377 t__gen_msg subject Save2 from 1 to 1 body 'Body2' >> "${MBOX}"
5378 t__gen_msg subject Save3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5379 check ${1} - "${MBOX}" '1391391227 473' # for flag test
5381 </dev/null ${MAILX} ${ARGS} -f \
5400 "${MBOX}" > ./.tallx 2>&1
5406 if have_feat uistrings; then # TODO
5407 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5408 ${sed} '$d' < ./.tallx > ./.tall
5410 ${mv} ./.tallx ./.tall
5413 check 5-2 - ./.tlst '1058655452 9'
5414 check 5-3 - ./.tall '3418590770 1617'
5415 check 5-4 - ./from1 '1462882526 999'
5416 check 5-5 - ./ex '2153575326 149'
5417 ${rm} -f ./.tlst ./.tall ./from1 ./ex
5420 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5422 if have_feat uistrings; then # TODO
5423 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5424 ${sed} '$d' < ./.tallx > ./.tall
5426 ${mv} ./.tallx ./.tall
5428 echo * .tfolder/* > ./.tlst
5429 check 6-2 - ./.tlst '1865898363 29'
5430 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5431 check 6-4 - .tfolder/from1 '1462882526 999'
5432 check 6-5 - .tfolder/ex '2153575326 149'
5437 t__x2_msg > ./.tmbox
5438 check ${1} - ./.tmbox '561523988 397'
5441 [ ${#} -gt 2 ] && a='-S MBOX=./.tmboxx'
5442 [ ${#} -gt 3 ] && a="${a}"' -S inbox=./.tmbox'
5448 headerpick save retain cc date from subject to
5451 unheaderpick save retain *
5454 headerpick save ignore status in-reply-to
5457 #' | ${MAILX} ${ARGS} -f ${a} ./.tmbox > ./.tall 2>&1
5461 t_it 7 'save ./.tout'
5463 check 7-1 - ./.tall '4190949581 312'
5464 check 7-2 - ./.tout '2447734879 1316'
5465 check 7-3 - ./.tmbox '561523988 397'
5470 check 8-1 - ./.tall '2109832180 296'
5471 check 8-2 - ./mr2 '2447734879 1316'
5472 check 8-3 - ./.tlst '3190056903 4'
5473 check 8-3 - ./.tmbox '561523988 397'
5475 # saves in $MBOX without argument
5478 check 9-1 - ./.tall '652005824 320'
5479 check 9-2 - ./.tmboxx '2447734879 1316'
5480 check 9-3 - ./.tmbox '561523988 397'
5482 # and deletes if editing a primary mailbox
5484 t_it 10 save yes yes
5486 check 10-1 - ./.tall '652005824 320'
5487 check 10-2 - ./.tmboxx '2447734879 1316'
5488 [ -f ./.tmbox ]; check_exn0 10-3
5496 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5497 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5498 check 1 - "${MBOX}" '2967134193 324' # for flag test
5501 </dev/null ${MAILX} ${ARGS} -f \
5510 !touch .tf2; '"${chmod}"' 0444 .tf2
5513 !'"${chmod}"' 0644 .tf2
5518 "${MBOX}" > ./.tallx 2>./.terr
5521 if have_feat uistrings; then # TODO
5522 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5523 ${sed} '$d' < ./.tallx > ./.tall
5525 ${mv} ./.tallx ./.tall
5527 if [ -n "${HONOURS_READONLY}" ]; then
5528 n2_1=2-1 cs2_1='1641443074 491'
5529 n2_4=2-4 cs2_4='602144474 155'
5531 n2_1=2-1-nrdonly cs2_1='3045412111 492'
5532 n2_4=2-4-nrdonly cs2_4='2197157669 201'
5534 check ${n2_1} - ./.tall "${cs2_1}"
5535 check 2-2 - ./.tf1 '1473857906 162'
5536 check 2-3 - ./.tf2 '331229810 162'
5537 if have_feat uistrings; then
5538 check ${n2_4} - ./.terr "${cs2_4}"
5540 t_echoskip '2-4:[!UISTRINGS]'
5544 check 3 - "${MBOX}" '4294967295 0'
5548 t__gen_msg subject Move1 from 1 to 1 body 'Body1' > "${MBOX}"
5549 t__gen_msg subject Move2 from 1 to 1 body 'Body2' >> "${MBOX}"
5550 t__gen_msg subject Move3 from ex@am.ple to 1 body 'Body3' >> "${MBOX}"
5551 check ${1} - "${MBOX}" '2826896131 473' # for flag test
5553 </dev/null ${MAILX} ${ARGS} -f \
5572 "${MBOX}" > ./.tallx 2>./.terr
5578 if have_feat uistrings; then # TODO
5579 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5580 ${sed} '$d' < ./.tallx > ./.tall
5582 ${mv} ./.tallx ./.tall
5585 check 5-2 - ./.tlst '1058655452 9'
5586 check 5-3 - ./.tall '419037676 870'
5587 if have_feat uistrings; then
5588 check 5-4 - ./.terr '1383646464 86'
5590 t_echoskip '5-4:[!UISTRINGS]'
5592 check 5-5 - ./from1 '3719268580 827'
5593 check 5-6 - ./ex '4262925856 149'
5594 ${rm} -f ./.tlst ./.tall ./.terr ./from1 ./ex
5597 t_it 6 '#' 'set outfolder folder='"`${pwd}`"'/.tfolder'
5599 if have_feat uistrings; then # TODO
5600 ${sed} -e '$bP' -e d -e :P < ./.tallx >> "${ERR}"
5601 ${sed} '$d' < ./.tallx > ./.tall
5603 ${mv} ./.tallx ./.tall
5605 echo * .tfolder/* > ./.tlst
5606 check 6-2 - ./.tlst '1865898363 29'
5607 ${cat} ./.tall >> ${ERR} #check 6-3 - ./.tall # TODO due to folder echoes
5608 check 6-4 - .tfolder/from1 '3719268580 827'
5609 check 6-5 - .tfolder/ex '4262925856 149'
5612 t__x2_msg > ./.tmbox
5618 headerpick save retain cc date from subject to
5621 unheaderpick save retain *
5624 headerpick save ignore status in-reply-to
5627 #' | ${MAILX} ${ARGS} -Rf ./.tmbox > ./.tall 2>&1
5633 check 7-1 - ./.tall '3805176908 152'
5634 check 7-2 - ./.tout '2447734879 1316'
5639 check 8-1 - ./.tall '1044700686 136'
5640 check 8-2 - ./mr2 '2447734879 1316'
5641 check 8-3 - ./.tlst '3190056903 4'
5651 while [ ${i} -lt 113 ]; do
5652 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5653 "${MBOX}" "${i}" "${i}"
5656 ) | ${MAILX} ${ARGS} > .tall 2>&1
5657 check 1 0 "${MBOX}" '1785801373 13336'
5658 check 1-outerr - ./.tall '4294967295 0' # empty file
5660 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
5661 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
5662 check 2 0 .tall '3467540956 8991'
5664 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
5665 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5666 check
3 0 .tall
'2410946529 8998'
5668 # copy only the odd (but the first), move the even
5670 printf 'File "file://%s"\ncopy ' .tmbox2
5672 while [ ${i} -lt 113 ]; do
5676 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
5677 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
5678 check
4 0 .tmbox3
'2554734733 6666'
5679 check
5 - .tall
'2062382804 4517'
5682 printf 'file "file://%s"\nmove ' .tmbox2
5684 while [ ${i} -lt 113 ]; do
5688 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
5689 .tmbox3 .tmbox3 .tmbox2
5690 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
5691 check
6 0 .tmbox3
'1429216753 13336'
5692 if have_feat uistrings
; then
5693 ${sed} 2d
< .tall
> .tallx
5697 check
7 - .tallx
'169518319 13477'
5699 # Invalid MBOXes (after [f4db93b3])
5701 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5702 check 8 0 .tinvmbox '2848412822 118'
5703 check 9 - ./.tall '461280182 33'
5705 echo ' ' > .tinvmbox
5706 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
5707 check
10 0 .tinvmbox
'624770486 120'
5708 check
11 - .
/.tall
'461280182 33'
5710 { echo; echo; } > .tinvmbox
# (not invalid)
5711 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
5712 check 12 0 .tinvmbox '1485640875 119'
5713 check 13 - ./.tall '461280182 33'
5715 # *mbox-rfc4155*, plus
5716 ${cat} <<-_EOT > ./.tinv1
5719 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
5720 Date: Wed, 02 Oct 1996 01:50:07 +0000
5722 Subject: Bad bad message 1
5724 From me to you, blinde Kuh!
5726 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5727 Date: Wed, 02 Oct 1996 01:50:07 +0000
5729 Subject: Bad bad message 2
5731 From me to you, blindes Kalb!
5733 ${cp} ./.tinv1 ./.tinv2
5737 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
5738 \\eval copy * "${2}"
5740 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
5742 ${cat} ./.tinv1 ./.tok >> .tall
5743 check 14 - ./.tall '739301109 616'
5746 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
5747 wysh File ./.tok # Just move away to nowhere
5749 wysh file ./.tinv2 # Fully repaired
5750 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5752 # Equal since [Auto-fix when MBOX had From_ errors on read (Dr. Werner
5754 check 15-1 - ./.tinv1 '4151504442 314'
5755 check 15-2 - ./.tinv2 '4151504442 314'
5757 # *mbox-fcc-and-pcc*
5758 ${cat} > ./.ttmpl <<-'_EOT'
5760 Bcc: | cat >> ./.tpcc1
5762 Subject: fcc and pcc, and *mbox-fcc-and-pcc*
5767 < ./.ttmpl ${MAILX} ${ARGS} -t > "${MBOX}" 2>&1
5768 check
16 0 "${MBOX}" '4294967295 0'
5769 check
17 - .
/.tfcc1
'2301294938 148'
5770 check
18 - .
/.tfcc2
'2301294938 148'
5771 check
19 - .
/.tpcc1
'2301294938 148'
5773 < .
/.ttmpl
${MAILX} ${ARGS} -t -Snombox-fcc-and-pcc > "${MBOX}" 2>&1
5774 check 20 0 "${MBOX}" '4294967295 0'
5775 check 21 - ./.tfcc1 '3629108107 98'
5776 check 22 - ./.tfcc2 '3629108107 98'
5777 check 23 - ./.tpcc1 '2373220256 246'
5779 # More invalid: since in "copy
* X
" messages will be copied in `sort' order,
5780 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5781 # ensure pre-v15 MBOX separation "in between
" messages.., 2019-08-07) that
5782 # could still have created invalid MBOX files!
5783 ${cat} <<-_EOT > ./.tinv1
5786 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5787 Date: Sun, 04 Oct 1998 01:50:07 +0000
5792 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5793 Date: Nix, 01 Oct BAD 01:50:07 +0000
5798 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5799 Date: Fri, 03 Oct 1997 01:50:07 +0000
5804 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5805 Date: Sun, 01 Oct 1995 01:50:07 +0000
5811 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5812 Date: Wed, 02 Oct 1996 01:50:07 +0000
5823 file ./.tinv1' | ${MAILX} ${ARGS} >>${ERR} 2>&1
5824 check 24 0 ./.tinv1 '104184185 560'
5825 check 25 - ./.tinv2 '853754737 510'
5833 if have_feat maildir; then :; else
5834 t_echoskip '[!MAILDIR]'
5841 while [ ${i} -lt 112 ]; do
5842 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
5843 "${MBOX}" "${i}" "${i}"
5846 ) | ${MAILX} ${ARGS}
5847 check 1 0 "${MBOX}" '2366902811 13332'
5853 ' "${MBOX}" .tmdir1 .tmdir1 |
5854 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
5855 check 2 0 .tlst '3442251309 8991'
5858 copy * "maildir
://%s
"
5861 ' "${MBOX}" .tmdir2 .tmdir2 |
5862 ${MAILX} ${ARGS} -Sshowlast > .tlst
5863 check 3 0 .tlst '3524806062 9001'
5865 printf 'File "maildir
://%s
"
5869 ' .tmdir2 .tmbox1 .tmbox1 |
5870 ${MAILX} ${ARGS} -Sshowlast > .tlst
5871 check 4 0 .tmbox1 '4096198846 12772'
5872 check 5 - .tlst '1262452287 8998'
5874 # only the odd (even)
5876 printf 'File "maildir
://%s
"
5879 while [ ${i} -lt 112 ]; do
5881 [ ${j} -eq 1 ] && printf '%s ' "${i}"
5888 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
5889 check 6 0 .tmbox2 '4228337024 6386'
5890 check 7 - .tlst '2078821439 4517'
5893 printf 'file "maildir
://%s
"
5896 while [ ${i} -lt 112 ]; do
5898 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
5906 ' .tmbox2 .tmbox2 .tmdir2
5907 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
5908 check
8 0 .tmbox2
'978751761 12656'
5909 ${sed} 2d
< .tlst
> .tlstx
5910 check
9 - .tlstx
'2172297531 13477'
5912 # More invalid: since in "copy * X" messages will be copied in `sort' order,
5913 # reordering may happen, and before ([f5db11fe] (a_cwrite_save1(): FIX:
5914 # ensure pre-v15 MBOX separation "in between" messages.., 2019-08-07) that
5915 # could still have created invalid MBOX files!
5916 ${cat} <<-_EOT > ./.tinv1
5919 From MAILER-DAEMON-4 Sun Oct 4 01:50:07 1998
5920 Date: Sun, 04 Oct 1998 01:50:07 +0000
5925 From MAILER-DAEMON-0 Fri Oct 28 21:02:21 2147483649
5926 Date: Nix, 01 Oct BAD 01:50:07 +0000
5931 From MAILER-DAEMON-3 Fri Oct 3 01:50:07 1997
5932 Date: Fri, 03 Oct 1997 01:50:07 +0000
5937 From MAILER-DAEMON-1 Sun Oct 1 01:50:07 1995
5938 Date: Sun, 01 Oct 1995 01:50:07 +0000
5944 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
5945 Date: Wed, 02 Oct 1996 01:50:07 +0000
5954 copy * maildir://./.tmdir10
5955 !{ for f in ./.tmdir10/new/*; do echo ===; %s $f; done; } > ./.t11
5959 ' "${cat}" | ${MAILX} ${ARGS} >>${ERR} 2>&1
5960 # Note that substdate() fixes all but one From_ line to $SOURCE_DATE_EPOCH!
5961 check 10 0 ./.t10warp '3551111321 502'
5962 check 11 - ./.t11 '642719592 302'
5968 # MIME and RFC basics {{{
5969 t_mime_if_not_ascii() {
5972 </dev/null ${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
5973 check
1 0 "${MBOX}" '3647956381 106'
5975 </dev
/null
${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
5977 check 2 0 "${MBOX}" '3964303752 274'
5986 printf 'Hey, you.\nFrom me to you\nCiao\n' |
5987 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5989 check
1 0 "${MBOX}" '3835153597 136'
5990 printf 'Hey, you.\n\nFrom me to you\nCiao.\n' |
5991 ${MAILX} ${ARGS} -s Subject -Smime-encoding=8b "${MBOX}" \
5993 check 2 0 "${MBOX}" '63875210 275'
5996 printf 'Hey, you.\n From me to you\nCiao\n' |
5997 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
5999 check
3 0 "${MBOX}" '465798521 412'
6000 printf 'Hey, you.\nFrom me to you\nCiao\n' |
6001 ${MAILX} ${ARGS} -s Subject -Smime-encoding=qp "${MBOX}" \
6003 check 4 0 "${MBOX}" '2075263697 655'
6006 printf 'Hey, you.\n From me to you\nCiao\n' |
6007 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6009 check
5 0 "${MBOX}" '601672771 792'
6010 printf 'Hey, you.\nFrom me to you\nCiao\n' |
6011 ${MAILX} ${ARGS} -s Subject -Smime-encoding=b64 "${MBOX}" \
6013 check 6 0 "${MBOX}" '3926760595 1034'
6018 t_xxxheads_rfc2047() {
6021 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
6022 -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̲' \
6024 check 1 0 "${MBOX}" '3422562347 371'
6026 # Single word (overlong line split -- bad standard! Requires injection of
6027 # artificial data!! But can be prevented by using RFC 2047 encoding)
6029 i=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_
"}'`
6030 echo | ${MAILX} ${ARGS} -s "${i}" "${MBOX}"
6031 check
2 0 "${MBOX}" '3317256266 1714'
6033 # Combination of encoded words, space and tabs of varying sort
6035 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6036 -s "1Abrä Kaspas1 2Abra Katä b_kaspas2 \
6037 3Abrä Kaspas3 4Abrä Kaspas4 5Abrä Kaspas5 \
6038 6Abra Kaspas6 7Abrä Kaspas7 8Abra Kaspas8 \
6039 9Abra Kaspastäb4-3 10Abra Kaspas1 _ 11Abra Katäb1 \
6040 12Abra Kadabrä1 After Tab after Täb this is NUTS" \
6042 check
3 0 "${MBOX}" '786672837 587'
6044 # Overlong multibyte sequence that must be forcefully split
6045 # todo This works even before v15.0, but only by accident
6047 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6048 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6049 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
6050 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄" \
6052 check
4 0 "${MBOX}" '2889557767 655'
6056 echo |
${MAILX} ${ARGS} \
6057 -s "1-1 B2 B3 B4 B5 B6 B\
6058 1-2 B2 B3 B4 B5 B6 B\
6059 1-3 B2 B3 B4 B5 B6 B\
6060 1-4 B2 B3 B4 B5 B6 B\
6061 1-5 B2 B3 B4 B5 B6 B\
6062 1-6 B2 B3 B4 B5 B6 " \
6064 check
5 0 "${MBOX}" '3135161683 293'
6066 # Leading and trailing WS
6068 echo |
${MAILX} ${ARGS} \
6069 -s " 2-1 B2 B3 B4 B5 B6 B\
6070 1-2 B2 B3 B4 B5 B6 B\
6071 1-3 B2 B3 B4 B5 B6 B\
6072 1-4 B2 B3 B4 B5 B6 " \
6074 check
6 0 "${MBOX}" '3221845405 232'
6076 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
6078 echo "Dat Früchtchen riecht häußlich" |
6079 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=test://"$MBOX" \
6081 'Schnödes "Früchtchen" <do@du> (Hä!)'
6082 check
7 0 "${MBOX}" '3681801246 373'
6084 # RFC 2047 in an address field, and iconv involved
6085 if have_feat
iconv; then
6087 ${cat} > .
/.trebox
<<_EOT
6088 From zaza@exam.ple Fri Mar 2 21:31:56 2018
6089 Date: Fri, 2 Mar 2018 20:31:45 +0000
6090 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
6091 To: dude <dude@exam.ple>
6092 Subject: houston(...)
6093 Message-ID: <abra@1>
6095 Content-Type: text/plain; charset=iso-8859-1
6096 Content-Disposition: inline
6097 Content-Transfer-Encoding: 8bit
6100 echo reply |
${MAILX} ${ARGS} ${ADDARG_UNI} \
6101 -Sfullnames -Sreply-in-same-charset \
6102 -Smta=test://"$MBOX" -Rf .
/.trebox
6103 check
8 0 "${MBOX}" '3499372945 285'
6105 t_echoskip
'8:[!ICONV]'
6111 t_iconv_mbyte_base64
() { # TODO uses sed(1) and special *headline*!!
6114 if [ -n "${UTF8_LOCALE}" ] && have_feat multibyte-charsets
&&
6115 have_feat
iconv; then
6116 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1 ||
6117 (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
6120 t_echoskip
'[ICONV/iconv(1):missing conversion(s)]'
6125 t_echoskip
'[no UTF-8 locale or !MULTIBYTE-CHARSETS or !ICONV]'
6130 if (</dev
/null
iconv -f ascii
-t iso-2022-jp
) >/dev
/null
2>&1; then
6131 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6132 -Smta=test://"$MBOX" \
6133 -Sescape=! -Smime-encoding=base64
2>.
/.terr
6134 set ttycharset
=utf-8 sendcharsets
=iso-2022-jp
6136 !s Japanese from UTF-8 to ISO-2022-JP
6137 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6139 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6142 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6144 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
6147 set ttycharset
=iso-2022-jp charset-7bit
=iso-2022-jp sendcharsets
=utf-8
6149 !s Japanese from ISO-2022-JP to UTF-8
, eh
, no
, also ISO-2022-JP
6150 \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
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
6155 \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
6157 \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
6160 # May not presume iconv output as long as roundtrip possible [489a7122]
6162 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6163 < "${MBOX}" > ./.tcksum
6164 check 1 - ./.tcksum '3314001564 516'
6165 check 2 - ./.terr '4294967295 0'
6167 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6168 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6169 -S headline="%>%a%m %-18f %-16d %i%-s" \
6170 -Rf "${MBOX}" >./.tlog 2>&1
6171 check 3 0 ./.twrite '1259742080 686'
6172 #check 4 - ./.tlog '3214068822 2123'
6173 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6174 check 4 - ./.txlog '4083300132 2030'
6176 t_echoskip '1-4:[ICONV/iconv(1):ISO-2022-JP unsupported]'
6179 if (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
6180 ${rm} -f "${MBOX}" ./.twrite
6181 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6182 -Smta=test://"$MBOX" \
6183 -Sescape=! -Smime-encoding=base64 2>./.terr
6184 set ttycharset=utf-8 sendcharsets=euc-jp
6186 !s Japanese from UTF-8 to EUC-JP
6187 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6189 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6192 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
6194 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
6197 set ttycharset=EUC-JP sendcharsets=utf-8
6199 !s Japanese from EUC-JP to UTF-8
6200 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6202 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6205 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
6207 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
6211 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
6212 < "${MBOX}" > ./.tcksum
6213 check 5 - ./.tcksum '1754179361 469'
6214 check 6 - ./.terr '4294967295 0'
6216 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
6217 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
6218 -S headline="%>%a%m %-18f %-16d %i%-s" \
6219 -Rf "${MBOX}" >./.tlog 2>&1
6220 check 7 0 ./.twrite '1259742080 686'
6221 #check 8 - ./.tlog '2506063395 2075'
6222 ${sed} -e '/^\[-- M/d' < ./.tlog > ./.txlog
6223 check 8 - ./.txlog '3192017734 1983'
6225 t_echoskip '5-8:[ICONV/iconv(1):EUC-JP unsupported]'
6231 t_iconv_mainbody() {
6234 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then :; else
6235 t_echoskip '[no UTF-8 locale or !ICONV]'
6240 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6241 -S charset-7bit=us-ascii -S charset-8bit=utf-8 \
6242 -s '–' over-the@rain.bow 2>./.terr
6243 check 1 0 "${MBOX}" '3559538297 250'
6244 check 2 - ./.terr '4294967295 0'
6246 printf '–' | ${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=test://"$MBOX" \
6247 -S charset-7bit=us-ascii -S charset-8bit=us-ascii \
6248 -s '–' over-the@rain.bow 2>./.terr
6250 check 3 - "${MBOX}" '3559538297 250'
6251 if have_feat uistrings; then
6252 check 4 - ./.terr '271380835 121'
6254 t_echoskip '4:[!UISTRINGS]'
6257 # The different iconv(3) implementations use different replacement sequence
6258 # types (character-wise, byte-wise, and the character(s) used differ)
6259 i="${MAILX_ICONV_MODE}"
6260 if [ -n "${i}" ]; then
6261 printf 'p\nx\n' | ${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
6263 check_ex0 5-1-estat ${j}
6264 check 5-1 - ./.terr '4294967295 0'
6265 if [ ${i} -eq 13 ]; then
6266 check 5-2 - ./.tout '189327996 283' # XXX old (before test MTA)
6267 elif [ ${i} -eq 12 ]; then
6268 check 5-3 - ./.tout '1959197095 283' # XXX old (before test MTA)
6269 elif [ ${i} -eq 3 ]; then
6270 check 5-4 - ./.tout '3544755786 278'
6272 check 5-5 - ./.tout '2381160335 278'
6275 t_echoskip '5:[test unsupported]'
6281 t_binary_mainbody() {
6284 printf 'abra\0\nka\r\ndabra' |
6285 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
6287 check 1 0 "${MBOX}" '1629827 239'
6288 check 2 - ./.terr '4294967295 0'
6290 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
6291 ${MAILX} ${ARGS} -Rf \
6292 -Spipe-application/octet-stream="?* ${cat} > ./.tcat" \
6293 "${MBOX}" >./.tall 2>&1
6294 check 3 0 ./.tall '733582513 319'
6295 check 4 - ./.tcat '3817108933 15'
6296 check 5 - ./.twrite '3817108933 15'
6301 t_mime_force_sendout() {
6304 if have_feat iconv; then :; else
6305 t_echoskip '[!ICONV]'
6310 printf '\150\303\274' > ./.tmba
6311 printf 'ha' > ./.tsba
6312 printf '' > "${MBOX}"
6314 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6316 over-the@rain.bow 2>>${ERR}
6317 check 1 4 "${MBOX}" '4294967295 0'
6319 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6320 -s go -Smime-force-sendout \
6321 over-the@rain.bow 2>>${ERR}
6322 check 2 0 "${MBOX}" '1866273282 219'
6324 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6326 -a ./.tmba over-the@rain.bow 2>>${ERR}
6327 check 3 4 "${MBOX}" '1866273282 219'
6329 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6330 -s go -Smime-force-sendout \
6331 -a ./.tmba over-the@rain.bow 2>>${ERR}
6332 check 4 0 "${MBOX}" '644433809 880'
6334 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6336 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6337 check 5 4 "${MBOX}" '644433809 880'
6339 printf ha | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6340 -s go -Smime-force-sendout \
6341 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6342 check 6 0 "${MBOX}" '3172365123 1729'
6344 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6346 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6347 check 7 4 "${MBOX}" '3172365123 1729'
6349 printf '\150\303\244' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6350 -s go -Smime-force-sendout \
6351 -a ./.tsba -a ./.tmba over-the@rain.bow 2>>${ERR}
6352 check 8 0 "${MBOX}" '4002905306 2565'
6357 t_C_opt_customhdr() {
6361 ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6362 -C 'C-One : Custom One Body' \
6363 -C 'C-Two:CustomTwoBody' \
6364 -C 'C-Three: CustomThreeBody ' \
6365 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body, chdr3: chdr3 body ' \
6366 this-goes@nowhere >./.tall 2>&1
6368 ${cat} ./.tall >> "${MBOX}"
6369 check 1 0 "${MBOX}" '2535463301 238'
6372 printf 'm this-goes@nowhere\nbody\n!.
6374 m this-goes2@nowhere\nbody2\n!.
6375 set customhdr=%ccustom1 : custom1 body%c
6376 m this-goes3@nowhere\nbody3\n!.
6377 set customhdr=%ccustom1 : custom1\\, body , \\
6378 custom2: custom2 body , custom-3 : custom3 body ,\\
6379 custom-4:custom4-body %c
6380 m this-goes4@nowhere\nbody4\n!.
6382 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
6383 -C 'C-One : Custom One Body' \
6384 -C 'C-Two:CustomTwoBody' \
6385 -C 'C-Three: CustomThreeBody ' \
6386 -C ' C-Four:CustomFourBody ' \
6387 -C 'C-Five:CustomFiveBody' \
6388 -S customhdr='ch1: b1 , ch2:b2, ch3:b3 ,ch4:b4, ch5: b5 ' \
6391 ${cat} ./.tall >> "${MBOX}"
6392 check 2 0 "${MBOX}" '544085062 1086'
6398 # Operational basics with trivial tests {{{
6402 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
6404 alias a1 ex2@a1.ple "EX3 <ex3@a1.ple>"
6406 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
6408 alias a4 a5 ex1@a4.ple
6410 alias a6 a7 ex1@a6.ple
6424 check 1 0 "${MBOX}" '139467786 277'
6425 check 2 - .tall '1598893942 133'
6427 if have_feat uistrings; then
6428 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6429 commandalias x echo '$?/$^ERRNAME'
6431 alias a:bra! ha@m beb@ra ha@m '' zeb@ra ha@m; x
6433 alias ha@m ham-expansion ha@m '';x
6435 alias beb@ra ceb@ra beb@ra1;x
6437 alias ceb@ra ceb@ra1;x
6455 \alias noexpa@and this@error1;x
6456 \alias ha@m '\noexp@and' expa@and \\noexp@and2;x
6459 \alias noexpa@and2 this@error2;x
6460 \alias expa1@and this@error3;x
6461 \alias expa@and \\expa1@and;x
6466 check 3 0 "${MBOX}" '1513155156 796'
6468 t_echoskip '3:[!UISTRINGS]'
6471 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
6472 # TODO need to somehow provide its contents to the test, then test
6480 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6481 commandalias x echo '$?/$^ERRNAME'
6483 charsetalias latin1 latin15;x
6484 charsetalias latin1;x
6485 charsetalias - latin1;x
6487 charsetalias cp1252 latin1 latin15 utf8 utf8 utf16;x
6488 charsetalias cp1252;x
6489 charsetalias latin15;x
6492 charsetalias - cp1252;x
6493 charsetalias - latin15;x
6494 charsetalias - utf8;x
6496 charsetalias latin1;x
6497 charsetalias - latin1;x
6498 uncharsetalias latin15;x
6499 charsetalias latin1;x
6500 charsetalias - latin1;x
6502 check 1 0 "${MBOX}" '3551595280 433'
6510 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6511 commandalias x echo '$?/$^ERRNAME'
6513 shortcut file1 expansion-of-file1;x
6514 shortcut file2 expansion-of-file2;x
6515 shortcut file3 expansion-of-file3;x
6516 shortcut file4 'expansion of file4' 'file 5' 'expansion of file5';x
6526 check 1 0 "${MBOX}" '1970515669 430'
6534 if have_feat netrc; then :; else
6535 t_echoskip '[!NETRC]'
6541 machine x.local login a1 machine x.local login a2 password p2
6542 machine x.local login a3 password "p 3"
6549 machine *.x.local login a2 password p2-any!
6550 machine y.local login ausr password apass
6554 # and unused default
6555 default login defacc password defpass
6557 ${chmod} 0600 ./.tnetrc
6559 printf 'netrc;echo =$?;netrc c;echo =$?;netr loa;echo =$?;netr s;echo =$?' |
6560 NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6561 check 1 0 "${MBOX}" '2911708535 542'
6563 have_feat uistrings && i='3076722625 893' || i='3808149439 645'
6569 echo ==(re)load cache
6570 netrc load;echo $?/$^ERRNAME
6572 netrc loo a1@x.local
6573 netrc loo a2@x.local
6574 netrc loo a3@x.local
6575 netrc loo a4@x.local
6577 netrc clear;echo $?/$^ERRNAME
6579 netrc loo a2@pop.x.local
6580 netrc loo a2@imap.x.local
6581 netrc loo a2@smtp.x.local
6583 netrc loo a2@nono.smtp.x.local
6584 echo ==[usr@]unknown-host
6586 netrc loo defacc@a.local
6587 netrc loo a1@a.local
6588 ' | NETRC=./.tnetrc ${MAILX} ${ARGS} > "${MBOX}" 2>&1
6589 check 2 0 "${MBOX}" "${i}"
6595 # Operational basics with easy tests {{{
6598 # MTA alias specific part in t_mta_aliases()
6599 # This only tests from command line, rest later on (iff any)
6602 if have_feat uistrings; then :; else
6603 t_echoskip '[!UISTRINGS]'
6608 echo "${cat}" > ./.tcat
6609 ${chmod} 0755 ./.tcat
6612 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6613 -X'alias talias talias@exam.ple' \
6614 './.tfile' ' | ./.tcat > ./.tpipe' 'talias' 'taddr@exam.ple' \
6616 check 1 4 "${MBOX}" '1216011460 138'
6617 check 2 - .tall '4169590008 162'
6620 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6622 -X'alias talias talias@exam.ple' \
6623 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6625 check 3 0 "${MBOX}" '847567042 276'
6626 check 4 - .tall '4294967295 0'
6627 check 5 - .tfile '1216011460 138'
6628 check 6 - .tpipe '1216011460 138'
6631 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6632 -Sexpandaddr=-all,+file,+pipe,+name,+addr \
6633 -X'alias talias talias@exam.ple' \
6634 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6636 check 7 0 "${MBOX}" '3682360102 414'
6637 check 8 - .tall '4294967295 0'
6638 check 9 - .tfile '847567042 276'
6639 check 10 - .tpipe '1216011460 138'
6642 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6643 -Sexpandaddr=-all,+file,-file,+pipe,+name,+addr \
6644 -X'alias talias talias@exam.ple' \
6645 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6647 check 11 4 "${MBOX}" '1010907786 552'
6648 check 12 - .tall '673208446 70'
6649 check 13 - .tfile '847567042 276'
6650 check 14 - .tpipe '1216011460 138'
6652 printf '' > ./.tpipe
6653 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6654 -Sexpandaddr=fail,-all,+file,-file,+pipe,+name,+addr \
6655 -X'alias talias talias@exam.ple' \
6656 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6658 check 15 4 "${MBOX}" '1010907786 552'
6659 check 16 - .tall '3280630252 179'
6660 check 17 - .tfile '847567042 276'
6661 check 18 - .tpipe '4294967295 0'
6664 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6665 -Sexpandaddr=-all,+file,+pipe,-pipe,+name,+addr \
6666 -X'alias talias talias@exam.ple' \
6667 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6669 check 19 4 "${MBOX}" '3359494254 690'
6670 check 20 - .tall '4052857227 91'
6671 check 21 - .tfile '3682360102 414'
6672 check 22 - .tpipe '4294967295 0'
6674 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6675 -Sexpandaddr=fail,-all,+file,+pipe,-pipe,+name,+addr \
6676 -X'alias talias talias@exam.ple' \
6677 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6679 check 23 4 "${MBOX}" '3359494254 690'
6680 check 24 - .tall '2168069102 200'
6681 check 25 - .tfile '3682360102 414'
6682 check 26 - .tpipe '4294967295 0'
6685 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6686 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6687 -X'alias talias talias@exam.ple' \
6688 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6690 check 27 0 "${MBOX}" '3735108703 828'
6691 check 28 - .tall '4294967295 0'
6692 check 29 - .tfile '1010907786 552'
6693 check 30 - .tpipe '1216011460 138'
6695 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6696 -Sexpandaddr=-all,+file,+pipe,+name,-name,+addr \
6697 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6699 check 31 4 "${MBOX}" '4225234603 949'
6700 check 32 - .tall '3486613973 73'
6701 check 33 - .tfile '452731060 673'
6702 check 34 - .tpipe '1905076731 121'
6704 printf '' > ./.tpipe
6705 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6706 -Sexpandaddr=fail,-all,+file,+pipe,+name,-name,+addr \
6707 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6709 check 35 4 "${MBOX}" '4225234603 949'
6710 check 36 - .tall '3032065285 182'
6711 check 37 - .tfile '452731060 673'
6712 check 38 - .tpipe '4294967295 0'
6715 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6716 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6717 -X'alias talias talias@exam.ple' \
6718 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6720 check 39 4 "${MBOX}" '4225234603 949'
6721 check 40 - .tall '3863610168 169'
6722 check 41 - .tfile '1975297706 775'
6723 check 42 - .tpipe '130065764 102'
6725 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6726 -Sexpandaddr=-all,+file,+pipe,+name,+addr,-addr \
6727 -Sadd-file-recipients \
6728 -X'alias talias talias@exam.ple' \
6729 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6731 check 43 4 "${MBOX}" '4225234603 949'
6732 check 44 - .tall '3863610168 169'
6733 check 45 - .tfile '3291831864 911'
6734 check 46 - .tpipe '4072000848 136'
6736 printf '' > ./.tpipe
6737 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6738 -Sexpandaddr=fail,-all,+file,+pipe,+name,+addr,-addr \
6739 -Sadd-file-recipients \
6740 -X'alias talias talias@exam.ple' \
6741 './.tfile' ' | ./.tcat >./.tpipe' 'talias' 'taddr@exam.ple' \
6743 check 47 4 "${MBOX}" '4225234603 949'
6744 check 48 - .tall '851041772 278'
6745 check 49 - .tfile '3291831864 911'
6746 check 50 - .tpipe '4294967295 0'
6749 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6750 -Sexpandaddr=-all,+addr \
6751 'taddr@exam.ple' 'this@@c.example' \
6753 check 51 4 "${MBOX}" '473729143 1070'
6754 check 52 - .tall '2646392129 66'
6756 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6757 -Sexpandaddr=-all,failinvaddr \
6758 'taddr@exam.ple' 'this@@c.example' \
6760 check 53 4 "${MBOX}" '473729143 1070'
6761 check 54 - .tall '887391555 175'
6764 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6765 -Sthis=taddr@exam.ple -Sexpandaddr \
6766 -c '\$this' -b '\$this' '\$this' \
6768 check 55 4 "${MBOX}" '473729143 1070'
6769 check 56 - .tall '1144578880 139'
6771 </dev/null ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -ssub \
6772 -Sthis=taddr@exam.ple -Sexpandaddr=shquote \
6773 -c '\$this' -b '\$this' '\$this' \
6775 check 57 0 "${MBOX}" '398243793 1191'
6776 check 58 - .tall '4294967295 0'
6779 printf '' > "${MBOX}"
6781 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6782 -Sadd-file-recipients \
6783 -Sexpandaddr=-all,+fcc \
6788 check 59 0 "${MBOX}" '4294967295 0'
6789 check 60 - .tall '4294967295 0'
6790 check 61 - .tfile1 '1067276522 124'
6791 check 62 - .tfile2 '1067276522 124'
6793 printf '' > "${MBOX}"
6795 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6796 -Sadd-file-recipients \
6797 -Sexpandaddr=-all,+file \
6802 check 63 0 "${MBOX}" '4294967295 0'
6803 check 64 - .tall '4294967295 0'
6804 check 65 - .tfile1 '2677253527 248'
6805 check 66 - .tfile2 '2677253527 248'
6807 printf '' > "${MBOX}"
6809 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6810 -Sadd-file-recipients \
6811 -Sexpandaddr=-all,+file,-fcc \
6816 check 67 0 "${MBOX}" '4294967295 0'
6817 check 68 - .tall '4294967295 0'
6818 check 69 - .tfile1 '3493511004 372'
6819 check 70 - .tfile2 '3493511004 372'
6821 printf '' > "${MBOX}"
6823 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6824 -Sadd-file-recipients \
6825 -Sexpandaddr=-all,+fcc,-file \
6830 check 71 4 "${MBOX}" '4294967295 0'
6831 check 72 - .tall '203687556 223'
6832 check 73 - .tfile1 '3493511004 372'
6833 check 74 - .tfile2 '3493511004 372'
6835 printf '' > "${MBOX}"
6837 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6838 -Sadd-file-recipients \
6839 -Sexpandaddr=-all,fail,+addr \
6845 check 75 4 "${MBOX}" '4294967295 0'
6846 check 76 - .tall '4060426468 247'
6847 check 77 - .tfile1 '3493511004 372'
6848 check 78 - .tfile2 '3493511004 372'
6851 printf '' > "${MBOX}"
6853 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6854 -Sexpandaddr=fail,domaincheck \
6858 check 79 0 "${MBOX}" '171635532 120'
6859 check 80 - .tall '4294967295 0'
6862 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6863 -Sexpandaddr=domaincheck \
6865 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6867 check 81 4 "${MBOX}" '2659464839 240'
6868 check 82 - .tall '1119895397 158'
6871 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6872 -Sexpandaddr=fail,domaincheck \
6874 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6876 check 83 4 "${MBOX}" '2659464839 240'
6877 check 84 - .tall '1577313789 267'
6880 ${MAILX} ${ARGS} -Snoexpandaddr -Smta=test://"$MBOX" -t -ssub \
6881 -Sexpandaddr=fail,domaincheck \
6882 -Sexpandaddr-domaincheck=exam.ple,tro.uble \
6884 To: one@localhost , Hey two <two@exam.ple>, Trouble <three@tro.uble>
6886 check 85 0 "${MBOX}" '1670655701 410'
6887 check 86 - .tall '4294967295 0'
6893 # after: t_expandaddr
6896 if have_feat mta-aliases; then :; else
6897 t_echoskip '[!MTA_ALIASES]'
6902 ${cat} > ./.tali <<- '__EOT'
6908 ex2@a1.ple, <ex3@a1.ple> ,
6910 a2: ex1@a2.ple , ex2@a2.ple,a2_2
6911 a2_2:ex3@a2.ple,ex4@a2.ple
6924 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6925 -Smta-aliases=./.tali \
6926 -b a3 -c a2 a1 > ./.tall 2>&1
6927 check 1 0 "${MBOX}" '1172368381 238'
6928 check 2 - .tall '4294967295 0'
6930 ## xxx The following are actually *expandaddr* tests!!
6932 # May not send plain names over SMTP!
6934 if have_feat smtp; then
6935 echo | ${MAILX} ${ARGS} \
6936 -Smta=smtp://laber.backe -Ssmtp-auth=none \
6937 -Smta-aliases=./.tali \
6938 -b a3 -c a2 a1 > ./.tall 2>&1
6940 check 4 - "${MBOX}" '1172368381 238'
6943 if [ -n "${mtaali}" ] && have_feat uistrings; then
6944 check 5 - .tall '771616226 179'
6946 t_echoskip '5:[!SMTP/!UISTRINGS]'
6949 # xxx for false-positive SMTP test we would need some mocking
6950 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6951 -Sexpandaddr=fail,-name \
6952 -Smta-aliases=./.tali \
6953 -b a3 -c a2 a1 > ./.tall 2>&1
6955 check 7 - "${MBOX}" '1172368381 238'
6956 if have_feat uistrings; then
6957 check 8 - .tall '2834389894 178'
6959 t_echoskip '8:[!UISTRINGS]'
6962 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6963 -Sexpandaddr=-name \
6964 -Smta-aliases=./.tali \
6965 -b a3 -c a2 a1 > ./.tall 2>&1
6966 check 9 4 "${MBOX}" '2322273994 472'
6967 if have_feat uistrings; then
6968 check 10 - .tall '2136559508 69'
6970 t_echoskip '10:[!UISTRINGS]'
6973 echo 'a9:nine@nine.nine' >> ./.tali
6975 echo | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
6976 -Sexpandaddr=fail,-name \
6977 -Smta-aliases=./.tali \
6978 -b a3 -c a2 a1 > ./.tall 2>&1
6979 check 11 0 "${MBOX}" '2422268299 722'
6980 check 12 - .tall '4294967295 0'
6983 set expandaddr=-name
6987 !^header insert bcc a3
6993 !^header insert bcc a3
6996 echo and, once again, check that cache is updated
6997 # Enclose one pipe in quotes: immense stress for our stupid address parser:(
6998 !echo "a10:./.tf1,|%s>./.tp1,\\"|%s > ./.tp2\\",./.tf2" >> ./.tali
7003 !^header insert bcc a3
7006 echo trigger happiness
7010 !^header insert bcc "a3 a10"
7013 ' "${cat}" "${cat}" | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7014 -Smta-aliases=./.tali \
7016 check 13 0 "${MBOX}" '550955032 1469'
7017 if have_feat uistrings; then
7018 check 14 - .tall '1795496020 473'
7020 t_echoskip '14:[!UISTRINGS]'
7022 check 15 - .tf1 '3056269950 249'
7023 check 16 - .tp1 '3056269950 249'
7024 check 17 - .tp2 '3056269950 249'
7025 check 18 - .tf2 '3056269950 249'
7027 # TODO t_mta_aliases: n_ALIAS_MAXEXP is compile-time constant,
7028 # TODO need to somehow provide its contents to the test, then test
7036 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
7037 "${TOPDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=test://"$MBOX"
7038 check 1 0 "${MBOX}" '1314354444 13536'
7040 if (echo | gzip -c) >/dev/null 2>&1; then
7042 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
7043 "${MBOX}" | ${MAILX} ${ARGS} \
7044 -X'filetype gz gzip\ -dc gzip\ -c'
7045 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7046 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
7048 check 2 - ./.t.mbox '1314354444 13536'
7049 check 3 - ./.t.out '635961640 103'
7051 t_echoskip '2:[missing gzip(1)]'
7052 t_echoskip '3:[missing gzip(1)]'
7057 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
7063 -X'filetype gz gzip\ -dc gzip\ -c' \
7064 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
7065 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
7066 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
7068 -X'filetype gz gzip\ -dc gzip\ -c' \
7069 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
7071 check 4 - ./.t.mbox '2687765142 27092'
7072 check 5 - ./.t.out '2230192693 173'
7081 ${MAILX} ${ARGS} -ef ./.t.mbox
7082 echo ${?} > "${MBOX}"
7084 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
7085 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7086 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
7087 ${MAILX} ${ARGS} -Smta=test://./.t.mbox
7089 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
7090 echo ${?} >> "${MBOX}"
7091 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
7092 echo ${?} >> "${MBOX}"
7093 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
7094 echo ${?} >> "${MBOX}"
7095 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
7096 echo ${?} >> "${MBOX}"
7097 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
7098 echo ${?} >> "${MBOX}"
7099 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
7100 echo ${?} >> "${MBOX}"
7101 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
7102 echo ${?} >> "${MBOX}"
7104 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
7105 echo ${?} >> "${MBOX}"
7106 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
7107 echo ${?} >> "${MBOX}"
7108 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
7109 echo ${?} >> "${MBOX}"
7110 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
7111 echo ${?} >> "${MBOX}"
7112 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
7113 echo ${?} >> "${MBOX}"
7114 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
7115 echo ${?} >> "${MBOX}"
7116 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
7117 echo ${?} >> "${MBOX}"
7119 check 1 - "${MBOX}" '1369201287 670'
7123 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
7124 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7125 -r '' -X 'wysh set from=pony1@$LOGNAME'
7126 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
7127 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7128 -r '' -X 'wysh set from=pony2@$LOGNAME'
7129 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
7130 ${MAILX} ${ARGS} -Smta=test://./.t.mbox \
7131 -r '' -X 'wysh set from=pony3@$LOGNAME'
7133 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7134 echo fh-test size; set autosort=size showname showto
7135 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7136 check 2 0 "${MBOX}" '4286438644 413'
7138 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7139 echo fh-test subject; set autosort=subject showname showto
7140 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7141 check 3 0 "${MBOX}" '3208053922 416'
7143 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7144 echo fh-test from; set autosort=from showto
7145 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7146 check 4 0 "${MBOX}" '4209767839 413'
7148 ${MAILX} ${ARGS} -S folder-hook=fh-test -X 'define fh-test {
7149 echo fh-test to; set autosort=to showto
7150 }' -fH ./.t.mbox > "${MBOX}" 2>&1
7151 check 5 0 "${MBOX}" '2785342736 411'
7157 # Simple, if we need more here, place in a later vim fold!
7160 # Three tests for MIME encoding and (a bit) content classification.
7161 # At the same time testing -q FILE, < FILE and -t FILE
7162 t__put_body > ./.tin
7164 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
7165 -a ./.tin -s "`t__put_subject
`" "${MBOX}"
7166 check 1 0 "${MBOX}" '1088822685 6642'
7169 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
7170 -a ./.tin -s "`t__put_subject
`" -q ./.tin "${MBOX}"
7171 check 2 0 "${MBOX}" '1088822685 6642'
7174 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject
`" && echo &&
7176 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
7177 check 3 0 "${MBOX}" '1088822685 6642'
7179 # Check comments in the header
7181 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
7184 # Noch ein Kommentar
7186 # Nachgestelltes Kommentar
7190 check 4 0 "${MBOX}" '4161555890 124'
7193 printf '' > "${MBOX}"
7194 ( echo 'To?single : ./.tout1 .tout2 ' &&
7195 echo 'CC: ./.tcc1 ./.tcc2' &&
7196 echo 'BcC?sin : ./.tbcc1 .tbcc2 ' &&
7197 echo 'To? : ./.tout3 .tout4 ' &&
7200 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -t -Smta=test://"$MBOX"
7201 check 5 0 './.tout1 .tout2' '2948857341 94'
7202 check 6 - ./.tcc1 '2948857341 94'
7203 check 7 - ./.tcc2 '2948857341 94'
7204 check 8 - './.tbcc1 .tbcc2' '2948857341 94'
7205 check 9 - './.tout3 .tout4' '2948857341 94'
7206 check 10 - "${MBOX}" '4294967295 0'
7211 t_message_injections() {
7212 # Simple, if we need more here, place in a later vim fold!
7215 echo mysig > ./.tmysig
7217 echo some-body | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7218 -Smessage-inject-head=head-inject \
7219 -Smessage-inject-tail="`${cat} .
/.tmysig
`"'\ntail-inject' \
7220 ex@am.ple > ./.tall 2>&1
7221 check 1 0 "${MBOX}" '701778583 143'
7222 check 2 - .tall '4294967295 0' # empty file
7225 ${cat} <<-_EOT > ./.template
7229 Subject: This subject is
7231 Body, body, body me.
7233 < ./.template ${MAILX} ${ARGS} -t -Smta=test://"$MBOX" \
7234 -Smessage-inject-head=head-inject \
7235 -Smessage-inject-tail="`${cat} .
/.tmysig
`\n"'tail-inject' \
7237 check 3 0 "${MBOX}" '2189109479 207'
7238 check 4 - .tall '4294967295 0' # empty file
7244 # TODO More should be in compose mode stuff aka digmsg
7247 ${cat} <<-_EOT > ./.tx
7248 From steffen Sun Feb 18 02:48:40 2018
7249 Date: Sun, 18 Feb 2018 02:48:40 +0100
7252 User-Agent: s-nail v14.9.7
7255 From steffen Sun Feb 18 02:48:42 2018
7256 Date: Sun, 18 Feb 2018 02:48:42 +0100
7259 User-Agent: s-nail v14.9.7
7264 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
7265 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
7266 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
7269 '!@ ./.t3 "./.t 4" ""
7277 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
7278 -a ./.t1 -a './.t 2' \
7279 -s attachment-test \
7280 ex@am.ple > ./.tall 2>&1
7281 check 1 0 "${MBOX}" '2484200149 644'
7282 if have_feat uistrings; then
7283 check 2 - .tall '1928331872 720'
7285 t_echoskip '2:[!UISTRINGS]'
7291 !s This the subject is
7292 !@ ./.t3 "#2" "./.t 4" "#1" ""
7302 !@ ./.t3 "#2" "./.t 4" "#1" ""
7310 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7319 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
7333 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7335 check 3 0 "${MBOX}" '3637385058 2335'
7336 if have_feat uistrings; then
7337 check 4 - .tall '2526106274 1910'
7339 t_echoskip '4:[!UISTRINGS]'
7368 | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Rf ./.tx \
7370 check 5 0 "${MBOX}" '1604688179 2316'
7371 if have_feat uistrings; then
7372 check 6 - .tall '1210753005 508'
7374 t_echoskip '6:[!UISTRINGS]'
7380 </dev/null ${MAILX} ${ARGS} -Smta=test \
7381 -Sstealthmua=noagent -Shostname \
7382 -a ./.t1 -a './.t 2' \
7383 -a ./.t3 -a './.t 4' \
7385 ex@am.ple > ./.tall 2>&1
7386 check 7 0 .tall '1003537919 1262'
7389 </dev/null ${MAILX} ${ARGS} -Smta=test -Sttycharset=utf8 \
7390 -a ./.t1=ascii -a './.t 2'=LATin1 \
7391 -a ./.t3=UTF-8 -a './.t 4'=- \
7393 ex@am.ple > ./.tall 2>&1
7394 check 8 0 .tall '361641281 921'
7396 # input+output charset, no iconv
7397 </dev/null ${MAILX} ${ARGS} -Smta=test \
7398 -a ./.t1=ascii#- -a './.t 2'=LATin1#- \
7399 -a ./.t3=UTF-8#- -a './.t 4'=utf8#- \
7401 ex@am.ple > ./.tall 2>&1
7402 check 9 0 .tall '1357456844 933'
7404 if have_feat iconv; then
7405 printf 'ein \303\244ffchen und ein pferd\n' > .t10-f1
7406 if (< .t10-f1 iconv -f ascii -t utf8) >/dev/null 2>&1; then
7407 </dev/null ${MAILX} ${ARGS} --set mta=test \
7408 --set stealthmua=noagent --set hostname \
7409 --attach ./.t1=-#utf8 \
7410 --attach ./.t10-f1=utf8#latin1 \
7412 ex@am.ple > ./.tall 2>&1
7413 check 10 0 .tall '1257664842 877'
7415 t_echoskip '10:[ICONV/iconv(1):missing conversion(1)]'
7418 t_echoskip '10:[!ICONV]'
7425 # (after attachments)
7429 mkdir ./.ttt || exit 1
7433 : > 'diet\ is \curd.txt'
7434 : > 'diet "is" curd.txt'
7436 : > 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
7437 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
7438 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
7439 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
7441 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
7442 -a "./.ttt/ma'ger.txt" -a "./.ttt/mä'ger.txt" \
7443 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is" curd.txt' \
7444 -a ./.ttt/höde-tröge.txt \
7445 -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 \
7446 -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 \
7447 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
7448 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
7450 check 1 0 "${MBOX}" '3720896054 3088'
7452 # `resend
' test, reusing $MBOX
7453 printf "Resend ./.t2\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7454 check 2 0 ./.t2 '3720896054 3088'
7456 printf "resend ./.t3\nx\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
7457 check 3 0 ./.t3 '3979736592 3133'
7459 # And a primitive test for reading messages with invalid parameters
7460 ${cat} <<-_EOT > ./.tinv
7461 From a@b.invalid Wed May 15 12:43:00 2018
7463 Content-Type: multipart/mixed; boundary="1"
7465 This is a multi-part message in MIME format.
7467 Content-Type: text/plain; charset=UTF-8
7468 Content-Transfer-Encoding: quoted-printable
7472 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7473 Content-Transfer-Encoding: 7bit
7474 Content-Disposition: inline
7479 From a@b.invalid Wed May 15 12:43:00 2018
7481 Content-Type: multipart/mixed; boundary="2"
7483 This is a multi-part message in MIME format.
7485 Content-Type: text/plain; charset=UTF-8
7486 Content-Transfer-Encoding: quoted-printable
7490 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7491 Content-Transfer-Encoding: 7bit
7492 Content-Disposition: inline;
7494 filename*998999999999999999999999999999="me-c-d"
7499 From a@b.invalid Wed May 15 12:43:00 2018
7501 Content-Type: multipart/mixed; boundary="3"
7503 This is a multi-part message in MIME format.
7505 Content-Type: text/plain; charset=UTF-8
7506 Content-Transfer-Encoding: quoted-printable
7510 Content-Type: text/plain; name*17="na"; name*18="me-c-t"
7511 Content-Transfer-Encoding: 7bit
7512 Content-Disposition: inline;
7513 filename*0="na"; filename*998="me-c-d"
7520 \\headerpick
type ignore Content-Type Content-Disposition
7523 ' | ${MAILX} ${ARGS} -Rf ./.tinv > ./.tall 2> ./.terr
7524 check 4 0 ./.tall '4094731083 905'
7525 if have_feat uistrings && have_feat iconv; then
7526 check 5 - ./.terr '3713266499 473'
7528 t_echoskip '5:[!UISTRINGS or
!ICONV
]'
7534 t_mime_types_load_control() {
7537 if have_feat uistrings; then :; else
7538 t_echoskip '[!UISTRINGS
]'
7543 ${cat} <<-_EOT > ./.tmts1
7544 ? application/mathml+xml mathml
7546 ${cat} <<-_EOT > ./.tmts2
7547 ? x-conference/x-cooltalk ice
7549 ? application/aga-aga aga
7552 ${cat} <<-_EOT > ./.tmts1.mathml
7553 <head>nonsense ML</head>
7555 ${cat} <<-_EOT > ./.tmts2.ice
7558 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.doom
7559 printf 'of
which the c
\x01rack is coming soon
' > ./.tmtsx.aga
7573 ' "${MBOX}" "${MBOX}" |
7575 -Smimetypes-load-control=f=./.tmts1,f=./.tmts2 \
7578 ${cat} "${MBOX}" >> ./.tout
7579 check 1 - ./.tout '2128819500 2441'
7581 echo type | ${MAILX} ${ARGS} -R \
7582 -Smimetypes-load-control=f=./.tmts1,f=./.tmts3 \
7583 -f "${MBOX}" >> ./.tout 2>&1
7584 check 2 0 ./.tout '1125106528 3642'
7590 # Around state machine, after basics {{{
7594 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" > ./.tall 2>&1
7595 commandalias x echo '$?
/$^ERRNAME
'
7596 commandalias y echo '$?
/$^ERRNAME
<$rv>'
7599 alternates a1@b1 a2@b2 a3@b3;x
7601 vput alternates rv;y
7605 vput alternates rv;y
7607 vput alternates rv;y
7609 vput alternates rv;y
7613 alternates a1@b1 a2@b2 a3@b3
7615 vput alternates rv;y
7617 vput alternates rv;y
7619 vput alternates rv;y
7622 alternates a1@b1 a2@b2 a3@b3
7624 vput alternates rv;y
7626 vput alternates rv;y
7628 vput alternates rv;y
7632 alternates a1@b1 a2@b2 a3@b3
7634 vput alternates rv;y
7638 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
7640 ~s all alternates, only a1@b1 remains
7642 ~b a3@b3 a3@c3 a3@d3
7651 alternates a1@b1 a1@c1 a2@b2 a3@b3
7653 ~s a1@b1 a1@d1, and a3@c3 a3@d3 remain
7655 ~b a3@b3 a3@c3 a3@d3
7662 alternates a1@b1 a2@b2 a3; set allnet
7664 ~s all alternates via allnet, only a1@b1 remains
7666 ~b a3@b3 a3@c3 a3@d3
7675 vput alternates rv;y
7677 vput alternates rv;y
7679 vput alternates rv;y
7681 vput alternates rv;y
7684 vput alternates rv;y
7688 alternates a1@b1 a2@b2;x
7689 vput alternates rv;y
7690 alternates a3@b3 a4@b4;x
7691 vput alternates rv;y
7694 check 1 0 "${MBOX}" '3901995195 542'
7695 if have_feat uistrings; then
7696 check 2 - .tall '1878598364 505'
7698 t_echoskip '2:[!UISTRINGS
]'
7701 # Automatic alternates, also from command line (freezing etc.)
7703 ${cat} <<- __EOT > ./.tin
7704 From trouble-report@desy Wed Jun 6 20:19:28 2018
7705 Date: Wed, 06 Jun 2018 19:58:02 +0200
7706 From: a@b.org, b@b.org, c@c.org
7709 Cc: a@b.org, c@c.org
7711 Message-ID: <20180606175802.dw-cn%a@b.org>
7721 !^header remove subject
7722 !^header insert to b@b.org
7723 !^header insert cc
"a@b.org b@b.org c@c.org"
7726 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7727 -S from=a@b.org,b@b.org,c@c.org -S sender=a@b.org \
7728 -Rf ./.tin > ./.tall 2>&1
7729 check 3 0 "${MBOX}" '3184203976 265'
7730 check 4 - .tall '3604001424 44'
7734 set from
=a@b.org
,b@b.org
,c@c.org sender
=a@b.org
7738 !^header remove subject
7739 !^header insert to b@b.org
7740 !^header insert cc
"a@b.org b@b.org c@c.org"
7743 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! \
7744 -Rf ./.tin > ./.tall 2>&1
7745 check 5 0 "${MBOX}" '98184290 530'
7746 check 6 - .tall '3604001424 44'
7748 # And more, with/out -r (and that Sender: vanishs as necessary)
7749 # TODO -r should be the Sender:, which should automatically propagate to
7750 # TODO From: if possible and/or necessary. It should be possible to
7751 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
7752 # TODO arg as appropriate.
7753 # TODO For now we are a bit messy
7756 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7757 -c a@b.example -c b@b.example -c c@c.example \
7758 -S from=a@b.example,b@b.example,c@c.example \
7759 -S sender=a@b.example \
7760 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7761 check 7 0 "${MBOX}" '4275947318 181'
7762 check 8 - .tout '4275947318 181'
7763 check 9 - .tall '4294967295 0'
7765 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7766 -c a@b.example -c b@b.example -c c@c.example \
7767 -S from=a@b.example,b@b.example,c@c.example \
7768 -S sender=a2@b.example \
7769 -r a@b.example b@b.example ./.tout >./.tall 2>&1
7770 check 10 0 "${MBOX}" '1189494079 383'
7771 check 11 - .tout '1189494079 383'
7772 check 12 - .tall '4294967295 0'
7774 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" -s '-Sfrom + -r ++ test' \
7775 -c a@b.example -c b@b.example -c c@c.example \
7776 -S from=a@b.example,b@b.example,c@c.example \
7777 -S sender=a@b.example \
7778 b@b.example >./.tall 2>&1
7779 check 13 0 "${MBOX}" '2253033142 610'
7780 check 14 - .tall '4294967295 0'
7786 # quote and cmd escapes because this (since Mail times) is worked in the
7787 # big collect() monster of functions
7790 echo 'included
file' > ./.ttxt
7791 { t__x1_msg && t__x2_msg && t__x3_msg &&
7792 t__gen_msg from 'ex4@am.ple
' subject sub4 &&
7793 t__gen_msg from 'eximan
<ex5@am.ple
>' subject sub5 &&
7794 t__gen_mimemsg from 'ex6@am.ple
' subject sub6; } > ./.tmbox
7795 check 1 - ./.tmbox '517368276 2182'
7797 # ~@ is tested with other attachment stuff, ~^ is in compose_edits + digmsg
7799 set Sign
=SignVar sign
=signvar DEAD
=.
/.ttxt
7800 set forward-inject-head quote-inject-head
7801 headerpick
type retain Subject
7802 headerpick forward retain Subject To
7804 !!1 Not escaped. And shell
test last
, right before
!..
7806 !: echo 2 only echoed via colon
7807 !:echo 2:$?
/$^ERRNAME
7808 !_
echo 3 only echoed via underscore
7809 !:echo 3:$?
/$^ERRNAME
7811 !:echo 4:$?
/$^ERRNAME
7812 !<! echo 5 shell
echo included
7813 !:echo 5:$?
/$^ERRNAME
7814 !|
echo 6 pipecmd-pre
; cat; echo 6 pipecmd-post
7815 !:echo 6:$?
/$^ERRNAME
7816 7 and
8 are ~A and ~a
:
7818 !:echo 7:$?
/$^ERRNAME
7820 !:echo 8:$?
/$^ERRNAME
7821 !b
9 added ~b cc
<ex1@am.ple
>
7822 !:echo 9:$?
/$^ERRNAME
7823 !c
10 added ~c c
<ex2@am.ple
>
7824 !:echo 10:$?
/$^ERRNAME
7827 !:echo 11:$?
/$^ERRNAME
7830 !:echo 12:$?
/$^ERRNAME
7833 !:echo 13:$?
/$^ERRNAME
7835 !:echo 13-1:$?
/$^ERRNAME
; set posix
7836 14: ~f
(headerpick
: subject
)
7838 !:echo 14:$?
/$^ERRNAME
; unset posix forward-inject-head quote-inject-head
7839 14.1: ~f
(!posix
: injections
; headerpick
: subject to
)
7841 !:echo 14.1:$?
/$^ERRNAME
; set forward-add-cc
7842 14.2: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr3
)
7844 !:echo 14.2:$?
/$^ERRNAME
; set fullnames
7845 14.3: ~f
(!posix
: headerpick
: subject to
; forward-add-cc adds mr1 fullname
)
7847 !:echo 14.3:$?
/$^ERRNAME
; set nofullnames noforward-add-cc posix
7850 !:echo 15:$?
/$^ERRNAME
7853 !:echo 15.5-1:$?
/$^ERRNAME
7855 !:echo 15.5-2:$?
/$^ERRNAME
7856 16, 17: ~I Sign
, ~i Sign
7858 !:echo 16:$?
/$^ERRNAME
7860 !:echo 17:$?
/$^ERRNAME
7863 !:echo 18:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7866 !:echo 19:$?
/$^ERRNAME
7869 !:echo 20:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7872 !:echo 21:$?
/$^ERRNAME
7873 !: # Initially ~Q was _exactly_ like
7874 28,29 nothing
, 30-34: ~Q
7875 !:echo quote
=<$quote>
7878 !:echo 30:$?
/$^ERRNAME
7881 !:echo 31:$?
/$^ERRNAME
7882 set quote-inject-head quote-inject-tail indentprefix
7883 !:wysh
set quote-inject-head
=%%a quote-inject-tail
=--%%r
7886 !:echo 32:$?
/$^ERRNAME
7887 set noquote-inject-head noquote-inject-tail quote-add-cc
7888 !:set noquote-inject-head noquote-inject-tail quote-add-cc
7891 !:echo 33:$?
/$^ERRNAME
7896 !:echo 34:$?
/$^ERRNAME
7897 unset fullnames
, quote stuff
7898 !:unset quote quote-add-cc fullnames
7901 !:echo 22:$?
/$^ERRNAME
7904 !:echo 23:$?
/$^ERRNAME
7905 24: ~s this new subject
7906 !s
24 did new ~s ubject
7907 !:echo 24:$?
/$^ERRNAME
7908 !t
25 added ~t o
<ex3@am.ple
>
7909 !:echo 25:$?
/$^ERRNAME
7912 !:echo 26.1:$?
/$^ERRNAME
7915 !:echo 26.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7918 !:echo 27.1:$?
/$^ERRNAME
7921 !:echo 27.2:$?
/$^ERRNAME
# XXX forward-add-cc: not expl. tested
7922 and i ~w rite this out to .
/.tmsg
7924 !:echo i ~w
:$?
/$^ERRNAME
7925 !:wysh
set x
=$escape;set escape
=~
7926 ~
!echo shell
command output
7927 ~
:echo shell
:$?
/$^ERRNAME
7928 ~
:wysh
set escape
=$x
7931 !:echo 50 was F
:$?
/$^ERRNAME
7934 !:echo 51 was f
:$?
/$^ERRNAME
7937 !:echo 52 was M
:$?
/$^ERRNAME
7940 !:echo 53 was m
:$?
/$^ERRNAME
; set quote
7943 !:echo 54 was Q
:$?
/$^ERRNAME
7946 !:echo 55 was U
:$?
/$^ERRNAME
7949 !:echo 56 was u
:$?
/$^ERRNAME
7951 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Rf \
7952 -Sescape=! -Sindentprefix=' |
' \
7953 ./.tmbox >./.tall 2>./.terr
7955 ${cat} ./.tall >> "${MBOX}"
7956 have_feat filter-html-tagsoup && ck='3877629593 7699' ||
7957 ck='2138694045 7943'
7958 check 2 - "${MBOX}" "${ck}"
7960 if have_feat uistrings && have_feat iconv; then
7961 check 2-err - ./.terr '3575876476 49'
7963 t_echoskip '2-err:[!UISTRINGS or
!ICONV
]'
7965 check 3 - ./.tmsg '3502750368 4445'
7967 # Simple return/error value after *expandaddr* failure test
7968 have_feat filter-html-tagsoup && ck='115245837 7900' ||
7969 ck='2245417271 8144'
7972 !s This a new subject is
7973 !:set expandaddr
=-name
7982 !:alias abcc one@bcc.invalid
7985 !:set expandaddr
=+addr
7987 !:echo $
!/$?
/$^ERRNAME
7989 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
7991 -s testsub one@to.invalid >./.tall 2>&1
7992 check 4 0 "${MBOX}" "${ck}"
7993 if have_feat uistrings; then
7994 check 5 - ./.tall '2336041127 212'
7996 check 5 - ./.tall '1818580177 59'
7999 # Modifiers and whitespace indulgence
8001 !:remove
'"${MBOX}"'
8014 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8017 -s testsub one@to.invalid >./.tall 2>./.terr
8018 check 6 4 ./.tall '686767281 95'
8019 [ -f "${MBOX}" ]; check_exn0 7
8020 if have_feat uistrings; then
8021 check 8 - ./.terr '1304637795 199'
8023 t_echoskip '8:[!UISTRINGS
]'
8029 t_compose_edits() { # XXX very rudimentary
8030 # after: t_cmd_escapes
8033 # Something to use as "editor"
8034 ${cat} <<-_EOT > ./.ted.sh
8036 ${cat} <<-__EOT > \${1}
8047 ${chmod} 0755 .ted.sh
8049 # > All these are in-a-row!
8051 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~.
' |
8052 ${MAILX} ${ARGS} -Seditheaders >./.tall 2>&1
8053 check 1 0 ./.tout '3993703854 127'
8054 check 2 - ./.tall '4294967295 0'
8056 ${mv} ./.tall ./.tout
8057 printf 'mail .
/.tout
\n~s This subject is
\nThis body is
\n~e
\n~.
' |
8058 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=./.ted.sh >./.tall 2>&1
8059 check 3 0 ./.tout1 '285981670 116'
8060 check 4 - ./.tout2 '285981670 116'
8061 check 5 - ./.tout3 '285981670 116'
8062 check 6 - ./.tout '4294967295 0'
8063 check 7 - ./.tall '4294967295 0'
8064 ${rm} ./.tout1 ./.tout2 ./.tout3
8066 # Note t_compose_hooks adds ~^ stress tests
8067 ${mv} ./.tout ./.tout1
8068 ${mv} ./.tall ./.tout2
8070 mail .
/.tout
\n!s This subject is
\nThis body is
8076 !^header insert fcc .
/.tout
8077 !^header insert fcc .tout1
8078 !^header insert fcc .
/.tout2
8081 !^header remove-at fcc
2
8082 !^header remove-at fcc
2
8086 !^header insert fcc .
/.tout
8090 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8091 check 8 0 ./.tout '3993703854 127'
8092 check 9 - ./.tout1 '4294967295 0'
8093 check 10 - ./.tout2 '4294967295 0'
8094 check 11 - ./.tall '1857504914 342'
8096 # < No longer in-a-row
8098 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >./.tall 2>&1
8100 Subject: Fcc via -t test
8104 check 12 0 ./.ttout '1289478830 122'
8105 check 13 - ./.tall '4294967295 0'
8107 # This test assumes code of `^' and
`digmsg' is shared: see t_digmsg()
8108 echo 'b 1' > ./.t' x 1'
8109 echo 'b 2' > ./.t' x 2'
8112 !^header insert subject subject
8118 !^attachment insert "$i"
8124 !^attachment insert '"'"'./.t x 2'"'"'
8128 !^attachment remove "$i"
8132 !^attachment insert $'"'"'\\$i'"'"'
8140 !^a attribute-set "$i" filenames " cannot wait for you "
8144 !^a attribute-set "$i" filename " cannot wait for you "
8150 !^a attribute-set-at 2 "filename" "private eyes"
8154 !^a attribute-set-at 2 content-description "private c-desc"
8158 !^a attribute-set-at 2 content-ID "priv invd c-id"
8162 !^a attribute-set-at 2 content-TyPE tExT/mARkLO
8166 !^a attribute-set-at 2 content-TyPE ""
8171 ' | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
8172 check 14 0 ./.tall '3491667030 1565'
8173 check 15 - ./.tatt '1685063733 636'
8178 t_digmsg() { # XXX rudimentary; <> compose_edits()?
8182 mail ./.tout\n!s This subject is\nThis body is
8185 !:digmsg - header list
8186 !:digmsg - header show subject
8187 !:digmsg - header show to
8188 !:digmsg - header remove to
8189 !:digmsg - header list
8190 !:digmsg - header show to
8194 !:digmsg - header list; readall x; echon "<$x>";
8195 !:digmsg - header show subject;readall x;echon "<$x>";;
8198 !: # nothing here as is comment
8199 !^header insert fcc ./.tbox
8202 !:digmsg - header list
8203 !:digmsg - header show fcc
8207 !:digmsg - header list
8208 !:digmsg - header show fcc
8209 !:digmsg - header insert fcc ./.tfcc
8218 digmsg 1 header list
8219 digmsg 1 header show subject
8224 digmsg 1 header list; echo $?/$^ERRNAME
8225 digmsg create -; echo $?/$^ERRNAME
8227 ! %s ./.tfcc > ./.tcat
8228 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
8230 mail nowhere@exam.ple
8232 !:digmsg create -; echo $?/$^ERRNAME;\\
8233 digmsg create 1; echo $?/$^ERRNAME;\\
8234 digmsg create 2; echo $?/$^ERRNAME
8236 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8238 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8242 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8244 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8246 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8250 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
8252 !:digmsg remove -; echo $?/$^ERRNAME;\\
8253 digmsg remove 1; echo $?/$^ERRNAME;\\
8254 digmsg remove 2; echo $?/$^ERRNAME;
8256 echo ======= new game new fun!
8259 !:set expandaddr=-name
8261 !^ header insert to two@to.invalid
8264 !^ header insert cc no-name-allowed
8266 !^ header insert cc one@cc.invalid
8269 !:alias abcc one@bcc.invalid
8270 !^ header insert bcc abcc
8272 !:set expandaddr=+addr
8273 !^ header insert bcc abcc
8274 !:echo $!/$?/$^ERRNAME
8277 ' "${cat}" "${sed}" |
8278 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8279 check 1 0 "$MBOX" '665881681 179'
8280 have_feat uistrings && i='4159482825 1372' || i='2254509488 1103'
8281 check 2 - ./.tall "${i}"
8282 check 3 - ./.tfcc '3993703854 127'
8283 check 4 - ./.tempty '4294967295 0'
8284 check 5 - ./.tcat '2157992522 256'
8289 t_on_main_loop_tick() {
8292 if have_feat cmd-vexpr; then :; else
8293 t_echoskip '[!CMD_VEXPR]'
8309 set on-main-loop-tick=omlt
8312 echo calling bla;call bla
8315 ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Sescape=! >./.tall 2>&1
8316 check 1 0 ./.tall '3697651500 130'
8321 t_on_program_exit() {
8325 -X 'define x {' -X 'echo jay' -X '}' -X x -Son-program-exit=x \
8327 check 1 0 ./.tall '2820891503 4'
8330 -X 'define x {' -X 'echo jay' -X '}' -X q -Son-program-exit=x \
8332 check 2 0 ./.tall '2820891503 4'
8334 </dev/null ${MAILX} ${ARGS} \
8335 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8337 check 3 0 ./.tall '2820891503 4'
8339 </dev/null ${MAILX} ${ARGS} -Smta=test://"$MBOX" \
8340 -X 'define x {' -X 'echo jay' -X '}' -Son-program-exit=x \
8341 -s subject -. hey@you \
8343 check 4 0 ./.tall '2820891503 4'
8344 check 5 - "$MBOX" '561900352 118'
8350 # Heavy use of/rely on state machine (behaviour) and basics {{{
8351 t_compose_hooks() { # {{{ TODO monster
8354 if have_feat uistrings &&
8355 have_feat cmd-csop && have_feat cmd-vexpr; then :; else
8356 t_echoskip '[!UISTRINGS/!CMD_CSOP/!CMD_VEXPR]'
8361 (echo line one&&echo line two&&echo line three) > ./.treadctl
8362 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
8364 # Supposed to extend t_compose_edits with ~^ stress tests!
8365 ${cat} <<'__EOT__' > ./.trc
8367 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8370 vput csop es substr "$1" 0 1
8375 define read_mline_res {
8376 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8377 echo $len/$es/$^ERRNAME: $hl
8378 if [ $es -ne $^ERR-NONE ]
8379 xcall bail read_mline_res
8381 \xcall read_mline_res
8386 echo "~^header list"; read hl; echo $hl;\
8387 call xerr "$hl" "in_addr ($xh) 0-1"
8389 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8390 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
8391 echo "~^header insert $xh <${xh}2@exam.ple>";\
8392 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
8393 echo "~^header insert $xh ${xh}3@exam.ple";\
8394 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
8395 echo "~^header list $xh"; read hl; echo $hl;\
8396 call xerr "$hl" "ins_addr $xh 1-4"
8397 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
8400 if [ "$t_remove" == "" ]
8404 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
8405 echo "~^header remove $xh"; read es; vput csop es substr $es 0 3
8407 xcall bail "ins_addr $xh 2-2"
8409 echo "~^header list $xh"; read es; vput csop es substr $es 0 3
8411 xcall bail "ins_addr $xh 2-3"
8413 echo "~^header show $xh"; read es; vput csop es substr $es 0 3
8415 xcall bail "ins_addr $xh 2-4"
8419 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8420 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
8421 echo "~^header insert $xh <${xh}2@exam.ple>";\
8422 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
8423 echo "~^header insert $xh ${xh}3@exam.ple";\
8424 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
8425 echo "~^header list $xh"; read hl; echo $hl;\
8426 call xerr "$hl" "ins_addr $xh 3-4"
8427 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
8430 echo "~^header remove-at $xh 1"; read es;\
8431 call xerr $es "ins_addr $xh 3-6"
8432 echo "~^header remove-at $xh 1"; read es;\
8433 call xerr $es "ins_addr $xh 3-7"
8434 echo "~^header remove-at $xh 1"; read es;\
8435 call xerr $es "ins_addr $xh 3-8"
8436 echo "~^header remove-at $xh 1"; read es;\
8437 vput csop es substr $es 0 3
8439 xcall bail "ins_addr $xh 3-9"
8441 echo "~^header remove-at $xh T"; read es;\
8442 vput csop es substr $es 0 3
8444 xcall bail "ins_addr $xh 3-10"
8446 echo "~^header list $xh"; read es;\
8447 vput csop es substr $es 0 3
8449 xcall bail "ins_addr $xh 3-11"
8451 echo "~^header show $xh"; read es;\
8452 vput csop es substr $es 0 3
8454 xcall bail "ins_addr $xh 3-12"
8458 echo "~^header insert $xh 'diet <$xh@exam.ple> spliced'";\
8459 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
8460 echo "~^header insert $xh <${xh}2@exam.ple>\ (comment)\ \\\"Quot(e)d\\\"";\
8461 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
8462 echo "~^header insert $xh ${xh}3@exam.ple";\
8463 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
8464 echo "~^header list $xh"; read hl; echo $hl;\
8465 call xerr "$hl" "header list $xh 3-4"
8466 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
8469 echo "~^header remove-at $xh 3"; read es;\
8470 call xerr $es "ins_addr $xh 4-6"
8471 echo "~^header remove-at $xh 2"; read es;\
8472 call xerr $es "ins_addr $xh 4-7"
8473 echo "~^header remove-at $xh 1"; read es;\
8474 call xerr $es "ins_addr $xh 4-8"
8475 echo "~^header remove-at $xh 1"; read es;\
8476 vput csop es substr $es 0 3
8478 xcall bail "ins_addr $xh 4-9"
8480 echo "~^header remove-at $xh T"; read es;\
8481 vput csop es substr $es 0 3
8483 xcall bail "ins_addr $xh 4-10"
8485 echo "~^header list $xh"; read es;\
8486 vput csop es substr $es 0 3
8488 xcall bail "ins_addr $xh 4-11"
8490 echo "~^header show $xh"; read es;\
8491 vput csop es substr $es 0 3
8493 xcall bail "ins_addr $xh 4-12"
8497 wysh set xh=$1 mult=$2
8498 echo "~^header list"; read hl; echo $hl;\
8499 call xerr "$hl" "ins_ref ($xh) 0-1"
8501 echo "~^header insert $xh <$xh@exam.ple>";\
8502 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
8504 echo "~^header insert $xh <${xh}2@exam.ple>";\
8505 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
8506 echo "~^header insert $xh ${xh}3@exam.ple";\
8507 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
8509 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
8510 vput csop es substr $es 0 3
8512 xcall bail "ins_ref $xh 1-4"
8516 echo "~^header list $xh"; read hl; echo $hl;\
8517 call xerr "$hl" "ins_ref $xh 1-5"
8518 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
8521 if [ "$t_remove" == "" ]
8525 echo "~^header remove $xh"; read es;\
8526 call xerr $es "ins_ref $xh 2-1"
8527 echo "~^header remove $xh"; read es;\
8528 vput csop es substr $es 0 3
8530 xcall bail "ins_ref $xh 2-2"
8532 echo "~^header list $xh"; read es;\
8533 vput csop es substr $es 0 3
8535 xcall bail "$es ins_ref $xh 2-3"
8537 echo "~^header show $xh"; read es;\
8538 vput csop es substr $es 0 3
8540 xcall bail "ins_ref $xh 2-4"
8544 echo "~^header insert $xh <$xh@exam.ple>";\
8545 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
8547 echo "~^header insert $xh <${xh}2@exam.ple>";\
8548 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
8549 echo "~^header insert $xh ${xh}3@exam.ple";\
8550 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
8552 echo "~^header list $xh";\
8553 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
8554 echo "~^header show $xh";\
8555 read es; call xerr $es "ins_ref $xh 3-5"
8558 echo "~^header remove-at $xh 1"; read es;\
8559 call xerr $es "ins_ref $xh 3-6"
8560 if [ $mult -ne 0 ] && [ $xh != subject ]
8561 echo "~^header remove-at $xh 1"; read es;\
8562 call xerr $es "ins_ref $xh 3-7"
8563 echo "~^header remove-at $xh 1"; read es;\
8564 call xerr $es "ins_ref $xh 3-8"
8566 echo "~^header remove-at $xh 1"; read es;\
8567 vput csop es substr $es 0 3
8569 xcall bail "ins_ref $xh 3-9"
8571 echo "~^header remove-at $xh T"; read es;\
8572 vput csop es substr $es 0 3
8574 xcall bail "ins_ref $xh 3-10"
8576 echo "~^header show $xh"; read es;\
8577 vput csop es substr $es 0 3
8579 xcall bail "ins_ref $xh 3-11"
8583 echo "~^header insert $xh <$xh@exam.ple> ";\
8584 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
8586 echo "~^header insert $xh <${xh}2@exam.ple> ";\
8587 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
8588 echo "~^header insert $xh ${xh}3@exam.ple";\
8589 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
8591 echo "~^header list $xh"; read hl; echo $hl;\
8592 call xerr "$hl" "ins_ref $xh 4-4"
8593 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
8596 if [ $mult -ne 0 ] && [ $xh != subject ]
8597 echo "~^header remove-at $xh 3"; read es;\
8598 call xerr $es "ins_ref $xh 4-6"
8599 echo "~^header remove-at $xh 2"; read es;\
8600 call xerr $es "ins_ref $xh 4-7"
8602 echo "~^header remove-at $xh 1"; read es;\
8603 call xerr $es "ins_ref $xh 4-8"
8604 echo "~^header remove-at $xh 1"; read es;\
8605 vput csop es substr $es 0 3
8607 xcall bail "ins_ref $xh 4-9"
8609 echo "~^header remove-at $xh T"; read es;\
8610 vput csop es substr $es 0 3
8612 xcall bail "ins_ref $xh 4-10"
8614 echo "~^header show $xh"; read es;\
8615 vput csop es substr $es 0 3
8617 xcall bail "ins_ref $xh 4-11"
8622 # In collect.c order
8624 call ins_ref sender 0 # Not a "ref", but works
8628 call ins_addr reply-To
8629 call ins_addr mail-Followup-to
8630 call ins_ref messAge-id 0
8631 call ins_ref rEfErEncEs 1
8632 call ins_ref in-Reply-to 1
8633 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
8634 call ins_addr freeForm1
8635 call ins_addr freeform2
8637 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
8639 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
8647 echo "~^attachment";\
8648 read hl; echo $hl; vput csop es substr "$hl" 0 3
8650 xcall bail "attach 0-1"
8653 echo "~^attach attribute ./.treadctl";\
8654 read hl; echo $hl; vput csop es substr "$hl" 0 3
8656 xcall bail "attach 0-2"
8658 echo "~^attachment attribute-at 1";\
8659 read hl; echo $hl; vput csop es substr "$hl" 0 3
8661 xcall bail "attach 0-3"
8664 echo "~^attachment insert ./.treadctl=ascii";\
8665 read hl; echo $hl; call xerr "$hl" "attach 1-1"
8666 echo "~^attachment list";\
8667 read es; echo $es;call xerr "$es" "attach 1-2"
8669 echo "~^attachment attribute ./.treadctl";\
8670 read es; echo $es;call xerr "$es" "attach 1-3"
8672 echo "~^attachment attribute .treadctl";\
8673 read es; echo $es;call xerr "$es" "attach 1-4"
8675 echo "~^attachment attribute-at 1";\
8676 read es; echo $es;call xerr "$es" "attach 1-5"
8679 echo "~^attachment attribute-set ./.treadctl filename rctl";\
8680 read es; echo $es;call xerr "$es" "attach 1-6"
8681 echo "~^attachment attribute-set .treadctl content-description Au";\
8682 read es; echo $es;call xerr "$es" "attach 1-7"
8683 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
8684 read es; echo $es;call xerr "$es" "attach 1-8"
8686 echo "~^attachment attribute ./.treadctl";\
8687 read es; echo $es;call xerr "$es" "attach 1-9"
8689 echo "~^attachment attribute .treadctl";\
8690 read es; echo $es;call xerr "$es" "attach 1-10"
8692 echo "~^attachment attribute rctl";\
8693 read es; echo $es;call xerr "$es" "attach 1-11"
8695 echo "~^attachment attribute-at 1";\
8696 read es; echo $es;call xerr "$es" "attach 1-12"
8700 echo "~^attachment insert ./.tattach=latin1";\
8701 read hl; echo $hl; call xerr "$hl" "attach 2-1"
8702 echo "~^attachment list";\
8703 read es; echo $es;call xerr "$es" "attach 2-2"
8705 echo "~^attachment attribute ./.tattach";\
8706 read es; echo $es;call xerr "$es" "attach 2-3"
8708 echo "~^attachment attribute .tattach";\
8709 read es; echo $es;call xerr "$es" "attach 2-4"
8711 echo "~^attachment attribute-at 2";\
8712 read es; echo $es;call xerr "$es" "attach 2-5"
8715 echo "~^attachment attribute-set ./.tattach filename tat";\
8716 read es; echo $es;call xerr "$es" "attach 2-6"
8718 "~^attachment attribute-set .tattach content-description Au2";\
8719 read es; echo $es;call xerr "$es" "attach 2-7"
8720 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
8721 read es; echo $es;call xerr "$es" "attach 2-8"
8723 "~^attachment attribute-set-at 2 content-type application/x-sh";\
8724 read es; echo $es;call xerr "$es" "attach 2-9"
8726 echo "~^attachment attribute ./.tattach";\
8727 read es; echo $es;call xerr "$es" "attach 2-10"
8729 echo "~^attachment attribute .tattach";\
8730 read es; echo $es;call xerr "$es" "attach 2-11"
8732 echo "~^attachment attribute tat";\
8733 read es; echo $es;call xerr "$es" "attach 2-12"
8735 echo "~^attachment attribute-at 2";\
8736 read es; echo $es;call xerr "$es" "attach 2-13"
8740 if [ "$t_remove" == "" ]
8744 echo "~^attachment remove ./.treadctl"; read es;\
8745 call xerr $es "attach 3-1"
8746 echo "~^attachment remove ./.tattach"; read es;\
8747 call xerr $es "attach 3-2"
8748 echo "~^ attachment remove ./.treadctl"; read es;\
8749 vput csop es substr $es 0 3
8751 xcall bail "attach 3-3"
8753 echo "~^ attachment remove ./.tattach"; read es;\
8754 vput csop es substr $es 0 3
8756 xcall bail "attach 3-4"
8758 echo "~^attachment list"; read es;\
8759 vput csop es substr $es 0 3
8761 xcall bail "attach 3-5"
8765 echo "~^attachment insert ./.tattach=latin1";\
8766 read hl; echo $hl; call xerr "$hl" "attach 4-1"
8767 echo "~^attachment insert ./.tattach=latin1";\
8768 read hl; echo $hl; call xerr "$hl" "attach 4-2"
8769 echo "~^attachment list";\
8770 read es; echo $es;call xerr "$es" "attach 4-3"
8772 echo "~^ attachment remove .tattach"; read es;\
8773 vput csop es substr $es 0 3
8775 xcall bail "attach 4-4 $es"
8777 echo "~^attachment remove-at T"; read es;\
8778 vput csop es substr $es 0 3
8780 xcall bail "attach 4-5"
8782 echo "~^attachment remove ./.tattach"; read es;\
8783 call xerr $es "attach 4-6"
8784 echo "~^attachment remove ./.tattach"; read es;\
8785 call xerr $es "attach 4-7"
8786 echo "~^ attachment remove ./.tattach"; read es;\
8787 vput csop es substr $es 0 3
8789 xcall bail "attach 4-8 $es"
8791 echo "~^attachment list"; read es;\
8792 vput csop es substr $es 0 3
8794 xcall bail "attach 4-9"
8798 echo "~^attachment insert ./.tattach=latin1";\
8799 read hl; echo $hl; call xerr "$hl" "attach 5-1"
8800 echo "~^attachment insert ./.tattach=latin1";\
8801 read hl; echo $hl; call xerr "$hl" "attach 5-2"
8802 echo "~^attachment insert ./.tattach=latin1";\
8803 read hl; echo $hl; call xerr "$hl" "attach 5-3"
8804 echo "~^attachment list";\
8805 read es; echo $es;call xerr "$es" "attach 5-4"
8808 echo "~^attachment remove-at 3"; read es;\
8809 call xerr $es "attach 5-5"
8810 echo "~^attachment remove-at 3"; read es;\
8811 vput csop es substr $es 0 3
8813 xcall bail "attach 5-6"
8815 echo "~^attachment remove-at 2"; read es;\
8816 call xerr $es "attach 5-7"
8817 echo "~^attachment remove-at 2"; read es;\
8818 vput csop es substr $es 0 3
8820 xcall bail "attach 5-8"
8822 echo "~^attachment remove-at 1"; read es;\
8823 call xerr $es "attach 5-9"
8824 echo "~^attachment remove-at 1"; read es;\
8825 vput csop es substr $es 0 3
8827 xcall bail "attach 5-10"
8830 echo "~^attachment list"; read es;\
8831 vput csop es substr $es 0 3
8833 xcall bail "attach 5-11"
8837 echo "~^attachment insert ./.tattach=latin1";\
8838 read hl; echo $hl; call xerr "$hl" "attach 6-1"
8839 echo "~^attachment insert ./.tattach=latin1";\
8840 read hl; echo $hl; call xerr "$hl" "attach 6-2"
8841 echo "~^attachment insert ./.tattach=latin1";\
8842 read hl; echo $hl; call xerr "$hl" "attach 6-3"
8843 echo "~^attachment list";\
8844 read es; echo $es;call xerr "$es" "attach 6-4"
8847 echo "~^attachment remove-at 1"; read es;\
8848 call xerr $es "attach 6-5"
8849 echo "~^attachment remove-at 1"; read es;\
8850 call xerr $es "attach 6-6"
8851 echo "~^attachment remove-at 1"; read es;\
8852 call xerr $es "attach 6-7"
8853 echo "~^attachment remove-at 1"; read es;\
8854 vput csop es substr $es 0 3
8856 xcall bail "attach 6-8"
8859 echo "~^attachment list"; read es;\
8860 vput csop es substr $es 0 3
8862 xcall bail "attach 6-9"
8874 echo on-compose-enter, mailx-command<$mailx-command>
8875 alternates alter1@exam.ple alter2@exam.ple
8877 set autocc='alter1@exam.ple alter2@exam.ple'
8878 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8879 echo mailx-subject<$mailx-subject>
8880 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8881 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8882 mailx-raw-bcc<$mailx-raw-bcc>
8883 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8884 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8885 digmsg create - -;echo $?/$!/$^ERRNAME;\
8886 digmsg - header list;\
8887 digmsg remove -;echo $?/$!/$^ERRNAME
8888 digmsg create -;echo $?/$!/$^ERRNAME;\
8889 digmsg - header list;readall x;echon $x;\
8890 digmsg remove -;echo $?/$!/$^ERRNAME
8893 echo on-compose-leave, mailx-command<$mailx-command>
8895 eval alternates $al alter3@exam.ple alter4@exam.ple
8897 set autobcc='alter3@exam.ple alter4@exam.ple'
8898 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8899 echo mailx-subject<$mailx-subject>
8900 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8901 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8902 mailx-raw-bcc<$mailx-raw-bcc>
8903 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8904 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8905 digmsg create - -;echo $?/$!/$^ERRNAME;\
8906 digmsg - header list;\
8907 digmsg remove -;echo $?/$!/$^ERRNAME
8908 digmsg create -;echo $?/$!/$^ERRNAME;\
8909 digmsg - header list;readall x;echon $x;\
8910 digmsg remove -;echo $?/$!/$^ERRNAME
8913 echo on-compose-cleanup, mailx-command<$mailx-command>
8916 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
8917 echo mailx-subject<$mailx-subject>
8918 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
8919 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
8920 mailx-raw-bcc<$mailx-raw-bcc>
8921 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
8922 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
8923 # XXX error message variable digmsg create - -;echo $?/$!/$^ERRNAME;\
8924 digmsg - header list;\
8925 digmsg remove -;echo $?/$!/$^ERRNAME
8926 # ditto digmsg create -;echo $?/$!/$^ERRNAME;\
8927 digmsg - header list;readall x;echon $x;\
8928 digmsg remove -;echo $?/$!/$^ERRNAME
8930 wysh set on-compose-splice=t_ocs \
8931 on-compose-enter=t_oce on-compose-leave=t_ocl \
8932 on-compose-cleanup=t_occ
8935 printf 'm this-goes@nowhere\nbody\n!.\n' |
8936 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8937 -X'source ./.trc' -Smta=test://"$MBOX" \
8939 ${cat} ./.tall >> "${MBOX}"
8940 check 1 0 "${MBOX}" '1646284089 10565'
8943 printf 'm this-goes@nowhere\nbody\n!.\n' |
8944 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
8945 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
8947 ${cat} ./.tall >> "${MBOX}"
8948 check 2 0 "${MBOX}" '700681006 12851'
8952 # Some state machine stress, shell compose hook, localopts for hook, etc.
8953 # readctl in child. ~r as HERE document
8955 printf 'm ex@am.ple\nbody\n!.
8956 echon ${mailx-command}${mailx-subject}
8957 echon ${mailx-from}${mailx-sender}
8958 echon ${mailx-to}${mailx-cc}${mailx-bcc}
8959 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
8960 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
8961 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
8962 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
8963 -Smta=test://"$MBOX" \
8966 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
8969 vput csop es substr "$1" 0 1
8974 define read_mline_res {
8975 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
8976 echo $len/$es/$^ERRNAME: $hl
8977 if [ $es -ne $^ERR-NONE ]
8978 xcall bail read_mline_res
8980 \xcall read_mline_res
8984 vput vexpr i + 1 "$2"
8986 vput vexpr j % $i 10
8993 eval \\$j _work $1 $i
8996 vput vexpr i + $i "$1"
9000 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
9001 echo read:$es/$en: $line
9002 if [ "${es}" -ne -1 ]
9005 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
9010 echo "~^header list"; read hl; echo $hl;\
9011 vput csop es substr "$hl" 0 1
9013 xcall bail "header list"
9016 call _work 1; echo $?
9017 echo "~^header insert cc splicy\ diet\ <splice@exam.ple>\ spliced";\
9018 read es; echo $es; vput csop es substr "$es" 0 1
9020 xcall bail "be diet"
9022 echo "~^header insert cc <splice2@exam.ple>";\
9023 read es; echo $es; vput csop es substr "$es" 0 1
9025 xcall bail "be diet2"
9028 call _work 2; echo $?
9029 echo "~^header insert bcc juicy\ juice\ <juice@exam.ple>\ spliced";\
9030 read es; echo $es;vput csop es substr "$es" 0 1
9032 xcall bail "be juicy"
9034 echo "~^header insert bcc juice2@exam.ple";\
9035 read es; echo $es;vput csop es substr "$es" 0 1
9037 xcall bail "be juicy2"
9039 echo "~^header insert bcc juice3\ <juice3@exam.ple>";\
9040 read es; echo $es;vput csop es substr "$es" 0 1
9042 xcall bail "be juicy3"
9044 echo "~^header insert bcc juice4@exam.ple";\
9045 read es; echo $es;vput csop es substr "$es" 0 1
9047 xcall bail "be juicy4"
9050 echo "~^header remove-at bcc 3";\
9051 read es; echo $es;vput csop es substr "$es" 0 1
9053 xcall bail "remove juicy5"
9055 echo "~^header remove-at bcc 2";\
9056 read es; echo $es;vput csop es substr "$es" 0 1
9058 xcall bail "remove juicy6"
9060 echo "~^header remove-at bcc 3";\
9061 read es; echo $es;vput csop es substr "$es" 0 3
9063 xcall bail "failed to remove-at"
9065 # Add duplicates which ought to be removed!
9066 echo "~^header insert bcc juice4@exam.ple";\
9067 read es; echo $es;vput csop es substr "$es" 0 1
9069 xcall bail "be juicy4-1"
9071 echo "~^header insert bcc juice4@exam.ple";\
9072 read es; echo $es;vput csop es substr "$es" 0 1
9074 xcall bail "be juicy4-2"
9076 echo "~^header insert bcc juice4@exam.ple";\
9077 read es; echo $es;vput csop es substr "$es" 0 1
9079 xcall bail "be juicy4-3"
9084 call _work 3; echo $?
9086 vput ! i echo just knock if you can hear me;\
9088 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
9090 echon shell-cmd says $?/$^ERRNAME: $i
9091 echo "~x will not become interpreted, we are reading until __EOT"
9093 read r_status; echo "~~r status output: $r_status"
9094 echo "~:echo $? $! $^ERRNAME"
9096 echo "~~r status from parent: $r_status"
9099 call _work 4; echo $?
9100 vput cwd cwd;echo cwd:$?
9101 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
9105 call _work 5; echo $?
9106 echo "~^header show MAILX-Command"; read es;\
9107 call xerr $es "t_header 1000"; call read_mline_res
9108 echo "~^header show MAILX-raw-TO"; read es;\
9109 call xerr $es "t_header 1001"; xcall read_mline_res
9111 echoerr IT IS WRONG IF YOU SEE THIS
9114 echo on-compose-enter, mailx-command<$mailx-command>
9115 set t_oce autobcc=oce@exam.ple
9116 alternates alter1@exam.ple alter2@exam.ple
9118 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9119 echo mailx-subject<$mailx-subject>
9120 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9121 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9122 mailx-raw-bcc<$mailx-raw-bcc>
9123 echo mailx-orig-from<$mailx-orig-from> \
9124 mailx-orig-to<$mailx-orig-to> \
9125 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9128 echo on-compose-leave, mailx-command<$mailx-command>
9129 set t_ocl autocc=ocl@exam.ple
9131 alternates alter3@exam.ple alter4@exam.ple
9133 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9134 echo mailx-subject<$mailx-subject>
9135 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9136 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9137 mailx-raw-bcc<$mailx-raw-bcc>
9138 echo mailx-orig-from<$mailx-orig-from> \
9139 mailx-orig-to<$mailx-orig-to> \
9140 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9143 echo on-compose-cleanup, mailx-command<$mailx-command>
9144 set t_occ autocc=occ@exam.ple
9147 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9148 echo mailx-subject<$mailx-subject>
9149 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9150 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9151 mailx-raw-bcc<$mailx-raw-bcc>
9152 echo mailx-orig-from<$mailx-orig-from> \
9153 mailx-orig-to<$mailx-orig-to> \
9154 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9156 wysh set on-compose-splice=t_ocs \
9157 on-compose-splice-shell="read ver;echo t_ocs-shell;\
9158 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
9159 on-compose-enter=t_oce on-compose-leave=t_ocl \
9160 on-compose-cleanup=t_occ
9163 ${cat} ./.tnotes >> "${MBOX}"
9164 check 3 - "${MBOX}" '3986011319 2437'
9166 # Reply, forward, resend, Resend
9174 set from="du <f2@z>" stealthmua=noagent
9178 ' | ${MAILX} ${ARGS} -Smta=test://"$MBOX" -Snomemdebug -Sescape=! \
9180 check_ex0 4-intro-estat
9183 echo start: $? $! $^ERRNAME
9185 echo File: $? $! $^ERRNAME;echo;echo
9187 this is content of reply 1
9189 echo reply 1: $? $! $^ERRNAME;echo;echo
9191 this is content of Reply 1 2
9193 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
9194 forward 1 fwdex@am.ple
9195 this is content of forward 1
9197 echo forward 1: $? $! $^ERRNAME;echo;echo
9198 wysh set forward-inject-head=$'"'"'-- \\
9199 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
9200 wysh set forward-inject-tail=$'"'"'-- \\
9201 end of forward (%%i) --\\n'"'"'
9202 forward 2 fwdex@am.ple
9203 this is content of forward 2
9205 echo forward 2: $? $! $^ERRNAME;echo;echo
9207 forward 2 fwdex2@am.ple
9208 this is content of forward 2, 2nd, with showname set
9210 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
9211 resend 1 2 resendex@am.ple
9212 echo resend 1 2: $? $! $^ERRNAME;echo;echo
9213 Resend 1 2 Resendex@am.ple
9214 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
9216 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
9217 -Smta=test://"$MBOX" \
9220 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9223 vput csop es substr "$1" 0 1
9228 define read_mline_res {
9229 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
9230 echo mline_res:$len/$es/$^ERRNAME: $hl
9231 if [ $es -ne $^ERR-NONE ]
9232 xcall bail read_mline_res
9234 \xcall read_mline_res
9238 echo "~^header show $1"; read es;\
9239 call xerr $es "work_hl $1"; echo $1; call read_mline_res
9247 echo t_ocs version $ver
9248 echo "~^header list"; read hl; echo $hl;\
9249 echoerr the header list is $hl;\
9250 call xerr "$hl" "header list"
9251 eval vpospar set $hl
9254 echoerr IT IS WRONG IF YOU SEE THIS
9257 echo on-XY-enter, mailx-command<$mailx-command>
9258 set t_oce autobcc=oce@exam.ple
9259 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9260 echo mailx-subject<$mailx-subject>
9261 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9262 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9263 mailx-raw-bcc<$mailx-raw-bcc>
9264 echo mailx-orig-from<$mailx-orig-from> \
9265 mailx-orig-to<$mailx-orig-to> \
9266 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9269 echo on-XY-leave, mailx-command<$mailx-command>
9270 set t_ocl autocc=ocl@exam.ple
9271 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9272 echo mailx-subject<$mailx-subject>
9273 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9274 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9275 mailx-raw-bcc<$mailx-raw-bcc>
9276 echo mailx-orig-from<$mailx-orig-from> \
9277 mailx-orig-to<$mailx-orig-to> \
9278 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9281 echo on-XY-cleanup, mailx-command<$mailx-command>
9282 set t_occ autocc=occ@exam.ple
9283 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
9284 echo mailx-subject<$mailx-subject>
9285 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
9286 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
9287 mailx-raw-bcc<$mailx-raw-bcc>
9288 echo mailx-orig-from<$mailx-orig-from> \
9289 mailx-orig-to<$mailx-orig-to> \
9290 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
9292 wysh set on-compose-splice=t_ocs \
9293 on-compose-enter=t_oce on-compose-leave=t_ocl \
9294 on-compose-cleanup=t_occ \
9295 on-resend-enter=t_oce on-resend-cleanup=t_occ
9298 ${cat} ./.tnotes >> "${MBOX}"
9299 check 4 - "${MBOX}" '1850092468 11799'
9304 t_mass_recipients() {
9307 if have_feat cmd-vexpr; then :; else
9308 t_echoskip '[!CMD_VEXPR]'
9313 ${cat} <<'__EOT__' > ./.trc
9315 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
9318 wysh set nr=$1 hn=$2
9319 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
9321 xcall bail "ins_addr $hn 1-$nr"
9323 vput vexpr nr + $nr 1
9324 if [ "$nr" -le "$maximum" ]
9325 xcall ins_addr $nr $hn
9329 wysh set nr=$1 hn=$2
9330 alternates $hn$nr@$hn
9331 vput vexpr nr + $nr 2
9332 if [ "$nr" -le "$maximum" ]
9333 xcall bld_alter $nr $hn
9343 if [ "$t_remove" != '' ]
9348 set on-compose-splice=t_ocs on-compose-leave=t_ocl
9351 printf 'm this-goes@nowhere\nbody\n!.\n' |
9352 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9353 -X'source ./.trc' -Smta=test://"$MBOX" -Smaximum=${LOOPS_MAX} \
9356 ${cat} ./.tall >> "${MBOX}"
9357 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9358 check 1-${LOOPS_BIG} - "${MBOX}" '3835365533 51534'
9359 elif [ ${LOOPS_MAX} -eq ${LOOPS_SMALL} ]; then
9360 check 1-${LOOPS_SMALL} - "${MBOX}" '3647549277 4686'
9364 printf 'm this-goes@nowhere\nbody\n!.\n' |
9365 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
9366 -St_remove=1 -X'source ./.trc' -Smta=test://"$MBOX" \
9367 -Smaximum=${LOOPS_MAX} \
9370 ${cat} ./.tall >> "${MBOX}"
9371 if [ ${LOOPS_MAX} -eq ${LOOPS_BIG} ]; then
9372 check 2-${LOOPS_BIG} - "${MBOX}" '3768249992 34402'
9373 elif [ $LOOPS_MAX -eq ${LOOPS_SMALL} ]; then
9374 check 2-${LOOPS_SMALL} - "${MBOX}" '4042568441 3170'
9380 t_lreply_futh_rth_etc() {
9383 ${cat} <<-_EOT > ./.tmbox
9384 From neverneverland Sun Jul 23 13:46:25 2017
9385 Subject: Bugstop: five miles out 1
9386 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9387 From: mister originator <mr@originator>
9388 To: bugstop-commit@five.miles.out, laber@backe.eu
9390 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
9391 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
9392 Date: Wed, 19 Jul 2017 09:22:57 -0400
9393 Message-Id: <20170719132257.766AF781267@originator>
9396 > |Sorry, I think I misunderstand something. I would think that
9400 From neverneverland Fri Jul 7 22:39:11 2017
9401 Subject: Bugstop: five miles out 2
9402 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
9403 Content-Transfer-Encoding: 7bit
9404 From: mister originator <mr@originator>
9405 To: bugstop-commit@five.miles.out
9407 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
9408 Date: Fri, 07 Jul 2017 16:33:59 -0400
9411 capable of changing back.
9413 From neverneverland Fri Jul 7 22:42:00 2017
9414 Subject: Bugstop: five miles out 3
9415 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9416 Content-Transfer-Encoding: 7bit
9417 From: mister originator <mr@originator>
9418 To: bugstop-commit@five.miles.out
9420 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
9421 Date: Fri, 07 Jul 2017 16:33:59 -0400
9422 List-Post: <mailto:bugstop@five.miles.out>
9425 are you ready, boots?
9427 From neverneverland Sat Aug 19 23:15:00 2017
9428 Subject: Bugstop: five miles out 4
9429 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
9430 Content-Transfer-Encoding: 7bit
9431 From: mister originator <mr@originator>
9432 To: bugstop@five.miles.out
9434 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
9435 Date: Fri, 07 Jul 2017 16:33:59 -0400
9436 List-Post: <mailto:bugstop@five.miles.out>
9439 are you ready, boots?
9444 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" \
9445 -Rf ./.tmbox >> "${MBOX}" 2>&1
9447 wysh set m="This is text of \"reply ${1}."
9458 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
9461 wysh set m="This is text of \"Reply ${1}."
9467 echo -----After Reply $1.$2: $?/$^ERRNAME
9476 wysh set m="This is text of \"Lreply ${1}." on-compose-splice=_Lh n=$2
9480 # We need two indirections for this test: one for the case that Lreply
9481 # fails because of missing recipients: we need to read EOF next, thus
9482 # place this in _Ls last; and second for the succeeding cases EOF is
9483 # not what these should read, so go over the backside and splice it in!
9484 # (A shame we do not have redirection++ as a Bourne/K/POSIX shell!)
9486 echo -----After Lreply $1.$2: $?/$^ERRNAME
9489 localopts call-fixate yes
9491 call R $1 1; call R $1 2; call R $1 3; call R $1 4
9492 call L $1 1; call L $1 2; call L $1 3
9495 echo;echo '===== CHANGING === '"$*"' =====';echo
9499 set from=laber@backe.eu
9502 call tweak set reply-to-honour
9504 call tweak set followup-to
9506 call tweak set followup-to-honour
9508 call tweak mlist bugstop@five.miles.out
9510 call tweak mlsubscribe bugstop@five.miles.out
9512 call tweak set recipients-in-cc
9514 # While here, test that *fullnames* works (also here)
9515 call tweak set fullnames
9517 This message should have *fullnames* in the header.
9520 call tweak unmlsubscribe bugstop@five.miles.out';' \
9521 set followup-to-add-cc nofullnames
9523 call tweak mlsubscribe bugstop@five.miles.out
9528 if have_feat uistrings; then
9529 check 1 - "${MBOX}" '1519985418 39828'
9531 t_echoskip '1:[!UISTRINGS]'
9536 ${cat} <<-_EOT > ./.tmbox
9537 From tom@i-i.example Thu Oct 26 03:15:55 2017
9538 Date: Wed, 25 Oct 2017 21:15:46 -0400
9539 From: tom <tom@i-i.example>
9540 To: Steffen Nurpmeso <steffen@sdaoden.eu>
9541 Cc: tom <tom@i-i.example>
9542 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
9543 Message-ID: <20171026011546.GA11643@i-i.example>
9544 Reply-To: tom@i-i.example
9545 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
9546 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
9549 The report's useful :-)
9552 # Let us test In-Reply-To: removal starts a new thread..
9553 # This needs adjustment of *stealthmua*
9554 argadd='-Sstealthmua=noagent -Shostname'
9557 printf 'reply 1\nthread\n!.\n' |
9558 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9559 ${argadd} -Rf ./.tmbox > .tall 2>&1
9560 check 2 0 "${MBOX}" '841868335 433'
9561 check 3 - .tall '4294967295 0'
9563 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
9564 "${sed}" '/^In-Reply-To:/d' |
9565 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9566 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9567 check 4 0 "${MBOX}" '3136957908 771'
9568 check 5 - .tall '4294967295 0'
9570 printf 'reply 2\nold <- new <- thread!\n!.\n' |
9571 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9572 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9573 check 6 0 "${MBOX}" '3036449053 1231'
9574 check 7 - .tall '4294967295 0'
9576 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
9577 "${sed}" '/^In-Reply-To:/d' |
9578 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9579 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9580 check 8 0 "${MBOX}" '2069841383 1583'
9581 check 9 - .tall '4294967295 0'
9583 # And follow-up testing whether changing In-Reply-To: to - starts a new
9584 # thread with only the message being replied-to.
9586 printf 'reply 1\nthread with only one ref!\n!||%s -e "%s"\n!.\n' \
9587 "${sed}" 's/^In-Reply-To:.*$/In-Reply-To:-/' |
9588 ${MAILX} ${ARGS} -Sescape=! -Smta=test://"$MBOX" -Sreply-to-honour \
9589 ${argadd} -Rf "${MBOX}" > .tall 2>&1
9590 check 10 0 "${MBOX}" '3155846378 2047'
9591 check 11 - .tall '4294967295 0'
9599 if have_feat cmd-vexpr; then :; else
9600 t_echoskip '[!CMD_VEXPR]'
9605 # "Test for" [d6f316a] (Gavin Troy)
9606 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
9607 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="?* ${cat}" > "${BODY}"
9608 check 1 0 "${MBOX}" '3942990636 118'
9609 check 2 - "${BODY}" '3951695530 170'
9612 printf "m %s\n~s subject2\n~@%s\nBody2\n~.\nFi %s\nmimeview\nx\n" \
9613 "${MBOX}" "${TOPDIR}snailmail.jpg" "${MBOX}" |
9614 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9615 -S 'pipe-text/plain=?' \
9616 -S 'pipe-image/jpeg=?=&?'\
9617 'trap \"'"${rm}"' -f '\ '\\"${MAILX_FILENAME_TEMPORARY}\\"\" EXIT;'\
9618 'trap \"trap \\\"\\\" INT QUIT TERM; exit 1\" INT QUIT TERM;'\
9619 '{ echo C=$MAILX_CONTENT;'\
9620 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9621 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9622 'echo F=$MAILX_FILENAME;'\
9623 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9624 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9625 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9626 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"; } > ./.tax 2>&1;'"${mv}"' ./.tax ./.tay' \
9628 check 3 0 "${MBOX}" '1933681911 13435'
9629 check 4 - "${BODY}" '2036666633 493'
9630 check 4-hdl - ./.tay '144517347 151' async
9633 if [ -z "${ln}" ]; then
9634 t_echoskip '5:[ln(1) not found]'
9636 # Let us fill in tmpfile, test auto-deletion
9637 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9638 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9639 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9640 -S 'pipe-text/plain=?' \
9641 -S 'pipe-image/jpeg=?=++?'\
9642 'echo C=$MAILX_CONTENT;'\
9643 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9644 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9645 'echo F=$MAILX_FILENAME;'\
9646 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9647 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9648 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9649 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9650 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9652 check 5 0 "${BODY}" '4260004050 661'
9654 # Fill in ourselfs, test auto-deletion
9655 printf 'Fi %s\nmimeview\nvput vexpr v file-stat .t.one-link\n'\
9656 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9657 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9658 -S 'pipe-text/plain=?' \
9659 -S 'pipe-image/jpeg=?++?'\
9660 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9661 'echo C=$MAILX_CONTENT;'\
9662 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9663 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9664 'echo F=$MAILX_FILENAME;'\
9665 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9666 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9667 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9668 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9670 check 6 0 "${BODY}" '4260004050 661'
9672 # And the same, via copiousoutput (fake)
9673 printf 'Fi %s\np\nvput vexpr v file-stat .t.one-link\n'\
9674 'eval wysh set $v;echo should be $st_nlink link\nx\n' "${MBOX}" |
9675 ${MAILX} ${ARGS} ${ADDARG_UNI} \
9676 -S 'pipe-text/plain=?' \
9677 -S 'pipe-image/jpeg=?*++?'\
9678 "${cat}"' > $MAILX_FILENAME_TEMPORARY;'\
9679 'echo C=$MAILX_CONTENT;'\
9680 'echo C-E=$MAILX_CONTENT_EVIDENCE;'\
9681 'echo E-B-U=$MAILX_EXTERNAL_BODY_URL;'\
9682 'echo F=$MAILX_FILENAME;'\
9683 'echo F-G=not testable MAILX_FILENAME_GENERATED;'\
9684 'echo F-T=not testable MAILX_FILENAME_TEMPORARY;'\
9685 "${ln}"' -f $MAILX_FILENAME_TEMPORARY .t.one-link;'\
9686 ''"${cksum}"' < \"${MAILX_FILENAME_TEMPORARY}\" |'\
9687 ''"${sed}"' -e "s/[ ]\{1,\}/ /g"' \
9689 check 7 0 "${BODY}" '709946464 677'
9698 if have_feat mailcap; then :; else
9699 t_echoskip '[!MAILCAP]'
9704 ${cat} <<-'_EOT' > ./.tmailcap
9705 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
9706 application/pdf; /Applications/Preview.app/Contents/MacOS/Preview %s;\
9707 nametemplate=%s.pdf;\
9708 test = [ "${OSTYPE}" = darwin ]
9711 trap "rm -f ${infile}" EXIT\;\
9712 trap "exit 75" INT QUIT TERM\;\
9714 test = [ -n "${DISPLAY}" ];\
9715 nametemplate = %s.pdf; x-mailx-async
9716 application/pdf; pdftotext -layout %s -; nametemplate=%s.pdf; copiousoutput
9717 application/*; echo "This is \\"%t\\" but \
9718 is 50 \% Greek to me" \; < %s head -c 1024 | cat -vet; \
9719 description=" this is\;a \"wildcard\" match, no trailing quote! ;\
9720 copiousoutput; x-mailx-noquote
9725 application/postscript; ps-to-terminal %s;\ needsterminal
9726 application/postscript; ps-to-terminal %s; \compose=idraw %s
9727 x-be2; the-cmd %s; \
9728 print=print-cmd %s ; \
9730 compose=compose-cmd -d %s ; \
9732 composetyped = composetyped-cmd -dd %s ; \
9734 edit=edit-cmd -ddd %s; \
9735 description = a\;desc;\
9736 nametemplate=%s.be2;\
9737 test = this is "a" test ; \
9738 x-mailx-test-once ;\
9739 x11-bitmap = x11-bitmap.bpm;;;;;
9740 application/*; echo "is \"%t\" \
9741 50 \% Greek" \; cat %s; copiousoutput; \; description="catch-all buddy";
9742 audio/*; showaudio;compose=%n
9743 image/jpeg; showpicture -viewer xv %s
9744 image/*; showpicture %s
9745 message/partial; showpartial %s %{id} %{number} %{total}
9746 application/postscript ; lpr %s ; label="PS File";\
9747 compose="getx PS %s"
9748 application/atomicmail; atomicmail %s ; needsterminal
9749 application/andrew-inset; ezview %s ; copiousoutput;\
9750 edit=ez -d %s; compose="ez -d %s"; label="Andrew i/d"
9751 text/richtext; xy iso-8859-1 -e richtext -p %s; \
9752 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9753 text/plain; xy iso-8859-1 %s;\
9754 test=test "`echo %{charset
} |
tr A-Z a-z
`" = iso-8859-1; copiousoutput
9755 text/richtext; rich %s %{not-closed; copiousoutput
9756 default; cat %s; copiousoutput
9758 ${chmod} 0644 ./.tmailcap
9760 printf 'm;echo =1/$?;m c;echo =2/$?;
9761 mailca loa;echo =3/$?;mailc s;echo =4/$?' |
9762 MAILCAPS=./.tmailcap ${MAILX} -X'commandalias m mailcap' ${ARGS} \
9764 check 1 0 ./.tall '2012114724 3064'
9765 have_feat uistrings && i='3903313993 2338' || i='4294967295 0'
9766 check 2 - ./.terr "${i}"
9770 echo 'From me with love' | ${MAILX} ${ARGS} -s sub1 "${MBOX}"
9771 check 3 0 "${MBOX}" '4224630386 228'
9773 # For reproducability, one pseudo check with cat(1) and mv(1)
9775 text/plain; echo p-1-1\\;< %%s cat\\;echo p-1-2;\\
9776 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9777 text/plain; echo p-2-1\\;< %%s cat\\;echo p-2-2;\\
9778 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9779 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9780 </dev/null cat %%s\\;echo p-3-2\\; } > ./.tx\\; mv -f ./.tx ./.tasy;\\
9781 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9782 text/plain; echo p-4-1\\;cat\\;echo p-4-2;copiousoutput
9785 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9786 ${MAILX} ${ARGS} -Snomailcap-disable \
9788 -Rf "${MBOX}" > ./.tall 2>./.terr
9789 check 4.pre 0 ./.tall '1428075831 455'
9791 # Same with real programs
9793 text/plain; echo p-1-1\\;< %%s %s\\;echo p-1-2;\\
9794 test=echo X >> ./.terrmc\\; [ -n "$XY" ];x-mailx-test-once
9795 text/plain; echo p-2-1\\;< %%s %s\\;echo p-2-2;\\
9796 test=echo Y >> ./.terrmc\\;[ -z "$XY" ]
9797 text/plain; { file=%%s\\; echo p-3-1 = ${file##*.}\\;\\
9798 </dev/null %s %%s\\;echo p-3-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9799 test=[ -n "$XY" ];nametemplate=%%s.txt;x-mailx-async
9800 text/plain; echo p-4-1\\;%s\\;echo p-4-2;copiousoutput
9801 ' "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" > ./.tmailcap
9803 </dev/null MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9804 ${MAILX} ${ARGS} -Snomailcap-disable \
9815 -Rf "${MBOX}" > ./.tall 2>./.terr
9816 check 4 0 ./.tall '1912261831 831'
9817 check 5 - ./.terr '4294967295 0'
9818 check 6 - ./.terrmc '2376112102 6'
9819 check 7 - ./.tasy '3913344578 37' async
9821 # "Binary data"; ensure all possible temporary file / nametemplate
9822 # etc. paths are taken: avoid 2nd e7a60732c1906aefe4755fd61c5ffa81eeca0af0
9825 printf 'du\x7fbo€o\bm' > ./.tatt.pdf
9826 printf 'du' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9827 check 8 0 "${MBOX}" '3444709420 644'
9831 application/pdf; echo p-1-1\\;%s\\;echo p-1-2; test=[ "$XY" = "" ]
9832 # tmpfile, no template
9833 application/pdf; echo p-2-1\\;< %%s %s\\;echo p-2-2; test = [ "$XY" = two ]
9835 application/pdf; echo p-3-1\\;< %%s %s\\;echo p-3-2; test=[ "$XY" = three ];\\
9836 nametemplate=%%s.txt
9837 # tmpfile, template, async
9838 application/pdf; { file=%%s \\; echo p-4-1 = ${file##*.}\\;\\
9839 </dev/null %s %%s\\;echo p-4-2\\; } > ./.tx\\; %s -f ./.tx ./.tasy;\\
9840 test=[ "$XY" = four ] ; nametemplate = %%s.txt ; x-mailx-async
9842 application/pdf; echo p-5-1\\;%s\\;echo p-5-2; test=[ "$XY" = 1 ];\\
9844 # copious, tmpfile, no template
9845 application/pdf; echo p-6-1\\;< %%s %s\\;echo p-6-2; test = [ "$XY" = 2 ];\\
9847 # copious, tmpfile, template
9848 application/pdf; echo p-7-1\\;< %%s %s\\;echo p-7-2;test = [ "$XY" = 3 ];\\
9849 nametemplate=%%s.txt; copiousoutput
9850 ' "${cat}" "${cat}" "${cat}" "${cat}" "${mv}" "${cat}" "${cat}" "${cat}" \
9853 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9854 ${MAILX} ${ARGS} -Snomailcap-disable \
9862 \environ set XY=three
9865 \environ set XY=four
9878 -Rf "${MBOX}" > ./.tall 2>./.terr
9879 check 9 0 ./.tall '2388630345 3850'
9880 check 10 - ./.terr '4294967295 0'
9881 check 11 - ./.tasy '842146666 27' async
9883 # x-mailx-last-resort, x-mailx-ignore
9886 printf 'in a pdf\n' > ./.tatt.pdf
9887 printf 'du\n' | ${MAILX} ${ARGS} -a ./.tatt.pdf -s test "${MBOX}"
9888 check 12 0 "${MBOX}" '3968874750 579'
9892 application/pdf;echo hidden;x-mailx-ignore
9893 application/pdf;echo hidden;copiousoutput;x-mailx-ignore
9894 application/pdf; echo pre\\;%s\\;echo post; x-mailx-last-resort
9895 ' "${cat}" > ./.tmailcap
9897 </dev/null XY= MAILCAPS=./.tmailcap TMPDIR=`${pwd}` \
9898 ${MAILX} ${ARGS} -Snomailcap-disable \
9903 \mimetype ?t application/pdf pdf
9908 \unmimetype application/pdf
9912 -Rf "${MBOX}" > ./.tall 2>./.terr
9913 check 13 0 ./.tall '759843612 1961'
9914 check 14 - ./.terr '4294967295 0'
9920 # Unclassified rest {{{
9924 t__gen_msg subject top1 to 1 from 1 cc 1 body 'body1-1
9933 t__gen_msg subject top2 to 1 from 1 cc 1 body 'body2-1
9944 ${MAILX} ${ARGS} -Rf -Y '#
9946 \echo --- $?/$^ERRNAME, 1; \set toplines=10
9948 \echo --- $?/$^ERRNAME, 2; \set toplines=5
9949 \headerpick top retain subject # For top
9950 \headerpick type retain to subject # For Top
9952 \echo --- $?/$^ERRNAME, 3; \set topsqueeze
9954 \echo --- $?/$^ERRNAME, 4
9956 \echo --- $?/$^ERRNAME, 5
9957 # ' "${MBOX}" > ./.tall 2>&1
9958 check 1 0 ./.tall '2556125754 705'
9966 if have_feat smime; then :; else
9967 t_echoskip '[!SMIME]'
9972 ${cat} <<-_EOT > ./.t.conf
9974 x509_extensions = extensions
9975 distinguished_name = req_distinguished_name
9976 attributes = req_attributes
9978 output_password = Pacem_in_terris
9981 basicConstraints = CA:FALSE
9982 # Needs a CA for that keyUsage = digitalSignature
9983 extendedKeyUsage = emailProtection
9985 [req_distinguished_name]
9992 emailAddress = test@localhost
9995 challengePassword = hi ca it is me me me
10001 if [ "${_z}" = 0 ]; then
10006 _pass=Pacem_in_terris
10008 _ossl='-passin pass:'${_pass}
10011 ${rm} -f ./.VERIFY ./.ENCRYPT ./.DECRYPT
10013 openssl req ${_osslreq} ${_ossl} -x509 -days 3650 -config ./.t.conf \
10014 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
10018 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
10021 echo bla | ${MAILX} ${ARGS} \
10022 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10023 -Ssmime-sign-digest=sha1 \
10024 -S password-test@localhost.smime-cert-key=${_pass} \
10025 -s 'S/MIME test' ./.VERIFY >>${ERR} 2>&1
10026 check_ex0 ${_z}-estat
10029 /^Content-Description: /{ skip = 2; print; next }
10030 /^$/{ if(skip) --skip }
10031 { if(!skip) print }
10033 < ./.VERIFY > "${MBOX}"
10034 check ${_z} - "${MBOX}" '335634014 644'
10037 printf 'verify\nx\n' |
10038 ${MAILX} ${ARGS} -Ssmime-ca-file=./.tcert.pem -Serrexit \
10039 -R -f ./.VERIFY >>${ERR} 2>&1
10040 check_ex0 ${_z} # XXX pipe
10043 openssl smime -verify -CAfile ./.tcert.pem -in ./.VERIFY >>${ERR} 2>&1
10047 # (signing +) encryption / decryption
10050 -Smta=test://./.ENCRYPT \
10051 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10052 -Ssmime-sign-digest=sha1 \
10053 -Ssmime-sign -Ssmime-sign-cert=./.tpair.pem -Sfrom=test@localhost \
10054 -S password-test@localhost.smime-cert-key=${_pass} \
10055 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10056 check_ex0 ${_z}-estat
10057 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10058 check ${_z} - "${MBOX}" '2359655411 336'
10061 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
10063 -Smta=test://./.ENCRYPT \
10064 -Ssmime-ca-file=./.tcert.pem \
10065 -Ssmime-sign-cert=./.tpair.pem \
10066 -Sfrom=test@localhost \
10067 -S password-test@localhost.smime-cert-key=${_pass} \
10068 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10069 check_ex0 ${_z}-estat
10072 /^Content-Description: /{ skip = 2; print; next }
10073 /^$/{ if(skip) --skip }
10074 { if(!skip) print }
10076 < ./.DECRYPT > "${MBOX}"
10077 check ${_z} - "${MBOX}" '2602978204 940'
10080 (openssl smime -decrypt ${_ossl} -inkey ./.tkey.pem -in ./.ENCRYPT |
10081 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1
10082 check_ex0 ${_z} # XXX pipe..
10086 echo bla | ${MAILX} ${ARGS} \
10087 -Smta=test://./.ENCRYPT \
10088 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
10089 -Sfrom=test@localhost \
10090 -S password-test@localhost.smime-cert-key=${_pass} \
10091 -s 'S/MIME test' recei@ver.com >>${ERR} 2>&1
10092 check_ex0 ${_z}-estat
10093 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
10094 check ${_z} - "${MBOX}" '2359655411 336'
10098 # Note: deduce from *sign-cert*, not from *from*!
10099 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
10100 -Smta=test://./.ENCRYPT \
10101 -Ssmime-sign-cert-recei@ver.com=./.tpair.pem \
10102 -S password-recei@ver.com.smime-cert-key=${_pass} \
10103 -Serrexit -R -f ./.ENCRYPT >>${ERR} 2>&1
10104 check ${_z} 0 ./.DECRYPT '2453471323 431'
10107 openssl smime ${_ossl} -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT \
10111 unset _z _pass _osslreq _ossl
10121 # xxx Note: t_z() was the first test (series) written. Today many
10122 # xxx aspects are (better) covered by other tests above, some are not.
10123 # xxx At some future date and time, convert the last remains not covered
10124 # xxx elsewhere to a real t_* test and drop it
10128 # Test for [260e19d] (Juergen Daubert)
10129 echo body | ${MAILX} ${ARGS} "${MBOX}"
10130 check 4 0 "${MBOX}" '2948857341 94'
10132 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
10135 for(i = 0; i < 10000; ++i)
10137 #printf "\xF0\x90\x87\x90"
10138 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
10139 check 7 0 "${MBOX}" '1707496413 61812'
10146 t___gen_msg '' "${@}"
10150 t___gen_msg 1 "${@}"
10162 while [ ${___hi} -le ${3} ]; do
10163 [ ${___hi} -gt 1 ] && printf ', '
10164 printf '%s%s <%s%s@exam.ple>' ${1} ${___hi} ${2} ${___hi}
10165 ___hi=`add
${___hi} 1`
10175 printf 'From reproducible_build Wed Oct 2 01:50:07 1996
10176 Date: Wed, 02 Oct 1996 01:50:07 +0000
10180 while [ ${#} -ge 2 ]; do
10182 from) t___header From from "${2}";;
10183 to) t___header To to "${2}";;
10184 cc) t___header Cc cc "${2}";;
10185 bcc) t___header Bcc bcc "${2}";;
10186 subject) printf 'Subject: %s\n' "${2}";;
10187 body) body="${2}";;
10192 if [ -z "${ismime}" ]; then
10193 printf '\n%s\n\n' "${body}"
10195 printf 'MIME-Version: 1.0
10196 Message-ID: <20200204225307.FaKeD%%bo@oo>
10197 Content-Type: multipart/mixed; boundary="=BOUNDOUT="
10200 Content-Type: multipart/alternative; boundary==BOUNDIN=
10203 Content-Type: text/plain; charset=utf-8
10204 Content-Transfer-Encoding: 8-bit
10209 Content-Type: text/html; charset=utf-8
10210 Content-Transfer-Encoding: 8-bit
10212 <HTML><BODY>%s<BR></BODY></HTML>
10217 Content-Type: text/troff
10222 Content-Type: text/x-uuencode
10224 Aprendimos a quererte
10227 ' "${body}" "${body}"
10233 From neverneverland Sun Jul 23 13:46:25 2017
10234 Subject: Bugstop: five miles out 1
10235 Reply-To: mister originator1 <mr1@originator>
10236 From: mister originator1 <mr1@originator>
10237 To: bugstop-commit@five.miles.out
10239 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
10240 Date: Wed, 19 Jul 2017 09:22:57 -0400
10241 Message-Id: <20170719132257.766AF781267-1@originator>
10242 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
10245 That's appalling, I.
10252 From neverneverland Sun Jul 23 13:47:25 2017
10253 Subject: Bugstop: five miles out 2
10254 Reply-To: mister originator2 <mr2@originator>
10255 From: mister originator2 <mr2@originator>
10256 To: bugstop-commit@five.miles.out
10258 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
10259 Date: Wed, 19 Jul 2017 09:23:57 -0400
10260 Message-Id: <20170719132257.766AF781267-2@originator>
10263 That's appalling, II.
10270 From neverneverland Sun Jul 23 13:48:25 2017
10271 Subject: Bugstop: five miles out 3
10272 Reply-To: mister originator3 <mr3@originator>
10273 From: mister originator3 <mr3@originator>
10274 To: bugstop-commit@five.miles.out
10276 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
10277 Date: Wed, 19 Jul 2017 09:24:57 -0400
10278 Message-Id: <20170719132257.766AF781267-3@originator>
10281 That's appalling, III.
10287 # MIME encoding (QP) stress message subject
10288 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
10289 'adadaddsssssssddddddddddddddddddddd'\
10290 'ddddddddddddddddddddddddddddddddddd'\
10291 'ddddddddddddddddddddddddddddddddddd'\
10292 'dddddddddddddddddddd Hallelulja? Od'\
10293 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10294 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
10295 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
10296 'fffffffffffffffffffffffffffffffffff'\
10297 'fffffffffffffffffffff ggggggggggggg'\
10298 'ggggggggggggggggggggggggggggggggggg'\
10299 'ggggggggggggggggggggggggggggggggggg'\
10300 'ggggggggggggggggggggggggggggggggggg'\
10305 # MIME encoding (QP) stress message body
10307 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
10308 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
10309 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
10310 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
10311 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
10312 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
10313 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
10314 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
10315 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
10316 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
10317 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
10318 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
10319 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
10320 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
10321 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
10322 "auf den zeilen vorher.\r\n"\
10323 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
10325 "Die letzte Zeile war nur ein Punkt.\r\n"\
10327 "Das waren deren zwei.\r\n"\
10329 "Die letzte Zeile war ein Leerschritt.\n"\
10330 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
10331 "Prösterchen.\r\n"\
10333 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
10335 "Das waren deren zwei. ditto.\n"\
10337 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
10338 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
10339 "auf den zeilen vorher.\n"\
10341 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
10342 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
10344 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10346 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10348 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10350 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10352 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
10354 "QP am Zeilenende über soft-nl hinweg\n"\
10355 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10357 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10359 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10361 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
10363 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
10365 "Die letzte Zeile war ein Leerschritt.\n"\
10370 # cc_all_configs() {{{
10371 # Test all configs TODO doesn't cover all *combinations*, stupid!
10373 if [ ${MAXJOBS} -gt 1 ]; then
10374 MAXJOBS='-j '${MAXJOBS}
10378 if [ -n "${NOCOLOUR}" ] || [ -n "${MAILX_CC_TEST_NO_COLOUR}" ]; then
10379 MAILX_CC_TEST_NO_COLOUR=1
10380 export MAILX_CC_TEST_NO_COLOUR
10385 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
10386 NOTME["OPT_AUTOCC_STACKPROT"] = 1
10387 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
10388 NOTME["OPT_CROSS_BUILD"] = 1
10389 NOTME["OPT_AUTOCC"] = 1
10390 NOTME["OPT_AMALGAMATION"] = 1
10391 NOTME["OPT_DEBUG"] = 1
10392 NOTME["OPT_DEVEL"] = 1
10393 NOTME["OPT_ASAN_ADDRESS"] = 1
10394 NOTME["OPT_ASAN_MEMORY"] = 1
10395 NOTME["OPT_USAN"] = 1
10396 NOTME["OPT_NOMEMDBG"] = 1
10401 MULCHOICE["OPT_ICONV"] = "VAL_ICONV"
10402 MULVALS["VAL_ICONV"] = 1
10403 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
10404 MULVALS["VAL_IDNA"] = 1
10406 #VALKEYS[0] = "VAL_RANDOM"
10407 VALVALS["VAL_RANDOM"] = 1
10412 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
10413 # does not seem to be a compliant escape for =
10415 $1 = substr($1, 1, index($1, "=") - 1)
10417 OPTVALS[OPTNO++] = $1
10422 val = substr($0, index($0, "=") + 1)
10424 val = substr(val, 2)
10425 val = substr(val, 1, length(val) - 1)
10427 $1 = substr($1, 1, index($1, "=") - 1)
10430 else if(VALVALS[$1]){
10431 VALKEYS[VALNO++] = $1
10436 function onepass(addons){
10437 a_onepass__worker(addons, "1", "0")
10438 a_onepass__worker(addons, "0", "1")
10440 function a_onepass__worker(addons, b0, b1){
10441 # Doing this completely sequentially and not doing make distclean in
10442 # between runs should effectively result in lesser compilations.
10443 # It is completely dumb nonetheless... TODO
10444 for(ono = 0; ono < OPTNO; ++ono){
10446 for(i = 0; i < ono; ++i){
10447 myconf = myconf " " OPTVALS[i] "=" b0 " "
10449 j = MULCHOICE[OPTVALS[i]]
10454 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10458 for(i = ono; i < OPTNO; ++i){
10459 myconf = myconf " " OPTVALS[i] "=" b1 " "
10461 j = MULCHOICE[OPTVALS[i]]
10466 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
10472 myconf = VALKEYS[i] "=any " myconf
10474 myconf = myconf " " ALWAYS " " addons
10479 i = split(MULVALS[mula], ia)
10483 print mula "=\"" j "\" " myconf
10489 # We cannot test NULL because of missing UI strings, which will end
10490 # up with different checksums
10491 print "CONFIG=NULLI OPT_AUTOCC=1"
10493 j = split(VALVALS[VALKEYS[i]], ia)
10497 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
10500 print "CONFIG=MINIMAL OPT_AUTOCC=1"
10501 print "CONFIG=NETSEND OPT_AUTOCC=1"
10502 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
10504 j = split(VALVALS[VALKEYS[i]], ia)
10508 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
10511 print "CONFIG=DEVEL OPT_AUTOCC=1"
10512 print "CONFIG=ODEVEL OPT_AUTOCC=1"
10516 onepass("OPT_DEBUG=1")
10519 ' | while read c; do
10520 if [ "$c" = split_here ]; then
10521 printf 'Predefined configs done, now OPT_ combinations\n'
10522 printf 'Predefined configs done, now OPT_ combinations\n' >&2
10523 ${SHELL} -c "cd ../ && ${MAKE} distclean"
10526 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
10527 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n"
10528 printf "\n\n##########\n${MAKE} ${MAXJOBS} config $c\n" >&2
10529 ${SHELL} -c "cd .. && ${MAKE} ${MAXJOBS} config ${c}"
10530 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
10531 printf 'Skipping after config, nothing changed\n'
10532 printf 'Skipping after config, nothing changed\n' >&2
10535 ${SHELL} -c "cd ../ && ${MAKE} ${MAXJOBS} build test"
10538 cd .. && ${MAKE} distclean
10543 if [ -z "${CHECK}${RUN_TEST}" ]; then
10547 if have_feat debug; then
10548 if have_feat devel; then
10552 ARGS="${ARGS} -Smemdebug"
10553 JOBWAIT=`add
$JOBWAIT $JOBWAIT`
10555 elif have_feat devel; then
10558 LOOPS_MAX=${LOOPS_BIG}
10562 if [ -z "${RUN_TEST}" ] || [ ${#} -eq 0 ]; then
10564 printf 'Will do up to %s tests in parallel, with a %s second timeout\n' \
10565 ${MAXJOBS} ${JOBWAIT}
10571 printf 'Tests have a %s second timeout\n' ${JOBWAIT}
10573 while [ ${#} -gt 0 ]; do
10583 printf '%u tests: %s%u ok%s, %s%u failure(s)%s. %s%u test(s) skipped%s\n' \
10584 "${TESTS_PERFORMED}" "${COLOR_OK_ON}" "${TESTS_OK}" "${COLOR_OK_OFF}" \
10585 "${COLOR_ERR_ON}" "${TESTS_FAILED}" "${COLOR_ERR_OFF}" \
10586 "${COLOR_WARN_ON}" "${TESTS_SKIPPED}" "${COLOR_WARN_OFF}"
10587 if [ -n "${ssec}" ] && [ -n "${esec}" ]; then
10588 ( echo 'Elapsed seconds: '`$awk 'BEGIN{print '"${esec}"' - '"${ssec}"'}'` )