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-disable -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
288 t_input_inject_semicolon_seq
318 t_quote_a_cmd_escapes
321 t_mime_types_load_control
322 t_lreply_futh_rth_etc
335 t_X_opt_input_command_stack
() {
336 t_prolog X_opt_input_command_stack
338 ${cat} <<- '__EOT' > "${BODY}"
346 echo "define mac1 {";\
347 echo " echo mac1-1 via1 \$0";\
349 echo " echo mac1-2";\
351 echo " echo mac1-3";\
354 echo "define mac2 {";\
355 echo " echo mac2-1 via1 \$0";\
357 echo " echo mac2-2";\
363 echo echo 1-1-1 via1 \$0;\
375 # The -X option supports multiline arguments, and those can internally use
376 # reverse solidus newline escaping. And all -X options are joined...
378 < "${BODY}" ${MAILX} ${ARGS} \
393 echo "define mac1 {";\
394 echo " echo mac1-1 via2 \$0";\
396 echo " echo mac1-2";\
398 echo " echo mac1-3";\
401 echo "define mac2 {";\
402 echo " echo mac2-1 via2 \$0";\
404 echo " echo mac2-2";\
410 echo echo 1-1-1 via2 \$0;\
424 check 1 0 "${MBOX}" '1786542668 416'
431 if have_feat uistrings; then :; else
432 echo 'x_errexit: unsupported, skipped'
436 ${cat} <<- '__EOT' > "${BODY}"
442 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
443 -X'echo one' -X' echos nono ' -X'echo two' \
445 check 1 0 "${MBOX}" '916157812 53'
447 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
449 check 2 0 "${MBOX}" '916157812 53'
451 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
453 check
3 0 "${MBOX}" '916157812 53'
457 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
458 -X'echo one' -X' echos nono ' -X'echo two' \
460 check
4 1 "${MBOX}" '2118430867 49'
462 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
464 check 5 1 "${MBOX}" '2118430867 49'
466 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
468 check
6 1 "${MBOX}" '12955965 172'
470 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
472 check 7 1 "${MBOX}" '12955965 172'
474 ## Repeat 4-7 with ignerr set
476 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
478 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
479 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
481 check
8 0 "${BODY}" '916157812 53'
483 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
485 check 9 0 "${BODY}" '916157812 53'
487 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
489 check
10 0 "${BODY}" '916157812 53'
491 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
493 check 11 0 "${BODY}" '916157812 53'
503 # Test basic assumption
504 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
505 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
507 check
1 0 "${MBOX}" '270686329 21'
510 ${cat} <<- '__EOT' > "${BODY}"
515 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
516 -Snoasksub -Sasksub -Snoasksub \
517 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
519 check
2 0 "${MBOX}" '3182942628 37'
521 ${cat} <<- '__EOT' > "${BODY}"
526 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
527 -Snoasksub -Sasksub \
528 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
530 check
3 0 "${MBOX}" '2006554293 39'
533 ${cat} <<- '__EOT' > "${BODY}"
534 echo dietcurd<$dietcurd>
536 echo dietcurd<$dietcurd>
538 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
539 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
540 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
541 -X'echo dietcurd<$dietcurd>' \
543 check
4 0 "${MBOX}" '1985768109 65'
545 ${cat} <<- '__EOT' > "${BODY}"
546 echo dietcurd<$dietcurd>
548 echo dietcurd<$dietcurd>
550 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
551 -Sdietcurd=strawberry
-Snodietcurd \
552 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
553 -X'echo dietcurd<$dietcurd>' \
555 check
5 0 "${MBOX}" '151574279 51'
557 # TODO once we have a detached one with env=1..
558 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
559 echo 's_freeze-{6,7}: shell sets $TERM, skipped'
561 ${cat} <<- '__EOT' > "${BODY}"
562 !echo "shell says TERM<$TERM>"
564 !echo "shell says TERM<$TERM>"
566 !echo "shell says TERM<$TERM>"
568 !echo "shell says TERM<$TERM>"
570 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
571 -STERM=strawberry
-SnoTERM -STERM=vanilla \
572 -X'echo mail<$TERM>' -X'unset TERM' \
573 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
575 check
6 0 "${MBOX}" '1211476036 167'
577 ${cat} <<- '__EOT' > "${BODY}"
578 !echo "shell says TERM<$TERM>"
580 !echo "shell says TERM<$TERM>"
582 !echo "shell says TERM<$TERM>"
584 !echo "shell says TERM<$TERM>"
586 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
587 -STERM=strawberry
-SnoTERM \
588 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
589 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
591 check
7 0 "${MBOX}" '3365080441 132'
598 t_input_inject_semicolon_seq
() {
599 t_prolog input_inject_semicolon_seq
601 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
606 echon this_is_mymac;call mydeepmac;echon ';';
608 echon one';';call mymac;echon two";";call mymac;echo three$';';
610 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
612 echon one';';call mymac;echon two";";call mymac;echo three$';';
615 check 1 0 "${MBOX}" '512117110 140'
623 # XXX the first needs to be checked, it is quite dumb as such
624 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
654 vput shcodec res e abcd
655 echo $?
/$^ERRNAME
$res
658 vput shcodec res d abcd
659 echo $?
/$^ERRNAME
$res
662 vput shcodec res e a
'b'c
'd'
663 echo $?
/$^ERRNAME
$res
666 vput shcodec res d a
'b'c
'd'
667 echo $?
/$^ERRNAME
$res
670 vput shcodec res e a
"b"c
"d"
671 echo $?
/$^ERRNAME
$res
674 vput shcodec res d a
"b"c
"d"
675 echo $?
/$^ERRNAME
$res
678 vput shcodec res e a$
'b'c$
'd'
679 echo $?
/$^ERRNAME
$res
682 vput shcodec res d a$
'b'c$
'd'
683 echo $?
/$^ERRNAME
$res
686 vput shcodec res e
'abcd'
687 echo $?
/$^ERRNAME
$res
690 vput shcodec res d
'abcd'
691 echo $?
/$^ERRNAME
$res
694 vput shcodec res e
"abcd"
695 echo $?
/$^ERRNAME
$res
698 vput shcodec res d
"abcd"
699 echo $?
/$^ERRNAME
$res
702 vput shcodec res e $
'abcd'
703 echo $?
/$^ERRNAME
$res
706 vput shcodec res d $
'abcd'
707 echo $?
/$^ERRNAME
$res
711 vput shcodec res e a b\ c d
712 echo $?
/$^ERRNAME
$res
715 vput shcodec res d a b\ c d
716 echo $?
/$^ERRNAME
$res
717 vput shcodec res e ab
cd
718 echo $?
/$^ERRNAME
$res
721 vput shcodec res d
'ab cd'
722 echo $?
/$^ERRNAME
$res
723 vput shcodec res e a
'b c' d
724 echo $?
/$^ERRNAME
$res
727 vput shcodec res d a
'b c' d
728 echo $?
/$^ERRNAME
$res
729 vput shcodec res e a
"b c" d
730 echo $?
/$^ERRNAME
$res
733 vput shcodec res d a
"b c" d
734 echo $?
/$^ERRNAME
$res
735 vput shcodec res e a $
'b c' d
736 echo $?
/$^ERRNAME
$res
739 vput shcodec res d a $
'b c' d
740 echo $?
/$^ERRNAME
$res
742 vput shcodec res e
'a$`"\'
743 echo $?/$^ERRNAME $res
746 vput shcodec res d 'a$
`"\'
747 echo $?/$^ERRNAME $res
748 vput shcodec res e "a\$\`'\"\\"
749 echo $?/$^ERRNAME $res
752 vput shcodec res d "a\$\`'\"\\"
753 echo $?/$^ERRNAME $res
754 vput shcodec res e $'a\$`\'\"\\'
755 echo $?/$^ERRNAME $res
758 vput shcodec res d $'a\$`\'\"\\'
759 echo $?/$^ERRNAME $res
760 vput shcodec res e $'a\$`\'"\\'
761 echo $?/$^ERRNAME $res
764 vput shcodec res d $'a\$
`\'"\\'
765 echo $?/$^ERRNAME $res
768 vput shcodec res e a${diet}c
769 echo $?/$^ERRNAME $res
772 eval vput shcodec res e a${diet}c
773 echo $?/$^ERRNAME $res
776 vput shcodec res e "a${diet}c"
777 echo $?/$^ERRNAME $res
780 eval vput shcodec res e "a${diet}c"
781 echo $?/$^ERRNAME $res
785 check 1 0 "${MBOX}" '3316745312 1241'
787 if [ -z "${UTF8_LOCALE}" ]; then
788 echo 'Skip shcodec-unicode, no UTF8_LOCALE TODO CANNOT'
790 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
791 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
795 shcodec d $'t\u00E4st'
798 shcodec d $'a\u054Dc'
801 shcodec d $'a\U0001F603c'
803 check unicode 0 "${MBOX}" '4233409480 77'
812 ${cat} <<- '__EOT' > "${BODY}"
831 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
832 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
833 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
835 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
836 echo a$'\u0041\u41\u0C1\U00000041\U41'c
859 echo a$'b\U0000000'dt
860 echo a$'b\U00000000'du
870 if [ -z "${UTF8_LOCALE}" ]; then
871 echo 'Skip wysh-unicode, no UTF8_LOCALE'
873 < "${BODY}" DIET=CURD TIED= \
874 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
875 check unicode 0 "${MBOX}" '475805847 317'
878 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
879 check c 0 "${MBOX}" '1473887148 321'
881 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
882 wysh set mager='\hey\'
884 wysh set mager="\hey\\"
886 wysh set mager=$'\hey\\'
889 check 3 0 "${MBOX}" '1289698238 69'
895 t_prolog commandalias
897 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
898 commandalias echo echo hoho
902 commandalias XxX XxXx
903 commandalias XxXx XxXxX
904 commandalias XxXxX XxXxXx
905 commandalias XxXxXx echo huhu
906 commandalias XxXxXxX echo huhu
908 commandalias XxXxXx XxXxXxX
911 commandalias XxXxXx echo huhu
915 check 1 0 "${MBOX}" '1638809585 36'
923 # Nestable conditions test
924 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
946 if $dietcurd == 'yoho'
951 if $dietcurd @== 'Yoho'
956 if $dietcurd == 'Yoho'
961 if $dietcurd != 'yoho'
966 if $dietcurd @!= 'Yoho'
971 if $dietcurd != 'Yoho'
1032 if $dietcurd == 'yohu
'
1034 elif $dietcurd == 'yoha
'
1036 elif $dietcurd == 'yohe
'
1038 elif $dietcurd == 'yoho
'
1040 if $dietcurd == 'yohu
'
1042 elif $dietcurd == 'yoha
'
1044 elif $dietcurd == 'yohe
'
1046 elif $dietcurd == 'yoho
'
1048 if $dietcurd == 'yohu
'
1050 elif $dietcurd == 'yoha
'
1052 elif $dietcurd == 'yohe
'
1054 elif $dietcurd == 'yoho
'
1110 if $dietcurd @== aBC
1115 if $dietcurd @>= AbC
1120 if $dietcurd @<= ABc
1125 if $dietcurd @>= abd
1130 if $dietcurd @<= abb
1158 if $dietcurd @i=% aB
1203 set diet=abc curd=abc
1209 set diet=abc curd=abcd
1215 # 1. Shitty grouping capabilities as of today
1216 unset diet curd ndefined
1217 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1223 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1228 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1233 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1238 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1243 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1244 && [ no ] || [ yes ]
1249 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1254 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1259 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1264 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1269 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1274 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1279 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1284 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1289 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1294 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1300 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1306 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1311 # 2. Shitty grouping capabilities as of today
1312 unset diet curd ndefined
1313 if [ false || false || true ] && [ false || true ] && yes
1318 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1323 if [ 1 || 0 || 0 || 0 ]
1328 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1333 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1338 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1343 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1348 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1353 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1358 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1363 if 1 || 0 || 0 || 0 && 0
1368 if 1 || 0 || 0 || 0 && 1
1373 if 0 || 0 || 0 || 1 && 0
1378 if 0 || 0 || 0 || 1 && 1
1383 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1388 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1394 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1399 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1405 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1410 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1415 if [ [ [ [ [ [ $diet == 'yo
' && $curd == 'ho
' && $ndefined ] ] ] ] ] ]
1420 # Some more en-braced variables
1422 if ${diet} == ${curd}
1427 if ${diet} != ${curd}
1443 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1448 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1453 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1458 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1463 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1468 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1473 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1478 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1483 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1489 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1494 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1499 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1504 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1509 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1514 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1519 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1524 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1529 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1536 check normal 0 "${MBOX}" '1688759742 719'
1538 if have_feat regex; then
1539 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1541 if $dietcurd =~ '^yo.
*'
1546 if $dietcurd =~ '^Yo.
*'
1551 if $dietcurd @=~ '^Yo.
*'
1556 if $dietcurd =~ '^yOho.
+'
1561 if $dietcurd @!~ '.
*Ho$
'
1566 if $dietcurd !~ '.
+yohO$
'
1571 if [ $dietcurd @i!~ '.
+yoho$
' ]
1576 if ! [ $dietcurd @i=~ '.
+yoho$
' ]
1581 if ! ! [ $dietcurd @i!~ '.
+yoho$
' ]
1586 if ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ]
1591 if [ ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ] ]
1596 if ! [ ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1601 if ! ! ! $dietcurd !~ '.
+yoho$
'
1606 if ! ! ! $dietcurd =~ '.
+yoho$
'
1611 if ! [ ! ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1616 set diet=abc curd='^abc$
'
1622 set diet=abc curd='^abcd$
'
1630 check regex 0 "${MBOX}" '1115671789 95'
1632 printf 'if-regex
: unsupported
, skipped
\n'
1641 # Nestable conditions test
1642 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1657 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1662 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1663 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1672 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1674 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1683 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1690 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1697 echo ----- $1: $2 -> $3 -> $4
1705 call llx 'call off
' on on on
1706 call llx 'call off
' off on on
1707 call llx 'call off
' on off on
1708 call llx 'call off
' on off off
1709 localopts call-fixate on
1710 call llx 'call-fixate on
' on on on
1711 call llx 'call-fixate on
' off on on
1712 call llx 'call-fixate on
' on off on
1713 call llx 'call-fixate on
' on off off
1714 unset x;localopts call on
1715 call llx 'call on
' on on on
1716 call llx 'call on
' off on on
1717 call llx 'call on
' on off on
1718 call llx 'call on
' on off off
1723 check 1 0 "${MBOX}" '4016155249 1246'
1731 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1759 echo ------- global-1 du=$du
1761 echo ------- global-2 du=$du
1764 echo ------- global-3 du=$du
1766 echo ------- global-4 du=$du
1768 echo ------- global-5 du=$du
1771 check 1 0 "${MBOX}" '2411598140 641'
1776 t_macro_param_shift() {
1777 t_prolog macro_param_shift
1779 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1782 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1787 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1788 if [ $# > 1 ] || [ $ignerr == '' ]
1793 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1795 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1799 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1804 call t2 1 you get four args
1805 echo t1.1: $?';' ignerr ($ignerr) should not exist
1806 call t2 1 you get 'three args
'
1807 echo t1.2: $?';' ignerr ($ignerr) should not exist
1808 call t2 1 you 'get two args
'
1809 echo t1.3: $?';' ignerr ($ignerr) should not exist
1810 call t2 1 'you get one arg
'
1811 echo t1.4: $?';' ignerr ($ignerr) should not exist
1812 ignerr call t2 '' 'you get one arg
'
1813 echo t1.5: $?';' ignerr ($ignerr) should not exist
1818 check 1 0 "${MBOX}" '1402489146 1682'
1826 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1827 vput addrcodec res e 1 <doog@def>
1828 echo $?/$^ERRNAME $res
1829 eval vput addrcodec res d $res
1830 echo $?/$^ERRNAME $res
1831 vput addrcodec res e 2 . <doog@def>
1832 echo $?/$^ERRNAME $res
1833 eval vput addrcodec res d $res
1834 echo $?/$^ERRNAME $res
1835 vput addrcodec res e 3 Sauer Dr. <doog@def>
1836 echo $?/$^ERRNAME $res
1837 eval vput addrcodec res d $res
1838 echo $?/$^ERRNAME $res
1839 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1840 echo $?/$^ERRNAME $res
1841 eval vput addrcodec res d $res
1842 echo $?/$^ERRNAME $res
1843 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1844 echo $?/$^ERRNAME $res
1845 eval vput addrcodec res d $res
1846 echo $?/$^ERRNAME $res
1848 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1849 echo $?/$^ERRNAME $res
1850 eval vput addrcodec res d $res
1851 echo $?/$^ERRNAME $res
1852 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1853 echo $?/$^ERRNAME $res
1854 eval vput addrcodec res d $res
1855 echo $?/$^ERRNAME $res
1856 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1857 echo $?/$^ERRNAME $res
1858 eval vput addrcodec res d $res
1859 echo $?/$^ERRNAME $res
1860 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1861 echo $?/$^ERRNAME $res
1862 eval vput addrcodec res d $res
1863 echo $?/$^ERRNAME $res
1864 vput addrcodec res +e 8 \
1865 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1866 echo $?/$^ERRNAME $res
1867 eval vput addrcodec res d $res
1868 echo $?/$^ERRNAME $res
1869 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1870 echo $?/$^ERRNAME $res
1871 eval vput addrcodec res d $res
1872 echo $?/$^ERRNAME $res
1873 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1874 echo $?/$^ERRNAME $res
1875 eval vput addrcodec res d $res
1876 echo $?/$^ERRNAME $res
1877 vput addrcodec res +e 11 (Ma)Braten Dr"." (Heu) <doog@def>
1878 echo $?/$^ERRNAME $res
1879 eval vput addrcodec res d $res
1880 echo $?/$^ERRNAME $res
1881 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1882 echo $?/$^ERRNAME $res
1883 eval vput addrcodec res d $res
1884 echo $?/$^ERRNAME $res
1885 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1886 echo $?/$^ERRNAME $res
1887 eval vput addrcodec res d $res
1888 echo $?/$^ERRNAME $res
1889 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1890 echo $?/$^ERRNAME $res
1891 eval vput addrcodec res d $res
1892 echo $?/$^ERRNAME $res
1893 vput addrcodec res +e 15 \
1894 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1895 echo $?/$^ERRNAME $res
1896 eval vput addrcodec res d $res
1897 echo $?/$^ERRNAME $res
1898 vput addrcodec res +e 16 \
1899 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1900 echo $?/$^ERRNAME $res
1901 eval vput addrcodec res d $res
1902 echo $?/$^ERRNAME $res
1903 vput addrcodec res +e 17 \
1904 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1905 echo $?/$^ERRNAME $res
1906 eval vput addrcodec res d $res
1907 echo $?/$^ERRNAME $res
1908 vput addrcodec res +e 18 \
1909 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1910 echo $?/$^ERRNAME $res
1911 eval vput addrcodec res d $res
1912 echo $?/$^ERRNAME $res
1913 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1914 echo $?/$^ERRNAME $res
1915 eval vput addrcodec res d $res
1916 echo $?/$^ERRNAME $res
1918 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1919 echo $?/$^ERRNAME $res
1920 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1921 echo $?/$^ERRNAME $res
1922 eval vput addrcodec res d $res
1923 echo $?/$^ERRNAME $res
1925 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1926 echo $?/$^ERRNAME $res
1927 eval vput addrcodec res d $res
1928 echo $?/$^ERRNAME $res
1930 vput addrcodec res s \
1931 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1932 echo $?/$^ERRNAME $res
1934 # Fix for [f3852f88]
1935 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot(e)d"
1936 echo $?/$^ERRNAME $res
1937 eval vput addrcodec res d $res
1938 echo $?/$^ERRNAME $res
1939 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot(e)d"
1940 echo $?/$^ERRNAME $res
1941 eval vput addrcodec res d $res
1942 echo $?/$^ERRNAME $res
1945 check 1 0 "${MBOX}" '1047317989 2612'
1947 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1949 mlsubscribe isa2@list
1951 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1952 echo $?/$^ERRNAME $res
1953 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1954 echo $?/$^ERRNAME $res
1955 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1956 echo $?/$^ERRNAME $res
1957 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1958 echo $?/$^ERRNAME $res
1959 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1960 echo $?/$^ERRNAME $res
1961 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1962 echo $?/$^ERRNAME $res
1965 check 2 0 "${MBOX}" '1391779299 104'
1967 if have_feat idna; then
1968 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1969 vput addrcodec res e (heu) <du@blödiän> "stroh" du
1970 echo $?/$^ERRNAME $res
1971 eval vput addrcodec res d $res
1972 echo $?/$^ERRNAME $res
1973 vput addrcodec res e <du@blödiän> du
1974 echo $?/$^ERRNAME $res
1975 eval vput addrcodec res d $res
1976 echo $?/$^ERRNAME $res
1977 vput addrcodec res e du <du@blödiän>
1978 echo $?/$^ERRNAME $res
1979 eval vput addrcodec res d $res
1980 echo $?/$^ERRNAME $res
1981 vput addrcodec res e <du@blödiän>
1982 echo $?/$^ERRNAME $res
1983 eval vput addrcodec res d $res
1984 echo $?/$^ERRNAME $res
1985 vput addrcodec res e du@blödiän
1986 echo $?/$^ERRNAME $res
1987 eval vput addrcodec res d $res
1988 echo $?/$^ERRNAME $res
1991 check idna 0 "${MBOX}" '498775983 326'
1993 printf 'addrcodec-idna
: unsupported
, skipped
\n'
2002 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
2004 vput vexpr res
= 9223372036854775807
2005 echo $?
/$^ERRNAME
$res
2006 vput vexpr res
= 9223372036854775808
2007 echo $?
/$^ERRNAME
$res
2008 vput vexpr res
= u9223372036854775808
2009 echo $?
/$^ERRNAME
$res
2010 vput vexpr res @
= 9223372036854775808
2011 echo $?
/$^ERRNAME
$res
2012 vput vexpr res
= -9223372036854775808
2013 echo $?
/$^ERRNAME
$res
2014 vput vexpr res
= -9223372036854775809
2015 echo $?
/$^ERRNAME
$res
2016 vput vexpr res @
= -9223372036854775809
2017 echo $?
/$^ERRNAME
$res
2018 vput vexpr res
= U9223372036854775809
2019 echo $?
/$^ERRNAME
$res
2022 0b0111111111111111111111111111111111111111111111111111111111111111
2023 echo $?
/$^ERRNAME
$res
2025 S0b1000000000000000000000000000000000000000000000000000000000000000
2026 echo $?
/$^ERRNAME
$res
2028 S0b1000000000000000000000000000000000000000000000000000000000000000
2029 echo $?
/$^ERRNAME
$res
2031 U0b1000000000000000000000000000000000000000000000000000000000000000
2032 echo $?
/$^ERRNAME
$res
2034 0b1000000000000000000000000000000000000000000000000000000000000000
2035 echo $?
/$^ERRNAME
$res
2037 0b1000000000000000000000000000000000000000000000000000000000000000
2038 echo $?
/$^ERRNAME
$res
2040 -0b1000000000000000000000000000000000000000000000000000000000000000
2041 echo $?
/$^ERRNAME
$res
2043 S0b1000000000000000000000000000000000000000000000000000000000000001
2044 echo $?
/$^ERRNAME
$res
2046 S0b1000000000000000000000000000000000000000000000000000000000000001
2047 echo $?
/$^ERRNAME
$res
2049 -0b1000000000000000000000000000000000000000000000000000000000000001
2050 echo $?
/$^ERRNAME
$res
2052 U0b1000000000000000000000000000000000000000000000000000000000000001
2053 echo $?
/$^ERRNAME
$res
2055 vput vexpr res
= 0777777777777777777777
2056 echo $?
/$^ERRNAME
$res
2057 vput vexpr res
= S01000000000000000000000
2058 echo $?
/$^ERRNAME
$res
2059 vput vexpr res @
= S01000000000000000000000
2060 echo $?
/$^ERRNAME
$res
2061 vput vexpr res
= U01000000000000000000000
2062 echo $?
/$^ERRNAME
$res
2063 vput vexpr res
= 01000000000000000000000
2064 echo $?
/$^ERRNAME
$res
2065 vput vexpr res @
= 01000000000000000000000
2066 echo $?
/$^ERRNAME
$res
2067 vput vexpr res
= -01000000000000000000000
2068 echo $?
/$^ERRNAME
$res
2069 vput vexpr res
= S01000000000000000000001
2070 echo $?
/$^ERRNAME
$res
2071 vput vexpr res @
= S01000000000000000000001
2072 echo $?
/$^ERRNAME
$res
2073 vput vexpr res @
= -01000000000000000000001
2074 echo $?
/$^ERRNAME
$res
2075 vput vexpr res
= U01000000000000000000001
2076 echo $?
/$^ERRNAME
$res
2078 vput vexpr res
= 0x7FFFFFFFFFFFFFFF
2079 echo $?
/$^ERRNAME
$res
2080 vput vexpr res
= S0x8000000000000000
2081 echo $?
/$^ERRNAME
$res
2082 vput vexpr res @
= S0x8000000000000000
2083 echo $?
/$^ERRNAME
$res
2084 vput vexpr res
= U0x8000000000000000
2085 echo $?
/$^ERRNAME
$res
2086 vput vexpr res
= 0x8000000000000000
2087 echo $?
/$^ERRNAME
$res
2088 vput vexpr res @
= 0x8000000000000000
2089 echo $?
/$^ERRNAME
$res
2090 vput vexpr res
= -0x8000000000000000
2091 echo $?
/$^ERRNAME
$res
2092 vput vexpr res
= S0x8000000000000001
2093 echo $?
/$^ERRNAME
$res
2094 vput vexpr res @
= S0x8000000000000001
2095 echo $?
/$^ERRNAME
$res
2096 vput vexpr res @
= -0x8000000000000001
2097 echo $?
/$^ERRNAME
$res
2098 vput vexpr res
= u0x8000000000000001
2099 echo $?
/$^ERRNAME
$res
2102 echo $?
/$^ERRNAME
$res
2104 echo $?
/$^ERRNAME
$res
2106 echo $?
/$^ERRNAME
$res
2108 vput vexpr res
+ 0 0
2109 echo $?
/$^ERRNAME
$res
2110 vput vexpr res
+ 0 1
2111 echo $?
/$^ERRNAME
$res
2112 vput vexpr res
+ 1 1
2113 echo $?
/$^ERRNAME
$res
2115 vput vexpr res
+ 9223372036854775807 0
2116 echo $?
/$^ERRNAME
$res
2117 vput vexpr res
+ 9223372036854775807 1
2118 echo $?
/$^ERRNAME
$res
2119 vput vexpr res @
+ 9223372036854775807 1
2120 echo $?
/$^ERRNAME
$res
2121 vput vexpr res
+ 0 9223372036854775807
2122 echo $?
/$^ERRNAME
$res
2123 vput vexpr res
+ 1 9223372036854775807
2124 echo $?
/$^ERRNAME
$res
2125 vput vexpr res @
+ 1 9223372036854775807
2126 echo $?
/$^ERRNAME
$res
2128 vput vexpr res
+ -9223372036854775808 0
2129 echo $?
/$^ERRNAME
$res
2130 vput vexpr res
+ -9223372036854775808 -1
2131 echo $?
/$^ERRNAME
$res
2132 vput vexpr res @
+ -9223372036854775808 -1
2133 echo $?
/$^ERRNAME
$res
2134 vput vexpr res
+ 0 -9223372036854775808
2135 echo $?
/$^ERRNAME
$res
2136 vput vexpr res
+ -1 -9223372036854775808
2137 echo $?
/$^ERRNAME
$res
2138 vput vexpr res @
+ -1 -9223372036854775808
2139 echo $?
/$^ERRNAME
$res
2141 vput vexpr res
- 0 0
2142 echo $?
/$^ERRNAME
$res
2143 vput vexpr res
- 0 1
2144 echo $?
/$^ERRNAME
$res
2145 vput vexpr res
- 1 1
2146 echo $?
/$^ERRNAME
$res
2148 vput vexpr res
- 9223372036854775807 0
2149 echo $?
/$^ERRNAME
$res
2150 vput vexpr res
- 9223372036854775807 -1
2151 echo $?
/$^ERRNAME
$res
2152 vput vexpr res @
- 9223372036854775807 -1
2153 echo $?
/$^ERRNAME
$res
2154 vput vexpr res
- 0 9223372036854775807
2155 echo $?
/$^ERRNAME
$res
2156 vput vexpr res
- -1 9223372036854775807
2157 echo $?
/$^ERRNAME
$res
2158 vput vexpr res
- -2 9223372036854775807
2159 echo $?
/$^ERRNAME
$res
2160 vput vexpr res @
- -2 9223372036854775807
2161 echo $?
/$^ERRNAME
$res
2163 vput vexpr res
- -9223372036854775808 +0
2164 echo $?
/$^ERRNAME
$res
2165 vput vexpr res
- -9223372036854775808 +1
2166 echo $?
/$^ERRNAME
$res
2167 vput vexpr res @
- -9223372036854775808 +1
2168 echo $?
/$^ERRNAME
$res
2169 vput vexpr res
- 0 -9223372036854775808
2170 echo $?
/$^ERRNAME
$res
2171 vput vexpr res
- +1 -9223372036854775808
2172 echo $?
/$^ERRNAME
$res
2173 vput vexpr res @
- +1 -9223372036854775808
2174 echo $?
/$^ERRNAME
$res
2176 vput vexpr res
+ -13 -2
2177 echo $?
/$^ERRNAME
$res
2178 vput vexpr res
- 0 0
2179 echo $?
/$^ERRNAME
$res
2180 vput vexpr res
- 0 1
2181 echo $?
/$^ERRNAME
$res
2182 vput vexpr res
- 1 1
2183 echo $?
/$^ERRNAME
$res
2184 vput vexpr res
- -13 -2
2185 echo $?
/$^ERRNAME
$res
2187 vput vexpr res
* 0 0
2188 echo $?
/$^ERRNAME
$res
2189 vput vexpr res
* 0 1
2190 echo $?
/$^ERRNAME
$res
2191 vput vexpr res
* 1 1
2192 echo $?
/$^ERRNAME
$res
2193 vput vexpr res
* -13 -2
2194 echo $?
/$^ERRNAME
$res
2196 vput vexpr res
/ 0 0
2197 echo $?
/$^ERRNAME
$res
2198 vput vexpr res
/ 0 1
2199 echo $?
/$^ERRNAME
$res
2200 vput vexpr res
/ 1 1
2201 echo $?
/$^ERRNAME
$res
2202 vput vexpr res
/ -13 -2
2203 echo $?
/$^ERRNAME
$res
2205 vput vexpr res
% 0 0
2206 echo $?
/$^ERRNAME
$res
2207 vput vexpr res
% 0 1
2208 echo $?
/$^ERRNAME
$res
2209 vput vexpr res
% 1 1
2210 echo $?
/$^ERRNAME
$res
2211 vput vexpr res
% -13 -2
2212 echo $?
/$^ERRNAME
$res
2215 check numeric
0 "${MBOX}" '960821755 1962'
2217 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2218 vput vexpr res find 'bananarama' 'nana'
2219 echo $?/$^ERRNAME :$res:
2220 vput vexpr res find 'bananarama' 'bana'
2221 echo $?/$^ERRNAME :$res:
2222 vput vexpr res find 'bananarama' 'Bana'
2223 echo $?/$^ERRNAME :$res:
2224 vput vexpr res find 'bananarama' 'rama'
2225 echo $?/$^ERRNAME :$res:
2227 vput vexpr res ifind 'bananarama' 'nana'
2228 echo $?/$^ERRNAME :$res:
2229 vput vexpr res ifind 'bananarama' 'bana'
2230 echo $?/$^ERRNAME :$res:
2231 vput vexpr res ifind 'bananarama' 'Bana'
2232 echo $?/$^ERRNAME :$res:
2233 vput vexpr res ifind 'bananarama' 'rama'
2234 echo $?/$^ERRNAME :$res:
2236 vput vexpr res substring 'bananarama' 1
2237 echo $?/$^ERRNAME :$res:
2238 vput vexpr res substring 'bananarama' 3
2239 echo $?/$^ERRNAME :$res:
2240 vput vexpr res substring 'bananarama' 5
2241 echo $?/$^ERRNAME :$res:
2242 vput vexpr res substring 'bananarama' 7
2243 echo $?/$^ERRNAME :$res:
2244 vput vexpr res substring 'bananarama' 9
2245 echo $?/$^ERRNAME :$res:
2246 vput vexpr res substring 'bananarama' 10
2247 echo $?/$^ERRNAME :$res:
2248 vput vexpr res substring 'bananarama' 1 3
2249 echo $?/$^ERRNAME :$res:
2250 vput vexpr res substring 'bananarama' 3 3
2251 echo $?/$^ERRNAME :$res:
2252 vput vexpr res substring 'bananarama' 5 3
2253 echo $?/$^ERRNAME :$res:
2254 vput vexpr res substring 'bananarama' 7 3
2255 echo $?/$^ERRNAME :$res:
2256 vput vexpr res substring 'bananarama' 9 3
2257 echo $?/$^ERRNAME :$res:
2258 vput vexpr res substring 'bananarama' 10 3
2259 echo $?/$^ERRNAME :$res:
2261 vput vexpr res substring 'bananarama' -1
2262 echo $?/$^ERRNAME :$res:
2263 vput vexpr res substring 'bananarama' -3
2264 echo $?/$^ERRNAME :$res:
2265 vput vexpr res substring 'bananarama' -5
2266 echo $?/$^ERRNAME :$res:
2267 vput vexpr res substring 'bananarama' -7
2268 echo $?/$^ERRNAME :$res:
2269 vput vexpr res substring 'bananarama' -9
2270 echo $?/$^ERRNAME :$res:
2271 vput vexpr res substring 'bananarama' -10
2272 echo $?/$^ERRNAME :$res:
2273 vput vexpr res substring 'bananarama' 1 -3
2274 echo $?/$^ERRNAME :$res:
2275 vput vexpr res substring 'bananarama' 3 -3
2276 echo $?/$^ERRNAME :$res:
2277 vput vexpr res substring 'bananarama' 5 -3
2278 echo $?/$^ERRNAME :$res:
2279 vput vexpr res substring 'bananarama' 7 -3
2280 echo $?/$^ERRNAME :$res:
2281 vput vexpr res substring 'bananarama' 9 -3
2282 echo $?/$^ERRNAME :$res:
2283 vput vexpr res substring 'bananarama' 10 -3
2284 echo $?/$^ERRNAME :$res:
2286 vput vexpr res trim 'Cocoon Cocoon'
2287 echo $?/$^ERRNAME :$res:
2288 vput vexpr res trim ' Cocoon Cocoon '
2289 echo $?/$^ERRNAME :$res:
2290 vput vexpr res trim-front 'Cocoon Cocoon'
2291 echo $?/$^ERRNAME :$res:
2292 vput vexpr res trim-front ' Cocoon Cocoon '
2293 echo $?/$^ERRNAME :$res:
2294 vput vexpr res trim-end 'Cocoon Cocoon'
2295 echo $?/$^ERRNAME :$res:
2296 vput vexpr res trim-end ' Cocoon Cocoon '
2297 echo $?/$^ERRNAME :$res:
2300 check string 0 "${MBOX}" '3182004322 601'
2302 if have_feat regex; then
2303 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2304 vput vexpr res regex
'bananarama' 'nana'
2305 echo $?
/$^ERRNAME
:$res:
2306 vput vexpr res regex
'bananarama' 'bana'
2307 echo $?
/$^ERRNAME
:$res:
2308 vput vexpr res regex
'bananarama' 'Bana'
2309 echo $?
/$^ERRNAME
:$res:
2310 vput vexpr res regex
'bananarama' 'rama'
2311 echo $?
/$^ERRNAME
:$res:
2313 vput vexpr res iregex
'bananarama' 'nana'
2314 echo $?
/$^ERRNAME
:$res:
2315 vput vexpr res iregex
'bananarama' 'bana'
2316 echo $?
/$^ERRNAME
:$res:
2317 vput vexpr res iregex
'bananarama' 'Bana'
2318 echo $?
/$^ERRNAME
:$res:
2319 vput vexpr res iregex
'bananarama' 'rama'
2320 echo $?
/$^ERRNAME
:$res:
2322 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2323 echo $?
/$^ERRNAME
:$res:
2324 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2325 echo $?
/$^ERRNAME
:$res:
2326 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2327 echo $?
/$^ERRNAME
:$res:
2328 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2329 echo $?
/$^ERRNAME
:$res:
2331 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2332 echo $?
/$^ERRNAME
:$res:
2333 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2334 echo $?
/$^ERRNAME
:$res:
2335 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2336 echo $?
/$^ERRNAME
:$res:
2337 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2338 echo $?
/$^ERRNAME
:$res:
2342 check regex
0 "${MBOX}" '3270360157 311'
2344 printf 'vexpr-regex: unsupported, skipped\n'
2353 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2358 vput vexpr j '&' $i 7
2364 vput vexpr j '&' $i 7
2370 echo ! The end for $1
2374 # Transport $?/$! up the call chain
2380 wysh set i=$? j=$! k=$^ERRNAME
2384 echo ! The end for $1
2385 return $i $^ERR-BUSY
2389 # Up and down it goes
2396 vput vexpr k - $1 $2
2400 echo "# <$i/$j> .. "
2404 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2407 echo ! The end
for $1=$i/$2
2411 return $i $^ERR-BUSY
2417 call w1
0; echo ?
=$?
!=$
!; echo -----;
2418 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2419 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2422 check
1 0 "${MBOX}" '1572045517 5922'
2430 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2435 vput vexpr j '&' $i 7
2441 echo ! The end for $1/$2
2443 return $i $^ERR-BUSY
2454 echo ?=$? !=$^ERRNAME
2457 echo ?=$? !=$^ERRNAME
2459 echo ?=$? !=$^ERRNAME
2462 check 1 0 "${MBOX}" '2401702082 23801'
2466 if have_feat uistrings; then
2467 ${cat} <<- '__EOT' > "${BODY}"
2472 vput vexpr j '&' $i 7
2478 echo ! The end for $1
2481 echo would be err with errexit
2490 echo zwei, ?=$? !=$!
2491 localopts yes; set errexit
2493 echo drei, ?=$? !=$^ERRNAME
2495 echo vier, ?=$? !=$^ERRNAME, this is an error
2498 echo outer 1, ?=$? !=$^ERRNAME
2500 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2502 echo outer 3, ?=$? !=$^ERRNAME
2503 echo this is definitely an error
2506 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2507 -Snomemdebug > "${MBOX}" 2>&1
2508 check
2 0 "${MBOX}" '3900716531 4200'
2510 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2511 -Snomemdebug > "${MBOX}" 2>&1
2512 check 3 1 "${MBOX}" '1006776201 2799'
2514 echo 'xcall-2: unsupported, skipped'
2515 echo 'xcall-3: unsupported, skipped'
2524 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2525 vpospar
set hey
, "'you ", world
!
2526 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2527 vput vpospar x quote
; echo x
<$x>
2528 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2529 vput vpospar y quote
;echo y
<$y>
2530 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2531 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2532 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2535 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2536 vput vpospar z quote
;echo infun2
:z
<$z>
2540 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2541 vput vpospar y quote
;echo infun
:y
<$y>
2542 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2543 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2545 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2546 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2549 call infun This
"in a" fun
2550 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2551 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2553 check
1 0 "${MBOX}" '155175639 866'
2556 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2558 echo ifs<$ifs> ifs-ws<$ifs-ws>
2559 vpospar set hey, "'you ", world!
2560 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2561 vput vpospar x quote; echo x<$x>
2562 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2563 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2566 echo ifs<$ifs> ifs-ws<$ifs-ws>
2567 vpospar set hey, "'you
", world!
2568 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2570 vput vpospar x quote; echo x<$x>
2571 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2572 eval vpospar set ${x};\
2573 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2576 echo ifs<$ifs> ifs-ws<$ifs-ws>
2577 vpospar set hey, "'you ", world!
2578 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2580 vput vpospar x quote; echo x<$x>
2581 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2582 eval vpospar set ${x};\
2583 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2585 check ifs 0 "${MBOX}" '2015927702 706'
2592 TRAP_EXIT_ADDONS="./.t*"
2594 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2597 printf " (1/$#: <$1>)"
2599 if [ $# -gt 0 ]; then
2613 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2614 printf xxx;xxx arg ,b u.
2615 printf xxx;xxx arg , .
2616 printf xxx;xxx arg ,ball.
2622 echon " (1/$#: <$1>)"
2637 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2638 echon xxx;call xxx arg ,b u.
2639 echon xxx;call xxx arg , .
2640 echon xxx;call xxx arg ,ball.
2643 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2644 check 1 0 "${MBOX}" '41566293 164'
2646 #${SHELL} ./.t.sh > ./.tshout 2>&1
2647 #check disproof-1 0 ./.tshout '41566293 164'
2654 TRAP_EXIT_ADDONS="./.t*"
2656 ${cat} <<- '__EOT
' > .tin
2657 hey1, "'you
", world!
2658 hey2, "'you ", bugs bunny!
2663 ${cat} <<- '__EOT
' |\
2664 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2666 echo $?/$^ERRNAME / <$a><$b><$c>
2668 echo $?/$^ERRNAME / <$a><$b><$c>
2670 echo $?/$^ERRNAME / <$a><$b><$c>
2672 echo $?/$^ERRNAME / <$a><$b><$c>
2673 unset a b c;read a b c
2674 echo $?/$^ERRNAME / <$a><$b><$c>
2675 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2677 check 1 0 "${MBOX}" '1527910147 173'
2679 ${cat} <<- '__EOT
' > .tin2
2680 hey2.0,:"'you
",:world!:mars.:
2681 hey2.1,:"'you ",:world!
2682 hey2.2,:"'you
",:bugs bunny!
2688 ${cat} <<- '__EOT' |\
2689 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2692 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2694 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2696 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2698 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2700 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2702 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2703 unset a b c
;read a b c
2704 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2706 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2707 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2709 check ifs
0 "${MBOX}" '890153490 298'
2711 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2713 readall d; echo $?/$^ERRNAME / <$d>
2714 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2715 readctl create .tin2
2716 readall d; echo $?/$^ERRNAME / <$d>
2717 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2718 readctl remove .tin;echo $?/$^ERRNAME;\
2719 readctl remove .tin2;echo $?/$^ERRNAME
2720 echo '### now with empty lines'
2721 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2722 readctl create .temptynl;echo $?/$^ERRNAME
2723 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2724 readctl remove .temptynl;echo $?/$^ERRNAME
2726 check readall 0 "${MBOX}" '4113506527 405'
2733 TRAP_EXIT_ADDONS=".
/.t
*"
2737 while [ ${i} -lt 113 ]; do
2738 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2739 "${MBOX}" "${i}" "${i}"
2742 ) | ${MAILX} ${ARGS} > .tall 2>&1
2743 check 1 0 "${MBOX}" '1785801373 13336'
2744 check 1-outerr - ./.tall '4294967295 0' # empty file
2746 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2747 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2748 check 2 0 .tall '3075634057 9103'
2750 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2751 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2752 check
3 0 .tall
'1902668747 9110'
2754 # copy only the odd (but the first), move the even
2756 printf 'File "file://%s"\ncopy ' .tmbox2
2758 while [ ${i} -lt 113 ]; do
2762 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2763 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2764 check
4 0 .tmbox3
'2554734733 6666'
2765 check
5 - .tall
'3168324241 4573'
2768 printf 'file "file://%s"\nmove ' .tmbox2
2770 while [ ${i} -lt 113 ]; do
2774 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2775 .tmbox3 .tmbox3 .tmbox2
2776 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2777 check
6 0 .tmbox3
'1429216753 13336'
2778 if have_feat uistrings
; then
2779 ${sed} 2d
< .tall
> .tallx
2783 check
7 - .tallx
'3604509039 13645'
2785 # Invalid MBOXes (after [f4db93b3])
2787 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2788 check 8 0 .tinvmbox '2848412822 118'
2789 check 9 - ./.tall '461280182 33'
2791 echo ' ' > .tinvmbox
2792 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2793 check
10 0 .tinvmbox
'624770486 120'
2794 check
11 - .
/.tall
'461280182 33'
2796 { echo; echo; } > .tinvmbox
# (not invalid)
2797 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2798 check 12 0 .tinvmbox '1485640875 119'
2799 check 13 - ./.tall '461280182 33'
2801 # *mbox-rfc4155*, plus
2802 ${cat} <<-_EOT > ./.tinv1
2805 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2806 Date: Wed, 02 Oct 1996 01:50:07 +0000
2808 Subject: Bad bad message 1
2810 From me to you, blinde Kuh!
2812 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2813 Date: Wed, 02 Oct 1996 01:50:07 +0000
2815 Subject: Bad bad message 2
2817 From me to you, blindes Kalb!
2819 ${cp} ./.tinv1 ./.tinv2
2823 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2824 \\eval copy * "${2}"
2826 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2828 ${cat} ./.tinv1 ./.tok >> .tall
2829 check 14 - ./.tall '739301109 616'
2832 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2833 wysh File ./.tok # Just move away to nowhere
2835 wysh file ./.tinv2 # Fully repaired
2836 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2838 check 15-1 - ./.tinv1 '3178048820 332'
2839 check 15-2 - ./.tinv2 '4151504442 314'
2846 if have_feat maildir; then :; else
2847 echo 'maildir: unsupported, skipped'
2851 TRAP_EXIT_ADDONS=".
/.t
*"
2855 while [ ${i} -lt 112 ]; do
2856 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2857 "${MBOX}" "${i}" "${i}"
2860 ) | ${MAILX} ${ARGS}
2861 check 1 0 "${MBOX}" '2366902811 13332'
2867 ' "${MBOX}" .tmdir1 .tmdir1 |
2868 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2869 check 2 0 .tlst '1713783045 9103'
2872 copy * "maildir
://%s
"
2875 ' "${MBOX}" .tmdir2 .tmdir2 |
2876 ${MAILX} ${ARGS} -Sshowlast > .tlst
2877 check 3 0 .tlst '1240307893 9113'
2879 printf 'File "maildir
://%s
"
2883 ' .tmdir2 .tmbox1 .tmbox1 |
2884 ${MAILX} ${ARGS} -Sshowlast > .tlst
2885 check 4 0 .tmbox1 '4096198846 12772'
2886 check 5 - .tlst '817337448 9110'
2888 # only the odd (even)
2890 printf 'File "maildir
://%s
"
2893 while [ ${i} -lt 112 ]; do
2895 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2902 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2903 check 6 0 .tmbox2 '4228337024 6386'
2904 check 7 - .tlst '884389294 4573'
2907 printf 'file "maildir
://%s
"
2910 while [ ${i} -lt 112 ]; do
2912 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2920 ' .tmbox2 .tmbox2 .tmdir2
2921 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2922 check
8 0 .tmbox2
'978751761 12656'
2923 ${sed} 2d
< .tlst
> .tlstx
2924 check
9 - .tlstx
'2391942957 13645'
2929 t_record_a_resend
() {
2930 t_prolog record_a_resend
2931 TRAP_EXIT_ADDONS
="./.t.record ./.t.resent"
2935 m %s\n~s Subject 1.\nHello.\n~.
2936 set record-files add-file-recipients
2937 m %s\n~s Subject 2.\nHello.\n~.
2939 resend 2 ./.t.resent
2940 Resend 1 ./.t.resent
2942 resend 2 ./.t.resent
2943 Resend 1 ./.t.resent
2944 ' .
/.t.record
"${MBOX}" "${MBOX}" "${MBOX}" |
2947 check
1 0 "${MBOX}" '2632690399 252'
2948 check
2 - .t.record
'3337485450 456'
2949 check
3 - .t.resent
'1560890069 640'
2956 TRAP_EXIT_ADDONS
="./.tmta.sh ./.t.mbox"
2958 t_xmta
'Alchemilla Wed Apr 07 17:03:33 2017' .
/.t.mbox
2961 ${MAILX} ${ARGS} -ef .
/.t.mbox
2962 echo ${?} > "${MBOX}"
2964 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
2965 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2966 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
2967 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
2969 ${MAILX} ${ARGS} -ef .
/.t.mbox
2970 echo ${?} >> "${MBOX}"
2971 ${MAILX} ${ARGS} -efL @t@me .
/.t.mbox
2972 echo ${?} >> "${MBOX}"
2973 ${MAILX} ${ARGS} -efL @t@you .
/.t.mbox
2974 echo ${?} >> "${MBOX}"
2975 ${MAILX} ${ARGS} -efL '@>@Line 1' .
/.t.mbox
2976 echo ${?} >> "${MBOX}"
2977 ${MAILX} ${ARGS} -efL '@>@Hello.' .
/.t.mbox
2978 echo ${?} >> "${MBOX}"
2979 ${MAILX} ${ARGS} -efL '@>@Bye.' .
/.t.mbox
2980 echo ${?} >> "${MBOX}"
2981 ${MAILX} ${ARGS} -efL '@>@Good bye.' .
/.t.mbox
2982 echo ${?} >> "${MBOX}"
2984 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}"
2985 echo ${?} >> "${MBOX}"
2986 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}"
2987 echo ${?} >> "${MBOX}"
2988 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}"
2989 echo ${?} >> "${MBOX}"
2990 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}"
2991 echo ${?} >> "${MBOX}"
2992 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}"
2993 echo ${?} >> "${MBOX}"
2994 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}"
2995 echo ${?} >> "${MBOX}"
2996 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
2997 echo ${?} >> "${MBOX}"
2999 check
1 - "${MBOX}" '1708955574 678'
3006 TRAP_EXIT_ADDONS
="./.t*"
3008 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
3010 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3014 alternates a1@b1 a2@b2 a3@b3
3019 echo $?
/$^ERRNAME
<$rv>
3024 echo $?
/$^ERRNAME
<$rv>
3027 echo $?
/$^ERRNAME
<$rv>
3030 echo $?
/$^ERRNAME
<$rv>
3034 alternates a1@b1 a2@b2 a3@b3
3037 echo $?
/$^ERRNAME
<$rv>
3040 echo $?
/$^ERRNAME
<$rv>
3043 echo $?
/$^ERRNAME
<$rv>
3046 alternates a1@b1 a2@b2 a3@b3
3049 echo $?
/$^ERRNAME
<$rv>
3052 echo $?
/$^ERRNAME
<$rv>
3055 echo $?
/$^ERRNAME
<$rv>
3059 alternates a1@b1 a2@b2 a3@b3
3062 echo $?
/$^ERRNAME
<$rv>
3066 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
3068 ~s all alternates
, only a1@b1 remains
3070 ~b a3@b3 a3@c3 a3@d3
3079 alternates a1@b1 a1@c1 a2@b2 a3@b3
3081 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
3083 ~b a3@b3 a3@c3 a3@d3
3090 alternates a1@b1 a2@b2 a3
; set allnet
3092 ~s all alternates via allnet
, only a1@b1 remains
3094 ~b a3@b3 a3@c3 a3@d3
3105 echo $?
/$^ERRNAME
<$rv>
3109 echo $?
/$^ERRNAME
<$rv>
3113 echo $?
/$^ERRNAME
<$rv>
3117 echo $?
/$^ERRNAME
<$rv>
3121 echo $?
/$^ERRNAME
<$rv>
3125 alternates a1@b1 a2@b2
3128 echo $?
/$^ERRNAME
<$rv>
3129 alternates a3@b3 a4@b4
3132 echo $?
/$^ERRNAME
<$rv>
3135 check
1 0 "${MBOX}" '142184864 515'
3136 if have_feat uistrings
; then
3137 check
2 - .tall
'1878598364 505'
3139 echo 'alternates-2: unsupported, skipped'
3142 # Automatic alternates, also from command line (freezing etc.)
3144 ${cat} <<- __EOT > ./.tin
3145 From trouble-report@desy Wed Jun 6 20:19:28 2018
3146 Date: Wed, 06 Jun 2018 19:58:02 +0200
3147 From: a@b.org, b@b.org, c@c.org
3150 Cc: a@b.org, c@c.org
3152 Message-ID: <20180606175802.dw-cn%a@b.org>
3162 a@b.org b@b.org c@c.org
3167 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3168 -S from
=a@b.org
,b@b.org
,c@c.org
-S sender
=a@b.org \
3169 -Rf .
/.tin
> .
/.tall
2>&1
3170 check
3 0 "${MBOX}" '287250471 256'
3171 check
4 - .tall
'4294967295 0'
3175 set from=a@b.org,b@b.org,c@c.org sender=a@b.org
3179 a@b.org b@b.org c@c.org
3184 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3185 -Rf .
/.tin
> .
/.tall
2>&1
3186 check
5 0 "${MBOX}" '2618762028 512'
3187 check
6 - .tall
'4294967295 0'
3189 # And more, with/out -r
3190 # TODO -r should be the Sender:, which should automatically propagate to
3191 # TODO From: if possible and/or necessary. It should be possible to
3192 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
3193 # TODO arg as appropriate.
3194 # TODO For now we are a bit messy
3197 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3198 -c a@b.example
,b@b.example
,c@c.example \
3199 -S from
=a@b.example
,b@b.example
,c@c.example \
3200 -S sender
=a@b.example \
3201 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
3202 check
7 0 "${MBOX}" '3510981487 192'
3203 check
8 - .tout
'2052716617 201'
3204 check
9 - .tall
'4294967295 0'
3206 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3207 -c a@b.example
,b@b.example
,c@c.example \
3208 -S from
=a@b.example
,b@b.example
,c@c.example \
3209 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
3210 check
10 0 "${MBOX}" '2282326606 364'
3211 check
11 - .tout
'3213404599 382'
3212 check
12 - .tall
'4294967295 0'
3214 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3215 -c a@b.example
,b@b.example
,c@c.example \
3216 -S from
=a@b.example
,b@b.example
,c@c.example \
3217 -S sender
=a@b.example \
3218 b@b.example
>.
/.tall
2>&1
3219 check
13 0 "${MBOX}" '1460017970 582'
3220 check
14 - .tall
'4294967295 0'
3227 TRAP_EXIT_ADDONS
="./.t*"
3229 t_xmta
'Hippocastanum Mon Jun 19 15:07:07 2017'
3231 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3233 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
3235 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3237 alias a4 a5 ex1@a4.ple
3239 alias a6 a7 ex1@a6.ple
3253 check
1 0 "${MBOX}" '2496925843 272'
3254 check
2 - .tall
'3548953204 152'
3256 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3257 # TODO need to somehow provide its contents to the test, then test
3264 TRAP_EXIT_ADDONS
="./.t*"
3266 t_xmta
'Alchemilla Wed Apr 25 15:12:13 2017'
3268 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3269 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tmta.sh
3270 check 1 0 "${MBOX}" '1594682963 13520'
3272 if (echo | gzip -c) >/dev/null 2>&1; then
3274 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3275 "${MBOX}" | ${MAILX} ${ARGS} \
3276 -X'filetype gz gzip\ -dc gzip\ -c'
3277 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3278 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3280 check
2 - "./.t.mbox" '1594682963 13520'
3281 check
3 - "./.t.out" '2392348396 102'
3283 echo 'filetype-2: unsupported, skipped'
3284 echo 'filetype-3: unsupported, skipped'
3289 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
3295 -X'filetype gz gzip\ -dc gzip\ -c' \
3296 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
3297 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
3298 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3300 -X'filetype gz gzip\ -dc gzip\ -c' \
3301 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
3303 check
4 - "./.t.mbox" '2886541147 27060'
3304 check
5 - "./.t.out" '852335377 172'
3309 t_message_injections
() {
3310 t_prolog message_injections
3311 TRAP_EXIT_ADDONS
="./.t*"
3313 t_xmta
'Echinacea Tue Jun 20 15:54:02 2017'
3315 echo mysig
> .
/.tmysig
3317 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3318 -Smessage-inject-head=head-inject \
3319 -Smessage-inject-tail=tail-inject \
3320 -Ssignature=.
/.tmysig \
3321 ex@am.ple
> .
/.tall
2>&1
3322 check
1 0 "${MBOX}" '2434746382 134'
3323 check
2 - .tall
'4294967295 0' # empty file
3326 ${cat} <<-_EOT > ./.template
3330 Subject: This subject is
3332 Body, body, body me.
3334 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tmta.sh \
3335 -Smessage-inject-head=head-inject \
3336 -Smessage-inject-tail=tail-inject \
3337 -Ssignature=.
/.tmysig \
3339 check
3 0 "${MBOX}" '3114203412 198'
3340 check
4 - .tall
'4294967295 0' # empty file
3346 t_prolog attachments
3347 TRAP_EXIT_ADDONS
="./.t*"
3349 t_xmta
'Cannabis Sun Feb 18 02:02:46 2018'
3351 ${cat} <<-_EOT > ./.tx
3352 From steffen Sun Feb 18 02:48:40 2018
3353 Date: Sun, 18 Feb 2018 02:48:40 +0100
3356 User-Agent: s-nail v14.9.7
3359 From steffen Sun Feb 18 02:48:42 2018
3360 Date: Sun, 18 Feb 2018 02:48:42 +0100
3363 User-Agent: s-nail v14.9.7
3368 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3369 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3370 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3373 '!@ ./.t3 "./.t 4" ""
3381 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
3382 -a .
/.t1
-a './.t 2' \
3383 -s attachment-test \
3384 ex@am.ple
> .
/.tall
2>&1
3385 check
1 0 "${MBOX}" '4107062253 634'
3386 if have_feat uistrings
; then
3387 check
2 - .tall
'1928331872 720'
3389 echo 'attachments-2: unsupported, skipped'
3395 !s This the subject is
3396 !@ ./.t3 "#2" "./.t 4" "#1" ""
3406 !@ ./.t3 "#2" "./.t 4" "#1" ""
3414 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3423 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3437 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3439 check
3 0 "${MBOX}" '798122412 2285'
3440 if have_feat uistrings
; then
3441 check
4 - .tall
'2526106274 1910'
3443 echo 'attachments-4: unsupported, skipped'
3472 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3474 check
5 0 "${MBOX}" '2165311808 2276'
3475 if have_feat uistrings
; then
3476 check
6 - .tall
'3662598562 509'
3478 echo 'attachments-6: unsupported, skipped'
3484 t_compose_hooks
() { # TODO monster
3485 t_prolog compose_hooks
3486 if have_feat uistrings
; then :; else
3487 echo 'compose_hooks: unsupported, skipped'
3490 TRAP_EXIT_ADDONS
="./.t*"
3492 t_xmta
'PrimulaVeris Wed Apr 10 22:59:00 2017'
3494 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3495 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3497 ${cat} <<'__EOT__' > ./.trc
3499 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3502 vput vexpr es substr "$1" 0 1
3507 define read_mline_res {
3508 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3509 echo $len/$es/$^ERRNAME: $hl
3510 if [ $es -ne $^ERR-NONE ]
3511 xcall bail read_mline_res
3513 \xcall read_mline_res
3518 echo "~^header list"; read hl; echo $hl;\
3519 call xerr "$hl" "in_addr ($xh) 0-1"
3521 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3522 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3523 echo "~^header insert $xh <${xh}2@exam.ple>";\
3524 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3525 echo "~^header insert $xh ${xh}3@exam.ple";\
3526 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3527 echo "~^header list $xh"; read hl; echo $hl;\
3528 call xerr "$hl" "ins_addr $xh 1-4"
3529 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3532 if [ "$t_remove" == "" ]
3536 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3537 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3539 xcall bail "ins_addr $xh 2-2"
3541 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3543 xcall bail "ins_addr $xh 2-3"
3545 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3547 xcall bail "ins_addr $xh 2-4"
3551 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3552 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3553 echo "~^header insert $xh <${xh}2@exam.ple>";\
3554 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3555 echo "~^header insert $xh ${xh}3@exam.ple";\
3556 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3557 echo "~^header list $xh"; read hl; echo $hl;\
3558 call xerr "$hl" "ins_addr $xh 3-4"
3559 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3562 echo "~^header remove-at $xh 1"; read es;\
3563 call xerr $es "ins_addr $xh 3-6"
3564 echo "~^header remove-at $xh 1"; read es;\
3565 call xerr $es "ins_addr $xh 3-7"
3566 echo "~^header remove-at $xh 1"; read es;\
3567 call xerr $es "ins_addr $xh 3-8"
3568 echo "~^header remove-at $xh 1"; read es;\
3569 vput vexpr es substr $es 0 3
3571 xcall bail "ins_addr $xh 3-9"
3573 echo "~^header remove-at $xh T"; read es;\
3574 vput vexpr es substr $es 0 3
3576 xcall bail "ins_addr $xh 3-10"
3578 echo "~^header list $xh"; read es;\
3579 vput vexpr es substr $es 0 3
3581 xcall bail "ins_addr $xh 3-11"
3583 echo "~^header show $xh"; read es;\
3584 vput vexpr es substr $es 0 3
3586 xcall bail "ins_addr $xh 3-12"
3590 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3591 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3592 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3593 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3594 echo "~^header insert $xh ${xh}3@exam.ple";\
3595 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3596 echo "~^header list $xh"; read hl; echo $hl;\
3597 call xerr "$hl" "header list $xh 3-4"
3598 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3601 echo "~^header remove-at $xh 3"; read es;\
3602 call xerr $es "ins_addr $xh 4-6"
3603 echo "~^header remove-at $xh 2"; read es;\
3604 call xerr $es "ins_addr $xh 4-7"
3605 echo "~^header remove-at $xh 1"; read es;\
3606 call xerr $es "ins_addr $xh 4-8"
3607 echo "~^header remove-at $xh 1"; read es;\
3608 vput vexpr es substr $es 0 3
3610 xcall bail "ins_addr $xh 4-9"
3612 echo "~^header remove-at $xh T"; read es;\
3613 vput vexpr es substr $es 0 3
3615 xcall bail "ins_addr $xh 4-10"
3617 echo "~^header list $xh"; read es;\
3618 vput vexpr es substr $es 0 3
3620 xcall bail "ins_addr $xh 4-11"
3622 echo "~^header show $xh"; read es;\
3623 vput vexpr es substr $es 0 3
3625 xcall bail "ins_addr $xh 4-12"
3629 wysh set xh=$1 mult=$2
3630 echo "~^header list"; read hl; echo $hl;\
3631 call xerr "$hl" "ins_ref ($xh) 0-1"
3633 echo "~^header insert $xh <$xh@exam.ple>";\
3634 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3636 echo "~^header insert $xh <${xh}2@exam.ple>";\
3637 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3638 echo "~^header insert $xh ${xh}3@exam.ple";\
3639 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3641 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3642 vput vexpr es substr $es 0 3
3644 xcall bail "ins_ref $xh 1-4"
3648 echo "~^header list $xh"; read hl; echo $hl;\
3649 call xerr "$hl" "ins_ref $xh 1-5"
3650 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3653 if [ "$t_remove" == "" ]
3657 echo "~^header remove $xh"; read es;\
3658 call xerr $es "ins_ref $xh 2-1"
3659 echo "~^header remove $xh"; read es;\
3660 vput vexpr es substr $es 0 3
3662 xcall bail "ins_ref $xh 2-2"
3664 echo "~^header list $xh"; read es;\
3665 vput vexpr es substr $es 0 3
3667 xcall bail "$es ins_ref $xh 2-3"
3669 echo "~^header show $xh"; read es;\
3670 vput vexpr es substr $es 0 3
3672 xcall bail "ins_ref $xh 2-4"
3676 echo "~^header insert $xh <$xh@exam.ple>";\
3677 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3679 echo "~^header insert $xh <${xh}2@exam.ple>";\
3680 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3681 echo "~^header insert $xh ${xh}3@exam.ple";\
3682 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3684 echo "~^header list $xh";\
3685 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3686 echo "~^header show $xh";\
3687 read es; call xerr $es "ins_ref $xh 3-5"
3690 echo "~^header remove-at $xh 1"; read es;\
3691 call xerr $es "ins_ref $xh 3-6"
3692 if [ $mult -ne 0 ] && [ $xh != subject ]
3693 echo "~^header remove-at $xh 1"; read es;\
3694 call xerr $es "ins_ref $xh 3-7"
3695 echo "~^header remove-at $xh 1"; read es;\
3696 call xerr $es "ins_ref $xh 3-8"
3698 echo "~^header remove-at $xh 1"; read es;\
3699 vput vexpr es substr $es 0 3
3701 xcall bail "ins_ref $xh 3-9"
3703 echo "~^header remove-at $xh T"; read es;\
3704 vput vexpr es substr $es 0 3
3706 xcall bail "ins_ref $xh 3-10"
3708 echo "~^header show $xh"; read es;\
3709 vput vexpr es substr $es 0 3
3711 xcall bail "ins_ref $xh 3-11"
3715 echo "~^header insert $xh <$xh@exam.ple> ";\
3716 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3718 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3719 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3720 echo "~^header insert $xh ${xh}3@exam.ple";\
3721 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3723 echo "~^header list $xh"; read hl; echo $hl;\
3724 call xerr "$hl" "ins_ref $xh 4-4"
3725 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3728 if [ $mult -ne 0 ] && [ $xh != subject ]
3729 echo "~^header remove-at $xh 3"; read es;\
3730 call xerr $es "ins_ref $xh 4-6"
3731 echo "~^header remove-at $xh 2"; read es;\
3732 call xerr $es "ins_ref $xh 4-7"
3734 echo "~^header remove-at $xh 1"; read es;\
3735 call xerr $es "ins_ref $xh 4-8"
3736 echo "~^header remove-at $xh 1"; read es;\
3737 vput vexpr es substr $es 0 3
3739 xcall bail "ins_ref $xh 4-9"
3741 echo "~^header remove-at $xh T"; read es;\
3742 vput vexpr es substr $es 0 3
3744 xcall bail "ins_ref $xh 4-10"
3746 echo "~^header show $xh"; read es;\
3747 vput vexpr es substr $es 0 3
3749 xcall bail "ins_ref $xh 4-11"
3754 # In collect.c order
3756 call ins_ref sender 0 # Not a "ref", but works
3760 call ins_addr reply-To
3761 call ins_addr mail-Followup-to
3762 call ins_ref messAge-id 0
3763 call ins_ref rEfErEncEs 1
3764 call ins_ref in-Reply-to 1
3765 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3766 call ins_addr freeForm1
3767 call ins_addr freeform2
3769 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3771 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3779 echo "~^attachment";\
3780 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3782 xcall bail "attach 0-1"
3785 echo "~^attach attribute ./.treadctl";\
3786 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3788 xcall bail "attach 0-2"
3790 echo "~^attachment attribute-at 1";\
3791 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3793 xcall bail "attach 0-3"
3796 echo "~^attachment insert ./.treadctl=ascii";\
3797 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3798 echo "~^attachment list";\
3799 read es; echo $es;call xerr "$es" "attach 1-2"
3801 echo "~^attachment attribute ./.treadctl";\
3802 read es; echo $es;call xerr "$es" "attach 1-3"
3804 echo "~^attachment attribute .treadctl";\
3805 read es; echo $es;call xerr "$es" "attach 1-4"
3807 echo "~^attachment attribute-at 1";\
3808 read es; echo $es;call xerr "$es" "attach 1-5"
3811 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3812 read es; echo $es;call xerr "$es" "attach 1-6"
3813 echo "~^attachment attribute-set .treadctl content-description Au";\
3814 read es; echo $es;call xerr "$es" "attach 1-7"
3815 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3816 read es; echo $es;call xerr "$es" "attach 1-8"
3818 echo "~^attachment attribute ./.treadctl";\
3819 read es; echo $es;call xerr "$es" "attach 1-9"
3821 echo "~^attachment attribute .treadctl";\
3822 read es; echo $es;call xerr "$es" "attach 1-10"
3824 echo "~^attachment attribute rctl";\
3825 read es; echo $es;call xerr "$es" "attach 1-11"
3827 echo "~^attachment attribute-at 1";\
3828 read es; echo $es;call xerr "$es" "attach 1-12"
3832 echo "~^attachment insert ./.tattach=latin1";\
3833 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3834 echo "~^attachment list";\
3835 read es; echo $es;call xerr "$es" "attach 2-2"
3837 echo "~^attachment attribute ./.tattach";\
3838 read es; echo $es;call xerr "$es" "attach 2-3"
3840 echo "~^attachment attribute .tattach";\
3841 read es; echo $es;call xerr "$es" "attach 2-4"
3843 echo "~^attachment attribute-at 2";\
3844 read es; echo $es;call xerr "$es" "attach 2-5"
3847 echo "~^attachment attribute-set ./.tattach filename tat";\
3848 read es; echo $es;call xerr "$es" "attach 2-6"
3850 "~^attachment attribute-set .tattach content-description Au2";\
3851 read es; echo $es;call xerr "$es" "attach 2-7"
3852 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3853 read es; echo $es;call xerr "$es" "attach 2-8"
3855 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3856 read es; echo $es;call xerr "$es" "attach 2-9"
3858 echo "~^attachment attribute ./.tattach";\
3859 read es; echo $es;call xerr "$es" "attach 2-10"
3861 echo "~^attachment attribute .tattach";\
3862 read es; echo $es;call xerr "$es" "attach 2-11"
3864 echo "~^attachment attribute tat";\
3865 read es; echo $es;call xerr "$es" "attach 2-12"
3867 echo "~^attachment attribute-at 2";\
3868 read es; echo $es;call xerr "$es" "attach 2-13"
3872 if [ "$t_remove" == "" ]
3876 echo "~^attachment remove ./.treadctl"; read es;\
3877 call xerr $es "attach 3-1"
3878 echo "~^attachment remove ./.tattach"; read es;\
3879 call xerr $es "attach 3-2"
3880 echo "~^ attachment remove ./.treadctl"; read es;\
3881 vput vexpr es substr $es 0 3
3883 xcall bail "attach 3-3"
3885 echo "~^ attachment remove ./.tattach"; read es;\
3886 vput vexpr es substr $es 0 3
3888 xcall bail "attach 3-4"
3890 echo "~^attachment list"; read es;\
3891 vput vexpr es substr $es 0 3
3893 xcall bail "attach 3-5"
3897 echo "~^attachment insert ./.tattach=latin1";\
3898 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3899 echo "~^attachment insert ./.tattach=latin1";\
3900 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3901 echo "~^attachment list";\
3902 read es; echo $es;call xerr "$es" "attach 4-3"
3904 echo "~^ attachment remove .tattach"; read es;\
3905 vput vexpr es substr $es 0 3
3907 xcall bail "attach 4-4 $es"
3909 echo "~^attachment remove-at T"; read es;\
3910 vput vexpr es substr $es 0 3
3912 xcall bail "attach 4-5"
3914 echo "~^attachment remove ./.tattach"; read es;\
3915 call xerr $es "attach 4-6"
3916 echo "~^attachment remove ./.tattach"; read es;\
3917 call xerr $es "attach 4-7"
3918 echo "~^ attachment remove ./.tattach"; read es;\
3919 vput vexpr es substr $es 0 3
3921 xcall bail "attach 4-8 $es"
3923 echo "~^attachment list"; read es;\
3924 vput vexpr es substr $es 0 3
3926 xcall bail "attach 4-9"
3930 echo "~^attachment insert ./.tattach=latin1";\
3931 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3932 echo "~^attachment insert ./.tattach=latin1";\
3933 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3934 echo "~^attachment insert ./.tattach=latin1";\
3935 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3936 echo "~^attachment list";\
3937 read es; echo $es;call xerr "$es" "attach 5-4"
3940 echo "~^attachment remove-at 3"; read es;\
3941 call xerr $es "attach 5-5"
3942 echo "~^attachment remove-at 3"; read es;\
3943 vput vexpr es substr $es 0 3
3945 xcall bail "attach 5-6"
3947 echo "~^attachment remove-at 2"; read es;\
3948 call xerr $es "attach 5-7"
3949 echo "~^attachment remove-at 2"; read es;\
3950 vput vexpr es substr $es 0 3
3952 xcall bail "attach 5-8"
3954 echo "~^attachment remove-at 1"; read es;\
3955 call xerr $es "attach 5-9"
3956 echo "~^attachment remove-at 1"; read es;\
3957 vput vexpr es substr $es 0 3
3959 xcall bail "attach 5-10"
3962 echo "~^attachment list"; read es;\
3963 vput vexpr es substr $es 0 3
3965 xcall bail "attach 5-11"
3969 echo "~^attachment insert ./.tattach=latin1";\
3970 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3971 echo "~^attachment insert ./.tattach=latin1";\
3972 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3973 echo "~^attachment insert ./.tattach=latin1";\
3974 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3975 echo "~^attachment list";\
3976 read es; echo $es;call xerr "$es" "attach 6-4"
3979 echo "~^attachment remove-at 1"; read es;\
3980 call xerr $es "attach 6-5"
3981 echo "~^attachment remove-at 1"; read es;\
3982 call xerr $es "attach 6-6"
3983 echo "~^attachment remove-at 1"; read es;\
3984 call xerr $es "attach 6-7"
3985 echo "~^attachment remove-at 1"; read es;\
3986 vput vexpr es substr $es 0 3
3988 xcall bail "attach 6-8"
3991 echo "~^attachment list"; read es;\
3992 vput vexpr es substr $es 0 3
3994 xcall bail "attach 6-9"
4006 echo on-compose-enter, mailx-command<$mailx-command>
4007 alternates alter1@exam.ple alter2@exam.ple
4009 set autocc='alter1@exam.ple alter2@exam.ple'
4010 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4011 echo mailx-subject<$mailx-subject>
4012 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4013 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4014 mailx-raw-bcc<$mailx-raw-bcc>
4015 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4016 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4019 echo on-compose-leave, mailx-command<$mailx-command>
4021 eval alternates $al alter3@exam.ple alter4@exam.ple
4023 set autobcc='alter3@exam.ple alter4@exam.ple'
4024 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4025 echo mailx-subject<$mailx-subject>
4026 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4027 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4028 mailx-raw-bcc<$mailx-raw-bcc>
4029 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4030 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4033 echo on-compose-cleanup, mailx-command<$mailx-command>
4036 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4037 echo mailx-subject<$mailx-subject>
4038 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4039 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4040 mailx-raw-bcc<$mailx-raw-bcc>
4041 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4042 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4044 wysh set on-compose-splice=t_ocs \
4045 on-compose-enter=t_oce on-compose-leave=t_ocl \
4046 on-compose-cleanup=t_occ
4049 printf 'm this-goes@nowhere\nbody\n!.\n' |
4050 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4051 -X'source ./.trc' -Smta=.
/.tmta.sh \
4053 ${cat} .
/.tall
>> "${MBOX}"
4054 check
1 0 "${MBOX}" '2481823179 10101'
4057 printf 'm this-goes@nowhere\nbody\n!.\n' |
4058 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4059 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh \
4061 ${cat} .
/.tall
>> "${MBOX}"
4062 check
2 0 "${MBOX}" '3654000499 12535'
4066 # Some state machine stress, shell compose hook, localopts for hook, etc.
4067 # readctl in child. ~r as HERE document
4069 printf 'm ex@am.ple\nbody\n!.
4070 echon ${mailx-command}${mailx-subject}
4071 echon ${mailx-from}${mailx-sender}
4072 echon ${mailx-to}${mailx-cc}${mailx-bcc}
4073 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
4074 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
4075 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
4076 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4080 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4083 vput vexpr es substr "$1" 0 1
4088 define read_mline_res {
4089 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4090 echo $len/$es/$^ERRNAME: $hl
4091 if [ $es -ne $^ERR-NONE ]
4092 xcall bail read_mline_res
4094 \xcall read_mline_res
4098 vput vexpr i + 1 "$2"
4100 vput vexpr j % $i 10
4107 eval \\$j _work $1 $i
4110 vput vexpr i + $i "$1"
4114 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
4115 echo read:$es/$en: $line
4116 if [ "${es}" -ne -1 ]
4119 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
4124 echo "~^header list"; read hl; echo $hl;\
4125 vput vexpr es substr "$hl" 0 1
4127 xcall bail "header list"
4130 call _work 1; echo $?
4131 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
4132 read es; echo $es; vput vexpr es substr "$es" 0 1
4134 xcall bail "be diet"
4136 echo "~^header insert cc <splice2@exam.ple>";\
4137 read es; echo $es; vput vexpr es substr "$es" 0 1
4139 xcall bail "be diet2"
4142 call _work 2; echo $?
4143 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
4144 read es; echo $es;vput vexpr es substr "$es" 0 1
4146 xcall bail "be juicy"
4148 echo "~^header insert bcc juice2@exam.ple";\
4149 read es; echo $es;vput vexpr es substr "$es" 0 1
4151 xcall bail "be juicy2"
4153 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
4154 read es; echo $es;vput vexpr es substr "$es" 0 1
4156 xcall bail "be juicy3"
4158 echo "~^header insert bcc juice4@exam.ple";\
4159 read es; echo $es;vput vexpr es substr "$es" 0 1
4161 xcall bail "be juicy4"
4164 echo "~^header remove-at bcc 3";\
4165 read es; echo $es;vput vexpr es substr "$es" 0 1
4167 xcall bail "remove juicy5"
4169 echo "~^header remove-at bcc 2";\
4170 read es; echo $es;vput vexpr es substr "$es" 0 1
4172 xcall bail "remove juicy6"
4174 echo "~^header remove-at bcc 3";\
4175 read es; echo $es;vput vexpr es substr "$es" 0 3
4177 xcall bail "failed to remove-at"
4179 # Add duplicates which ought to be removed!
4180 echo "~^header insert bcc juice4@exam.ple";\
4181 read es; echo $es;vput vexpr es substr "$es" 0 1
4183 xcall bail "be juicy4-1"
4185 echo "~^header insert bcc juice4@exam.ple";\
4186 read es; echo $es;vput vexpr es substr "$es" 0 1
4188 xcall bail "be juicy4-2"
4190 echo "~^header insert bcc juice4@exam.ple";\
4191 read es; echo $es;vput vexpr es substr "$es" 0 1
4193 xcall bail "be juicy4-3"
4198 call _work 3; echo $?
4200 vput ! i echo just knock if you can hear me;\
4202 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
4204 echon shell-cmd says $?/$^ERRNAME: $i
4205 echo "~x will not become interpreted, we are reading until __EOT"
4207 read r_status; echo "~~r status output: $r_status"
4208 echo "~:echo $? $! $^ERRNAME"
4210 echo "~~r status from parent: $r_status"
4213 call _work 4; echo $?
4214 vput cwd cwd;echo cwd:$?
4215 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
4219 call _work 5; echo $?
4220 echo "~^header show MAILX-Command"; read es;\
4221 call xerr $es "t_header 1000"; call read_mline_res
4222 echo "~^header show MAILX-raw-TO"; read es;\
4223 call xerr $es "t_header 1001"; xcall read_mline_res
4225 echoerr IT IS WRONG IF YOU SEE THIS
4228 echo on-compose-enter, mailx-command<$mailx-command>
4229 set t_oce autobcc=oce@exam.ple
4230 alternates alter1@exam.ple alter2@exam.ple
4232 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4233 echo mailx-subject<$mailx-subject>
4234 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4235 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4236 mailx-raw-bcc<$mailx-raw-bcc>
4237 echo mailx-orig-from<$mailx-orig-from> \
4238 mailx-orig-to<$mailx-orig-to> \
4239 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4242 echo on-compose-leave, mailx-command<$mailx-command>
4243 set t_ocl autocc=ocl@exam.ple
4245 alternates alter3@exam.ple alter4@exam.ple
4247 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4248 echo mailx-subject<$mailx-subject>
4249 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4250 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4251 mailx-raw-bcc<$mailx-raw-bcc>
4252 echo mailx-orig-from<$mailx-orig-from> \
4253 mailx-orig-to<$mailx-orig-to> \
4254 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4257 echo on-compose-cleanup, mailx-command<$mailx-command>
4258 set t_occ autocc=occ@exam.ple
4261 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4262 echo mailx-subject<$mailx-subject>
4263 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4264 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4265 mailx-raw-bcc<$mailx-raw-bcc>
4266 echo mailx-orig-from<$mailx-orig-from> \
4267 mailx-orig-to<$mailx-orig-to> \
4268 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4270 wysh set on-compose-splice=t_ocs \
4271 on-compose-splice-shell="read ver;echo t_ocs-shell;\
4272 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
4273 on-compose-enter=t_oce on-compose-leave=t_ocl \
4274 on-compose-cleanup=t_occ
4277 ${cat} .
/.tnotes
>> "${MBOX}"
4278 check
3 - "${MBOX}" '679526364 2431'
4280 # Reply, forward, resend, Resend
4288 set from="du <f2@z>" stealthmua=noagent
4292 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Snomemdebug -Sescape=!
4295 echo start: $? $! $^ERRNAME
4297 echo File: $? $! $^ERRNAME;echo;echo
4299 this is content of reply 1
4301 echo reply 1: $? $! $^ERRNAME;echo;echo
4303 this is content of Reply 1 2
4305 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
4306 forward 1 fwdex@am.ple
4307 this is content of forward 1
4309 echo forward 1: $? $! $^ERRNAME;echo;echo
4310 wysh set forward-inject-head=$'"'"'-- \\
4311 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
4312 wysh set forward-inject-tail=$'"'"'-- \\
4313 end of forward (%%i) --\\n'"'"'
4314 forward 2 fwdex@am.ple
4315 this is content of forward 2
4317 echo forward 2: $? $! $^ERRNAME;echo;echo
4319 forward 2 fwdex2@am.ple
4320 this is content of forward 2, 2nd, with showname set
4322 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
4323 resend 1 2 resendex@am.ple
4324 echo resend 1 2: $? $! $^ERRNAME;echo;echo
4325 Resend 1 2 Resendex@am.ple
4326 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
4328 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
4332 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4335 vput vexpr es substr "$1" 0 1
4340 define read_mline_res {
4341 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4342 echo mline_res:$len/$es/$^ERRNAME: $hl
4343 if [ $es -ne $^ERR-NONE ]
4344 xcall bail read_mline_res
4346 \xcall read_mline_res
4350 echo "~^header show $1"; read es;\
4351 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4359 echo t_ocs version $ver
4360 echo "~^header list"; read hl; echo $hl;\
4361 echoerr the header list is $hl;\
4362 call xerr "$hl" "header list"
4363 eval vpospar set $hl
4366 echoerr IT IS WRONG IF YOU SEE THIS
4369 echo on-XY-enter, mailx-command<$mailx-command>
4370 set t_oce autobcc=oce@exam.ple
4371 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4372 echo mailx-subject<$mailx-subject>
4373 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4374 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4375 mailx-raw-bcc<$mailx-raw-bcc>
4376 echo mailx-orig-from<$mailx-orig-from> \
4377 mailx-orig-to<$mailx-orig-to> \
4378 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4381 echo on-XY-leave, mailx-command<$mailx-command>
4382 set t_ocl autocc=ocl@exam.ple
4383 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4384 echo mailx-subject<$mailx-subject>
4385 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4386 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4387 mailx-raw-bcc<$mailx-raw-bcc>
4388 echo mailx-orig-from<$mailx-orig-from> \
4389 mailx-orig-to<$mailx-orig-to> \
4390 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4393 echo on-XY-cleanup, mailx-command<$mailx-command>
4394 set t_occ autocc=occ@exam.ple
4395 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4396 echo mailx-subject<$mailx-subject>
4397 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4398 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4399 mailx-raw-bcc<$mailx-raw-bcc>
4400 echo mailx-orig-from<$mailx-orig-from> \
4401 mailx-orig-to<$mailx-orig-to> \
4402 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4404 wysh set on-compose-splice=t_ocs \
4405 on-compose-enter=t_oce on-compose-leave=t_ocl \
4406 on-compose-cleanup=t_occ \
4407 on-resend-enter=t_oce on-resend-cleanup=t_occ
4410 ${cat} .
/.tnotes
>> "${MBOX}"
4411 check
4 - "${MBOX}" '2151712038 11184'
4416 t_C_opt_customhdr
() {
4417 t_prolog C_opt_customhdr
4418 TRAP_EXIT_ADDONS
="./.t*"
4420 t_xmta
'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
4423 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
4424 -C 'C-One : Custom One Body' \
4425 -C 'C-Two:CustomTwoBody' \
4426 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4427 this-goes@nowhere
>.
/.tall
2>&1
4429 ${cat} .
/.tall
>> "${MBOX}"
4430 check
1 0 "${MBOX}" '2400078426 195'
4433 printf 'm this-goes@nowhere\nbody\n!.
4435 m this-goes2@nowhere\nbody2\n!.
4436 set customhdr=%ccustom1 : custom1 body%c
4437 m this-goes2@nowhere\nbody2\n!.
4438 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4439 m this-goes3@nowhere\nbody3\n!.
4441 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
4442 -C 'C-One : Custom One Body' \
4443 -C 'C-Two:CustomTwoBody' \
4444 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4447 ${cat} .
/.tall
>> "${MBOX}"
4448 check
2 0 "${MBOX}" '3546878678 752'
4453 t_quote_a_cmd_escapes
() {
4454 t_prolog quote_a_cmd_escapes
4455 TRAP_EXIT_ADDONS
="./.t*"
4459 echo 'included file' > .
/.ttxt
4461 ${cat} <<-_EOT > ./.tmbox
4462 From neverneverland Sun Jul 23 13:46:25 2017
4463 Subject: Bugstop: five miles out 1
4464 Reply-To: mister originator1 <mr1@originator>
4465 From: mister originator1 <mr1@originator>
4466 To: bugstop-commit@five.miles.out
4468 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4469 Date: Wed, 19 Jul 2017 09:22:57 -0400
4470 Message-Id: <20170719132257.766AF781267-1@originator>
4473 That's appalling, I.
4475 From neverneverland Sun Jul 23 13:47:25 2017
4476 Subject: Bugstop: five miles out 2
4477 Reply-To: mister originator2 <mr2@originator>
4478 From: mister originator2 <mr2@originator>
4479 To: bugstop-commit@five.miles.out
4481 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4482 Date: Wed, 19 Jul 2017 09:23:57 -0400
4483 Message-Id: <20170719132257.766AF781267-2@originator>
4486 That's appalling, II.
4488 From neverneverland Sun Jul 23 13:48:25 2017
4489 Subject: Bugstop: five miles out 3
4490 Reply-To: mister originator3 <mr3@originator>
4491 From: mister originator3 <mr3@originator>
4492 To: bugstop-commit@five.miles.out
4494 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4495 Date: Wed, 19 Jul 2017 09:24:57 -0400
4496 Message-Id: <20170719132257.766AF781267-3@originator>
4499 That's appalling, III.
4504 set indentprefix=" |"
4511 headerpick type retain cc date from message-id reply-to subject to
4515 set quote=allheaders
4518 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4519 -Sescape=! -Sindentprefix=' >' \
4520 .
/.tmbox
>.
/.tall
2>&1
4522 ${cat} .
/.tall
>> "${MBOX}"
4523 check
1 0 "${MBOX}" '2181726970 2023'
4525 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4528 set Sign=SignVar sign=signvar DEAD=./.ttxt
4529 headerpick type retain Subject
4531 !!1 Not escaped. And shell test last, right before !..
4532 !: echo 2 only echoed via colon
4533 !_ echo 3 only echoed via underscore
4535 !<! echo 5 shell echo included
4536 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4537 7 and 8 are ~A and ~a:
4540 !b 9 added ~b cc <ex1@am.ple>
4541 !c 10 added ~c c <ex2@am.ple>
4548 14: ~f (headerpick: subject)
4552 16, 17: ~I Sign, ~i Sign
4573 set quote-inject-head quote-inject-tail indentprefix
4574 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4578 !:unset quote quote-inject-head quote-inject-tail
4583 24: ~s this new subject
4584 !s 24 did new ~s ubject
4585 !t 25 added ~t o <ex3@am.ple>
4590 and i ~w rite this out to ./.tmsg
4592 !:wysh set x=$escape;set escape=~
4593 ~!echo shell command output
4594 ~:wysh set escape=$x
4596 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4597 -Sescape=! -Sindentprefix=' |' \
4598 .
/.tmbox
>.
/.tall
2>&1
4600 ${cat} .
/.tall
>> "${MBOX}"
4601 check
2 0 "${MBOX}" '2613898218 4090'
4602 check
3 - .
/.tmsg
'2771314896 3186'
4607 t_mass_recipients
() {
4608 t_prolog mass_recipients
4609 TRAP_EXIT_ADDONS
="./.t*"
4611 t_xmta
'Eucalyptus Sat Jul 08 21:14:57 2017'
4613 ${cat} <<'__EOT__' > ./.trc
4615 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4618 wysh set nr=$1 hn=$2
4619 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4621 xcall bail "ins_addr $hn 1-$nr"
4623 vput vexpr nr + $nr 1
4624 if [ "$nr" -le "$maximum" ]
4625 xcall ins_addr $nr $hn
4629 wysh set nr=$1 hn=$2
4630 alternates $hn$nr@$hn
4631 vput vexpr nr + $nr 2
4632 if [ "$nr" -le "$maximum" ]
4633 xcall bld_alter $nr $hn
4643 if [ "$t_remove" != '' ]
4648 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4651 printf 'm this-goes@nowhere\nbody\n!.\n' |
4652 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4653 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4656 ${cat} .
/.tall
>> "${MBOX}"
4657 check
1 - "${MBOX}" '2912243346 51526'
4660 printf 'm this-goes@nowhere\nbody\n!.\n' |
4661 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4662 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4665 ${cat} .
/.tall
>> "${MBOX}"
4666 check
2 - "${MBOX}" '4097804632 34394'
4671 t_mime_types_load_control
() {
4672 t_prolog mime_types_load_control
4673 if have_feat uistrings
; then :; else
4674 echo 'mime_types_load_control: unsupported, skipped'
4677 TRAP_EXIT_ADDONS
="./.t*"
4679 ${cat} <<-_EOT > ./.tmts1
4680 @ application/mathml+xml mathml
4682 ${cat} <<-_EOT > ./.tmts2
4683 @ x-conference/x-cooltalk ice
4685 @ application/aga-aga aga
4688 ${cat} <<-_EOT > ./.tmts1.mathml
4689 <head>nonsense ML</head>
4691 ${cat} <<-_EOT > ./.tmts2.ice
4694 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4695 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4709 ' "${MBOX}" "${MBOX}" |
4711 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4714 ${cat} "${MBOX}" >> .
/.tout
4715 check
1 - .
/.tout
'2716124839 2441'
4717 echo type |
${MAILX} ${ARGS} -R \
4718 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4719 -f "${MBOX}" >> .
/.tout
2>&1
4720 check
2 0 .
/.tout
'2093030907 3634'
4725 t_lreply_futh_rth_etc
() {
4726 t_prolog lreply_futh_rth_etc
4727 TRAP_EXIT_ADDONS
="./.t*"
4729 t_xmta
'HumulusLupulus Thu Jul 27 14:41:20 2017'
4731 ${cat} <<-_EOT > ./.tmbox
4732 From neverneverland Sun Jul 23 13:46:25 2017
4733 Subject: Bugstop: five miles out 1
4734 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4735 From: mister originator <mr@originator>
4736 To: bugstop-commit@five.miles.out, laber@backe.eu
4738 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4739 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4740 Date: Wed, 19 Jul 2017 09:22:57 -0400
4741 Message-Id: <20170719132257.766AF781267@originator>
4744 > |Sorry, I think I misunderstand something. I would think that
4748 From neverneverland Fri Jul 7 22:39:11 2017
4749 Subject: Bugstop: five miles out 2
4750 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4751 Content-Transfer-Encoding: 7bit
4752 From: mister originator <mr@originator>
4753 To: bugstop-commit@five.miles.out
4755 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4756 Date: Fri, 07 Jul 2017 16:33:59 -0400
4759 capable of changing back.
4761 From neverneverland Fri Jul 7 22:42:00 2017
4762 Subject: Bugstop: five miles out 3
4763 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4764 Content-Transfer-Encoding: 7bit
4765 From: mister originator <mr@originator>
4766 To: bugstop-commit@five.miles.out
4768 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4769 Date: Fri, 07 Jul 2017 16:33:59 -0400
4770 List-Post: <mailto:bugstop@five.miles.out>
4773 are you ready, boots?
4775 From neverneverland Sat Aug 19 23:15:00 2017
4776 Subject: Bugstop: five miles out 4
4777 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4778 Content-Transfer-Encoding: 7bit
4779 From: mister originator <mr@originator>
4780 To: bugstop@five.miles.out
4782 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4783 Date: Fri, 07 Jul 2017 16:33:59 -0400
4784 List-Post: <mailto:bugstop@five.miles.out>
4787 are you ready, boots?
4792 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
4793 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4795 wysh
set m
="This is text of \"reply ${1}."
4806 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4809 wysh set m="This is text of
\"Reply
${1}.
"
4815 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4824 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4828 # We need two indirections for this test: one for the case that Lreply
4829 # fails because of missing recipients: we need to read EOF next, thus
4830 # place this in _Ls last; and second for the succeeding cases EOF is
4831 # not what these should read, so go over the backside and splice it in!
4833 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4836 localopts call-fixate
yes
4838 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4839 call L
$1 1; call L
$1 2; call L
$1 3
4842 echo;echo '===== CHANGING === '"$*"' =====';echo
4846 set from
=laber@backe.eu
4849 call tweak
set reply-to-honour
4851 call tweak
set followup-to
4853 call tweak
set followup-to-honour
4855 call tweak mlist bugstop@five.miles.out
4857 call tweak mlsubscribe bugstop@five.miles.out
4859 call tweak
set recipients-in-cc
4861 # While here, test that *fullnames* works (also here)
4864 This message should have
*fullnames
* in the header.
4869 if have_feat uistrings
; then
4870 check
1 - "${MBOX}" '1530821219 29859'
4872 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
4877 ${cat} <<-_EOT > ./.tmbox
4878 From tom@i-i.example Thu Oct 26 03:15:55 2017
4879 Date: Wed, 25 Oct 2017 21:15:46 -0400
4880 From: tom <tom@i-i.example>
4881 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4882 Cc: tom <tom@i-i.example>
4883 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4884 Message-ID: <20171026011546.GA11643@i-i.example>
4885 Reply-To: tom@i-i.example
4886 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4887 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4890 The report's useful :-)
4893 # Let us test In-Reply-To: removal starts a new thread..
4894 # This needs adjustment of *stealthmua*
4895 argadd
='-Sstealthmua=noagent -Shostname'
4898 printf 'reply 1\nthread\n!.\n' |
4899 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4900 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
4901 check
2 0 "${MBOX}" '3321764338 429'
4902 check
3 - .tall
'4294967295 0'
4904 printf 'reply 1\nnew <- thread!\n!v\n!.\n' |
4905 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4906 -Seditheaders -S VISUAL
="${sed} -i'' -e '/^In-Reply-To:/d'" \
4907 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4908 check
4 0 "${MBOX}" '1682552516 763'
4909 check
5 - .tall
'4294967295 0'
4911 printf 'reply 2\nold <- new <- thread!\n!.\n' |
4912 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4913 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4914 check
6 0 "${MBOX}" '2900984135 1219'
4915 check
7 - .tall
'4294967295 0'
4917 printf 'reply 3\nnew <- old <- new <- thread!\n!v\n!.\n' |
4918 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4919 -Seditheaders -S VISUAL
="${sed} -i'' -e '/^In-Reply-To:/d'" \
4920 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4921 check
8 0 "${MBOX}" '794031200 1567'
4922 check
9 - .tall
'4294967295 0'
4927 t_mime_if_not_ascii
() {
4928 t_prolog mime_if_not_ascii
4930 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4931 check 1 0 "${MBOX}" '3647956381 106'
4933 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4935 check
2 0 "${MBOX}" '3964303752 274'
4940 t_xxxheads_rfc2047
() {
4941 t_prolog xxxheads_rfc2047
4942 TRAP_EXIT_ADDONS
="./.t*"
4944 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
4946 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4947 -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̲' \
4949 check
1 0 "${MBOX}" '3422562347 371'
4951 # Single word (overlong line split -- bad standard! Requires injection of
4952 # artificial data!! But can be prevented by using RFC 2047 encoding)
4954 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4955 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4956 check 2 0 "${MBOX}" '3317256266 1714'
4958 # Combination of encoded words, space and tabs of varying sort
4960 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4961 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4962 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4963 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4964 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4965 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4967 check 3 0 "${MBOX}" '786672837 587'
4969 # Overlong multibyte sequence that must be forcefully split
4970 # todo This works even before v15.0, but only by accident
4972 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4973 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4974 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4975 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4977 check 4 0 "${MBOX}" '2889557767 655'
4981 echo | ${MAILX} ${ARGS} \
4982 -s "1-1 B2 B3 B4 B5 B6 B\
4983 1-2 B2 B3 B4 B5 B6 B\
4984 1-3 B2 B3 B4 B5 B6 B\
4985 1-4 B2 B3 B4 B5 B6 B\
4986 1-5 B2 B3 B4 B5 B6 B\
4987 1-6 B2 B3 B4 B5 B6
" \
4989 check 5 0 "${MBOX}" '3135161683 293'
4991 # Leading and trailing WS
4993 echo | ${MAILX} ${ARGS} \
4994 -s " 2-1 B2 B3 B4 B5 B6 B\
4995 1-2 B2 B3 B4 B5 B6 B\
4996 1-3 B2 B3 B4 B5 B6 B\
4997 1-4 B2 B3 B4 B5 B6
" \
4999 check 6 0 "${MBOX}" '3221845405 232'
5001 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
5003 echo "Dat Früchtchen riecht häußlich
" |
5004 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
5006 'Schnödes "Früchtchen
" <do@du> (Hä!)'
5007 check 7 0 "${MBOX}" '800505986 368'
5009 # RFC 2047 in an address field, and iconv involved
5010 if have_feat iconv; then
5012 ${cat} > ./.trebox <<_EOT
5013 From zaza@exam.ple Fri Mar 2 21:31:56 2018
5014 Date: Fri, 2 Mar 2018 20:31:45 +0000
5015 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
5016 To: dude <dude@exam.ple>
5017 Subject: houston(...)
5018 Message-ID: <abra@1>
5020 Content-Type: text/plain; charset=iso-8859-1
5021 Content-Disposition: inline
5022 Content-Transfer-Encoding: 8bit
5025 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
5026 -Sfullnames -Sreply-in-same-charset \
5027 -Smta=./.tmta.sh -Rf ./.trebox
5028 check 8 0 "${MBOX}" '2914485741 280'
5030 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
5038 TRAP_EXIT_ADDONS=".
/.t
*"
5041 mkdir ./.ttt || exit 1
5045 : > 'diet\ is \curd.txt'
5046 : > 'diet "is
" curd.txt'
5048 : > 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
5049 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
5050 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
5051 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
5053 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
5054 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
5055 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
5056 -a ./.ttt/höde-tröge.txt \
5057 -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 \
5058 -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 \
5059 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
5060 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
5062 check 1 0 "${MBOX}" '3720896054 3088'
5064 # `resend' test, reusing $MBOX
5065 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
5066 check
2 0 .
/.t2
'3720896054 3088'
5068 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
5069 check 3 0 ./.t3 '3979736592 3133'
5074 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
5075 t_prolog iconv_mbyte_base64
5076 TRAP_EXIT_ADDONS=".
/.t
*"
5078 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
5079 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
5080 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
5083 echo 'iconv_mbyte_base64: unsupported, skipped'
5087 echo 'iconv_mbyte_base64: unsupported, skipped'
5091 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
5093 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
5094 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5096 -Sescape=! -Smime-encoding=base64 2>./.terr
5097 set ttycharset=utf-8 sendcharsets=iso-2022-jp
5099 !s Japanese from UTF-8 to ISO-2022-JP
5100 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
5102 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5105 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5107 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
5110 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
5112 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
5113 \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
5115 \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
5118 \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
5120 \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
5123 # May not presume iconv output as long as roundtrip possible [489a7122]
5125 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
5126 < "${MBOX}" > .
/.tcksum
5127 check
1 - .
/.tcksum
'2694609714 520'
5128 check
2 - .
/.terr
'4294967295 0'
5130 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
5131 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5132 -S headline
="%>%a%m %-18f %-16d %i%-s" \
5133 -Rf "${MBOX}" >.
/.tlog
2>&1
5134 check
3 0 .
/.twrite
'1259742080 686'
5135 #check 4 - ./.tlog '3214068822 2123'
5136 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
5137 check
4 - .
/.txlog
'3659773472 2035'
5139 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
5142 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
5143 rm -f "${MBOX}" .
/.twrite
5144 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5146 -Sescape=! -Smime-encoding=base64
2>.
/.terr
5147 set ttycharset
=utf-8 sendcharsets
=euc-jp
5149 !s Japanese from UTF-8 to EUC-JP
5150 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
5152 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5155 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5157 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
5160 set ttycharset
=EUC-JP sendcharsets
=utf-8
5162 !s Japanese from EUC-JP to UTF-8
5163 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
5165 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
5168 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
5170 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
5174 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
5175 < "${MBOX}" > .
/.tcksum
5176 check
5 - .
/.tcksum
'2870183985 473'
5177 check
6 - .
/.terr
'4294967295 0'
5179 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
5180 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5181 -S headline
="%>%a%m %-18f %-16d %i%-s" \
5182 -Rf "${MBOX}" >.
/.tlog
2>&1
5183 check
7 0 .
/.twrite
'1259742080 686'
5184 #check 8 - ./.tlog '2506063395 2075'
5185 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
5186 check
8 - .
/.txlog
'2528199891 1988'
5188 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
5194 t_iconv_mainbody
() {
5195 t_prolog iconv_mainbody
5196 TRAP_EXIT_ADDONS
="./.t*"
5198 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
5201 echo 'iconv_mainbody: unsupported, skipped'
5205 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
5207 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
5208 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
5209 -s '–' over-the@rain.bow
2>.
/.terr
5210 check
1 0 "${MBOX}" '3634015017 251'
5211 check
2 - .
/.terr
'4294967295 0'
5213 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
5214 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
5215 -s '–' over-the@rain.bow
2>.
/.terr
5217 check
3 - "${MBOX}" '3634015017 251'
5218 if have_feat uistrings
; then
5219 if have_feat docstrings
; then # xxx should not be like that
5220 check
4 - .
/.terr
'2579894983 148'
5222 check
4 - .
/.terr
'271380835 121'
5225 echo 'iconv_mainbody-4: unsupported, skipped'
5228 # The different iconv(3) implementations use different replacement sequence
5229 # types (character-wise, byte-wise, and the character(s) used differ)
5230 i
="${MAILX_ICONV_MODE}"
5231 if [ -n "${i}" ]; then
5232 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
5234 check_ex0 5-1-estat ${j}
5235 check 5-1 - ./.terr '4294967295 0'
5236 if [ ${i} -eq 13 ]; then
5237 check 5-2 - ./.tout '189327996 283'
5238 elif [ ${i} -eq 12 ]; then
5239 check 5-3 - ./.tout '1959197095 283'
5240 elif [ ${i} -eq 3 ]; then
5241 check 5-4 - ./.tout '3196380198 279'
5243 check 5-5 - ./.tout '3760313827 279'
5246 echo 'iconv_mainbody-5: unsupported, skipped'
5252 t_binary_mainbody() {
5253 t_prolog binary_mainbody
5254 TRAP_EXIT_ADDONS=".
/.t
*"
5256 printf 'abra\0\nka\r\ndabra' |
5257 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
5259 check 1 0 "${MBOX}" '1629827 239'
5260 check 2 - ./.terr '4294967295 0'
5262 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
5263 ${MAILX} ${ARGS} -Rf \
5264 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
5265 "${MBOX}" >./.tall 2>&1
5266 check 3 0 ./.tall '733582513 319'
5267 check 4 - ./.tcat '3817108933 15'
5268 check 5 - ./.twrite '3817108933 15'
5274 t_prolog q_t_etc_opts
5275 TRAP_EXIT_ADDONS=".
/.t
*"
5277 # Three tests for MIME encoding and (a bit) content classification.
5278 # At the same time testing -q FILE, < FILE and -t FILE
5279 t__put_body > ./.tin
5281 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
5282 -a ./.tin -s "`t__put_subject`" "${MBOX}"
5283 check 1 0 "${MBOX}" '1088822685 6642'
5286 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
5287 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
5288 check 2 0 "${MBOX}" '1088822685 6642'
5291 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
5293 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
5294 check 3 0 "${MBOX}" '1088822685 6642'
5296 # Check comments in the header
5298 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
5301 # Noch ein Kommentar
5303 # Nachgestelltes Kommentar
5307 check
4 0 "${MBOX}" '4161555890 124'
5313 have_feat smime ||
{
5314 echo 's_mime: unsupported, skipped'
5319 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5320 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5321 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5323 ${cat} <<-_EOT > ./.t.conf
5326 default_keyfile = keyfile.pem
5327 distinguished_name = req_distinguished_name
5328 attributes = req_attributes
5332 [ req_distinguished_name ]
5339 emailAddress = test@localhost
5344 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5345 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5347 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5350 echo bla |
${MAILX} ${ARGS} \
5351 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5352 -s 'S/MIME test' .
/.VERIFY
5356 /^Content-Description: /{ skip = 2; print; next }
5357 /^$/{ if(skip) --skip }
5360 < .
/.VERIFY
> "${MBOX}"
5361 check
1 - "${MBOX}" '1311565262 644'
5363 printf 'verify\nx\n' |
5364 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5365 -R -f .
/.VERIFY
>>${ERR} 2>&1
5368 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5371 # (signing +) encryption / decryption
5372 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5377 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5378 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5379 -s 'S/MIME test' recei@ver.com
5381 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5382 check
4 - "${MBOX}" '1937410597 327'
5384 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5387 -Ssmime-ca-file=.
/.tcert.pem \
5388 -Ssmime-sign-cert=.
/.tpair.pem \
5389 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5393 /^Content-Description: /{ skip = 2; print; next }
5394 /^$/{ if(skip) --skip }
5397 < .
/.DECRYPT
> "${MBOX}"
5398 check
5 - "${MBOX}" '1720739247 931'
5400 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5401 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5405 echo bla |
${MAILX} ${ARGS} \
5407 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5408 -Sfrom=test@localhost \
5409 -s 'S/MIME test' recei@ver.com
5411 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5412 check
7 - "${MBOX}" '1937410597 327'
5415 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5417 -Ssmime-sign-cert=.
/.tpair.pem \
5418 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5419 check
8 0 "./.DECRYPT" '2624716890 422'
5421 openssl smime
-decrypt -inkey .
/.tkey.pem \
5422 -in .
/.ENCRYPT
>>${ERR} 2>&1
5428 # xxx Note: t_z() was the first test (series) written. Today many
5429 # xxx aspects are (better) covered by other tests above, some are not.
5430 # xxx At some future date and time, convert the last remains not covered
5431 # xxx elsewhere to a real t_* test and drop it
5435 # Test for [260e19d] (Juergen Daubert)
5436 echo body |
${MAILX} ${ARGS} "${MBOX}"
5437 check 4 0 "${MBOX}" '2948857341 94'
5439 # "Test
for" [d6f316a] (Gavin Troy)
5441 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5442 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5443 check
6 0 "${MBOX}" '3942990636 118'
5444 check
6-1 - "${BODY}" '3951695530 170'
5446 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5449 for(i = 0; i < 10000; ++i)
5451 #printf "\xF0\x90\x87\x90"
5452 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5453 check 7 0 "${MBOX}" '1707496413 61812'
5459 # MIME encoding (QP) stress message subject
5460 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5461 'adadaddsssssssddddddddddddddddddddd'\
5462 'ddddddddddddddddddddddddddddddddddd'\
5463 'ddddddddddddddddddddddddddddddddddd'\
5464 'dddddddddddddddddddd Hallelulja? Od'\
5465 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5466 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5467 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5468 'fffffffffffffffffffffffffffffffffff'\
5469 'fffffffffffffffffffff ggggggggggggg'\
5470 'ggggggggggggggggggggggggggggggggggg'\
5471 'ggggggggggggggggggggggggggggggggggg'\
5472 'ggggggggggggggggggggggggggggggggggg'\
5477 # MIME encoding (QP) stress message body
5479 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5480 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5481 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5482 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5483 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5484 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5485 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5486 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5487 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5488 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5489 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5490 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5491 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5492 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5493 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5494 "auf den zeilen vorher.
\r\n"\
5495 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5497 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5499 "Das waren deren zwei.
\r\n"\
5501 "Die letzte Zeile war ein Leerschritt.
\n"\
5502 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5505 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5507 "Das waren deren zwei. ditto.
\n"\
5509 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5510 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5511 "auf den zeilen vorher.
\n"\
5513 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5514 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5516 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5518 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5520 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5522 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5524 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5526 "QP am Zeilenende über soft-nl hinweg
\n"\
5527 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5529 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5531 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5533 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5535 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5537 "Die letzte Zeile war ein Leerschritt.
\n"\
5542 # Test all configs TODO doesn't cover all *combinations*, stupid!
5546 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5547 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5548 NOTME["OPT_CROSS_BUILD
"] = 1
5549 NOTME["OPT_AUTOCC
"] = 1
5550 NOTME["OPT_AMALGAMATION
"] = 1
5551 NOTME["OPT_DEBUG
"] = 1
5552 NOTME["OPT_DEVEL
"] = 1
5553 NOTME["OPT_ASAN_ADDRESS
"] = 1
5554 NOTME["OPT_ASAN_MEMORY
"] = 1
5555 NOTME["OPT_FORCED_STACKPROT
"] = 1
5556 NOTME["OPT_NOMEMDBG
"] = 1
5557 NOTME["OPT_NYD2
"] = 1
5562 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5563 MULVALS["VAL_IDNA
"] = 1
5565 #VALKEYS[0] = "VAL_RANDOM
"
5566 VALVALS["VAL_RANDOM
"] = 1
5569 /^[[:space:]]*OPT_/{
5570 sub(/^[[:space:]]*/, "")
5571 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5572 # does not seem to be a compliant escape for =
5574 $1 = substr($1, 1, index($1, "=") - 1)
5576 OPTVALS[OPTNO++] = $1
5579 /^[[:space:]]*VAL_/{
5580 sub(/^[[:space:]]*/, "")
5581 val = substr($0, index($0, "=") + 1)
5583 val = substr(val, 2)
5584 val = substr(val, 1, length(val) - 1)
5586 $1 = substr($1, 1, index($1, "=") - 1)
5589 else if(VALVALS[$1]){
5590 VALKEYS[VALNO++] = $1
5595 function onepass(addons){
5596 a_onepass__worker(addons, "1", "0")
5597 a_onepass__worker(addons, "0", "1")
5599 function a_onepass__worker(addons, b0, b1){
5600 # Doing this completely sequentially and not doing make distclean in
5601 # between runs should effectively result in lesser compilations.
5602 # It is completely dumb nonetheless... TODO
5603 for(ono = 0; ono < OPTNO; ++ono){
5605 for(i = 0; i < ono; ++i){
5606 myconf = myconf " " OPTVALS[i] "=" b0 " "
5608 j = MULCHOICE[OPTVALS[i]]
5613 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5617 for(i = ono; i < OPTNO; ++i){
5618 myconf = myconf " " OPTVALS[i] "=" b1 " "
5620 j = MULCHOICE[OPTVALS[i]]
5625 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5631 myconf = VALKEYS[i] "=any
" myconf
5633 myconf = myconf " " ALWAYS " " addons
5638 i = split(MULVALS[mula], ia)
5642 print mula "=\"" j "\" " myconf
5648 # We cannot test NULL because of missing UI strings, which will end
5649 # up with different checksums
5650 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5652 j = split(VALVALS[VALKEYS[i]], ia)
5656 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5659 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5660 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5661 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5663 j = split(VALVALS[VALKEYS[i]], ia)
5667 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5670 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5671 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5673 onepass("OPT_DEBUG
=1")
5676 ' | while read c; do
5677 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5678 printf "\n\n##########\n$c\n"
5679 printf "\n\n##########\n$c\n" >&2
5680 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5681 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5682 printf 'Skipping after config, nothing changed\n'
5683 printf 'Skipping after config, nothing changed\n' >&2
5686 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5689 cd .. && ${MAKE} distclean
5692 [ -n "${ERR}" ] && echo > ${ERR}
5693 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5695 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5696 # if have_feat devel; then
5697 # ARGS="${ARGS} -Smemdebug"
5703 while [ ${#} -gt 0 ]; do
5709 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'