2 #@ Synopsis: ./cc-test.sh --check-only [s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ [./cc-test.sh # Note: performs hundreds of compilations!]
5 #@ The latter generates output files.
6 #@ TODO _All_ the tests should happen in a temporary subdir.
9 # Instead of figuring out the environment in here, require a configured build
10 # system and include that! Our makefile and configure ensure that this test
11 # does not run in the configured, but the user environment nonetheless!
13 if [ -f .
/mk-config.ev
]; then
15 elif [ -f snailmail.jpg
] && [ -f .obj
/mk-config.ev
]; then
19 echo >&2 'S-nail/S-mailx is not configured.'
20 echo >&2 'This test script requires the shell environment that only the'
21 echo >&2 'configuration script can figure out, even if it will be used to'
22 echo >&2 'test a different binary than the one that would be produced!'
23 echo >&2 '(The necessary information will be in .obj/mk-config.ev.)'
24 echo >&2 'Hit RETURN to run "make config CONFIG=null'
26 make config CONFIG
=null
29 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
30 MAILX__CC_TEST_RUNNING
=1
31 export MAILX__CC_TEST_RUNNING
32 exec "${SHELL}" "${i}${0}" "${@}"
35 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
36 # such is a compile-time variable
37 ARGS
='-:/ -# -Sdotlock-ignore-error -Sexpandaddr=restrict'
38 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
39 ADDARG_UNI
=-Sttycharset=UTF-8
43 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
45 #UTF8_LOCALE= autodetected unless set
47 # Note valgrind has problems with FDs in forked childs, which causes some tests
48 # to fail (the FD is rewound and thus will be dumped twice)
50 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
52 ## -- (>8 -- 8<) -- ##
57 printf >&2 -- "${fmt}\\n" "${@}"
62 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
66 # Wed Oct 2 01:50:07 UTC 1996
67 SOURCE_DATE_EPOCH
=844221007
69 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
70 unset POSIXLY_CORRECT LOGNAME USER
74 Synopsis: cc-test.sh --check-only s-mailx-binary
75 Synopsis: cc-test.sh --mae-test s-mailx-binary [:TEST:]
78 --check-only EXE run the test series, exit success or error;
79 if run in a git(1) checkout then failed tests
80 create test output data files
81 --mae-test EXE [:TEST:] run all or only the given TESTs, and create
82 test output data files; if run in a git(1)
83 checkout with the [test-out] branch available,
84 it will also create file differences
86 Without arguments as many different configurations as possible
87 will be compiled and tested.
92 CHECK_ONLY
= MAE_TEST
= GIT_REPO
= MAILX
=
93 if [ "${1}" = --check-only ]; then
94 [ ${#} -eq 2 ] || usage
95 CHECK_ONLY
=1 MAILX
=${2}
96 [ -x "${MAILX}" ] || usage
97 echo 'Mode: --check-only, binary: '"${MAILX}"
98 [ -d ..
/.git
] && [ -z "${MAILX__CC_TEST_NO_DATA_FILES}" ] && GIT_REPO
=1
99 elif [ "${1}" = --mae-test ]; then
100 [ ${#} -ge 2 ] || usage
101 MAE_TEST
=1 MAILX
=${2}
102 [ -x "${MAILX}" ] || usage
104 echo 'Mode: --mae-test, binary: '"${MAILX}"
105 [ -d ..
/.git
] && GIT_REPO
=1
107 [ ${#} -eq 0 ] || usage
108 echo 'Mode: full compile test, this will take a long time...'
109 MAILX__CC_TEST_NO_DATA_FILES
=1
110 export MAILX__CC_TEST_NO_DATA_FILES
114 MAILX
="${MEMTESTER}${MAILX}"
115 export RAWMAILX MAILX
117 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
118 if [ -z "${UTF8_LOCALE}" ]; then
119 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
120 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
121 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
122 echo 'Trying to detect UTF-8 locale via '"${RAWMAILX}"
123 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
125 \if [ "${ttycharset}" @i=% utf ]
130 \wysh set LC_ALL=${1}
132 \eval xcall cset_test "${@}"
136 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
137 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
139 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
142 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
143 echo 'Trying to detect UTF-8 locale via locale -a'
144 UTF8_LOCALE
=`locale -a | { m=
147 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
150 ${grep} -e POSIX -e en_EN -e en_US; } \
151 >/dev/null 2>&1; then
161 if [ -n "${UTF8_LOCALE}" ]; then
162 echo 'Using Unicode locale '"${UTF8_LOCALE}"
164 echo 'No Unicode locale found, disabling Unicode tests'
172 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
173 trap "exit 1" HUP INT TERM
176 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
177 ${grep} +${1} ) >/dev
/null
2>&1
181 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
183 if [ ${#} -gt 0 ]; then
185 printf '[%s]\n' "${1}"
193 [ ${#} -ge 1 ] && __from
=${1} ||
194 __from
='Silybum Marianum Tue Apr 17 15:55:01 2018'
195 [ ${#} -eq 2 ] && __to=${2} || __to="${MBOX}"
196 ${cat} <<-_EOT > .tmta.sh
198 ( echo 'From '"${__from}" && ${cat} && echo ) >> "${__to}"
204 restat=${?} tid=${1} eestat=${2} f=${3} s=${4}
205 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
206 err "${TESTNAME}-${tid}" 'unexpected status: '"${restat} != ${eestat}"
207 csum="`${cksum} < ${f}`"
208 if [ "${csum}" = "${s}" ]; then
210 printf '%s-%s: ok\n' "${TEST_NAME}" "${tid}"
214 printf '%s-%s: error: checksum mismatch (got %s)\n' \
215 "${TEST_NAME}" "${tid}" "${csum}"
218 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
219 x="t.
${TEST_NAME}-${tid}"
220 if [ -n "${MAE_TEST}" ] || [ -n "${maex}" -a -n "${GIT_REPO}" ]; then
221 ${cp} -f "${f}" ./"${x}"
224 if [ -n "${maex}" ] && [ -n "${GIT_REPO}" ] &&
225 command -v diff >/dev
/null
2>&1 &&
226 (git rev-parse
--verify test-out
) >/dev
/null
2>&1 &&
227 git show test-out
:"${x}" > .
/"${x}".old
2>/dev
/null
; then
228 diff -ru .
/"${x}".old ./"${x}" > "${x}".
diff
235 printf '%s: error: %s\n' ${1} "${2}"
239 # $1=test name [$2=status]
241 [ ${#} -gt 1 ] && __qm__
=${2}
242 if [ ${__qm__} -ne 0 ]; then
243 err
"${TEST_NAME}-${1}" 'unexpected non-0 exit status'
246 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
252 # $1=test name [$2=status]
254 [ ${#} -gt 1 ] && __qm__
=${2}
255 if [ ${__qm__} -eq 0 ]; then
256 err
"${TEST_NAME}-${1}" 'unexpected 0 exit status'
259 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
264 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
266 echo "$((${1} + ${2}))"
270 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
274 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
276 echo "$((${1} % ${2}))"
280 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
285 t_X_opt_input_command_stack
289 t_input_inject_semicolon_seq
317 t_quote_a_cmd_escapes
320 t_mime_types_load_control
321 t_lreply_futh_rth_etc
334 t_X_opt_input_command_stack
() {
335 t_prolog X_opt_input_command_stack
337 ${cat} <<- '__EOT' > "${BODY}"
345 echo "define mac1 {";\
346 echo " echo mac1-1 via1 \$0";\
348 echo " echo mac1-2";\
350 echo " echo mac1-3";\
353 echo "define mac2 {";\
354 echo " echo mac2-1 via1 \$0";\
356 echo " echo mac2-2";\
362 echo echo 1-1-1 via1 \$0;\
374 # The -X option supports multiline arguments, and those can internally use
375 # reverse solidus newline escaping. And all -X options are joined...
377 < "${BODY}" ${MAILX} ${ARGS} \
392 echo "define mac1 {";\
393 echo " echo mac1-1 via2 \$0";\
395 echo " echo mac1-2";\
397 echo " echo mac1-3";\
400 echo "define mac2 {";\
401 echo " echo mac2-1 via2 \$0";\
403 echo " echo mac2-2";\
409 echo echo 1-1-1 via2 \$0;\
423 check 1 0 "${MBOX}" '1786542668 416'
430 if have_feat uistrings; then :; else
431 echo 'x_errexit: unsupported, skipped'
435 ${cat} <<- '__EOT' > "${BODY}"
441 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
442 -X'echo one' -X' echos nono ' -X'echo two' \
444 check 1 0 "${MBOX}" '916157812 53'
446 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
448 check 2 0 "${MBOX}" '916157812 53'
450 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
452 check
3 0 "${MBOX}" '916157812 53'
456 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
457 -X'echo one' -X' echos nono ' -X'echo two' \
459 check
4 1 "${MBOX}" '2118430867 49'
461 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
463 check 5 1 "${MBOX}" '2118430867 49'
465 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
467 check
6 1 "${MBOX}" '12955965 172'
469 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
471 check 7 1 "${MBOX}" '12955965 172'
473 ## Repeat 4-7 with ignerr set
475 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
477 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
478 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
480 check
8 0 "${BODY}" '916157812 53'
482 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
484 check 9 0 "${BODY}" '916157812 53'
486 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
488 check
10 0 "${BODY}" '916157812 53'
490 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
492 check 11 0 "${BODY}" '916157812 53'
502 # Test basic assumption
503 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
504 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
506 check
1 0 "${MBOX}" '270686329 21'
509 ${cat} <<- '__EOT' > "${BODY}"
514 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
515 -Snoasksub -Sasksub -Snoasksub \
516 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
518 check
2 0 "${MBOX}" '3182942628 37'
520 ${cat} <<- '__EOT' > "${BODY}"
525 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
526 -Snoasksub -Sasksub \
527 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
529 check
3 0 "${MBOX}" '2006554293 39'
532 ${cat} <<- '__EOT' > "${BODY}"
533 echo dietcurd<$dietcurd>
535 echo dietcurd<$dietcurd>
537 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
538 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
539 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
540 -X'echo dietcurd<$dietcurd>' \
542 check
4 0 "${MBOX}" '1985768109 65'
544 ${cat} <<- '__EOT' > "${BODY}"
545 echo dietcurd<$dietcurd>
547 echo dietcurd<$dietcurd>
549 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
550 -Sdietcurd=strawberry
-Snodietcurd \
551 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
552 -X'echo dietcurd<$dietcurd>' \
554 check
5 0 "${MBOX}" '151574279 51'
556 # TODO once we have a detached one with env=1..
557 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
558 echo 's_freeze-{6,7}: shell sets $TERM, skipped'
560 ${cat} <<- '__EOT' > "${BODY}"
561 !echo "shell says TERM<$TERM>"
563 !echo "shell says TERM<$TERM>"
565 !echo "shell says TERM<$TERM>"
567 !echo "shell says TERM<$TERM>"
569 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
570 -STERM=strawberry
-SnoTERM -STERM=vanilla \
571 -X'echo mail<$TERM>' -X'unset TERM' \
572 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
574 check
6 0 "${MBOX}" '1211476036 167'
576 ${cat} <<- '__EOT' > "${BODY}"
577 !echo "shell says TERM<$TERM>"
579 !echo "shell says TERM<$TERM>"
581 !echo "shell says TERM<$TERM>"
583 !echo "shell says TERM<$TERM>"
585 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
586 -STERM=strawberry
-SnoTERM \
587 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
588 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
590 check
7 0 "${MBOX}" '3365080441 132'
600 ${cat} <<- '__EOT' > "${BODY}"
619 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
620 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
621 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
623 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
624 echo a$'\u0041\u41\u0C1\U00000041\U41'c
647 echo a$'b\U0000000'dt
648 echo a$'b\U00000000'du
658 if [ -z "${UTF8_LOCALE}" ]; then
659 echo 'Skip wysh-unicode, no UTF8_LOCALE'
661 < "${BODY}" DIET=CURD TIED= \
662 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
663 check unicode 0 "${MBOX}" '475805847 317'
666 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
667 check c 0 "${MBOX}" '1473887148 321'
669 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
670 wysh set mager='\hey\'
672 wysh set mager="\hey\\"
674 wysh set mager=$'\hey\\'
677 check 3 0 "${MBOX}" '1289698238 69'
682 t_input_inject_semicolon_seq() {
683 t_prolog input_inject_semicolon_seq
685 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
690 echon this_is_mymac;call mydeepmac;echon ';';
692 echon one';';call mymac;echon two";";call mymac;echo three$';';
694 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
696 echon one';';call mymac;echon two";";call mymac;echo three$';';
699 check 1 0 "${MBOX}" '512117110 140'
705 t_prolog commandalias
707 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
708 commandalias echo echo hoho
712 commandalias XxX XxXx
713 commandalias XxXx XxXxX
714 commandalias XxXxX XxXxXx
715 commandalias XxXxXx echo huhu
716 commandalias XxXxXxX echo huhu
718 commandalias XxXxXx XxXxXxX
721 commandalias XxXxXx echo huhu
725 check 1 0 "${MBOX}" '1638809585 36'
733 # Nestable conditions test
734 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
756 if $dietcurd == 'yoho'
761 if $dietcurd @== 'Yoho'
766 if $dietcurd == 'Yoho'
771 if $dietcurd != 'yoho'
776 if $dietcurd @!= 'Yoho'
781 if $dietcurd != 'Yoho'
842 if $dietcurd == 'yohu'
844 elif $dietcurd == 'yoha'
846 elif $dietcurd == 'yohe'
848 elif $dietcurd == 'yoho'
850 if $dietcurd == 'yohu'
852 elif $dietcurd == 'yoha'
854 elif $dietcurd == 'yohe'
856 elif $dietcurd == 'yoho'
858 if $dietcurd == 'yohu'
860 elif $dietcurd == 'yoha'
862 elif $dietcurd == 'yohe'
864 elif $dietcurd == 'yoho'
1013 set diet=abc curd=abc
1019 set diet=abc curd=abcd
1025 # 1. Shitty grouping capabilities as of today
1026 unset diet curd ndefined
1027 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1033 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1038 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1043 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1048 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1053 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1054 && [ no ] || [ yes ]
1059 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1064 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1069 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1074 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1079 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1084 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1089 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1094 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1099 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1104 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1110 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1116 if [ [ $diet == 'yo' ] && [ $curd == 'ho' ] ] && [ $ndefined ]
1121 # 2. Shitty grouping capabilities as of today
1122 unset diet curd ndefined
1123 if [ false || false || true ] && [ false || true ] && yes
1128 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1133 if [ 1 || 0 || 0 || 0 ]
1138 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1143 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1148 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1153 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1158 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1163 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1168 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1173 if 1 || 0 || 0 || 0 && 0
1178 if 1 || 0 || 0 || 0 && 1
1183 if 0 || 0 || 0 || 1 && 0
1188 if 0 || 0 || 0 || 1 && 1
1193 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1198 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1204 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1209 if $diet == 'yo' && $curd == 'ho' && $ndefined
1215 if [ $diet == 'yo' && $curd == 'ho' ] && $ndefined
1220 if $diet == 'yo' && $curd == 'ho' && $ndefined
1225 if [ [ [ [ [ [ $diet == 'yo' && $curd == 'ho' && $ndefined ] ] ] ] ] ]
1230 # Some more en-braced variables
1232 if ${diet} == ${curd}
1237 if ${diet} != ${curd}
1253 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1258 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1263 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1268 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1273 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1278 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1283 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1288 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1293 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1299 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1304 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1309 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1314 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1319 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1324 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1329 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1334 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1339 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1346 check normal 0 "${MBOX}" '1688759742 719'
1348 if have_feat regex; then
1349 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1351 if $dietcurd =~ '^yo.*'
1356 if $dietcurd =~ '^Yo.*'
1361 if $dietcurd @=~ '^Yo.*'
1366 if $dietcurd =~ '^yOho.+'
1371 if $dietcurd @!~ '.*Ho$'
1376 if $dietcurd !~ '.+yohO$'
1381 if [ $dietcurd @i!~ '.+yoho$' ]
1386 if ! [ $dietcurd @i=~ '.+yoho$' ]
1391 if ! ! [ $dietcurd @i!~ '.+yoho$' ]
1396 if ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ]
1401 if [ ! [ ! [ $dietcurd @i!~ '.+yoho$' ] ] ]
1406 if ! [ ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1411 if ! ! ! $dietcurd !~ '.+yoho$'
1416 if ! ! ! $dietcurd =~ '.+yoho$'
1421 if ! [ ! ! [ ! [ $dietcurd !~ '.+yoho$' ] ] ]
1426 set diet=abc curd='^abc$'
1432 set diet=abc curd='^abcd$'
1440 check regex 0 "${MBOX}" '1115671789 95'
1442 printf 'if-regex: unsupported, skipped\n'
1451 # Nestable conditions test
1452 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1467 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1472 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1473 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1482 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1484 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1493 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1500 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1507 echo ----- $1: $2 -> $3 -> $4
1515 call llx
'call off' on on on
1516 call llx
'call off' off on on
1517 call llx
'call off' on off on
1518 call llx
'call off' on off off
1519 localopts call-fixate on
1520 call llx
'call-fixate on' on on on
1521 call llx
'call-fixate on' off on on
1522 call llx
'call-fixate on' on off on
1523 call llx
'call-fixate on' on off off
1524 unset x
;localopts call on
1525 call llx
'call on' on on on
1526 call llx
'call on' off on on
1527 call llx
'call on' on off on
1528 call llx
'call on' on off off
1533 check
1 0 "${MBOX}" '4016155249 1246'
1541 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1569 echo ------- global-1 du=$du
1571 echo ------- global-2 du=$du
1574 echo ------- global-3 du=$du
1576 echo ------- global-4 du=$du
1578 echo ------- global-5 du=$du
1581 check 1 0 "${MBOX}" '2411598140 641'
1586 t_macro_param_shift() {
1587 t_prolog macro_param_shift
1589 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1592 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1597 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1598 if [ $# > 1 ] || [ $ignerr == '' ]
1603 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1605 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1609 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1614 call t2 1 you get four args
1615 echo t1.1: $?';' ignerr ($ignerr) should not exist
1616 call t2 1 you get 'three args'
1617 echo t1.2: $?';' ignerr ($ignerr) should not exist
1618 call t2 1 you 'get two args'
1619 echo t1.3: $?';' ignerr ($ignerr) should not exist
1620 call t2 1 'you get one arg'
1621 echo t1.4: $?';' ignerr ($ignerr) should not exist
1622 ignerr call t2 '' 'you get one arg'
1623 echo t1.5: $?';' ignerr ($ignerr) should not exist
1628 check 1 0 "${MBOX}" '1402489146 1682'
1636 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1637 vput addrcodec res e
1 <doog@def
>
1638 echo $?
/$^ERRNAME
$res
1639 eval vput addrcodec res d
$res
1640 echo $?
/$^ERRNAME
$res
1641 vput addrcodec res e
2 .
<doog@def
>
1642 echo $?
/$^ERRNAME
$res
1643 eval vput addrcodec res d
$res
1644 echo $?
/$^ERRNAME
$res
1645 vput addrcodec res e
3 Sauer Dr.
<doog@def
>
1646 echo $?
/$^ERRNAME
$res
1647 eval vput addrcodec res d
$res
1648 echo $?
/$^ERRNAME
$res
1649 vput addrcodec res e
3.50 Sauer
(Ma
) Dr.
<doog@def
>
1650 echo $?
/$^ERRNAME
$res
1651 eval vput addrcodec res d
$res
1652 echo $?
/$^ERRNAME
$res
1653 vput addrcodec res e
3.51 Sauer
(Ma
) "Dr." <doog@def
>
1654 echo $?
/$^ERRNAME
$res
1655 eval vput addrcodec res d
$res
1656 echo $?
/$^ERRNAME
$res
1658 vput addrcodec res
+e
4 Sauer
(Ma
) Dr.
<doog@def
>
1659 echo $?
/$^ERRNAME
$res
1660 eval vput addrcodec res d
$res
1661 echo $?
/$^ERRNAME
$res
1662 vput addrcodec res
+e
5 Sauer
(Ma
) Braten Dr.
<doog@def
>
1663 echo $?
/$^ERRNAME
$res
1664 eval vput addrcodec res d
$res
1665 echo $?
/$^ERRNAME
$res
1666 vput addrcodec res
+e
6 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
>
1667 echo $?
/$^ERRNAME
$res
1668 eval vput addrcodec res d
$res
1669 echo $?
/$^ERRNAME
$res
1670 vput addrcodec res
+e
7 Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
)
1671 echo $?
/$^ERRNAME
$res
1672 eval vput addrcodec res d
$res
1673 echo $?
/$^ERRNAME
$res
1674 vput addrcodec res
+e
8 \
1675 Dr. Sauer
(Ma
) Braten Dr.
(Heu
) <doog@def
> (bu
) Boom. Boom
1676 echo $?
/$^ERRNAME
$res
1677 eval vput addrcodec res d
$res
1678 echo $?
/$^ERRNAME
$res
1679 vput addrcodec res
+e
9 Dr.Sauer
(Ma
)Braten Dr.
(Heu
) <doog@def
>
1680 echo $?
/$^ERRNAME
$res
1681 eval vput addrcodec res d
$res
1682 echo $?
/$^ERRNAME
$res
1683 vput addrcodec res
+e
10 (Ma
)Braten Dr.
(Heu
) <doog@def
>
1684 echo $?
/$^ERRNAME
$res
1685 eval vput addrcodec res d
$res
1686 echo $?
/$^ERRNAME
$res
1687 vput addrcodec res
+e
11 (Ma
)Braten Dr
"." (Heu
) <doog@def
>
1688 echo $?
/$^ERRNAME
$res
1689 eval vput addrcodec res d
$res
1690 echo $?
/$^ERRNAME
$res
1691 vput addrcodec res
+e
12 Dr. Sauer
(Ma
) Braten Dr.
(u
) <doog@def
>
1692 echo $?
/$^ERRNAME
$res
1693 eval vput addrcodec res d
$res
1694 echo $?
/$^ERRNAME
$res
1695 vput addrcodec res
+e
13(Ma
)Braten Dr.
(Heu
) <doog@def
>
1696 echo $?
/$^ERRNAME
$res
1697 eval vput addrcodec res d
$res
1698 echo $?
/$^ERRNAME
$res
1699 vput addrcodec res
+e
14 Hey
, Du
<doog@def
> Wie
() findet Dr. das?
()
1700 echo $?
/$^ERRNAME
$res
1701 eval vput addrcodec res d
$res
1702 echo $?
/$^ERRNAME
$res
1703 vput addrcodec res
+e
15 \
1704 Hey
, Du
<doog@def
> Wie
() findet
"" Dr.
"" das?
()
1705 echo $?
/$^ERRNAME
$res
1706 eval vput addrcodec res d
$res
1707 echo $?
/$^ERRNAME
$res
1708 vput addrcodec res
+e
16 \
1709 "Hey," "Du" <doog@def
> "Wie()" findet
"" Dr.
"" das?
()
1710 echo $?
/$^ERRNAME
$res
1711 eval vput addrcodec res d
$res
1712 echo $?
/$^ERRNAME
$res
1713 vput addrcodec res
+e
17 \
1714 "Hey" Du
<doog@def
> "Wie() findet " " Dr. """ das?
()
1715 echo $?
/$^ERRNAME
$res
1716 eval vput addrcodec res d
$res
1717 echo $?
/$^ERRNAME
$res
1718 vput addrcodec res
+e
18 \
1719 <doog@def
> "Hey" Du
"Wie() findet " " Dr. """ das?
()
1720 echo $?
/$^ERRNAME
$res
1721 eval vput addrcodec res d
$res
1722 echo $?
/$^ERRNAME
$res
1723 vput addrcodec res
+e
19 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1724 echo $?
/$^ERRNAME
$res
1725 eval vput addrcodec res d
$res
1726 echo $?
/$^ERRNAME
$res
1728 vput addrcodec res
++e
20 Hey\
,\" <doog@def
> "Wie()" findet
\" Dr.
\" das?
1729 echo $?
/$^ERRNAME
$res
1730 vput addrcodec res
++e
21 Hey\
,\"" <doog@def> "Wie
()" findet \" Dr. \" das?
1731 echo $?/$^ERRNAME $res
1732 eval vput addrcodec res d $res
1733 echo $?/$^ERRNAME $res
1735 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie
()" findet \" Dr. \" das?
1736 echo $?/$^ERRNAME $res
1737 eval vput addrcodec res d $res
1738 echo $?/$^ERRNAME $res
1740 vput addrcodec res s \
1741 "23 Hey
\\,\\\" \"Wie
" () "\" findet
\\\" Dr.
\\\" das?
" <doog@def>
1742 echo $?/$^ERRNAME $res
1744 # Fix for [f3852f88]
1745 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1746 echo $?/$^ERRNAME $res
1747 eval vput addrcodec res d $res
1748 echo $?/$^ERRNAME $res
1749 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot
(e
)d
"
1750 echo $?/$^ERRNAME $res
1751 eval vput addrcodec res d $res
1752 echo $?/$^ERRNAME $res
1755 check 1 0 "${MBOX}" '1047317989 2612'
1757 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1759 mlsubscribe isa2@list
1761 vput addrcodec res skin Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1762 echo $?
/$^ERRNAME
$res
1763 vput addrcodec res skinlist Hey
\\,\" <isa0@list
> "Wie()" find \" Dr.
\" das?
1764 echo $?
/$^ERRNAME
$res
1765 vput addrcodec res skin Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1766 echo $?
/$^ERRNAME
$res
1767 vput addrcodec res skinlist Hey
\\,\" <isa1@list
> "Wie()" find \" Dr.
\" das?
1768 echo $?
/$^ERRNAME
$res
1769 vput addrcodec res skin Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1770 echo $?
/$^ERRNAME
$res
1771 vput addrcodec res skinlist Hey
\\,\" <isa2@list
> "Wie()" find \" Dr.
\" das?
1772 echo $?
/$^ERRNAME
$res
1775 check
2 0 "${MBOX}" '1391779299 104'
1777 if have_feat idna
; then
1778 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1779 vput addrcodec res e (heu) <du@blödiän> "stroh
" du
1780 echo $?/$^ERRNAME $res
1781 eval vput addrcodec res d $res
1782 echo $?/$^ERRNAME $res
1783 vput addrcodec res e <du@blödiän> du
1784 echo $?/$^ERRNAME $res
1785 eval vput addrcodec res d $res
1786 echo $?/$^ERRNAME $res
1787 vput addrcodec res e du <du@blödiän>
1788 echo $?/$^ERRNAME $res
1789 eval vput addrcodec res d $res
1790 echo $?/$^ERRNAME $res
1791 vput addrcodec res e <du@blödiän>
1792 echo $?/$^ERRNAME $res
1793 eval vput addrcodec res d $res
1794 echo $?/$^ERRNAME $res
1795 vput addrcodec res e du@blödiän
1796 echo $?/$^ERRNAME $res
1797 eval vput addrcodec res d $res
1798 echo $?/$^ERRNAME $res
1801 check idna 0 "${MBOX}" '498775983 326'
1803 printf 'addrcodec-idna: unsupported, skipped\n'
1812 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1814 vput vexpr res = 9223372036854775807
1815 echo $?/$^ERRNAME $res
1816 vput vexpr res = 9223372036854775808
1817 echo $?/$^ERRNAME $res
1818 vput vexpr res = u9223372036854775808
1819 echo $?/$^ERRNAME $res
1820 vput vexpr res @= 9223372036854775808
1821 echo $?/$^ERRNAME $res
1822 vput vexpr res = -9223372036854775808
1823 echo $?/$^ERRNAME $res
1824 vput vexpr res = -9223372036854775809
1825 echo $?/$^ERRNAME $res
1826 vput vexpr res @= -9223372036854775809
1827 echo $?/$^ERRNAME $res
1828 vput vexpr res = U9223372036854775809
1829 echo $?/$^ERRNAME $res
1832 0b0111111111111111111111111111111111111111111111111111111111111111
1833 echo $?/$^ERRNAME $res
1835 S0b1000000000000000000000000000000000000000000000000000000000000000
1836 echo $?/$^ERRNAME $res
1838 S0b1000000000000000000000000000000000000000000000000000000000000000
1839 echo $?/$^ERRNAME $res
1841 U0b1000000000000000000000000000000000000000000000000000000000000000
1842 echo $?/$^ERRNAME $res
1844 0b1000000000000000000000000000000000000000000000000000000000000000
1845 echo $?/$^ERRNAME $res
1847 0b1000000000000000000000000000000000000000000000000000000000000000
1848 echo $?/$^ERRNAME $res
1850 -0b1000000000000000000000000000000000000000000000000000000000000000
1851 echo $?/$^ERRNAME $res
1853 S0b1000000000000000000000000000000000000000000000000000000000000001
1854 echo $?/$^ERRNAME $res
1856 S0b1000000000000000000000000000000000000000000000000000000000000001
1857 echo $?/$^ERRNAME $res
1859 -0b1000000000000000000000000000000000000000000000000000000000000001
1860 echo $?/$^ERRNAME $res
1862 U0b1000000000000000000000000000000000000000000000000000000000000001
1863 echo $?/$^ERRNAME $res
1865 vput vexpr res = 0777777777777777777777
1866 echo $?/$^ERRNAME $res
1867 vput vexpr res = S01000000000000000000000
1868 echo $?/$^ERRNAME $res
1869 vput vexpr res @= S01000000000000000000000
1870 echo $?/$^ERRNAME $res
1871 vput vexpr res = U01000000000000000000000
1872 echo $?/$^ERRNAME $res
1873 vput vexpr res = 01000000000000000000000
1874 echo $?/$^ERRNAME $res
1875 vput vexpr res @= 01000000000000000000000
1876 echo $?/$^ERRNAME $res
1877 vput vexpr res = -01000000000000000000000
1878 echo $?/$^ERRNAME $res
1879 vput vexpr res = S01000000000000000000001
1880 echo $?/$^ERRNAME $res
1881 vput vexpr res @= S01000000000000000000001
1882 echo $?/$^ERRNAME $res
1883 vput vexpr res @= -01000000000000000000001
1884 echo $?/$^ERRNAME $res
1885 vput vexpr res = U01000000000000000000001
1886 echo $?/$^ERRNAME $res
1888 vput vexpr res = 0x7FFFFFFFFFFFFFFF
1889 echo $?/$^ERRNAME $res
1890 vput vexpr res = S0x8000000000000000
1891 echo $?/$^ERRNAME $res
1892 vput vexpr res @= S0x8000000000000000
1893 echo $?/$^ERRNAME $res
1894 vput vexpr res = U0x8000000000000000
1895 echo $?/$^ERRNAME $res
1896 vput vexpr res = 0x8000000000000000
1897 echo $?/$^ERRNAME $res
1898 vput vexpr res @= 0x8000000000000000
1899 echo $?/$^ERRNAME $res
1900 vput vexpr res = -0x8000000000000000
1901 echo $?/$^ERRNAME $res
1902 vput vexpr res = S0x8000000000000001
1903 echo $?/$^ERRNAME $res
1904 vput vexpr res @= S0x8000000000000001
1905 echo $?/$^ERRNAME $res
1906 vput vexpr res @= -0x8000000000000001
1907 echo $?/$^ERRNAME $res
1908 vput vexpr res = u0x8000000000000001
1909 echo $?/$^ERRNAME $res
1912 echo $?/$^ERRNAME $res
1914 echo $?/$^ERRNAME $res
1916 echo $?/$^ERRNAME $res
1918 vput vexpr res + 0 0
1919 echo $?/$^ERRNAME $res
1920 vput vexpr res + 0 1
1921 echo $?/$^ERRNAME $res
1922 vput vexpr res + 1 1
1923 echo $?/$^ERRNAME $res
1925 vput vexpr res + 9223372036854775807 0
1926 echo $?/$^ERRNAME $res
1927 vput vexpr res + 9223372036854775807 1
1928 echo $?/$^ERRNAME $res
1929 vput vexpr res @+ 9223372036854775807 1
1930 echo $?/$^ERRNAME $res
1931 vput vexpr res + 0 9223372036854775807
1932 echo $?/$^ERRNAME $res
1933 vput vexpr res + 1 9223372036854775807
1934 echo $?/$^ERRNAME $res
1935 vput vexpr res @+ 1 9223372036854775807
1936 echo $?/$^ERRNAME $res
1938 vput vexpr res + -9223372036854775808 0
1939 echo $?/$^ERRNAME $res
1940 vput vexpr res + -9223372036854775808 -1
1941 echo $?/$^ERRNAME $res
1942 vput vexpr res @+ -9223372036854775808 -1
1943 echo $?/$^ERRNAME $res
1944 vput vexpr res + 0 -9223372036854775808
1945 echo $?/$^ERRNAME $res
1946 vput vexpr res + -1 -9223372036854775808
1947 echo $?/$^ERRNAME $res
1948 vput vexpr res @+ -1 -9223372036854775808
1949 echo $?/$^ERRNAME $res
1951 vput vexpr res - 0 0
1952 echo $?/$^ERRNAME $res
1953 vput vexpr res - 0 1
1954 echo $?/$^ERRNAME $res
1955 vput vexpr res - 1 1
1956 echo $?/$^ERRNAME $res
1958 vput vexpr res - 9223372036854775807 0
1959 echo $?/$^ERRNAME $res
1960 vput vexpr res - 9223372036854775807 -1
1961 echo $?/$^ERRNAME $res
1962 vput vexpr res @- 9223372036854775807 -1
1963 echo $?/$^ERRNAME $res
1964 vput vexpr res - 0 9223372036854775807
1965 echo $?/$^ERRNAME $res
1966 vput vexpr res - -1 9223372036854775807
1967 echo $?/$^ERRNAME $res
1968 vput vexpr res - -2 9223372036854775807
1969 echo $?/$^ERRNAME $res
1970 vput vexpr res @- -2 9223372036854775807
1971 echo $?/$^ERRNAME $res
1973 vput vexpr res - -9223372036854775808 +0
1974 echo $?/$^ERRNAME $res
1975 vput vexpr res - -9223372036854775808 +1
1976 echo $?/$^ERRNAME $res
1977 vput vexpr res @- -9223372036854775808 +1
1978 echo $?/$^ERRNAME $res
1979 vput vexpr res - 0 -9223372036854775808
1980 echo $?/$^ERRNAME $res
1981 vput vexpr res - +1 -9223372036854775808
1982 echo $?/$^ERRNAME $res
1983 vput vexpr res @- +1 -9223372036854775808
1984 echo $?/$^ERRNAME $res
1986 vput vexpr res + -13 -2
1987 echo $?/$^ERRNAME $res
1988 vput vexpr res - 0 0
1989 echo $?/$^ERRNAME $res
1990 vput vexpr res - 0 1
1991 echo $?/$^ERRNAME $res
1992 vput vexpr res - 1 1
1993 echo $?/$^ERRNAME $res
1994 vput vexpr res - -13 -2
1995 echo $?/$^ERRNAME $res
1997 vput vexpr res * 0 0
1998 echo $?/$^ERRNAME $res
1999 vput vexpr res * 0 1
2000 echo $?/$^ERRNAME $res
2001 vput vexpr res * 1 1
2002 echo $?/$^ERRNAME $res
2003 vput vexpr res * -13 -2
2004 echo $?/$^ERRNAME $res
2006 vput vexpr res / 0 0
2007 echo $?/$^ERRNAME $res
2008 vput vexpr res / 0 1
2009 echo $?/$^ERRNAME $res
2010 vput vexpr res / 1 1
2011 echo $?/$^ERRNAME $res
2012 vput vexpr res / -13 -2
2013 echo $?/$^ERRNAME $res
2015 vput vexpr res % 0 0
2016 echo $?/$^ERRNAME $res
2017 vput vexpr res % 0 1
2018 echo $?/$^ERRNAME $res
2019 vput vexpr res % 1 1
2020 echo $?/$^ERRNAME $res
2021 vput vexpr res % -13 -2
2022 echo $?/$^ERRNAME $res
2025 check numeric 0 "${MBOX}" '960821755 1962'
2027 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2028 vput vexpr res
find 'bananarama' 'nana'
2029 echo $?
/$^ERRNAME
:$res:
2030 vput vexpr res
find 'bananarama' 'bana'
2031 echo $?
/$^ERRNAME
:$res:
2032 vput vexpr res
find 'bananarama' 'Bana'
2033 echo $?
/$^ERRNAME
:$res:
2034 vput vexpr res
find 'bananarama' 'rama'
2035 echo $?
/$^ERRNAME
:$res:
2037 vput vexpr res ifind
'bananarama' 'nana'
2038 echo $?
/$^ERRNAME
:$res:
2039 vput vexpr res ifind
'bananarama' 'bana'
2040 echo $?
/$^ERRNAME
:$res:
2041 vput vexpr res ifind
'bananarama' 'Bana'
2042 echo $?
/$^ERRNAME
:$res:
2043 vput vexpr res ifind
'bananarama' 'rama'
2044 echo $?
/$^ERRNAME
:$res:
2046 vput vexpr res substring
'bananarama' 1
2047 echo $?
/$^ERRNAME
:$res:
2048 vput vexpr res substring
'bananarama' 3
2049 echo $?
/$^ERRNAME
:$res:
2050 vput vexpr res substring
'bananarama' 5
2051 echo $?
/$^ERRNAME
:$res:
2052 vput vexpr res substring
'bananarama' 7
2053 echo $?
/$^ERRNAME
:$res:
2054 vput vexpr res substring
'bananarama' 9
2055 echo $?
/$^ERRNAME
:$res:
2056 vput vexpr res substring
'bananarama' 10
2057 echo $?
/$^ERRNAME
:$res:
2058 vput vexpr res substring
'bananarama' 1 3
2059 echo $?
/$^ERRNAME
:$res:
2060 vput vexpr res substring
'bananarama' 3 3
2061 echo $?
/$^ERRNAME
:$res:
2062 vput vexpr res substring
'bananarama' 5 3
2063 echo $?
/$^ERRNAME
:$res:
2064 vput vexpr res substring
'bananarama' 7 3
2065 echo $?
/$^ERRNAME
:$res:
2066 vput vexpr res substring
'bananarama' 9 3
2067 echo $?
/$^ERRNAME
:$res:
2068 vput vexpr res substring
'bananarama' 10 3
2069 echo $?
/$^ERRNAME
:$res:
2071 vput vexpr res substring
'bananarama' -1
2072 echo $?
/$^ERRNAME
:$res:
2073 vput vexpr res substring
'bananarama' -3
2074 echo $?
/$^ERRNAME
:$res:
2075 vput vexpr res substring
'bananarama' -5
2076 echo $?
/$^ERRNAME
:$res:
2077 vput vexpr res substring
'bananarama' -7
2078 echo $?
/$^ERRNAME
:$res:
2079 vput vexpr res substring
'bananarama' -9
2080 echo $?
/$^ERRNAME
:$res:
2081 vput vexpr res substring
'bananarama' -10
2082 echo $?
/$^ERRNAME
:$res:
2083 vput vexpr res substring
'bananarama' 1 -3
2084 echo $?
/$^ERRNAME
:$res:
2085 vput vexpr res substring
'bananarama' 3 -3
2086 echo $?
/$^ERRNAME
:$res:
2087 vput vexpr res substring
'bananarama' 5 -3
2088 echo $?
/$^ERRNAME
:$res:
2089 vput vexpr res substring
'bananarama' 7 -3
2090 echo $?
/$^ERRNAME
:$res:
2091 vput vexpr res substring
'bananarama' 9 -3
2092 echo $?
/$^ERRNAME
:$res:
2093 vput vexpr res substring
'bananarama' 10 -3
2094 echo $?
/$^ERRNAME
:$res:
2096 vput vexpr res trim
'Cocoon Cocoon'
2097 echo $?
/$^ERRNAME
:$res:
2098 vput vexpr res trim
' Cocoon Cocoon '
2099 echo $?
/$^ERRNAME
:$res:
2100 vput vexpr res trim-front
'Cocoon Cocoon'
2101 echo $?
/$^ERRNAME
:$res:
2102 vput vexpr res trim-front
' Cocoon Cocoon '
2103 echo $?
/$^ERRNAME
:$res:
2104 vput vexpr res trim-end
'Cocoon Cocoon'
2105 echo $?
/$^ERRNAME
:$res:
2106 vput vexpr res trim-end
' Cocoon Cocoon '
2107 echo $?
/$^ERRNAME
:$res:
2110 check string
0 "${MBOX}" '3182004322 601'
2112 if have_feat regex
; then
2113 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2114 vput vexpr res regex 'bananarama' 'nana'
2115 echo $?/$^ERRNAME :$res:
2116 vput vexpr res regex 'bananarama' 'bana'
2117 echo $?/$^ERRNAME :$res:
2118 vput vexpr res regex 'bananarama' 'Bana'
2119 echo $?/$^ERRNAME :$res:
2120 vput vexpr res regex 'bananarama' 'rama'
2121 echo $?/$^ERRNAME :$res:
2123 vput vexpr res iregex 'bananarama' 'nana'
2124 echo $?/$^ERRNAME :$res:
2125 vput vexpr res iregex 'bananarama' 'bana'
2126 echo $?/$^ERRNAME :$res:
2127 vput vexpr res iregex 'bananarama' 'Bana'
2128 echo $?/$^ERRNAME :$res:
2129 vput vexpr res iregex 'bananarama' 'rama'
2130 echo $?/$^ERRNAME :$res:
2132 vput vexpr res regex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2133 echo $?/$^ERRNAME :$res:
2134 vput vexpr res regex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2135 echo $?/$^ERRNAME :$res:
2136 vput vexpr res regex 'bananarama' 'Bana(.+)' '\$1\$0'
2137 echo $?/$^ERRNAME :$res:
2138 vput vexpr res regex 'bananarama' '(.+)rama' '\$1\$0'
2139 echo $?/$^ERRNAME :$res:
2141 vput vexpr res iregex 'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2142 echo $?/$^ERRNAME :$res:
2143 vput vexpr res iregex 'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2144 echo $?/$^ERRNAME :$res:
2145 vput vexpr res iregex 'bananarama' 'Bana(.+)' '\$1\$0'
2146 echo $?/$^ERRNAME :$res:
2147 vput vexpr res iregex 'bananarama' '(.+)rama' '\$1\$0'
2148 echo $?/$^ERRNAME :$res:
2152 check regex 0 "${MBOX}" '3270360157 311'
2154 printf 'vexpr-regex: unsupported, skipped\n'
2163 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2168 vput vexpr j
'&' $i 7
2174 vput vexpr j
'&' $i 7
2180 echo ! The end
for $1
2184 # Transport $?/$! up the call chain
2190 wysh
set i
=$? j
=$
! k
=$^ERRNAME
2194 echo ! The end
for $1
2195 return $i $^ERR-BUSY
2199 # Up and down it goes
2206 vput vexpr k
- $1 $2
2210 echo "# <$i/$j> .. "
2214 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2217 echo ! The end
for $1=$i/$2
2221 return $i $^ERR-BUSY
2227 call w1
0; echo ?
=$?
!=$
!; echo -----;
2228 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2229 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2232 check
1 0 "${MBOX}" '1572045517 5922'
2240 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2245 vput vexpr j '&' $i 7
2251 echo ! The end for $1/$2
2253 return $i $^ERR-BUSY
2264 echo ?=$? !=$^ERRNAME
2267 echo ?=$? !=$^ERRNAME
2269 echo ?=$? !=$^ERRNAME
2272 check 1 0 "${MBOX}" '2401702082 23801'
2276 if have_feat uistrings; then
2277 ${cat} <<- '__EOT' > "${BODY}"
2282 vput vexpr j '&' $i 7
2288 echo ! The end for $1
2291 echo would be err with errexit
2300 echo zwei, ?=$? !=$!
2301 localopts yes; set errexit
2303 echo drei, ?=$? !=$^ERRNAME
2305 echo vier, ?=$? !=$^ERRNAME, this is an error
2308 echo outer 1, ?=$? !=$^ERRNAME
2310 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2312 echo outer 3, ?=$? !=$^ERRNAME
2313 echo this is definitely an error
2316 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2317 -Snomemdebug > "${MBOX}" 2>&1
2318 check
2 0 "${MBOX}" '3900716531 4200'
2320 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2321 -Snomemdebug > "${MBOX}" 2>&1
2322 check 3 1 "${MBOX}" '1006776201 2799'
2324 echo 'xcall-2: unsupported, skipped'
2325 echo 'xcall-3: unsupported, skipped'
2334 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2335 vpospar
set hey
, "'you ", world
!
2336 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2337 vput vpospar x quote
; echo x
<$x>
2338 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2339 vput vpospar y quote
;echo y
<$y>
2340 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2341 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2342 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2345 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2346 vput vpospar z quote
;echo infun2
:z
<$z>
2350 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2351 vput vpospar y quote
;echo infun
:y
<$y>
2352 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2353 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2355 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2356 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2359 call infun This
"in a" fun
2360 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2361 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2363 check
1 0 "${MBOX}" '155175639 866'
2366 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2368 echo ifs<$ifs> ifs-ws<$ifs-ws>
2369 vpospar set hey, "'you ", world!
2370 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2371 vput vpospar x quote; echo x<$x>
2372 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2373 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2376 echo ifs<$ifs> ifs-ws<$ifs-ws>
2377 vpospar set hey, "'you
", world!
2378 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2380 vput vpospar x quote; echo x<$x>
2381 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2382 eval vpospar set ${x};\
2383 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2386 echo ifs<$ifs> ifs-ws<$ifs-ws>
2387 vpospar set hey, "'you ", world!
2388 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2390 vput vpospar x quote; echo x<$x>
2391 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2392 eval vpospar set ${x};\
2393 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2395 check ifs 0 "${MBOX}" '2015927702 706'
2402 TRAP_EXIT_ADDONS="./.t*"
2404 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2407 printf " (1/$#: <$1>)"
2409 if [ $# -gt 0 ]; then
2423 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2424 printf xxx;xxx arg ,b u.
2425 printf xxx;xxx arg , .
2426 printf xxx;xxx arg ,ball.
2432 echon " (1/$#: <$1>)"
2447 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2448 echon xxx;call xxx arg ,b u.
2449 echon xxx;call xxx arg , .
2450 echon xxx;call xxx arg ,ball.
2453 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2454 check 1 0 "${MBOX}" '41566293 164'
2456 #${SHELL} ./.t.sh > ./.tshout 2>&1
2457 #check disproof-1 0 ./.tshout '41566293 164'
2464 TRAP_EXIT_ADDONS="./.t*"
2466 ${cat} <<- '__EOT
' > .tin
2467 hey1, "'you
", world!
2468 hey2, "'you ", bugs bunny!
2473 ${cat} <<- '__EOT
' |\
2474 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2476 echo $?/$^ERRNAME / <$a><$b><$c>
2478 echo $?/$^ERRNAME / <$a><$b><$c>
2480 echo $?/$^ERRNAME / <$a><$b><$c>
2482 echo $?/$^ERRNAME / <$a><$b><$c>
2483 unset a b c;read a b c
2484 echo $?/$^ERRNAME / <$a><$b><$c>
2485 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2487 check 1 0 "${MBOX}" '1527910147 173'
2489 ${cat} <<- '__EOT
' > .tin2
2490 hey2.0,:"'you
",:world!:mars.:
2491 hey2.1,:"'you ",:world!
2492 hey2.2,:"'you
",:bugs bunny!
2498 ${cat} <<- '__EOT' |\
2499 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2502 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2504 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2506 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2508 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2510 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2512 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2513 unset a b c
;read a b c
2514 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2516 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2517 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2519 check ifs
0 "${MBOX}" '890153490 298'
2521 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2523 readall d; echo $?/$^ERRNAME / <$d>
2524 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2525 readctl create .tin2
2526 readall d; echo $?/$^ERRNAME / <$d>
2527 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2528 readctl remove .tin;echo $?/$^ERRNAME;\
2529 readctl remove .tin2;echo $?/$^ERRNAME
2530 echo '### now with empty lines'
2531 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2532 readctl create .temptynl;echo $?/$^ERRNAME
2533 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2534 readctl remove .temptynl;echo $?/$^ERRNAME
2536 check readall 0 "${MBOX}" '4113506527 405'
2543 TRAP_EXIT_ADDONS=".
/.t
*"
2547 while [ ${i} -lt 113 ]; do
2548 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2549 "${MBOX}" "${i}" "${i}"
2552 ) | ${MAILX} ${ARGS} > .tall 2>&1
2553 check 1 0 "${MBOX}" '1872102723 13784'
2554 check 1-outerr - ./.tall '4294967295 0' # empty file
2556 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2557 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2558 check 2 0 .tall '3498373999 9103'
2560 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2561 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2562 check
3 0 .tall
'381610797 9110'
2564 # copy only the odd (but the first), move the even
2566 printf 'File "file://%s"\ncopy ' .tmbox2
2568 while [ ${i} -lt 113 ]; do
2572 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2573 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2574 check
4 0 .tmbox3
'4145104131 6890'
2575 check
5 - .tall
'361127721 4573'
2578 printf 'file "file://%s"\nmove ' .tmbox2
2580 while [ ${i} -lt 113 ]; do
2584 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2585 .tmbox3 .tmbox3 .tmbox2
2586 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2587 check
6 0 .tmbox3
'3249991493 13784'
2588 if have_feat uistrings
; then
2589 ${sed} 2d
< .tall
> .tallx
2593 check
7 - .tallx
'1584413080 13645'
2595 # Invalid MBOXes (after [f4db93b3])
2597 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2598 check 8 0 .tinvmbox '896415941 122'
2599 check 9 - ./.tall '3146754194 33'
2601 echo ' ' > .tinvmbox
2602 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2603 check
10 0 .tinvmbox
'4011310616 124'
2604 check
11 - .
/.tall
'3146754194 33'
2606 { echo; echo; } > .tinvmbox
# (not invalid)
2607 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2608 check 12 0 .tinvmbox '287409579 123'
2609 check 13 - ./.tall '3146754194 33'
2611 # *mbox-rfc4155*, plus
2612 ${cat} <<-_EOT > ./.tinv1
2615 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2616 Date: Wed, 02 Oct 1996 01:50:07 +0000
2618 Subject: Bad bad message 1
2620 From me to you, blinde Kuh!
2622 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2623 Date: Wed, 02 Oct 1996 01:50:07 +0000
2625 Subject: Bad bad message 2
2627 From me to you, blindes Kalb!
2629 ${cp} ./.tinv1 ./.tinv2
2633 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2634 \\eval copy * "${2}"
2636 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2638 ${cat} ./.tinv1 ./.tok >> .tall
2639 check 14 - ./.tall '739301109 616'
2642 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2643 wysh File ./.tok # Just move away to nowhere
2645 wysh file ./.tinv2 # Fully repaired
2646 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2648 check 15-1 - ./.tinv1 '3178048820 332'
2649 check 15-2 - ./.tinv2 '4151504442 314'
2656 TRAP_EXIT_ADDONS=".
/.t
*"
2660 while [ ${i} -lt 112 ]; do
2661 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2662 "${MBOX}" "${i}" "${i}"
2665 ) | ${MAILX} ${ARGS}
2666 check 1 0 "${MBOX}" '1140119864 13780'
2672 ' "${MBOX}" .tmdir1 .tmdir1 |
2673 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2674 check 2 0 .tlst '1797938753 9103'
2677 copy * "maildir
://%s
"
2680 ' "${MBOX}" .tmdir2 .tmdir2 |
2681 ${MAILX} ${ARGS} -Sshowlast > .tlst
2682 check 3 0 .tlst '1155631089 9113'
2684 printf 'File "maildir
://%s
"
2688 ' .tmdir2 .tmbox1 .tmbox1 |
2689 ${MAILX} ${ARGS} -Sshowlast > .tlst
2690 check 4 0 .tmbox1 '2646131190 13220'
2691 check 5 - .tlst '3701297796 9110'
2693 # only the odd (even)
2695 printf 'File "maildir
://%s
"
2698 while [ ${i} -lt 112 ]; do
2700 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2707 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2708 check 6 0 .tmbox2 '142890131 6610'
2709 check 7 - .tlst '960096773 4573'
2712 printf 'file "maildir
://%s
"
2715 while [ ${i} -lt 112 ]; do
2717 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2725 ' .tmbox2 .tmbox2 .tmdir2
2726 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2727 check
8 0 .tmbox2
'3806905791 13100'
2728 ${sed} 2d
< .tlst
> .tlstx
2729 check
9 - .tlstx
'4216815295 13645'
2734 t_record_a_resend
() {
2735 t_prolog record_a_resend
2736 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2740 m %s\n~s Subject 1.\nHello.\n~.
2741 set record-files add-file-recipients
2742 m %s\n~s Subject 2.\nHello.\n~.
2744 resend 2 ./.t.resent
2745 Resend 1 ./.t.resent
2747 resend 2 ./.t.resent
2748 Resend 1 ./.t.resent
2749 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2752 check
1 0 "${MBOX}" '3057873538 256'
2753 check
2 - .t.record
'391356429 460'
2754 check
3 - .t.resent
'2685231691 648'
2761 TRAP_EXIT_ADDONS
="./.tmta.sh ./.t.mbox"
2763 t_xmta
'Alchemilla Wed Apr 07 17:03:33 2017' .
/.t.mbox
2766 ${MAILX} ${ARGS} -ef .
/.t.mbox
2767 echo ${?} > "${MBOX}"
2769 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2770 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2771 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2772 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2774 ${MAILX} ${ARGS} -ef .
/.t.mbox
2775 echo ${?} >> "${MBOX}"
2776 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2777 echo ${?} >> "${MBOX}"
2778 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2779 echo ${?} >> "${MBOX}"
2780 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2781 echo ${?} >> "${MBOX}"
2782 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2783 echo ${?} >> "${MBOX}"
2784 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2785 echo ${?} >> "${MBOX}"
2786 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2787 echo ${?} >> "${MBOX}"
2789 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2790 echo ${?} >> "${MBOX}"
2791 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2792 echo ${?} >> "${MBOX}"
2793 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2794 echo ${?} >> "${MBOX}"
2795 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2796 echo ${?} >> "${MBOX}"
2797 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2798 echo ${?} >> "${MBOX}"
2799 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2800 echo ${?} >> "${MBOX}"
2801 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2802 echo ${?} >> "${MBOX}"
2804 check
1 - "${MBOX}" '1708955574 678'
2811 TRAP_EXIT_ADDONS
="./.t*"
2813 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
2815 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
2819 alternates a1@b1 a2@b2 a3@b3
2824 echo $?
/$^ERRNAME
<$rv>
2829 echo $?
/$^ERRNAME
<$rv>
2832 echo $?
/$^ERRNAME
<$rv>
2835 echo $?
/$^ERRNAME
<$rv>
2839 alternates a1@b1 a2@b2 a3@b3
2842 echo $?
/$^ERRNAME
<$rv>
2845 echo $?
/$^ERRNAME
<$rv>
2848 echo $?
/$^ERRNAME
<$rv>
2851 alternates a1@b1 a2@b2 a3@b3
2854 echo $?
/$^ERRNAME
<$rv>
2857 echo $?
/$^ERRNAME
<$rv>
2860 echo $?
/$^ERRNAME
<$rv>
2864 alternates a1@b1 a2@b2 a3@b3
2867 echo $?
/$^ERRNAME
<$rv>
2871 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
2873 ~s all alternates
, only a1@b1 remains
2875 ~b a3@b3 a3@c3 a3@d3
2884 alternates a1@b1 a1@c1 a2@b2 a3@b3
2886 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
2888 ~b a3@b3 a3@c3 a3@d3
2895 alternates a1@b1 a2@b2 a3
; set allnet
2897 ~s all alternates via allnet
, only a1@b1 remains
2899 ~b a3@b3 a3@c3 a3@d3
2910 echo $?
/$^ERRNAME
<$rv>
2914 echo $?
/$^ERRNAME
<$rv>
2918 echo $?
/$^ERRNAME
<$rv>
2922 echo $?
/$^ERRNAME
<$rv>
2926 echo $?
/$^ERRNAME
<$rv>
2930 alternates a1@b1 a2@b2
2933 echo $?
/$^ERRNAME
<$rv>
2934 alternates a3@b3 a4@b4
2937 echo $?
/$^ERRNAME
<$rv>
2940 check
1 0 "${MBOX}" '142184864 515'
2941 if have_feat uistrings
; then
2942 check
2 - .tall
'1878598364 505'
2944 echo 'alternates-2: unsupported, skipped'
2952 TRAP_EXIT_ADDONS
="./.t*"
2954 t_xmta
'Hippocastanum Mon Jun 19 15:07:07 2017'
2956 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
2958 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
2960 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
2962 alias a4 a5 ex1@a4.ple
2964 alias a6 a7 ex1@a6.ple
2978 check
1 0 "${MBOX}" '2496925843 272'
2979 check
2 - .tall
'3548953204 152'
2981 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
2982 # TODO need to somehow provide its contents to the test, then test
2989 TRAP_EXIT_ADDONS
="./.t*"
2991 t_xmta
'Alchemilla Wed Apr 25 15:12:13 2017'
2993 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
2994 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tmta.sh
2995 check 1 0 "${MBOX}" '1594682963 13520'
2997 if (echo | gzip -c) >/dev/null 2>&1; then
2999 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3000 "${MBOX}" | ${MAILX} ${ARGS} \
3001 -X'filetype gz gzip\ -dc gzip\ -c'
3002 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3003 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3005 check
2 - "./.t.mbox" '1594682963 13520'
3006 check
3 - "./.t.out" '2392348396 102'
3008 echo 'filetype-2: unsupported, skipped'
3009 echo 'filetype-3: unsupported, skipped'
3014 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
3020 -X'filetype gz gzip\ -dc gzip\ -c' \
3021 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
3022 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
3023 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3025 -X'filetype gz gzip\ -dc gzip\ -c' \
3026 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
3028 check
4 - "./.t.mbox" '2886541147 27060'
3029 check
5 - "./.t.out" '852335377 172'
3034 t_message_injections
() {
3035 t_prolog message_injections
3036 TRAP_EXIT_ADDONS
="./.t*"
3038 t_xmta
'Echinacea Tue Jun 20 15:54:02 2017'
3040 echo mysig
> .
/.tmysig
3042 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3043 -Smessage-inject-head=head-inject \
3044 -Smessage-inject-tail=tail-inject \
3045 -Ssignature=.
/.tmysig \
3046 ex@am.ple
> .
/.tall
2>&1
3047 check
1 0 "${MBOX}" '2434746382 134'
3048 check
2 - .tall
'4294967295 0' # empty file
3051 ${cat} <<-_EOT > ./.template
3055 Subject: This subject is
3057 Body, body, body me.
3059 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tmta.sh \
3060 -Smessage-inject-head=head-inject \
3061 -Smessage-inject-tail=tail-inject \
3062 -Ssignature=.
/.tmysig \
3064 check
3 0 "${MBOX}" '3114203412 198'
3065 check
4 - .tall
'4294967295 0' # empty file
3071 t_prolog attachments
3072 TRAP_EXIT_ADDONS
="./.t*"
3074 t_xmta
'Cannabis Sun Feb 18 02:02:46 2018'
3076 ${cat} <<-_EOT > ./.tx
3077 From steffen Sun Feb 18 02:48:40 2018
3078 Date: Sun, 18 Feb 2018 02:48:40 +0100
3081 User-Agent: s-nail v14.9.7
3084 From steffen Sun Feb 18 02:48:42 2018
3085 Date: Sun, 18 Feb 2018 02:48:42 +0100
3088 User-Agent: s-nail v14.9.7
3093 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3094 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3095 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3098 '!@ ./.t3 "./.t 4" ""
3106 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
3107 -a .
/.t1
-a './.t 2' \
3108 -s attachment-test \
3109 ex@am.ple
> .
/.tall
2>&1
3110 check
1 0 "${MBOX}" '4107062253 634'
3111 if have_feat uistrings
; then
3112 check
2 - .tall
'1928331872 720'
3114 echo 'attachments-2: unsupported, skipped'
3120 !s This the subject is
3121 !@ ./.t3 "#2" "./.t 4" "#1" ""
3131 !@ ./.t3 "#2" "./.t 4" "#1" ""
3139 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3148 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3162 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3164 check
3 0 "${MBOX}" '798122412 2285'
3165 if have_feat uistrings
; then
3166 check
4 - .tall
'2526106274 1910'
3168 echo 'attachments-4: unsupported, skipped'
3174 t_compose_hooks
() { # TODO monster
3175 t_prolog compose_hooks
3176 if have_feat uistrings
; then :; else
3177 echo 'compose_hooks: unsupported, skipped'
3180 TRAP_EXIT_ADDONS
="./.t*"
3182 t_xmta
'PrimulaVeris Wed Apr 10 22:59:00 2017'
3184 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3185 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3187 ${cat} <<'__EOT__' > ./.trc
3189 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3192 vput vexpr es substr "$1" 0 1
3197 define read_mline_res {
3198 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3199 echo $len/$es/$^ERRNAME: $hl
3200 if [ $es -ne $^ERR-NONE ]
3201 xcall bail read_mline_res
3203 \xcall read_mline_res
3208 echo "~^header list"; read hl; echo $hl;\
3209 call xerr "$hl" "in_addr ($xh) 0-1"
3211 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3212 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3213 echo "~^header insert $xh <${xh}2@exam.ple>";\
3214 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3215 echo "~^header insert $xh ${xh}3@exam.ple";\
3216 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3217 echo "~^header list $xh"; read hl; echo $hl;\
3218 call xerr "$hl" "ins_addr $xh 1-4"
3219 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3222 if [ "$t_remove" == "" ]
3226 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3227 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3229 xcall bail "ins_addr $xh 2-2"
3231 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3233 xcall bail "ins_addr $xh 2-3"
3235 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3237 xcall bail "ins_addr $xh 2-4"
3241 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3242 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3243 echo "~^header insert $xh <${xh}2@exam.ple>";\
3244 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3245 echo "~^header insert $xh ${xh}3@exam.ple";\
3246 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3247 echo "~^header list $xh"; read hl; echo $hl;\
3248 call xerr "$hl" "ins_addr $xh 3-4"
3249 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3252 echo "~^header remove-at $xh 1"; read es;\
3253 call xerr $es "ins_addr $xh 3-6"
3254 echo "~^header remove-at $xh 1"; read es;\
3255 call xerr $es "ins_addr $xh 3-7"
3256 echo "~^header remove-at $xh 1"; read es;\
3257 call xerr $es "ins_addr $xh 3-8"
3258 echo "~^header remove-at $xh 1"; read es;\
3259 vput vexpr es substr $es 0 3
3261 xcall bail "ins_addr $xh 3-9"
3263 echo "~^header remove-at $xh T"; read es;\
3264 vput vexpr es substr $es 0 3
3266 xcall bail "ins_addr $xh 3-10"
3268 echo "~^header list $xh"; read es;\
3269 vput vexpr es substr $es 0 3
3271 xcall bail "ins_addr $xh 3-11"
3273 echo "~^header show $xh"; read es;\
3274 vput vexpr es substr $es 0 3
3276 xcall bail "ins_addr $xh 3-12"
3280 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3281 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3282 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3283 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3284 echo "~^header insert $xh ${xh}3@exam.ple";\
3285 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3286 echo "~^header list $xh"; read hl; echo $hl;\
3287 call xerr "$hl" "header list $xh 3-4"
3288 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3291 echo "~^header remove-at $xh 3"; read es;\
3292 call xerr $es "ins_addr $xh 4-6"
3293 echo "~^header remove-at $xh 2"; read es;\
3294 call xerr $es "ins_addr $xh 4-7"
3295 echo "~^header remove-at $xh 1"; read es;\
3296 call xerr $es "ins_addr $xh 4-8"
3297 echo "~^header remove-at $xh 1"; read es;\
3298 vput vexpr es substr $es 0 3
3300 xcall bail "ins_addr $xh 4-9"
3302 echo "~^header remove-at $xh T"; read es;\
3303 vput vexpr es substr $es 0 3
3305 xcall bail "ins_addr $xh 4-10"
3307 echo "~^header list $xh"; read es;\
3308 vput vexpr es substr $es 0 3
3310 xcall bail "ins_addr $xh 4-11"
3312 echo "~^header show $xh"; read es;\
3313 vput vexpr es substr $es 0 3
3315 xcall bail "ins_addr $xh 4-12"
3319 wysh set xh=$1 mult=$2
3320 echo "~^header list"; read hl; echo $hl;\
3321 call xerr "$hl" "ins_ref ($xh) 0-1"
3323 echo "~^header insert $xh <$xh@exam.ple>";\
3324 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3326 echo "~^header insert $xh <${xh}2@exam.ple>";\
3327 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3328 echo "~^header insert $xh ${xh}3@exam.ple";\
3329 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3331 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3332 vput vexpr es substr $es 0 3
3334 xcall bail "ins_ref $xh 1-4"
3338 echo "~^header list $xh"; read hl; echo $hl;\
3339 call xerr "$hl" "ins_ref $xh 1-5"
3340 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3343 if [ "$t_remove" == "" ]
3347 echo "~^header remove $xh"; read es;\
3348 call xerr $es "ins_ref $xh 2-1"
3349 echo "~^header remove $xh"; read es;\
3350 vput vexpr es substr $es 0 3
3352 xcall bail "ins_ref $xh 2-2"
3354 echo "~^header list $xh"; read es;\
3355 vput vexpr es substr $es 0 3
3357 xcall bail "$es ins_ref $xh 2-3"
3359 echo "~^header show $xh"; read es;\
3360 vput vexpr es substr $es 0 3
3362 xcall bail "ins_ref $xh 2-4"
3366 echo "~^header insert $xh <$xh@exam.ple>";\
3367 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3369 echo "~^header insert $xh <${xh}2@exam.ple>";\
3370 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3371 echo "~^header insert $xh ${xh}3@exam.ple";\
3372 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3374 echo "~^header list $xh";\
3375 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3376 echo "~^header show $xh";\
3377 read es; call xerr $es "ins_ref $xh 3-5"
3380 echo "~^header remove-at $xh 1"; read es;\
3381 call xerr $es "ins_ref $xh 3-6"
3382 if [ $mult -ne 0 ] && [ $xh != subject ]
3383 echo "~^header remove-at $xh 1"; read es;\
3384 call xerr $es "ins_ref $xh 3-7"
3385 echo "~^header remove-at $xh 1"; read es;\
3386 call xerr $es "ins_ref $xh 3-8"
3388 echo "~^header remove-at $xh 1"; read es;\
3389 vput vexpr es substr $es 0 3
3391 xcall bail "ins_ref $xh 3-9"
3393 echo "~^header remove-at $xh T"; read es;\
3394 vput vexpr es substr $es 0 3
3396 xcall bail "ins_ref $xh 3-10"
3398 echo "~^header show $xh"; read es;\
3399 vput vexpr es substr $es 0 3
3401 xcall bail "ins_ref $xh 3-11"
3405 echo "~^header insert $xh <$xh@exam.ple> ";\
3406 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3408 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3409 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3410 echo "~^header insert $xh ${xh}3@exam.ple";\
3411 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3413 echo "~^header list $xh"; read hl; echo $hl;\
3414 call xerr "$hl" "ins_ref $xh 4-4"
3415 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3418 if [ $mult -ne 0 ] && [ $xh != subject ]
3419 echo "~^header remove-at $xh 3"; read es;\
3420 call xerr $es "ins_ref $xh 4-6"
3421 echo "~^header remove-at $xh 2"; read es;\
3422 call xerr $es "ins_ref $xh 4-7"
3424 echo "~^header remove-at $xh 1"; read es;\
3425 call xerr $es "ins_ref $xh 4-8"
3426 echo "~^header remove-at $xh 1"; read es;\
3427 vput vexpr es substr $es 0 3
3429 xcall bail "ins_ref $xh 4-9"
3431 echo "~^header remove-at $xh T"; read es;\
3432 vput vexpr es substr $es 0 3
3434 xcall bail "ins_ref $xh 4-10"
3436 echo "~^header show $xh"; read es;\
3437 vput vexpr es substr $es 0 3
3439 xcall bail "ins_ref $xh 4-11"
3444 # In collect.c order
3446 call ins_ref sender 0 # Not a "ref", but works
3450 call ins_addr reply-To
3451 call ins_addr mail-Followup-to
3452 call ins_ref messAge-id 0
3453 call ins_ref rEfErEncEs 1
3454 call ins_ref in-Reply-to 1
3455 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3456 call ins_addr freeForm1
3457 call ins_addr freeform2
3459 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3461 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3469 echo "~^attachment";\
3470 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3472 xcall bail "attach 0-1"
3475 echo "~^attach attribute ./.treadctl";\
3476 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3478 xcall bail "attach 0-2"
3480 echo "~^attachment attribute-at 1";\
3481 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3483 xcall bail "attach 0-3"
3486 echo "~^attachment insert ./.treadctl=ascii";\
3487 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3488 echo "~^attachment list";\
3489 read es; echo $es;call xerr "$es" "attach 1-2"
3491 echo "~^attachment attribute ./.treadctl";\
3492 read es; echo $es;call xerr "$es" "attach 1-3"
3494 echo "~^attachment attribute .treadctl";\
3495 read es; echo $es;call xerr "$es" "attach 1-4"
3497 echo "~^attachment attribute-at 1";\
3498 read es; echo $es;call xerr "$es" "attach 1-5"
3501 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3502 read es; echo $es;call xerr "$es" "attach 1-6"
3503 echo "~^attachment attribute-set .treadctl content-description Au";\
3504 read es; echo $es;call xerr "$es" "attach 1-7"
3505 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3506 read es; echo $es;call xerr "$es" "attach 1-8"
3508 echo "~^attachment attribute ./.treadctl";\
3509 read es; echo $es;call xerr "$es" "attach 1-9"
3511 echo "~^attachment attribute .treadctl";\
3512 read es; echo $es;call xerr "$es" "attach 1-10"
3514 echo "~^attachment attribute rctl";\
3515 read es; echo $es;call xerr "$es" "attach 1-11"
3517 echo "~^attachment attribute-at 1";\
3518 read es; echo $es;call xerr "$es" "attach 1-12"
3522 echo "~^attachment insert ./.tattach=latin1";\
3523 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3524 echo "~^attachment list";\
3525 read es; echo $es;call xerr "$es" "attach 2-2"
3527 echo "~^attachment attribute ./.tattach";\
3528 read es; echo $es;call xerr "$es" "attach 2-3"
3530 echo "~^attachment attribute .tattach";\
3531 read es; echo $es;call xerr "$es" "attach 2-4"
3533 echo "~^attachment attribute-at 2";\
3534 read es; echo $es;call xerr "$es" "attach 2-5"
3537 echo "~^attachment attribute-set ./.tattach filename tat";\
3538 read es; echo $es;call xerr "$es" "attach 2-6"
3540 "~^attachment attribute-set .tattach content-description Au2";\
3541 read es; echo $es;call xerr "$es" "attach 2-7"
3542 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3543 read es; echo $es;call xerr "$es" "attach 2-8"
3545 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3546 read es; echo $es;call xerr "$es" "attach 2-9"
3548 echo "~^attachment attribute ./.tattach";\
3549 read es; echo $es;call xerr "$es" "attach 2-10"
3551 echo "~^attachment attribute .tattach";\
3552 read es; echo $es;call xerr "$es" "attach 2-11"
3554 echo "~^attachment attribute tat";\
3555 read es; echo $es;call xerr "$es" "attach 2-12"
3557 echo "~^attachment attribute-at 2";\
3558 read es; echo $es;call xerr "$es" "attach 2-13"
3562 if [ "$t_remove" == "" ]
3566 echo "~^attachment remove ./.treadctl"; read es;\
3567 call xerr $es "attach 3-1"
3568 echo "~^attachment remove ./.tattach"; read es;\
3569 call xerr $es "attach 3-2"
3570 echo "~^ attachment remove ./.treadctl"; read es;\
3571 vput vexpr es substr $es 0 3
3573 xcall bail "attach 3-3"
3575 echo "~^ attachment remove ./.tattach"; read es;\
3576 vput vexpr es substr $es 0 3
3578 xcall bail "attach 3-4"
3580 echo "~^attachment list"; read es;\
3581 vput vexpr es substr $es 0 3
3583 xcall bail "attach 3-5"
3587 echo "~^attachment insert ./.tattach=latin1";\
3588 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3589 echo "~^attachment insert ./.tattach=latin1";\
3590 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3591 echo "~^attachment list";\
3592 read es; echo $es;call xerr "$es" "attach 4-3"
3594 echo "~^ attachment remove .tattach"; read es;\
3595 vput vexpr es substr $es 0 3
3597 xcall bail "attach 4-4 $es"
3599 echo "~^attachment remove-at T"; read es;\
3600 vput vexpr es substr $es 0 3
3602 xcall bail "attach 4-5"
3604 echo "~^attachment remove ./.tattach"; read es;\
3605 call xerr $es "attach 4-6"
3606 echo "~^attachment remove ./.tattach"; read es;\
3607 call xerr $es "attach 4-7"
3608 echo "~^ attachment remove ./.tattach"; read es;\
3609 vput vexpr es substr $es 0 3
3611 xcall bail "attach 4-8 $es"
3613 echo "~^attachment list"; read es;\
3614 vput vexpr es substr $es 0 3
3616 xcall bail "attach 4-9"
3620 echo "~^attachment insert ./.tattach=latin1";\
3621 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3622 echo "~^attachment insert ./.tattach=latin1";\
3623 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3624 echo "~^attachment insert ./.tattach=latin1";\
3625 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3626 echo "~^attachment list";\
3627 read es; echo $es;call xerr "$es" "attach 5-4"
3630 echo "~^attachment remove-at 3"; read es;\
3631 call xerr $es "attach 5-5"
3632 echo "~^attachment remove-at 3"; read es;\
3633 vput vexpr es substr $es 0 3
3635 xcall bail "attach 5-6"
3637 echo "~^attachment remove-at 2"; read es;\
3638 call xerr $es "attach 5-7"
3639 echo "~^attachment remove-at 2"; read es;\
3640 vput vexpr es substr $es 0 3
3642 xcall bail "attach 5-8"
3644 echo "~^attachment remove-at 1"; read es;\
3645 call xerr $es "attach 5-9"
3646 echo "~^attachment remove-at 1"; read es;\
3647 vput vexpr es substr $es 0 3
3649 xcall bail "attach 5-10"
3652 echo "~^attachment list"; read es;\
3653 vput vexpr es substr $es 0 3
3655 xcall bail "attach 5-11"
3659 echo "~^attachment insert ./.tattach=latin1";\
3660 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3661 echo "~^attachment insert ./.tattach=latin1";\
3662 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3663 echo "~^attachment insert ./.tattach=latin1";\
3664 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3665 echo "~^attachment list";\
3666 read es; echo $es;call xerr "$es" "attach 6-4"
3669 echo "~^attachment remove-at 1"; read es;\
3670 call xerr $es "attach 6-5"
3671 echo "~^attachment remove-at 1"; read es;\
3672 call xerr $es "attach 6-6"
3673 echo "~^attachment remove-at 1"; read es;\
3674 call xerr $es "attach 6-7"
3675 echo "~^attachment remove-at 1"; read es;\
3676 vput vexpr es substr $es 0 3
3678 xcall bail "attach 6-8"
3681 echo "~^attachment list"; read es;\
3682 vput vexpr es substr $es 0 3
3684 xcall bail "attach 6-9"
3696 echo on-compose-enter, mailx-command<$mailx-command>
3697 alternates alter1@exam.ple alter2@exam.ple
3699 set autocc='alter1@exam.ple alter2@exam.ple'
3700 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3701 echo mailx-subject<$mailx-subject>
3702 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3703 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3704 mailx-raw-bcc<$mailx-raw-bcc>
3705 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3706 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3709 echo on-compose-leave, mailx-command<$mailx-command>
3711 eval alternates $al alter3@exam.ple alter4@exam.ple
3713 set autobcc='alter3@exam.ple alter4@exam.ple'
3714 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3715 echo mailx-subject<$mailx-subject>
3716 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3717 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3718 mailx-raw-bcc<$mailx-raw-bcc>
3719 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3720 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3723 echo on-compose-cleanup, mailx-command<$mailx-command>
3726 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3727 echo mailx-subject<$mailx-subject>
3728 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3729 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3730 mailx-raw-bcc<$mailx-raw-bcc>
3731 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3732 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3734 wysh set on-compose-splice=t_ocs \
3735 on-compose-enter=t_oce on-compose-leave=t_ocl \
3736 on-compose-cleanup=t_occ
3739 printf 'm this-goes@nowhere\nbody\n!.\n' |
3740 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3741 -X'source ./.trc' -Smta=.
/.tmta.sh \
3743 ${cat} .
/.tall
>> "${MBOX}"
3744 check
1 0 "${MBOX}" '522535560 10101'
3747 printf 'm this-goes@nowhere\nbody\n!.\n' |
3748 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3749 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh \
3751 ${cat} .
/.tall
>> "${MBOX}"
3752 check
2 0 "${MBOX}" '3654000499 12535'
3756 # Some state machine stress, shell compose hook, localopts for hook, etc.
3757 # readctl in child. ~r as HERE document
3759 printf 'm ex@am.ple\nbody\n!.
3760 echon ${mailx-command}${mailx-subject}
3761 echon ${mailx-from}${mailx-sender}
3762 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3763 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3764 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3765 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3766 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3770 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3773 vput vexpr es substr "$1" 0 1
3778 define read_mline_res {
3779 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3780 echo $len/$es/$^ERRNAME: $hl
3781 if [ $es -ne $^ERR-NONE ]
3782 xcall bail read_mline_res
3784 \xcall read_mline_res
3788 vput vexpr i + 1 "$2"
3790 vput vexpr j % $i 10
3797 eval \\$j _work $1 $i
3800 vput vexpr i + $i "$1"
3804 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
3805 echo read:$es/$en: $line
3806 if [ "${es}" -ne -1 ]
3809 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
3814 echo "~^header list"; read hl; echo $hl;\
3815 vput vexpr es substr "$hl" 0 1
3817 xcall bail "header list"
3820 call _work 1; echo $?
3821 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
3822 read es; echo $es; vput vexpr es substr "$es" 0 1
3824 xcall bail "be diet"
3826 echo "~^header insert cc <splice2@exam.ple>";\
3827 read es; echo $es; vput vexpr es substr "$es" 0 1
3829 xcall bail "be diet2"
3832 call _work 2; echo $?
3833 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
3834 read es; echo $es;vput vexpr es substr "$es" 0 1
3836 xcall bail "be juicy"
3838 echo "~^header insert bcc juice2@exam.ple";\
3839 read es; echo $es;vput vexpr es substr "$es" 0 1
3841 xcall bail "be juicy2"
3843 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
3844 read es; echo $es;vput vexpr es substr "$es" 0 1
3846 xcall bail "be juicy3"
3848 echo "~^header insert bcc juice4@exam.ple";\
3849 read es; echo $es;vput vexpr es substr "$es" 0 1
3851 xcall bail "be juicy4"
3854 echo "~^header remove-at bcc 3";\
3855 read es; echo $es;vput vexpr es substr "$es" 0 1
3857 xcall bail "remove juicy5"
3859 echo "~^header remove-at bcc 2";\
3860 read es; echo $es;vput vexpr es substr "$es" 0 1
3862 xcall bail "remove juicy6"
3864 echo "~^header remove-at bcc 3";\
3865 read es; echo $es;vput vexpr es substr "$es" 0 3
3867 xcall bail "failed to remove-at"
3869 # Add duplicates which ought to be removed!
3870 echo "~^header insert bcc juice4@exam.ple";\
3871 read es; echo $es;vput vexpr es substr "$es" 0 1
3873 xcall bail "be juicy4-1"
3875 echo "~^header insert bcc juice4@exam.ple";\
3876 read es; echo $es;vput vexpr es substr "$es" 0 1
3878 xcall bail "be juicy4-2"
3880 echo "~^header insert bcc juice4@exam.ple";\
3881 read es; echo $es;vput vexpr es substr "$es" 0 1
3883 xcall bail "be juicy4-3"
3888 call _work 3; echo $?
3890 vput ! i echo just knock if you can hear me;\
3892 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
3894 echon shell-cmd says $?/$^ERRNAME: $i
3895 echo "~x will not become interpreted, we are reading until __EOT"
3897 read r_status; echo "~~r status output: $r_status"
3898 echo "~:echo $? $! $^ERRNAME"
3900 echo "~~r status from parent: $r_status"
3903 call _work 4; echo $?
3904 vput cwd cwd;echo cwd:$?
3905 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
3909 call _work 5; echo $?
3910 echo "~^header show MAILX-Command"; read es;\
3911 call xerr $es "t_header 1000"; call read_mline_res
3912 echo "~^header show MAILX-raw-TO"; read es;\
3913 call xerr $es "t_header 1001"; xcall read_mline_res
3915 echoerr IT IS WRONG IF YOU SEE THIS
3918 echo on-compose-enter, mailx-command<$mailx-command>
3919 set t_oce autobcc=oce@exam.ple
3920 alternates alter1@exam.ple alter2@exam.ple
3922 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3923 echo mailx-subject<$mailx-subject>
3924 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3925 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3926 mailx-raw-bcc<$mailx-raw-bcc>
3927 echo mailx-orig-from<$mailx-orig-from> \
3928 mailx-orig-to<$mailx-orig-to> \
3929 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3932 echo on-compose-leave, mailx-command<$mailx-command>
3933 set t_ocl autocc=ocl@exam.ple
3935 alternates alter3@exam.ple alter4@exam.ple
3937 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3938 echo mailx-subject<$mailx-subject>
3939 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3940 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3941 mailx-raw-bcc<$mailx-raw-bcc>
3942 echo mailx-orig-from<$mailx-orig-from> \
3943 mailx-orig-to<$mailx-orig-to> \
3944 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3947 echo on-compose-cleanup, mailx-command<$mailx-command>
3948 set t_occ autocc=occ@exam.ple
3951 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3952 echo mailx-subject<$mailx-subject>
3953 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3954 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3955 mailx-raw-bcc<$mailx-raw-bcc>
3956 echo mailx-orig-from<$mailx-orig-from> \
3957 mailx-orig-to<$mailx-orig-to> \
3958 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3960 wysh set on-compose-splice=t_ocs \
3961 on-compose-splice-shell="read ver;echo t_ocs-shell;\
3962 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
3963 on-compose-enter=t_oce on-compose-leave=t_ocl \
3964 on-compose-cleanup=t_occ
3967 ${cat} .
/.tnotes
>> "${MBOX}"
3968 check
3 - "${MBOX}" '679526364 2431'
3970 # Reply, forward, resend, Resend
3973 printf 'set from=f1@z\nm t1@z\nb1\n!.\nset from=f2@z\nm t2@z\nb2\n!.\n' |
3974 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
3978 echo start: $? $! $^ERRNAME
3980 echo File: $? $! $^ERRNAME;echo;echo
3982 this is content of reply 1
3984 echo reply 1: $? $! $^ERRNAME;echo;echo
3986 this is content of Reply 1 2
3988 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
3989 forward 1 fwdex@am.ple
3990 this is content of forward 1
3992 echo forward 1: $? $! $^ERRNAME;echo;echo
3993 resend 1 2 resendex@am.ple
3994 echo resend 1 2: $? $! $^ERRNAME;echo;echo
3995 Resend 1 2 Resendex@am.ple
3996 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
3998 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4002 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4005 vput vexpr es substr "$1" 0 1
4010 define read_mline_res {
4011 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4012 echo mline_res:$len/$es/$^ERRNAME: $hl
4013 if [ $es -ne $^ERR-NONE ]
4014 xcall bail read_mline_res
4016 \xcall read_mline_res
4020 echo "~^header show $1"; read es;\
4021 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4029 echo t_ocs version $ver
4030 echo "~^header list"; read hl; echo $hl;\
4031 echoerr the header list is $hl;\
4032 call xerr "$hl" "header list"
4033 eval vpospar set $hl
4036 echoerr IT IS WRONG IF YOU SEE THIS
4039 echo on-XY-enter, mailx-command<$mailx-command>
4040 set t_oce autobcc=oce@exam.ple
4041 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4042 echo mailx-subject<$mailx-subject>
4043 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4044 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4045 mailx-raw-bcc<$mailx-raw-bcc>
4046 echo mailx-orig-from<$mailx-orig-from> \
4047 mailx-orig-to<$mailx-orig-to> \
4048 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4051 echo on-XY-leave, mailx-command<$mailx-command>
4052 set t_ocl autocc=ocl@exam.ple
4053 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4054 echo mailx-subject<$mailx-subject>
4055 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4056 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4057 mailx-raw-bcc<$mailx-raw-bcc>
4058 echo mailx-orig-from<$mailx-orig-from> \
4059 mailx-orig-to<$mailx-orig-to> \
4060 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4063 echo on-XY-cleanup, mailx-command<$mailx-command>
4064 set t_occ autocc=occ@exam.ple
4065 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4066 echo mailx-subject<$mailx-subject>
4067 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4068 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4069 mailx-raw-bcc<$mailx-raw-bcc>
4070 echo mailx-orig-from<$mailx-orig-from> \
4071 mailx-orig-to<$mailx-orig-to> \
4072 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4074 wysh set on-compose-splice=t_ocs \
4075 on-compose-enter=t_oce on-compose-leave=t_ocl \
4076 on-compose-cleanup=t_occ \
4077 on-resend-enter=t_oce on-resend-cleanup=t_occ
4080 ${cat} .
/.tnotes
>> "${MBOX}"
4081 check
4 - "${MBOX}" '3038884027 7516'
4086 t_C_opt_customhdr
() {
4087 t_prolog C_opt_customhdr
4088 TRAP_EXIT_ADDONS
="./.t*"
4090 t_xmta
'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
4093 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
4094 -C 'C-One : Custom One Body' \
4095 -C 'C-Two:CustomTwoBody' \
4096 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4097 this-goes@nowhere
>.
/.tall
2>&1
4099 ${cat} .
/.tall
>> "${MBOX}"
4100 check
1 0 "${MBOX}" '2400078426 195'
4103 printf 'm this-goes@nowhere\nbody\n!.
4105 m this-goes2@nowhere\nbody2\n!.
4106 set customhdr=%ccustom1 : custom1 body%c
4107 m this-goes2@nowhere\nbody2\n!.
4108 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4109 m this-goes3@nowhere\nbody3\n!.
4111 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
4112 -C 'C-One : Custom One Body' \
4113 -C 'C-Two:CustomTwoBody' \
4114 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4117 ${cat} .
/.tall
>> "${MBOX}"
4118 check
2 0 "${MBOX}" '3546878678 752'
4123 t_quote_a_cmd_escapes
() {
4124 t_prolog quote_a_cmd_escapes
4125 TRAP_EXIT_ADDONS
="./.t*"
4129 echo 'included file' > .
/.ttxt
4131 ${cat} <<-_EOT > ./.tmbox
4132 From neverneverland Sun Jul 23 13:46:25 2017
4133 Subject: Bugstop: five miles out 1
4134 Reply-To: mister originator1 <mr1@originator>
4135 From: mister originator1 <mr1@originator>
4136 To: bugstop-commit@five.miles.out
4138 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4139 Date: Wed, 19 Jul 2017 09:22:57 -0400
4140 Message-Id: <20170719132257.766AF781267-1@originator>
4143 That's appalling, I.
4145 From neverneverland Sun Jul 23 13:47:25 2017
4146 Subject: Bugstop: five miles out 2
4147 Reply-To: mister originator2 <mr2@originator>
4148 From: mister originator2 <mr2@originator>
4149 To: bugstop-commit@five.miles.out
4151 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4152 Date: Wed, 19 Jul 2017 09:23:57 -0400
4153 Message-Id: <20170719132257.766AF781267-2@originator>
4156 That's appalling, II.
4158 From neverneverland Sun Jul 23 13:48:25 2017
4159 Subject: Bugstop: five miles out 3
4160 Reply-To: mister originator3 <mr3@originator>
4161 From: mister originator3 <mr3@originator>
4162 To: bugstop-commit@five.miles.out
4164 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4165 Date: Wed, 19 Jul 2017 09:24:57 -0400
4166 Message-Id: <20170719132257.766AF781267-3@originator>
4169 That's appalling, III.
4174 set indentprefix=" |"
4181 headerpick type retain cc date from message-id reply-to subject to
4185 set quote=allheaders
4188 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4189 -Sescape=! -Sindentprefix=' >' \
4190 .
/.tmbox
>.
/.tall
2>&1
4192 ${cat} .
/.tall
>> "${MBOX}"
4193 check
1 0 "${MBOX}" '3048941846 2023'
4195 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4198 set Sign=SignVar sign=signvar DEAD=./.ttxt
4199 headerpick type retain Subject
4201 !!1 Not escaped. And shell test last, right before !..
4202 !: echo 2 only echoed via colon
4203 !_ echo 3 only echoed via underscore
4205 !<! echo 5 shell echo included
4206 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4207 7 and 8 are ~A and ~a:
4210 !b 9 added ~b cc <ex1@am.ple>
4211 !c 10 added ~c c <ex2@am.ple>
4218 14: ~f (headerpick: subject)
4222 16, 17: ~I Sign, ~i Sign
4237 24: ~s this new subject
4238 !s 24 did new ~s ubject
4239 !t 25 added ~t o <ex3@am.ple>
4244 and i ~w rite this out to ./.tmsg
4246 !:wysh set x=$escape;set escape=~
4247 ~!echo shell command output
4248 ~:wysh set escape=$x
4250 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4251 -Sescape=! -Sindentprefix=' |' \
4252 .
/.tmbox
>.
/.tall
2>&1
4254 ${cat} .
/.tall
>> "${MBOX}"
4255 check
2 0 "${MBOX}" '375879934 3604'
4256 check
3 - .
/.tmsg
'2112542907 2789'
4261 t_mass_recipients
() {
4262 t_prolog mass_recipients
4263 TRAP_EXIT_ADDONS
="./.t*"
4265 t_xmta
'Eucalyptus Sat Jul 08 21:14:57 2017'
4267 ${cat} <<'__EOT__' > ./.trc
4269 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4272 wysh set nr=$1 hn=$2
4273 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4275 xcall bail "ins_addr $hn 1-$nr"
4277 vput vexpr nr + $nr 1
4278 if [ "$nr" -le "$maximum" ]
4279 xcall ins_addr $nr $hn
4283 wysh set nr=$1 hn=$2
4284 alternates $hn$nr@$hn
4285 vput vexpr nr + $nr 2
4286 if [ "$nr" -le "$maximum" ]
4287 xcall bld_alter $nr $hn
4297 if [ "$t_remove" != '' ]
4302 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4305 printf 'm this-goes@nowhere\nbody\n!.\n' |
4306 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4307 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4310 ${cat} .
/.tall
>> "${MBOX}"
4311 check
1 - "${MBOX}" '2912243346 51526'
4314 printf 'm this-goes@nowhere\nbody\n!.\n' |
4315 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4316 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4319 ${cat} .
/.tall
>> "${MBOX}"
4320 check
2 - "${MBOX}" '4097804632 34394'
4325 t_mime_types_load_control
() {
4326 t_prolog mime_types_load_control
4327 if have_feat uistrings
; then :; else
4328 echo 'mime_types_load_control: unsupported, skipped'
4331 TRAP_EXIT_ADDONS
="./.t*"
4333 ${cat} <<-_EOT > ./.tmts1
4334 @ application/mathml+xml mathml
4336 ${cat} <<-_EOT > ./.tmts2
4337 @ x-conference/x-cooltalk ice
4339 @ application/aga-aga aga
4342 ${cat} <<-_EOT > ./.tmts1.mathml
4343 <head>nonsense ML</head>
4345 ${cat} <<-_EOT > ./.tmts2.ice
4348 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4349 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4363 ' "${MBOX}" "${MBOX}" |
4365 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4368 ${cat} "${MBOX}" >> .
/.tout
4369 check
1 - .
/.tout
'1441260727 2449'
4371 echo type |
${MAILX} ${ARGS} -R \
4372 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4373 -f "${MBOX}" >> .
/.tout
2>&1
4374 check
2 0 .
/.tout
'1441391438 3646'
4379 t_lreply_futh_rth_etc
() {
4380 t_prolog lreply_futh_rth_etc
4381 TRAP_EXIT_ADDONS
="./.t*"
4383 t_xmta
'HumulusLupulus Thu Jul 27 14:41:20 2017'
4385 ${cat} <<-_EOT > ./.tmbox
4386 From neverneverland Sun Jul 23 13:46:25 2017
4387 Subject: Bugstop: five miles out 1
4388 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4389 From: mister originator <mr@originator>
4390 To: bugstop-commit@five.miles.out, laber@backe.eu
4392 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4393 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4394 Date: Wed, 19 Jul 2017 09:22:57 -0400
4395 Message-Id: <20170719132257.766AF781267@originator>
4398 > |Sorry, I think I misunderstand something. I would think that
4402 From neverneverland Fri Jul 7 22:39:11 2017
4403 Subject: Bugstop: five miles out 2
4404 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4405 Content-Transfer-Encoding: 7bit
4406 From: mister originator <mr@originator>
4407 To: bugstop-commit@five.miles.out
4409 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4410 Date: Fri, 07 Jul 2017 16:33:59 -0400
4413 capable of changing back.
4415 From neverneverland Fri Jul 7 22:42:00 2017
4416 Subject: Bugstop: five miles out 3
4417 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4418 Content-Transfer-Encoding: 7bit
4419 From: mister originator <mr@originator>
4420 To: bugstop-commit@five.miles.out
4422 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4423 Date: Fri, 07 Jul 2017 16:33:59 -0400
4424 List-Post: <mailto:bugstop@five.miles.out>
4427 are you ready, boots?
4429 From neverneverland Sat Aug 19 23:15:00 2017
4430 Subject: Bugstop: five miles out 4
4431 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4432 Content-Transfer-Encoding: 7bit
4433 From: mister originator <mr@originator>
4434 To: bugstop@five.miles.out
4436 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4437 Date: Fri, 07 Jul 2017 16:33:59 -0400
4438 List-Post: <mailto:bugstop@five.miles.out>
4441 are you ready, boots?
4446 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
4447 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4449 wysh
set m
="This is text of \"reply ${1}."
4460 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4463 wysh set m="This is text of
\"Reply
${1}.
"
4469 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4478 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4482 # We need two indirections for this test: one for the case that Lreply
4483 # fails because of missing recipients: we need to read EOF next, thus
4484 # place this in _Ls last; and second for the succeeding cases EOF is
4485 # not what these should read, so go over the backside and splice it in!
4487 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4490 localopts call-fixate
yes
4492 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4493 call L
$1 1; call L
$1 2; call L
$1 3
4496 echo;echo '===== CHANGING === '"$*"' =====';echo
4500 set from
=laber@backe.eu
4503 call tweak
set reply-to-honour
4505 call tweak
set followup-to
4507 call tweak
set followup-to-honour
4509 call tweak mlist bugstop@five.miles.out
4511 call tweak mlsubscribe bugstop@five.miles.out
4513 call tweak
set recipients-in-cc
4518 if have_feat uistrings
; then # xxx should not be so, skip??
4519 check
1 - "${MBOX}" '940818845 29373'
4521 check
1 - "${MBOX}" '3917430455 29259'
4526 ${cat} <<-_EOT > ./.tmbox
4527 From tom@i-i.example Thu Oct 26 03:15:55 2017
4528 Date: Wed, 25 Oct 2017 21:15:46 -0400
4529 From: tom <tom@i-i.example>
4530 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4531 Cc: tom <tom@i-i.example>
4532 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4533 Message-ID: <20171026011546.GA11643@i-i.example>
4534 Reply-To: tom@i-i.example
4535 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4536 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4539 The report's useful :-)
4542 printf 'reply 1\nthank you\n!.\n' |
4543 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4544 -Rf .
/.tmbox
> "${MBOX}" 2>&1
4545 check
2 0 "${MBOX}" '1045866991 331'
4550 t_mime_if_not_ascii
() {
4551 t_prolog mime_if_not_ascii
4553 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4554 check 1 0 "${MBOX}" '2287855519 110'
4556 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4558 check
2 0 "${MBOX}" '70754682 282'
4563 t_xxxheads_rfc2047
() {
4564 t_prolog xxxheads_rfc2047
4565 TRAP_EXIT_ADDONS
="./.t*"
4567 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
4569 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4570 -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̲' \
4572 check
1 0 "${MBOX}" '3370931614 375'
4574 # Single word (overlong line split -- bad standard! Requires injection of
4575 # artificial data!! But can be prevented by using RFC 2047 encoding)
4577 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4578 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4579 check 2 0 "${MBOX}" '489922370 1718'
4581 # Combination of encoded words, space and tabs of varying sort
4583 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4584 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4585 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4586 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4587 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4588 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4590 check 3 0 "${MBOX}" '1676887734 591'
4592 # Overlong multibyte sequence that must be forcefully split
4593 # todo This works even before v15.0, but only by accident
4595 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4596 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4597 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4598 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4600 check 4 0 "${MBOX}" '3029301775 659'
4604 echo | ${MAILX} ${ARGS} \
4605 -s "1-1 B2 B3 B4 B5 B6 B\
4606 1-2 B2 B3 B4 B5 B6 B\
4607 1-3 B2 B3 B4 B5 B6 B\
4608 1-4 B2 B3 B4 B5 B6 B\
4609 1-5 B2 B3 B4 B5 B6 B\
4610 1-6 B2 B3 B4 B5 B6
" \
4612 check 5 0 "${MBOX}" '4126167195 297'
4614 # Leading and trailing WS
4616 echo | ${MAILX} ${ARGS} \
4617 -s " 2-1 B2 B3 B4 B5 B6 B\
4618 1-2 B2 B3 B4 B5 B6 B\
4619 1-3 B2 B3 B4 B5 B6 B\
4620 1-4 B2 B3 B4 B5 B6
" \
4622 check 6 0 "${MBOX}" '3600624479 236'
4624 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4626 echo "Dat Früchtchen riecht häußlich
" |
4627 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
4629 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4630 check 7 0 "${MBOX}" '800505986 368'
4632 # RFC 2047 in an address field, and iconv involved
4633 if have_feat iconv; then
4635 ${cat} > ./.trebox <<_EOT
4636 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4637 Date: Fri, 2 Mar 2018 20:31:45 +0000
4638 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4639 To: dude <dude@exam.ple>
4640 Subject: houston(...)
4641 Message-ID: <abra@1>
4643 Content-Type: text/plain; charset=iso-8859-1
4644 Content-Disposition: inline
4645 Content-Transfer-Encoding: 8bit
4648 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4649 -Sfullnames -Sreply-in-same-charset \
4650 -Smta=./.tmta.sh -Rf ./.trebox
4651 check 8 0 "${MBOX}" '2821484185 280'
4653 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
4661 TRAP_EXIT_ADDONS=".
/.t
*"
4664 mkdir ./.ttt || exit 1
4668 : > 'diet\ is \curd.txt'
4669 : > 'diet "is
" curd.txt'
4671 : > 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
4672 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4673 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4674 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4676 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4677 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4678 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4679 -a ./.ttt/höde-tröge.txt \
4680 -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 \
4681 -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 \
4682 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4683 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4685 check 1 0 "${MBOX}" '684985954 3092'
4687 # `resend' test, reusing $MBOX
4688 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4689 check
2 0 .
/.t2
'684985954 3092'
4691 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4692 check 3 0 ./.t3 '3130352658 3148'
4697 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4698 t_prolog iconv_mbyte_base64
4699 TRAP_EXIT_ADDONS=".
/.t
*"
4701 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4702 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4703 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4706 echo 'iconv_mbyte_base64: unsupported, skipped'
4710 echo 'iconv_mbyte_base64: unsupported, skipped'
4714 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
4716 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
4717 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4719 -Sescape=! -Smime-encoding=base64 2>./.terr
4720 set ttycharset=utf-8 sendcharsets=iso-2022-jp
4722 !s Japanese from UTF-8 to ISO-2022-JP
4723 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4725 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4728 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4730 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
4733 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
4735 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
4736 \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
4738 \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
4741 \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
4743 \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
4746 # May not presume iconv output as long as roundtrip possible [489a7122]
4748 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4749 < "${MBOX}" > .
/.tcksum
4750 check
1 - .
/.tcksum
'2694609714 520'
4751 check
2 - .
/.terr
'4294967295 0'
4753 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4754 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4755 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4756 -Rf "${MBOX}" >.
/.tlog
2>&1
4757 check
3 0 .
/.twrite
'1259742080 686'
4758 #check 4 - ./.tlog '3214068822 2123'
4759 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4760 check
4 - .
/.txlog
'3659773472 2035'
4762 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
4765 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
4766 rm -f "${MBOX}" .
/.twrite
4767 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4769 -Sescape=! -Smime-encoding=base64
2>.
/.terr
4770 set ttycharset
=utf-8 sendcharsets
=euc-jp
4772 !s Japanese from UTF-8 to EUC-JP
4773 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4775 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4778 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
4780 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
4783 set ttycharset
=EUC-JP sendcharsets
=utf-8
4785 !s Japanese from EUC-JP to UTF-8
4786 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4788 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4791 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
4793 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
4797 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
4798 < "${MBOX}" > .
/.tcksum
4799 check
5 - .
/.tcksum
'2870183985 473'
4800 check
6 - .
/.terr
'4294967295 0'
4802 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
4803 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
4804 -S headline
="%>%a%m %-18f %-16d %i%-s" \
4805 -Rf "${MBOX}" >.
/.tlog
2>&1
4806 check
7 0 .
/.twrite
'1259742080 686'
4807 #check 8 - ./.tlog '2506063395 2075'
4808 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
4809 check
8 - .
/.txlog
'2528199891 1988'
4811 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
4817 t_iconv_mainbody
() {
4818 t_prolog iconv_mainbody
4819 TRAP_EXIT_ADDONS
="./.t*"
4821 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
4824 echo 'iconv_mainbody: unsupported, skipped'
4828 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
4830 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
4831 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
4832 -s '–' over-the@rain.bow
2>.
/.terr
4833 check
1 0 "${MBOX}" '3634015017 251'
4834 check
2 - .
/.terr
'4294967295 0'
4836 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
4837 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
4838 -s '–' over-the@rain.bow
2>.
/.terr
4840 check
3 - "${MBOX}" '3634015017 251'
4841 if have_feat uistrings
; then
4842 if have_feat docstrings
; then # xxx should not be like that
4843 check
4 - .
/.terr
'2579894983 148'
4845 check
4 - .
/.terr
'271380835 121'
4848 echo 'iconv_mainbody-4: unsupported, skipped'
4851 # The different iconv(3) implementations use different replacement sequence
4852 # types (character-wise, byte-wise, and the character(s) used differ)
4853 i
="${MAILX_ICONV_MODE}"
4854 if [ -n "${i}" ]; then
4855 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
4857 check_ex0 5-1-estat ${j}
4858 check 5-1 - ./.terr '4294967295 0'
4859 if [ ${i} -eq 13 ]; then
4860 check 5-2 - ./.tout '189327996 283'
4861 elif [ ${i} -eq 12 ]; then
4862 check 5-3 - ./.tout '1959197095 283'
4863 elif [ ${i} -eq 3 ]; then
4864 check 5-4 - ./.tout '3196380198 279'
4866 check 5-5 - ./.tout '3760313827 279'
4869 echo 'iconv_mainbody-5: unsupported, skipped'
4875 t_binary_mainbody() {
4876 t_prolog binary_mainbody
4877 TRAP_EXIT_ADDONS=".
/.t
*"
4879 printf 'abra\0\nka\r\ndabra' |
4880 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
4882 check 1 0 "${MBOX}" '2430168141 243'
4883 check 2 - ./.terr '4294967295 0'
4885 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
4886 ${MAILX} ${ARGS} -Rf \
4887 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
4888 "${MBOX}" >./.tall 2>&1
4889 check 3 0 ./.tall '1151843761 324'
4890 check 4 - ./.tcat '3817108933 15'
4891 check 5 - ./.twrite '3817108933 15'
4897 t_prolog q_t_etc_opts
4898 TRAP_EXIT_ADDONS=".
/.t
*"
4900 # Three tests for MIME encoding and (a bit) content classification.
4901 # At the same time testing -q FILE, < FILE and -t FILE
4902 t__put_body > ./.tin
4904 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
4905 -a ./.tin -s "`t__put_subject`" "${MBOX}"
4906 check 1 0 "${MBOX}" '3570973309 6646'
4909 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
4910 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
4911 check 2 0 "${MBOX}" '3570973309 6646'
4914 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
4916 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
4917 check 3 0 "${MBOX}" '3570973309 6646'
4923 have_feat smime || {
4924 echo 's_mime: unsupported, skipped'
4929 TRAP_EXIT_ADDONS=".
/.t.conf .
/.tkey.pem .
/.tcert.pem .
/.tpair.pem
"
4930 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.VERIFY .
/.DECRYPT .
/.ENCRYPT
"
4931 TRAP_EXIT_ADDONS="${TRAP_EXIT_ADDONS} .
/.tmta.sh
"
4933 ${cat} <<-_EOT > ./.t.conf
4936 default_keyfile = keyfile.pem
4937 distinguished_name = req_distinguished_name
4938 attributes = req_attributes
4942 [ req_distinguished_name ]
4949 emailAddress = test@localhost
4954 openssl req -x509 -nodes -days 3650 -config ./.t.conf \
4955 -newkey rsa:1024 -keyout ./.tkey.pem -out ./.tcert.pem >>${ERR} 2>&1
4957 ${cat} ./.tkey.pem ./.tcert.pem > ./.tpair.pem
4960 echo bla | ${MAILX} ${ARGS} \
4961 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4962 -Ssmime-sign -Sfrom=test@localhost \
4963 -s 'S/MIME test' ./.VERIFY
4967 /^Content-Description: /{ skip = 2; print; next }
4968 /^$/{ if(skip) --skip }
4971 < ./.VERIFY > "${MBOX}"
4972 check 1 - "${MBOX}" '2900817158 648'
4974 printf 'verify\nx\n' |
4976 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4977 -Ssmime-sign -Sfrom=test@localhost \
4979 -f ./.VERIFY >>${ERR} 2>&1
4982 openssl smime -verify -CAfile ./.tcert.pem \
4983 -in ./.VERIFY >>${ERR} 2>&1
4986 # (signing +) encryption / decryption
4987 t_xmta 'Euphrasia Thu Apr 27 17:56:23 2017' ./.ENCRYPT
4991 -Ssmime-force-encryption \
4992 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
4994 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
4995 -Ssmime-sign -Sfrom=test@localhost \
4996 -s 'S/MIME test' recei@ver.com
4998 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
4999 check 4 - "${MBOX}" '1937410597 327'
5001 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5003 -Ssmime-force-encryption \
5004 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
5006 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
5007 -Ssmime-sign -Sfrom=test@localhost \
5009 -f ./.ENCRYPT >>${ERR} 2>&1
5013 /^Content-Description: /{ skip = 2; print; next }
5014 /^$/{ if(skip) --skip }
5017 < ./.DECRYPT > "${MBOX}"
5018 check 5 - "${MBOX}" '1720739247 931'
5020 (openssl smime -decrypt -inkey ./.tkey.pem -in ./.ENCRYPT |
5021 openssl smime -verify -CAfile ./.tcert.pem) >>${ERR} 2>&1
5025 echo bla | ${MAILX} ${ARGS} \
5026 -Ssmime-force-encryption \
5027 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
5029 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
5030 -Sfrom=test@localhost \
5031 -s 'S/MIME test' recei@ver.com
5033 ${sed} -e '/^$/,$d' < ./.ENCRYPT > "${MBOX}"
5034 check 7 - "${MBOX}" '1937410597 327'
5037 printf 'decrypt ./.DECRYPT\nx\n' | ${MAILX} ${ARGS} \
5038 -Ssmime-force-encryption \
5039 -Ssmime-encrypt-recei@ver.com=./.tpair.pem \
5041 -Ssmime-ca-file=./.tcert.pem -Ssmime-sign-cert=./.tpair.pem \
5042 -Sfrom=test@localhost \
5044 -f ./.ENCRYPT >>${ERR} 2>&1
5045 check 8 0 ".
/.DECRYPT
" '2624716890 422'
5047 openssl smime -decrypt -inkey ./.tkey.pem \
5048 -in ./.ENCRYPT >>${ERR} 2>&1
5054 # xxx Note: t_z() was the first test (series) written. Today many
5055 # xxx aspects are (better) covered by other tests above, some are not.
5056 # xxx At some future date and time, convert the last remains not covered
5057 # xxx elsewhere to a real t_* test and drop it
5061 # Test for [260e19d] (Juergen Daubert)
5062 echo body | ${MAILX} ${ARGS} "${MBOX}"
5063 check
4 0 "${MBOX}" '2917662811 98'
5065 # "Test for" [d6f316a] (Gavin Troy)
5067 printf "m ${MBOX}\n~s subject1\nEmail body\n~.\nfi ${MBOX}\np\nx\n" |
5068 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5069 check 6 0 "${MBOX}" '2099098650 122'
5070 check 6-1 - "${BODY}" '794542938 174'
5072 # "Test
for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5075 for(i = 0; i < 10000; ++i)
5077 #printf "\xF0\x90\x87\x90"
5078 }' | ${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5079 check
7 0 "${MBOX}" '534262374 61816'
5085 # MIME encoding (QP) stress message subject
5086 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5087 'adadaddsssssssddddddddddddddddddddd'\
5088 'ddddddddddddddddddddddddddddddddddd'\
5089 'ddddddddddddddddddddddddddddddddddd'\
5090 'dddddddddddddddddddd Hallelulja? Od'\
5091 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5092 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5093 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5094 'fffffffffffffffffffffffffffffffffff'\
5095 'fffffffffffffffffffff ggggggggggggg'\
5096 'ggggggggggggggggggggggggggggggggggg'\
5097 'ggggggggggggggggggggggggggggggggggg'\
5098 'ggggggggggggggggggggggggggggggggggg'\
5103 # MIME encoding (QP) stress message body
5105 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5106 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5107 "wasde willst, gelle, gelle, gelle, gelle, gelle.\r\n"\
5108 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst \r\n"\
5109 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1\r\n"\
5110 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12\r\n"\
5111 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123\r\n"\
5112 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234\r\n"\
5113 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345\r\n"\
5114 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456\r\n"\
5115 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 1234567\r\n"\
5116 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 12345678\r\n"\
5117 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst 123456789\r\n"\
5118 "Unn ausserdem habe ich trailing SP/HT/SP/HT whitespace \r\n"\
5119 "Unn ausserdem habe ich trailing HT/SP/HT/SP whitespace \r\n"\
5120 "auf den zeilen vorher.\r\n"\
5121 "From am Zeilenbeginn und From der Mitte gibt es auch.\r\n"\
5123 "Die letzte Zeile war nur ein Punkt.\r\n"\
5125 "Das waren deren zwei.\r\n"\
5127 "Die letzte Zeile war ein Leerschritt.\n"\
5128 "=VIER = EQUAL SIGNS=ON A LINE=\r\n"\
5131 "Die letzte Zeile war nur ein Punkt, mit Unix Zeilenende.\n"\
5133 "Das waren deren zwei. ditto.\n"\
5135 "Unn ausseerdem habe ich trailing SP/HT/SP/HT whitespace \n"\
5136 "Unn ausseerdem habe ich trailing HT/SP/HT/SP whitespace \n"\
5137 "auf den zeilen vorher.\n"\
5139 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.\n"\
5140 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.1"\
5142 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5144 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5146 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5148 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5150 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende.12"\
5152 "QP am Zeilenende über soft-nl hinweg\n"\
5153 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5155 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5157 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5159 "Ich bin eine ziemlich lange, steile, scharfe Zeile mit Unix Zeilenende."\
5161 "=VIER = EQUAL SIGNS=ON A LINE=\n"\
5163 "Die letzte Zeile war ein Leerschritt.\n"\
5168 # Test all configs TODO doesn't cover all *combinations*, stupid!
5172 ALWAYS = "OPT_AUTOCC=1 OPT_AMALGAMATION=1"
5173 NOTME["OPT_ALWAYS_UNICODE_LOCALE"] = 1
5174 NOTME["OPT_CROSS_BUILD"] = 1
5175 NOTME["OPT_AUTOCC"] = 1
5176 NOTME["OPT_AMALGAMATION"] = 1
5177 NOTME["OPT_DEBUG"] = 1
5178 NOTME["OPT_DEVEL"] = 1
5179 NOTME["OPT_ASAN_ADDRESS"] = 1
5180 NOTME["OPT_ASAN_MEMORY"] = 1
5181 NOTME["OPT_FORCED_STACKPROT"] = 1
5182 NOTME["OPT_NOMEMDBG"] = 1
5183 NOTME["OPT_NYD2"] = 1
5188 MULCHOICE["OPT_IDNA"] = "VAL_IDNA"
5189 MULVALS["VAL_IDNA"] = 1
5191 #VALKEYS[0] = "VAL_RANDOM"
5192 VALVALS["VAL_RANDOM"] = 1
5195 /^[[:space:]]*OPT_/{
5196 sub(/^[[:space:]]*/, "")
5197 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5198 # does not seem to be a compliant escape for =
5200 $1 = substr($1, 1, index($1, "=") - 1)
5202 OPTVALS[OPTNO++] = $1
5205 /^[[:space:]]*VAL_/{
5206 sub(/^[[:space:]]*/, "")
5207 val = substr($0, index($0, "=") + 1)
5209 val = substr(val, 2)
5210 val = substr(val, 1, length(val) - 1)
5212 $1 = substr($1, 1, index($1, "=") - 1)
5215 else if(VALVALS[$1]){
5216 VALKEYS[VALNO++] = $1
5221 function onepass(addons){
5222 a_onepass__worker(addons, "1", "0")
5223 a_onepass__worker(addons, "0", "1")
5225 function a_onepass__worker(addons, b0, b1){
5226 # Doing this completely sequentially and not doing make distclean in
5227 # between runs should effectively result in lesser compilations.
5228 # It is completely dumb nonetheless... TODO
5229 for(ono = 0; ono < OPTNO; ++ono){
5231 for(i = 0; i < ono; ++i){
5232 myconf = myconf " " OPTVALS[i] "=" b0 " "
5234 j = MULCHOICE[OPTVALS[i]]
5239 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5243 for(i = ono; i < OPTNO; ++i){
5244 myconf = myconf " " OPTVALS[i] "=" b1 " "
5246 j = MULCHOICE[OPTVALS[i]]
5251 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any "
5257 myconf = VALKEYS[i] "=any " myconf
5259 myconf = myconf " " ALWAYS " " addons
5264 i = split(MULVALS[mula], ia)
5268 print mula "=\"" j "\" " myconf
5274 # We cannot test NULL because of missing UI strings, which will end
5275 # up with different checksums
5276 print "CONFIG=NULLI OPT_AUTOCC=1"
5278 j = split(VALVALS[VALKEYS[i]], ia)
5282 print VALKEYS[i] "=\"" k "\" CONFIG=NULLI OPT_AUTOCC=1"
5285 print "CONFIG=MINIMAL OPT_AUTOCC=1"
5286 print "CONFIG=NETSEND OPT_AUTOCC=1"
5287 print "CONFIG=MAXIMAL OPT_AUTOCC=1"
5289 j = split(VALVALS[VALKEYS[i]], ia)
5293 print VALKEYS[i] "=\"" k "\" CONFIG=MAXIMAL OPT_AUTOCC=1"
5296 print "CONFIG=DEVEL OPT_AUTOCC=1"
5297 print "CONFIG=ODEVEL OPT_AUTOCC=1"
5299 onepass("OPT_DEBUG=1")
5302 ' |
while read c
; do
5303 [ -f mk-config.h
] && ${cp} mk-config.h .ccac.h
5304 printf "\n\n##########\n$c\n"
5305 printf "\n\n##########\n$c\n" >&2
5306 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5307 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5308 printf 'Skipping after config, nothing changed\n'
5309 printf 'Skipping after config, nothing changed\n' >&2
5312 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5315 cd .. && ${MAKE} distclean
5318 [ -n "${ERR}" ] && echo > ${ERR}
5319 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5321 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5322 # if have_feat devel; then
5323 # ARGS="${ARGS} -Smemdebug"
5329 while [ ${#} -gt 0 ]; do
5335 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'