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}" '1872102723 13784'
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 '3498373999 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
'381610797 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
'4145104131 6890'
2765 check
5 - .tall
'361127721 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
'3249991493 13784'
2778 if have_feat uistrings
; then
2779 ${sed} 2d
< .tall
> .tallx
2783 check
7 - .tallx
'1584413080 13645'
2785 # Invalid MBOXes (after [f4db93b3])
2787 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2788 check 8 0 .tinvmbox '896415941 122'
2789 check 9 - ./.tall '3146754194 33'
2791 echo ' ' > .tinvmbox
2792 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2793 check
10 0 .tinvmbox
'4011310616 124'
2794 check
11 - .
/.tall
'3146754194 33'
2796 { echo; echo; } > .tinvmbox
# (not invalid)
2797 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2798 check 12 0 .tinvmbox '287409579 123'
2799 check 13 - ./.tall '3146754194 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}" '1140119864 13780'
2867 ' "${MBOX}" .tmdir1 .tmdir1 |
2868 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2869 check 2 0 .tlst '1797938753 9103'
2872 copy * "maildir
://%s
"
2875 ' "${MBOX}" .tmdir2 .tmdir2 |
2876 ${MAILX} ${ARGS} -Sshowlast > .tlst
2877 check 3 0 .tlst '1155631089 9113'
2879 printf 'File "maildir
://%s
"
2883 ' .tmdir2 .tmbox1 .tmbox1 |
2884 ${MAILX} ${ARGS} -Sshowlast > .tlst
2885 check 4 0 .tmbox1 '2646131190 13220'
2886 check 5 - .tlst '3701297796 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 '142890131 6610'
2904 check 7 - .tlst '960096773 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
'3806905791 13100'
2923 ${sed} 2d
< .tlst
> .tlstx
2924 check
9 - .tlstx
'4216815295 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}" '3057873538 256'
2948 check
2 - .t.record
'391356429 460'
2949 check
3 - .t.resent
'2685231691 648'
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'
3147 TRAP_EXIT_ADDONS
="./.t*"
3149 t_xmta
'Hippocastanum Mon Jun 19 15:07:07 2017'
3151 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3153 alias a1 ex2@a1.ple
"EX3 <ex3@a1.ple>"
3155 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3157 alias a4 a5 ex1@a4.ple
3159 alias a6 a7 ex1@a6.ple
3173 check
1 0 "${MBOX}" '2496925843 272'
3174 check
2 - .tall
'3548953204 152'
3176 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3177 # TODO need to somehow provide its contents to the test, then test
3184 TRAP_EXIT_ADDONS
="./.t*"
3186 t_xmta
'Alchemilla Wed Apr 25 15:12:13 2017'
3188 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3189 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=./.tmta.sh
3190 check 1 0 "${MBOX}" '1594682963 13520'
3192 if (echo | gzip -c) >/dev/null 2>&1; then
3194 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3195 "${MBOX}" | ${MAILX} ${ARGS} \
3196 -X'filetype gz gzip\ -dc gzip\ -c'
3197 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3198 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3200 check
2 - "./.t.mbox" '1594682963 13520'
3201 check
3 - "./.t.out" '2392348396 102'
3203 echo 'filetype-2: unsupported, skipped'
3204 echo 'filetype-3: unsupported, skipped'
3209 printf 'File "%s"\ncopy 1 ./.t.mbox.gz
3215 -X'filetype gz gzip\ -dc gzip\ -c' \
3216 -X'filetype mbox.gz "${sed} 1,3d|${cat}" \
3217 "echo eins;echo zwei;echo und mit ${sed} bist Du dabei;${cat}"'
3218 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3220 -X'filetype gz gzip\ -dc gzip\ -c' \
3221 -X'filetype mbox.gz "${sed} 1,3d|${cat}" kill\ 0'
3223 check
4 - "./.t.mbox" '2886541147 27060'
3224 check
5 - "./.t.out" '852335377 172'
3229 t_message_injections
() {
3230 t_prolog message_injections
3231 TRAP_EXIT_ADDONS
="./.t*"
3233 t_xmta
'Echinacea Tue Jun 20 15:54:02 2017'
3235 echo mysig
> .
/.tmysig
3237 echo some-body |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3238 -Smessage-inject-head=head-inject \
3239 -Smessage-inject-tail=tail-inject \
3240 -Ssignature=.
/.tmysig \
3241 ex@am.ple
> .
/.tall
2>&1
3242 check
1 0 "${MBOX}" '2434746382 134'
3243 check
2 - .tall
'4294967295 0' # empty file
3246 ${cat} <<-_EOT > ./.template
3250 Subject: This subject is
3252 Body, body, body me.
3254 < .
/.template
${MAILX} ${ARGS} -t -Smta=.
/.tmta.sh \
3255 -Smessage-inject-head=head-inject \
3256 -Smessage-inject-tail=tail-inject \
3257 -Ssignature=.
/.tmysig \
3259 check
3 0 "${MBOX}" '3114203412 198'
3260 check
4 - .tall
'4294967295 0' # empty file
3266 t_prolog attachments
3267 TRAP_EXIT_ADDONS
="./.t*"
3269 t_xmta
'Cannabis Sun Feb 18 02:02:46 2018'
3271 ${cat} <<-_EOT > ./.tx
3272 From steffen Sun Feb 18 02:48:40 2018
3273 Date: Sun, 18 Feb 2018 02:48:40 +0100
3276 User-Agent: s-nail v14.9.7
3279 From steffen Sun Feb 18 02:48:42 2018
3280 Date: Sun, 18 Feb 2018 02:48:42 +0100
3283 User-Agent: s-nail v14.9.7
3288 printf 'att2-1\natt2-2\natt2-4\n' > .
/'.t 2'
3289 printf 'att3-1\natt3-2\natt3-4\n' > .
/.t3
3290 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3293 '!@ ./.t3 "./.t 4" ""
3301 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
3302 -a .
/.t1
-a './.t 2' \
3303 -s attachment-test \
3304 ex@am.ple
> .
/.tall
2>&1
3305 check
1 0 "${MBOX}" '4107062253 634'
3306 if have_feat uistrings
; then
3307 check
2 - .tall
'1928331872 720'
3309 echo 'attachments-2: unsupported, skipped'
3315 !s This the subject is
3316 !@ ./.t3 "#2" "./.t 4" "#1" ""
3326 !@ ./.t3 "#2" "./.t 4" "#1" ""
3334 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3343 !@ ./.t3 "" "#2" "" "./.t 4" "" "#1" ""
3357 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3359 check
3 0 "${MBOX}" '798122412 2285'
3360 if have_feat uistrings
; then
3361 check
4 - .tall
'2526106274 1910'
3363 echo 'attachments-4: unsupported, skipped'
3392 |
${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Rf .
/.tx \
3394 check
5 0 "${MBOX}" '2165311808 2276'
3395 if have_feat uistrings
; then
3396 check
6 - .tall
'3662598562 509'
3398 echo 'attachments-6: unsupported, skipped'
3404 t_compose_hooks
() { # TODO monster
3405 t_prolog compose_hooks
3406 if have_feat uistrings
; then :; else
3407 echo 'compose_hooks: unsupported, skipped'
3410 TRAP_EXIT_ADDONS
="./.t*"
3412 t_xmta
'PrimulaVeris Wed Apr 10 22:59:00 2017'
3414 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
3415 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
3417 ${cat} <<'__EOT__' > ./.trc
3419 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
3422 vput vexpr es substr "$1" 0 1
3427 define read_mline_res {
3428 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
3429 echo $len/$es/$^ERRNAME: $hl
3430 if [ $es -ne $^ERR-NONE ]
3431 xcall bail read_mline_res
3433 \xcall read_mline_res
3438 echo "~^header list"; read hl; echo $hl;\
3439 call xerr "$hl" "in_addr ($xh) 0-1"
3441 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3442 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
3443 echo "~^header insert $xh <${xh}2@exam.ple>";\
3444 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
3445 echo "~^header insert $xh ${xh}3@exam.ple";\
3446 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
3447 echo "~^header list $xh"; read hl; echo $hl;\
3448 call xerr "$hl" "ins_addr $xh 1-4"
3449 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
3452 if [ "$t_remove" == "" ]
3456 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
3457 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
3459 xcall bail "ins_addr $xh 2-2"
3461 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
3463 xcall bail "ins_addr $xh 2-3"
3465 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
3467 xcall bail "ins_addr $xh 2-4"
3471 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3472 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
3473 echo "~^header insert $xh <${xh}2@exam.ple>";\
3474 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
3475 echo "~^header insert $xh ${xh}3@exam.ple";\
3476 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
3477 echo "~^header list $xh"; read hl; echo $hl;\
3478 call xerr "$hl" "ins_addr $xh 3-4"
3479 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
3482 echo "~^header remove-at $xh 1"; read es;\
3483 call xerr $es "ins_addr $xh 3-6"
3484 echo "~^header remove-at $xh 1"; read es;\
3485 call xerr $es "ins_addr $xh 3-7"
3486 echo "~^header remove-at $xh 1"; read es;\
3487 call xerr $es "ins_addr $xh 3-8"
3488 echo "~^header remove-at $xh 1"; read es;\
3489 vput vexpr es substr $es 0 3
3491 xcall bail "ins_addr $xh 3-9"
3493 echo "~^header remove-at $xh T"; read es;\
3494 vput vexpr es substr $es 0 3
3496 xcall bail "ins_addr $xh 3-10"
3498 echo "~^header list $xh"; read es;\
3499 vput vexpr es substr $es 0 3
3501 xcall bail "ins_addr $xh 3-11"
3503 echo "~^header show $xh"; read es;\
3504 vput vexpr es substr $es 0 3
3506 xcall bail "ins_addr $xh 3-12"
3510 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
3511 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
3512 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
3513 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
3514 echo "~^header insert $xh ${xh}3@exam.ple";\
3515 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
3516 echo "~^header list $xh"; read hl; echo $hl;\
3517 call xerr "$hl" "header list $xh 3-4"
3518 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
3521 echo "~^header remove-at $xh 3"; read es;\
3522 call xerr $es "ins_addr $xh 4-6"
3523 echo "~^header remove-at $xh 2"; read es;\
3524 call xerr $es "ins_addr $xh 4-7"
3525 echo "~^header remove-at $xh 1"; read es;\
3526 call xerr $es "ins_addr $xh 4-8"
3527 echo "~^header remove-at $xh 1"; read es;\
3528 vput vexpr es substr $es 0 3
3530 xcall bail "ins_addr $xh 4-9"
3532 echo "~^header remove-at $xh T"; read es;\
3533 vput vexpr es substr $es 0 3
3535 xcall bail "ins_addr $xh 4-10"
3537 echo "~^header list $xh"; read es;\
3538 vput vexpr es substr $es 0 3
3540 xcall bail "ins_addr $xh 4-11"
3542 echo "~^header show $xh"; read es;\
3543 vput vexpr es substr $es 0 3
3545 xcall bail "ins_addr $xh 4-12"
3549 wysh set xh=$1 mult=$2
3550 echo "~^header list"; read hl; echo $hl;\
3551 call xerr "$hl" "ins_ref ($xh) 0-1"
3553 echo "~^header insert $xh <$xh@exam.ple>";\
3554 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
3556 echo "~^header insert $xh <${xh}2@exam.ple>";\
3557 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
3558 echo "~^header insert $xh ${xh}3@exam.ple";\
3559 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
3561 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
3562 vput vexpr es substr $es 0 3
3564 xcall bail "ins_ref $xh 1-4"
3568 echo "~^header list $xh"; read hl; echo $hl;\
3569 call xerr "$hl" "ins_ref $xh 1-5"
3570 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
3573 if [ "$t_remove" == "" ]
3577 echo "~^header remove $xh"; read es;\
3578 call xerr $es "ins_ref $xh 2-1"
3579 echo "~^header remove $xh"; read es;\
3580 vput vexpr es substr $es 0 3
3582 xcall bail "ins_ref $xh 2-2"
3584 echo "~^header list $xh"; read es;\
3585 vput vexpr es substr $es 0 3
3587 xcall bail "$es ins_ref $xh 2-3"
3589 echo "~^header show $xh"; read es;\
3590 vput vexpr es substr $es 0 3
3592 xcall bail "ins_ref $xh 2-4"
3596 echo "~^header insert $xh <$xh@exam.ple>";\
3597 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
3599 echo "~^header insert $xh <${xh}2@exam.ple>";\
3600 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
3601 echo "~^header insert $xh ${xh}3@exam.ple";\
3602 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
3604 echo "~^header list $xh";\
3605 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
3606 echo "~^header show $xh";\
3607 read es; call xerr $es "ins_ref $xh 3-5"
3610 echo "~^header remove-at $xh 1"; read es;\
3611 call xerr $es "ins_ref $xh 3-6"
3612 if [ $mult -ne 0 ] && [ $xh != subject ]
3613 echo "~^header remove-at $xh 1"; read es;\
3614 call xerr $es "ins_ref $xh 3-7"
3615 echo "~^header remove-at $xh 1"; read es;\
3616 call xerr $es "ins_ref $xh 3-8"
3618 echo "~^header remove-at $xh 1"; read es;\
3619 vput vexpr es substr $es 0 3
3621 xcall bail "ins_ref $xh 3-9"
3623 echo "~^header remove-at $xh T"; read es;\
3624 vput vexpr es substr $es 0 3
3626 xcall bail "ins_ref $xh 3-10"
3628 echo "~^header show $xh"; read es;\
3629 vput vexpr es substr $es 0 3
3631 xcall bail "ins_ref $xh 3-11"
3635 echo "~^header insert $xh <$xh@exam.ple> ";\
3636 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
3638 echo "~^header insert $xh <${xh}2@exam.ple> ";\
3639 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
3640 echo "~^header insert $xh ${xh}3@exam.ple";\
3641 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
3643 echo "~^header list $xh"; read hl; echo $hl;\
3644 call xerr "$hl" "ins_ref $xh 4-4"
3645 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
3648 if [ $mult -ne 0 ] && [ $xh != subject ]
3649 echo "~^header remove-at $xh 3"; read es;\
3650 call xerr $es "ins_ref $xh 4-6"
3651 echo "~^header remove-at $xh 2"; read es;\
3652 call xerr $es "ins_ref $xh 4-7"
3654 echo "~^header remove-at $xh 1"; read es;\
3655 call xerr $es "ins_ref $xh 4-8"
3656 echo "~^header remove-at $xh 1"; read es;\
3657 vput vexpr es substr $es 0 3
3659 xcall bail "ins_ref $xh 4-9"
3661 echo "~^header remove-at $xh T"; read es;\
3662 vput vexpr es substr $es 0 3
3664 xcall bail "ins_ref $xh 4-10"
3666 echo "~^header show $xh"; read es;\
3667 vput vexpr es substr $es 0 3
3669 xcall bail "ins_ref $xh 4-11"
3674 # In collect.c order
3676 call ins_ref sender 0 # Not a "ref", but works
3680 call ins_addr reply-To
3681 call ins_addr mail-Followup-to
3682 call ins_ref messAge-id 0
3683 call ins_ref rEfErEncEs 1
3684 call ins_ref in-Reply-to 1
3685 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
3686 call ins_addr freeForm1
3687 call ins_addr freeform2
3689 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
3691 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
3699 echo "~^attachment";\
3700 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3702 xcall bail "attach 0-1"
3705 echo "~^attach attribute ./.treadctl";\
3706 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3708 xcall bail "attach 0-2"
3710 echo "~^attachment attribute-at 1";\
3711 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
3713 xcall bail "attach 0-3"
3716 echo "~^attachment insert ./.treadctl=ascii";\
3717 read hl; echo $hl; call xerr "$hl" "attach 1-1"
3718 echo "~^attachment list";\
3719 read es; echo $es;call xerr "$es" "attach 1-2"
3721 echo "~^attachment attribute ./.treadctl";\
3722 read es; echo $es;call xerr "$es" "attach 1-3"
3724 echo "~^attachment attribute .treadctl";\
3725 read es; echo $es;call xerr "$es" "attach 1-4"
3727 echo "~^attachment attribute-at 1";\
3728 read es; echo $es;call xerr "$es" "attach 1-5"
3731 echo "~^attachment attribute-set ./.treadctl filename rctl";\
3732 read es; echo $es;call xerr "$es" "attach 1-6"
3733 echo "~^attachment attribute-set .treadctl content-description Au";\
3734 read es; echo $es;call xerr "$es" "attach 1-7"
3735 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
3736 read es; echo $es;call xerr "$es" "attach 1-8"
3738 echo "~^attachment attribute ./.treadctl";\
3739 read es; echo $es;call xerr "$es" "attach 1-9"
3741 echo "~^attachment attribute .treadctl";\
3742 read es; echo $es;call xerr "$es" "attach 1-10"
3744 echo "~^attachment attribute rctl";\
3745 read es; echo $es;call xerr "$es" "attach 1-11"
3747 echo "~^attachment attribute-at 1";\
3748 read es; echo $es;call xerr "$es" "attach 1-12"
3752 echo "~^attachment insert ./.tattach=latin1";\
3753 read hl; echo $hl; call xerr "$hl" "attach 2-1"
3754 echo "~^attachment list";\
3755 read es; echo $es;call xerr "$es" "attach 2-2"
3757 echo "~^attachment attribute ./.tattach";\
3758 read es; echo $es;call xerr "$es" "attach 2-3"
3760 echo "~^attachment attribute .tattach";\
3761 read es; echo $es;call xerr "$es" "attach 2-4"
3763 echo "~^attachment attribute-at 2";\
3764 read es; echo $es;call xerr "$es" "attach 2-5"
3767 echo "~^attachment attribute-set ./.tattach filename tat";\
3768 read es; echo $es;call xerr "$es" "attach 2-6"
3770 "~^attachment attribute-set .tattach content-description Au2";\
3771 read es; echo $es;call xerr "$es" "attach 2-7"
3772 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
3773 read es; echo $es;call xerr "$es" "attach 2-8"
3775 "~^attachment attribute-set-at 2 content-type application/x-sh";\
3776 read es; echo $es;call xerr "$es" "attach 2-9"
3778 echo "~^attachment attribute ./.tattach";\
3779 read es; echo $es;call xerr "$es" "attach 2-10"
3781 echo "~^attachment attribute .tattach";\
3782 read es; echo $es;call xerr "$es" "attach 2-11"
3784 echo "~^attachment attribute tat";\
3785 read es; echo $es;call xerr "$es" "attach 2-12"
3787 echo "~^attachment attribute-at 2";\
3788 read es; echo $es;call xerr "$es" "attach 2-13"
3792 if [ "$t_remove" == "" ]
3796 echo "~^attachment remove ./.treadctl"; read es;\
3797 call xerr $es "attach 3-1"
3798 echo "~^attachment remove ./.tattach"; read es;\
3799 call xerr $es "attach 3-2"
3800 echo "~^ attachment remove ./.treadctl"; read es;\
3801 vput vexpr es substr $es 0 3
3803 xcall bail "attach 3-3"
3805 echo "~^ attachment remove ./.tattach"; read es;\
3806 vput vexpr es substr $es 0 3
3808 xcall bail "attach 3-4"
3810 echo "~^attachment list"; read es;\
3811 vput vexpr es substr $es 0 3
3813 xcall bail "attach 3-5"
3817 echo "~^attachment insert ./.tattach=latin1";\
3818 read hl; echo $hl; call xerr "$hl" "attach 4-1"
3819 echo "~^attachment insert ./.tattach=latin1";\
3820 read hl; echo $hl; call xerr "$hl" "attach 4-2"
3821 echo "~^attachment list";\
3822 read es; echo $es;call xerr "$es" "attach 4-3"
3824 echo "~^ attachment remove .tattach"; read es;\
3825 vput vexpr es substr $es 0 3
3827 xcall bail "attach 4-4 $es"
3829 echo "~^attachment remove-at T"; read es;\
3830 vput vexpr es substr $es 0 3
3832 xcall bail "attach 4-5"
3834 echo "~^attachment remove ./.tattach"; read es;\
3835 call xerr $es "attach 4-6"
3836 echo "~^attachment remove ./.tattach"; read es;\
3837 call xerr $es "attach 4-7"
3838 echo "~^ attachment remove ./.tattach"; read es;\
3839 vput vexpr es substr $es 0 3
3841 xcall bail "attach 4-8 $es"
3843 echo "~^attachment list"; read es;\
3844 vput vexpr es substr $es 0 3
3846 xcall bail "attach 4-9"
3850 echo "~^attachment insert ./.tattach=latin1";\
3851 read hl; echo $hl; call xerr "$hl" "attach 5-1"
3852 echo "~^attachment insert ./.tattach=latin1";\
3853 read hl; echo $hl; call xerr "$hl" "attach 5-2"
3854 echo "~^attachment insert ./.tattach=latin1";\
3855 read hl; echo $hl; call xerr "$hl" "attach 5-3"
3856 echo "~^attachment list";\
3857 read es; echo $es;call xerr "$es" "attach 5-4"
3860 echo "~^attachment remove-at 3"; read es;\
3861 call xerr $es "attach 5-5"
3862 echo "~^attachment remove-at 3"; read es;\
3863 vput vexpr es substr $es 0 3
3865 xcall bail "attach 5-6"
3867 echo "~^attachment remove-at 2"; read es;\
3868 call xerr $es "attach 5-7"
3869 echo "~^attachment remove-at 2"; read es;\
3870 vput vexpr es substr $es 0 3
3872 xcall bail "attach 5-8"
3874 echo "~^attachment remove-at 1"; read es;\
3875 call xerr $es "attach 5-9"
3876 echo "~^attachment remove-at 1"; read es;\
3877 vput vexpr es substr $es 0 3
3879 xcall bail "attach 5-10"
3882 echo "~^attachment list"; read es;\
3883 vput vexpr es substr $es 0 3
3885 xcall bail "attach 5-11"
3889 echo "~^attachment insert ./.tattach=latin1";\
3890 read hl; echo $hl; call xerr "$hl" "attach 6-1"
3891 echo "~^attachment insert ./.tattach=latin1";\
3892 read hl; echo $hl; call xerr "$hl" "attach 6-2"
3893 echo "~^attachment insert ./.tattach=latin1";\
3894 read hl; echo $hl; call xerr "$hl" "attach 6-3"
3895 echo "~^attachment list";\
3896 read es; echo $es;call xerr "$es" "attach 6-4"
3899 echo "~^attachment remove-at 1"; read es;\
3900 call xerr $es "attach 6-5"
3901 echo "~^attachment remove-at 1"; read es;\
3902 call xerr $es "attach 6-6"
3903 echo "~^attachment remove-at 1"; read es;\
3904 call xerr $es "attach 6-7"
3905 echo "~^attachment remove-at 1"; read es;\
3906 vput vexpr es substr $es 0 3
3908 xcall bail "attach 6-8"
3911 echo "~^attachment list"; read es;\
3912 vput vexpr es substr $es 0 3
3914 xcall bail "attach 6-9"
3926 echo on-compose-enter, mailx-command<$mailx-command>
3927 alternates alter1@exam.ple alter2@exam.ple
3929 set autocc='alter1@exam.ple alter2@exam.ple'
3930 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3931 echo mailx-subject<$mailx-subject>
3932 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3933 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3934 mailx-raw-bcc<$mailx-raw-bcc>
3935 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3936 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3939 echo on-compose-leave, mailx-command<$mailx-command>
3941 eval alternates $al alter3@exam.ple alter4@exam.ple
3943 set autobcc='alter3@exam.ple alter4@exam.ple'
3944 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3945 echo mailx-subject<$mailx-subject>
3946 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3947 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3948 mailx-raw-bcc<$mailx-raw-bcc>
3949 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3950 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3953 echo on-compose-cleanup, mailx-command<$mailx-command>
3956 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
3957 echo mailx-subject<$mailx-subject>
3958 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
3959 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
3960 mailx-raw-bcc<$mailx-raw-bcc>
3961 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
3962 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
3964 wysh set on-compose-splice=t_ocs \
3965 on-compose-enter=t_oce on-compose-leave=t_ocl \
3966 on-compose-cleanup=t_occ
3969 printf 'm this-goes@nowhere\nbody\n!.\n' |
3970 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3971 -X'source ./.trc' -Smta=.
/.tmta.sh \
3973 ${cat} .
/.tall
>> "${MBOX}"
3974 check
1 0 "${MBOX}" '2481823179 10101'
3977 printf 'm this-goes@nowhere\nbody\n!.\n' |
3978 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
3979 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh \
3981 ${cat} .
/.tall
>> "${MBOX}"
3982 check
2 0 "${MBOX}" '3654000499 12535'
3986 # Some state machine stress, shell compose hook, localopts for hook, etc.
3987 # readctl in child. ~r as HERE document
3989 printf 'm ex@am.ple\nbody\n!.
3990 echon ${mailx-command}${mailx-subject}
3991 echon ${mailx-from}${mailx-sender}
3992 echon ${mailx-to}${mailx-cc}${mailx-bcc}
3993 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
3994 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
3995 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
3996 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4000 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4003 vput vexpr es substr "$1" 0 1
4008 define read_mline_res {
4009 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4010 echo $len/$es/$^ERRNAME: $hl
4011 if [ $es -ne $^ERR-NONE ]
4012 xcall bail read_mline_res
4014 \xcall read_mline_res
4018 vput vexpr i + 1 "$2"
4020 vput vexpr j % $i 10
4027 eval \\$j _work $1 $i
4030 vput vexpr i + $i "$1"
4034 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
4035 echo read:$es/$en: $line
4036 if [ "${es}" -ne -1 ]
4039 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
4044 echo "~^header list"; read hl; echo $hl;\
4045 vput vexpr es substr "$hl" 0 1
4047 xcall bail "header list"
4050 call _work 1; echo $?
4051 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
4052 read es; echo $es; vput vexpr es substr "$es" 0 1
4054 xcall bail "be diet"
4056 echo "~^header insert cc <splice2@exam.ple>";\
4057 read es; echo $es; vput vexpr es substr "$es" 0 1
4059 xcall bail "be diet2"
4062 call _work 2; echo $?
4063 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
4064 read es; echo $es;vput vexpr es substr "$es" 0 1
4066 xcall bail "be juicy"
4068 echo "~^header insert bcc juice2@exam.ple";\
4069 read es; echo $es;vput vexpr es substr "$es" 0 1
4071 xcall bail "be juicy2"
4073 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
4074 read es; echo $es;vput vexpr es substr "$es" 0 1
4076 xcall bail "be juicy3"
4078 echo "~^header insert bcc juice4@exam.ple";\
4079 read es; echo $es;vput vexpr es substr "$es" 0 1
4081 xcall bail "be juicy4"
4084 echo "~^header remove-at bcc 3";\
4085 read es; echo $es;vput vexpr es substr "$es" 0 1
4087 xcall bail "remove juicy5"
4089 echo "~^header remove-at bcc 2";\
4090 read es; echo $es;vput vexpr es substr "$es" 0 1
4092 xcall bail "remove juicy6"
4094 echo "~^header remove-at bcc 3";\
4095 read es; echo $es;vput vexpr es substr "$es" 0 3
4097 xcall bail "failed to remove-at"
4099 # Add duplicates which ought to be removed!
4100 echo "~^header insert bcc juice4@exam.ple";\
4101 read es; echo $es;vput vexpr es substr "$es" 0 1
4103 xcall bail "be juicy4-1"
4105 echo "~^header insert bcc juice4@exam.ple";\
4106 read es; echo $es;vput vexpr es substr "$es" 0 1
4108 xcall bail "be juicy4-2"
4110 echo "~^header insert bcc juice4@exam.ple";\
4111 read es; echo $es;vput vexpr es substr "$es" 0 1
4113 xcall bail "be juicy4-3"
4118 call _work 3; echo $?
4120 vput ! i echo just knock if you can hear me;\
4122 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
4124 echon shell-cmd says $?/$^ERRNAME: $i
4125 echo "~x will not become interpreted, we are reading until __EOT"
4127 read r_status; echo "~~r status output: $r_status"
4128 echo "~:echo $? $! $^ERRNAME"
4130 echo "~~r status from parent: $r_status"
4133 call _work 4; echo $?
4134 vput cwd cwd;echo cwd:$?
4135 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
4139 call _work 5; echo $?
4140 echo "~^header show MAILX-Command"; read es;\
4141 call xerr $es "t_header 1000"; call read_mline_res
4142 echo "~^header show MAILX-raw-TO"; read es;\
4143 call xerr $es "t_header 1001"; xcall read_mline_res
4145 echoerr IT IS WRONG IF YOU SEE THIS
4148 echo on-compose-enter, mailx-command<$mailx-command>
4149 set t_oce autobcc=oce@exam.ple
4150 alternates alter1@exam.ple alter2@exam.ple
4152 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4153 echo mailx-subject<$mailx-subject>
4154 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4155 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4156 mailx-raw-bcc<$mailx-raw-bcc>
4157 echo mailx-orig-from<$mailx-orig-from> \
4158 mailx-orig-to<$mailx-orig-to> \
4159 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4162 echo on-compose-leave, mailx-command<$mailx-command>
4163 set t_ocl autocc=ocl@exam.ple
4165 alternates alter3@exam.ple alter4@exam.ple
4167 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4168 echo mailx-subject<$mailx-subject>
4169 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4170 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4171 mailx-raw-bcc<$mailx-raw-bcc>
4172 echo mailx-orig-from<$mailx-orig-from> \
4173 mailx-orig-to<$mailx-orig-to> \
4174 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4177 echo on-compose-cleanup, mailx-command<$mailx-command>
4178 set t_occ autocc=occ@exam.ple
4181 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4182 echo mailx-subject<$mailx-subject>
4183 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4184 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4185 mailx-raw-bcc<$mailx-raw-bcc>
4186 echo mailx-orig-from<$mailx-orig-from> \
4187 mailx-orig-to<$mailx-orig-to> \
4188 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4190 wysh set on-compose-splice=t_ocs \
4191 on-compose-splice-shell="read ver;echo t_ocs-shell;\
4192 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
4193 on-compose-enter=t_oce on-compose-leave=t_ocl \
4194 on-compose-cleanup=t_occ
4197 ${cat} .
/.tnotes
>> "${MBOX}"
4198 check
3 - "${MBOX}" '679526364 2431'
4200 # Reply, forward, resend, Resend
4208 set from="du <f2@z>" stealthmua=noagent
4212 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Snomemdebug -Sescape=!
4215 echo start: $? $! $^ERRNAME
4217 echo File: $? $! $^ERRNAME;echo;echo
4219 this is content of reply 1
4221 echo reply 1: $? $! $^ERRNAME;echo;echo
4223 this is content of Reply 1 2
4225 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
4226 forward 1 fwdex@am.ple
4227 this is content of forward 1
4229 echo forward 1: $? $! $^ERRNAME;echo;echo
4230 wysh set forward-inject-head=$'"'"'-- \\
4231 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
4232 wysh set forward-inject-tail=$'"'"'-- \\
4233 end of forward (%%i) --\\n'"'"'
4234 forward 2 fwdex@am.ple
4235 this is content of forward 2
4237 echo forward 2: $? $! $^ERRNAME;echo;echo
4239 forward 2 fwdex2@am.ple
4240 this is content of forward 2, 2nd, with showname set
4242 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
4243 resend 1 2 resendex@am.ple
4244 echo resend 1 2: $? $! $^ERRNAME;echo;echo
4245 Resend 1 2 Resendex@am.ple
4246 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
4248 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
4252 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4255 vput vexpr es substr "$1" 0 1
4260 define read_mline_res {
4261 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4262 echo mline_res:$len/$es/$^ERRNAME: $hl
4263 if [ $es -ne $^ERR-NONE ]
4264 xcall bail read_mline_res
4266 \xcall read_mline_res
4270 echo "~^header show $1"; read es;\
4271 call xerr $es "work_hl $1"; echo $1; call read_mline_res
4279 echo t_ocs version $ver
4280 echo "~^header list"; read hl; echo $hl;\
4281 echoerr the header list is $hl;\
4282 call xerr "$hl" "header list"
4283 eval vpospar set $hl
4286 echoerr IT IS WRONG IF YOU SEE THIS
4289 echo on-XY-enter, mailx-command<$mailx-command>
4290 set t_oce autobcc=oce@exam.ple
4291 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4292 echo mailx-subject<$mailx-subject>
4293 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4294 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4295 mailx-raw-bcc<$mailx-raw-bcc>
4296 echo mailx-orig-from<$mailx-orig-from> \
4297 mailx-orig-to<$mailx-orig-to> \
4298 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4301 echo on-XY-leave, mailx-command<$mailx-command>
4302 set t_ocl autocc=ocl@exam.ple
4303 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4304 echo mailx-subject<$mailx-subject>
4305 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4306 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4307 mailx-raw-bcc<$mailx-raw-bcc>
4308 echo mailx-orig-from<$mailx-orig-from> \
4309 mailx-orig-to<$mailx-orig-to> \
4310 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4313 echo on-XY-cleanup, mailx-command<$mailx-command>
4314 set t_occ autocc=occ@exam.ple
4315 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4316 echo mailx-subject<$mailx-subject>
4317 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4318 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4319 mailx-raw-bcc<$mailx-raw-bcc>
4320 echo mailx-orig-from<$mailx-orig-from> \
4321 mailx-orig-to<$mailx-orig-to> \
4322 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4324 wysh set on-compose-splice=t_ocs \
4325 on-compose-enter=t_oce on-compose-leave=t_ocl \
4326 on-compose-cleanup=t_occ \
4327 on-resend-enter=t_oce on-resend-cleanup=t_occ
4330 ${cat} .
/.tnotes
>> "${MBOX}"
4331 check
4 - "${MBOX}" '2151712038 11184'
4336 t_C_opt_customhdr
() {
4337 t_prolog C_opt_customhdr
4338 TRAP_EXIT_ADDONS
="./.t*"
4340 t_xmta
'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
4343 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
4344 -C 'C-One : Custom One Body' \
4345 -C 'C-Two:CustomTwoBody' \
4346 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4347 this-goes@nowhere
>.
/.tall
2>&1
4349 ${cat} .
/.tall
>> "${MBOX}"
4350 check
1 0 "${MBOX}" '2400078426 195'
4353 printf 'm this-goes@nowhere\nbody\n!.
4355 m this-goes2@nowhere\nbody2\n!.
4356 set customhdr=%ccustom1 : custom1 body%c
4357 m this-goes2@nowhere\nbody2\n!.
4358 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
4359 m this-goes3@nowhere\nbody3\n!.
4361 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
4362 -C 'C-One : Custom One Body' \
4363 -C 'C-Two:CustomTwoBody' \
4364 -S customhdr
='chdr1: chdr1 body, chdr2:chdr2 body' \
4367 ${cat} .
/.tall
>> "${MBOX}"
4368 check
2 0 "${MBOX}" '3546878678 752'
4373 t_quote_a_cmd_escapes
() {
4374 t_prolog quote_a_cmd_escapes
4375 TRAP_EXIT_ADDONS
="./.t*"
4379 echo 'included file' > .
/.ttxt
4381 ${cat} <<-_EOT > ./.tmbox
4382 From neverneverland Sun Jul 23 13:46:25 2017
4383 Subject: Bugstop: five miles out 1
4384 Reply-To: mister originator1 <mr1@originator>
4385 From: mister originator1 <mr1@originator>
4386 To: bugstop-commit@five.miles.out
4388 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4389 Date: Wed, 19 Jul 2017 09:22:57 -0400
4390 Message-Id: <20170719132257.766AF781267-1@originator>
4393 That's appalling, I.
4395 From neverneverland Sun Jul 23 13:47:25 2017
4396 Subject: Bugstop: five miles out 2
4397 Reply-To: mister originator2 <mr2@originator>
4398 From: mister originator2 <mr2@originator>
4399 To: bugstop-commit@five.miles.out
4401 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4402 Date: Wed, 19 Jul 2017 09:23:57 -0400
4403 Message-Id: <20170719132257.766AF781267-2@originator>
4406 That's appalling, II.
4408 From neverneverland Sun Jul 23 13:48:25 2017
4409 Subject: Bugstop: five miles out 3
4410 Reply-To: mister originator3 <mr3@originator>
4411 From: mister originator3 <mr3@originator>
4412 To: bugstop-commit@five.miles.out
4414 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4415 Date: Wed, 19 Jul 2017 09:24:57 -0400
4416 Message-Id: <20170719132257.766AF781267-3@originator>
4419 That's appalling, III.
4424 set indentprefix=" |"
4431 headerpick type retain cc date from message-id reply-to subject to
4435 set quote=allheaders
4438 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4439 -Sescape=! -Sindentprefix=' >' \
4440 .
/.tmbox
>.
/.tall
2>&1
4442 ${cat} .
/.tall
>> "${MBOX}"
4443 check
1 0 "${MBOX}" '2181726970 2023'
4445 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4448 set Sign=SignVar sign=signvar DEAD=./.ttxt
4449 headerpick type retain Subject
4451 !!1 Not escaped. And shell test last, right before !..
4452 !: echo 2 only echoed via colon
4453 !_ echo 3 only echoed via underscore
4455 !<! echo 5 shell echo included
4456 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4457 7 and 8 are ~A and ~a:
4460 !b 9 added ~b cc <ex1@am.ple>
4461 !c 10 added ~c c <ex2@am.ple>
4468 14: ~f (headerpick: subject)
4472 16, 17: ~I Sign, ~i Sign
4493 set quote-inject-head quote-inject-tail indentprefix
4494 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4498 !:unset quote quote-inject-head quote-inject-tail
4503 24: ~s this new subject
4504 !s 24 did new ~s ubject
4505 !t 25 added ~t o <ex3@am.ple>
4510 and i ~w rite this out to ./.tmsg
4512 !:wysh set x=$escape;set escape=~
4513 ~!echo shell command output
4514 ~:wysh set escape=$x
4516 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4517 -Sescape=! -Sindentprefix=' |' \
4518 .
/.tmbox
>.
/.tall
2>&1
4520 ${cat} .
/.tall
>> "${MBOX}"
4521 check
2 0 "${MBOX}" '2613898218 4090'
4522 check
3 - .
/.tmsg
'2771314896 3186'
4527 t_mass_recipients
() {
4528 t_prolog mass_recipients
4529 TRAP_EXIT_ADDONS
="./.t*"
4531 t_xmta
'Eucalyptus Sat Jul 08 21:14:57 2017'
4533 ${cat} <<'__EOT__' > ./.trc
4535 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4538 wysh set nr=$1 hn=$2
4539 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
4541 xcall bail "ins_addr $hn 1-$nr"
4543 vput vexpr nr + $nr 1
4544 if [ "$nr" -le "$maximum" ]
4545 xcall ins_addr $nr $hn
4549 wysh set nr=$1 hn=$2
4550 alternates $hn$nr@$hn
4551 vput vexpr nr + $nr 2
4552 if [ "$nr" -le "$maximum" ]
4553 xcall bld_alter $nr $hn
4563 if [ "$t_remove" != '' ]
4568 set on-compose-splice=t_ocs on-compose-leave=t_ocl
4571 printf 'm this-goes@nowhere\nbody\n!.\n' |
4572 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4573 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4576 ${cat} .
/.tall
>> "${MBOX}"
4577 check
1 - "${MBOX}" '2912243346 51526'
4580 printf 'm this-goes@nowhere\nbody\n!.\n' |
4581 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4582 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
4585 ${cat} .
/.tall
>> "${MBOX}"
4586 check
2 - "${MBOX}" '4097804632 34394'
4591 t_mime_types_load_control
() {
4592 t_prolog mime_types_load_control
4593 if have_feat uistrings
; then :; else
4594 echo 'mime_types_load_control: unsupported, skipped'
4597 TRAP_EXIT_ADDONS
="./.t*"
4599 ${cat} <<-_EOT > ./.tmts1
4600 @ application/mathml+xml mathml
4602 ${cat} <<-_EOT > ./.tmts2
4603 @ x-conference/x-cooltalk ice
4605 @ application/aga-aga aga
4608 ${cat} <<-_EOT > ./.tmts1.mathml
4609 <head>nonsense ML</head>
4611 ${cat} <<-_EOT > ./.tmts2.ice
4614 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
4615 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
4629 ' "${MBOX}" "${MBOX}" |
4631 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
4634 ${cat} "${MBOX}" >> .
/.tout
4635 check
1 - .
/.tout
'1441260727 2449'
4637 echo type |
${MAILX} ${ARGS} -R \
4638 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
4639 -f "${MBOX}" >> .
/.tout
2>&1
4640 check
2 0 .
/.tout
'1441391438 3646'
4645 t_lreply_futh_rth_etc
() { # TODO *fullnames*!
4646 t_prolog lreply_futh_rth_etc
4647 TRAP_EXIT_ADDONS
="./.t*"
4649 t_xmta
'HumulusLupulus Thu Jul 27 14:41:20 2017'
4651 ${cat} <<-_EOT > ./.tmbox
4652 From neverneverland Sun Jul 23 13:46:25 2017
4653 Subject: Bugstop: five miles out 1
4654 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4655 From: mister originator <mr@originator>
4656 To: bugstop-commit@five.miles.out, laber@backe.eu
4658 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
4659 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
4660 Date: Wed, 19 Jul 2017 09:22:57 -0400
4661 Message-Id: <20170719132257.766AF781267@originator>
4664 > |Sorry, I think I misunderstand something. I would think that
4668 From neverneverland Fri Jul 7 22:39:11 2017
4669 Subject: Bugstop: five miles out 2
4670 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
4671 Content-Transfer-Encoding: 7bit
4672 From: mister originator <mr@originator>
4673 To: bugstop-commit@five.miles.out
4675 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
4676 Date: Fri, 07 Jul 2017 16:33:59 -0400
4679 capable of changing back.
4681 From neverneverland Fri Jul 7 22:42:00 2017
4682 Subject: Bugstop: five miles out 3
4683 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4684 Content-Transfer-Encoding: 7bit
4685 From: mister originator <mr@originator>
4686 To: bugstop-commit@five.miles.out
4688 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
4689 Date: Fri, 07 Jul 2017 16:33:59 -0400
4690 List-Post: <mailto:bugstop@five.miles.out>
4693 are you ready, boots?
4695 From neverneverland Sat Aug 19 23:15:00 2017
4696 Subject: Bugstop: five miles out 4
4697 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
4698 Content-Transfer-Encoding: 7bit
4699 From: mister originator <mr@originator>
4700 To: bugstop@five.miles.out
4702 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
4703 Date: Fri, 07 Jul 2017 16:33:59 -0400
4704 List-Post: <mailto:bugstop@five.miles.out>
4707 are you ready, boots?
4712 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
4713 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
4715 wysh
set m
="This is text of \"reply ${1}."
4726 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
4729 wysh set m="This is text of
\"Reply
${1}.
"
4735 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
4744 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
4748 # We need two indirections for this test: one for the case that Lreply
4749 # fails because of missing recipients: we need to read EOF next, thus
4750 # place this in _Ls last; and second for the succeeding cases EOF is
4751 # not what these should read, so go over the backside and splice it in!
4753 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
4756 localopts call-fixate
yes
4758 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
4759 call L
$1 1; call L
$1 2; call L
$1 3
4762 echo;echo '===== CHANGING === '"$*"' =====';echo
4766 set from
=laber@backe.eu
4769 call tweak
set reply-to-honour
4771 call tweak
set followup-to
4773 call tweak
set followup-to-honour
4775 call tweak mlist bugstop@five.miles.out
4777 call tweak mlsubscribe bugstop@five.miles.out
4779 call tweak
set recipients-in-cc
4784 if have_feat uistrings
; then
4785 check
1 - "${MBOX}" '2950056640 29373'
4787 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
4792 ${cat} <<-_EOT > ./.tmbox
4793 From tom@i-i.example Thu Oct 26 03:15:55 2017
4794 Date: Wed, 25 Oct 2017 21:15:46 -0400
4795 From: tom <tom@i-i.example>
4796 To: Steffen Nurpmeso <steffen@sdaoden.eu>
4797 Cc: tom <tom@i-i.example>
4798 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
4799 Message-ID: <20171026011546.GA11643@i-i.example>
4800 Reply-To: tom@i-i.example
4801 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
4802 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
4805 The report's useful :-)
4808 # Let us test In-Reply-To: removal starts a new thread..
4809 # This needs adjustment of *stealthmua*
4810 argadd
='-Sstealthmua=noagent -Shostname'
4813 printf 'reply 1\nthread\n!.\n' |
4814 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4815 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
4816 check
2 0 "${MBOX}" '3321764338 429'
4817 check
3 - .tall
'4294967295 0'
4819 printf 'reply 1\nnew <- thread!\n!v\n!.\n' |
4820 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4821 -Seditheaders -S VISUAL
="${sed} -i'' -e '/^In-Reply-To:/d'" \
4822 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4823 check
4 0 "${MBOX}" '1682552516 763'
4824 check
5 - .tall
'4294967295 0'
4826 printf 'reply 2\nold <- new <- thread!\n!.\n' |
4827 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4828 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4829 check
6 0 "${MBOX}" '2900984135 1219'
4830 check
7 - .tall
'4294967295 0'
4832 printf 'reply 3\nnew <- old <- new <- thread!\n!v\n!.\n' |
4833 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
4834 -Seditheaders -S VISUAL
="${sed} -i'' -e '/^In-Reply-To:/d'" \
4835 ${argadd} -Rf "${MBOX}" > .tall
2>&1
4836 check
8 0 "${MBOX}" '794031200 1567'
4837 check
9 - .tall
'4294967295 0'
4842 t_mime_if_not_ascii
() {
4843 t_prolog mime_if_not_ascii
4845 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
4846 check 1 0 "${MBOX}" '2287855519 110'
4848 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
4850 check
2 0 "${MBOX}" '70754682 282'
4855 t_xxxheads_rfc2047
() {
4856 t_prolog xxxheads_rfc2047
4857 TRAP_EXIT_ADDONS
="./.t*"
4859 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
4861 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
4862 -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̲' \
4864 check
1 0 "${MBOX}" '3370931614 375'
4866 # Single word (overlong line split -- bad standard! Requires injection of
4867 # artificial data!! But can be prevented by using RFC 2047 encoding)
4869 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
4870 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
4871 check 2 0 "${MBOX}" '489922370 1718'
4873 # Combination of encoded words, space and tabs of varying sort
4875 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4876 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
4877 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
4878 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
4879 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
4880 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
4882 check 3 0 "${MBOX}" '1676887734 591'
4884 # Overlong multibyte sequence that must be forcefully split
4885 # todo This works even before v15.0, but only by accident
4887 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4888 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4889 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
4890 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
4892 check 4 0 "${MBOX}" '3029301775 659'
4896 echo | ${MAILX} ${ARGS} \
4897 -s "1-1 B2 B3 B4 B5 B6 B\
4898 1-2 B2 B3 B4 B5 B6 B\
4899 1-3 B2 B3 B4 B5 B6 B\
4900 1-4 B2 B3 B4 B5 B6 B\
4901 1-5 B2 B3 B4 B5 B6 B\
4902 1-6 B2 B3 B4 B5 B6
" \
4904 check 5 0 "${MBOX}" '4126167195 297'
4906 # Leading and trailing WS
4908 echo | ${MAILX} ${ARGS} \
4909 -s " 2-1 B2 B3 B4 B5 B6 B\
4910 1-2 B2 B3 B4 B5 B6 B\
4911 1-3 B2 B3 B4 B5 B6 B\
4912 1-4 B2 B3 B4 B5 B6
" \
4914 check 6 0 "${MBOX}" '3600624479 236'
4916 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
4918 echo "Dat Früchtchen riecht häußlich
" |
4919 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
4921 'Schnödes "Früchtchen
" <do@du> (Hä!)'
4922 check 7 0 "${MBOX}" '800505986 368'
4924 # RFC 2047 in an address field, and iconv involved
4925 if have_feat iconv; then
4927 ${cat} > ./.trebox <<_EOT
4928 From zaza@exam.ple Fri Mar 2 21:31:56 2018
4929 Date: Fri, 2 Mar 2018 20:31:45 +0000
4930 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
4931 To: dude <dude@exam.ple>
4932 Subject: houston(...)
4933 Message-ID: <abra@1>
4935 Content-Type: text/plain; charset=iso-8859-1
4936 Content-Disposition: inline
4937 Content-Transfer-Encoding: 8bit
4940 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4941 -Sfullnames -Sreply-in-same-charset \
4942 -Smta=./.tmta.sh -Rf ./.trebox
4943 check 8 0 "${MBOX}" '2914485741 280'
4945 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
4953 TRAP_EXIT_ADDONS=".
/.t
*"
4956 mkdir ./.ttt || exit 1
4960 : > 'diet\ is \curd.txt'
4961 : > 'diet "is
" curd.txt'
4963 : > 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
4964 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
4965 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
4966 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
4968 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
4969 -a ".
/.ttt
/ma
'ger.txt" -a "./.ttt/mä'ger.txt
" \
4970 -a './.ttt/diet\ is \curd.txt' -a './.ttt/diet "is
" curd.txt' \
4971 -a ./.ttt/höde-tröge.txt \
4972 -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 \
4973 -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 \
4974 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
4975 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
4977 check 1 0 "${MBOX}" '684985954 3092'
4979 # `resend' test, reusing $MBOX
4980 printf "Resend .
/.t2
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
4981 check
2 0 .
/.t2
'684985954 3092'
4983 printf "resend ./.t3\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
4984 check 3 0 ./.t3 '3130352658 3148'
4989 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
4990 t_prolog iconv_mbyte_base64
4991 TRAP_EXIT_ADDONS=".
/.t
*"
4993 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
4994 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
4995 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
4998 echo 'iconv_mbyte_base64: unsupported, skipped'
5002 echo 'iconv_mbyte_base64: unsupported, skipped'
5006 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
5008 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
5009 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5011 -Sescape=! -Smime-encoding=base64 2>./.terr
5012 set ttycharset=utf-8 sendcharsets=iso-2022-jp
5014 !s Japanese from UTF-8 to ISO-2022-JP
5015 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
5017 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5020 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5022 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
5025 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
5027 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
5028 \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
5030 \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
5033 \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
5035 \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
5038 # May not presume iconv output as long as roundtrip possible [489a7122]
5040 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
5041 < "${MBOX}" > .
/.tcksum
5042 check
1 - .
/.tcksum
'2694609714 520'
5043 check
2 - .
/.terr
'4294967295 0'
5045 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
5046 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5047 -S headline
="%>%a%m %-18f %-16d %i%-s" \
5048 -Rf "${MBOX}" >.
/.tlog
2>&1
5049 check
3 0 .
/.twrite
'1259742080 686'
5050 #check 4 - ./.tlog '3214068822 2123'
5051 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
5052 check
4 - .
/.txlog
'3659773472 2035'
5054 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
5057 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
5058 rm -f "${MBOX}" .
/.twrite
5059 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5061 -Sescape=! -Smime-encoding=base64
2>.
/.terr
5062 set ttycharset
=utf-8 sendcharsets
=euc-jp
5064 !s Japanese from UTF-8 to EUC-JP
5065 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
5067 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5070 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
5072 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
5075 set ttycharset
=EUC-JP sendcharsets
=utf-8
5077 !s Japanese from EUC-JP to UTF-8
5078 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
5080 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
5083 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
5085 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
5089 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
5090 < "${MBOX}" > .
/.tcksum
5091 check
5 - .
/.tcksum
'2870183985 473'
5092 check
6 - .
/.terr
'4294967295 0'
5094 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
5095 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
5096 -S headline
="%>%a%m %-18f %-16d %i%-s" \
5097 -Rf "${MBOX}" >.
/.tlog
2>&1
5098 check
7 0 .
/.twrite
'1259742080 686'
5099 #check 8 - ./.tlog '2506063395 2075'
5100 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
5101 check
8 - .
/.txlog
'2528199891 1988'
5103 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
5109 t_iconv_mainbody
() {
5110 t_prolog iconv_mainbody
5111 TRAP_EXIT_ADDONS
="./.t*"
5113 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
5116 echo 'iconv_mainbody: unsupported, skipped'
5120 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
5122 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
5123 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
5124 -s '–' over-the@rain.bow
2>.
/.terr
5125 check
1 0 "${MBOX}" '3634015017 251'
5126 check
2 - .
/.terr
'4294967295 0'
5128 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
5129 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
5130 -s '–' over-the@rain.bow
2>.
/.terr
5132 check
3 - "${MBOX}" '3634015017 251'
5133 if have_feat uistrings
; then
5134 if have_feat docstrings
; then # xxx should not be like that
5135 check
4 - .
/.terr
'2579894983 148'
5137 check
4 - .
/.terr
'271380835 121'
5140 echo 'iconv_mainbody-4: unsupported, skipped'
5143 # The different iconv(3) implementations use different replacement sequence
5144 # types (character-wise, byte-wise, and the character(s) used differ)
5145 i
="${MAILX_ICONV_MODE}"
5146 if [ -n "${i}" ]; then
5147 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
5149 check_ex0 5-1-estat ${j}
5150 check 5-1 - ./.terr '4294967295 0'
5151 if [ ${i} -eq 13 ]; then
5152 check 5-2 - ./.tout '189327996 283'
5153 elif [ ${i} -eq 12 ]; then
5154 check 5-3 - ./.tout '1959197095 283'
5155 elif [ ${i} -eq 3 ]; then
5156 check 5-4 - ./.tout '3196380198 279'
5158 check 5-5 - ./.tout '3760313827 279'
5161 echo 'iconv_mainbody-5: unsupported, skipped'
5167 t_binary_mainbody() {
5168 t_prolog binary_mainbody
5169 TRAP_EXIT_ADDONS=".
/.t
*"
5171 printf 'abra\0\nka\r\ndabra' |
5172 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
5174 check 1 0 "${MBOX}" '2430168141 243'
5175 check 2 - ./.terr '4294967295 0'
5177 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
5178 ${MAILX} ${ARGS} -Rf \
5179 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
5180 "${MBOX}" >./.tall 2>&1
5181 check 3 0 ./.tall '1151843761 324'
5182 check 4 - ./.tcat '3817108933 15'
5183 check 5 - ./.twrite '3817108933 15'
5189 t_prolog q_t_etc_opts
5190 TRAP_EXIT_ADDONS=".
/.t
*"
5192 # Three tests for MIME encoding and (a bit) content classification.
5193 # At the same time testing -q FILE, < FILE and -t FILE
5194 t__put_body > ./.tin
5196 < ./.tin ${MAILX} ${ARGS} ${ADDARG_UNI} \
5197 -a ./.tin -s "`t__put_subject`" "${MBOX}"
5198 check 1 0 "${MBOX}" '3570973309 6646'
5201 < /dev/null ${MAILX} ${ARGS} ${ADDARG_UNI} \
5202 -a ./.tin -s "`t__put_subject`" -q ./.tin "${MBOX}"
5203 check 2 0 "${MBOX}" '3570973309 6646'
5206 ( echo "To
: ${MBOX}" && echo "Subject
: `t__put_subject`" && echo &&
5208 ) | ${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a ./.tin -t
5209 check 3 0 "${MBOX}" '3570973309 6646'
5211 # Check comments in the header
5213 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
5216 # Noch ein Kommentar
5218 # Nachgestelltes Kommentar
5222 check
4 0 "${MBOX}" '3829967825 128'
5228 have_feat smime ||
{
5229 echo 's_mime: unsupported, skipped'
5234 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5235 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5236 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5238 ${cat} <<-_EOT > ./.t.conf
5241 default_keyfile = keyfile.pem
5242 distinguished_name = req_distinguished_name
5243 attributes = req_attributes
5247 [ req_distinguished_name ]
5254 emailAddress = test@localhost
5259 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5260 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5262 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5265 echo bla |
${MAILX} ${ARGS} \
5266 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5267 -s 'S/MIME test' .
/.VERIFY
5271 /^Content-Description: /{ skip = 2; print; next }
5272 /^$/{ if(skip) --skip }
5275 < .
/.VERIFY
> "${MBOX}"
5276 check
1 - "${MBOX}" '2900817158 648'
5278 printf 'verify\nx\n' |
5279 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5280 -R -f .
/.VERIFY
>>${ERR} 2>&1
5283 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5286 # (signing +) encryption / decryption
5287 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5292 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5293 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5294 -s 'S/MIME test' recei@ver.com
5296 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5297 check
4 - "${MBOX}" '1937410597 327'
5299 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5302 -Ssmime-ca-file=.
/.tcert.pem \
5303 -Ssmime-sign-cert=.
/.tpair.pem \
5304 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5308 /^Content-Description: /{ skip = 2; print; next }
5309 /^$/{ if(skip) --skip }
5312 < .
/.DECRYPT
> "${MBOX}"
5313 check
5 - "${MBOX}" '1720739247 931'
5315 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5316 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5320 echo bla |
${MAILX} ${ARGS} \
5322 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5323 -Sfrom=test@localhost \
5324 -s 'S/MIME test' recei@ver.com
5326 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5327 check
7 - "${MBOX}" '1937410597 327'
5330 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5332 -Ssmime-sign-cert=.
/.tpair.pem \
5333 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5334 check
8 0 "./.DECRYPT" '2624716890 422'
5336 openssl smime
-decrypt -inkey .
/.tkey.pem \
5337 -in .
/.ENCRYPT
>>${ERR} 2>&1
5343 # xxx Note: t_z() was the first test (series) written. Today many
5344 # xxx aspects are (better) covered by other tests above, some are not.
5345 # xxx At some future date and time, convert the last remains not covered
5346 # xxx elsewhere to a real t_* test and drop it
5350 # Test for [260e19d] (Juergen Daubert)
5351 echo body |
${MAILX} ${ARGS} "${MBOX}"
5352 check 4 0 "${MBOX}" '2917662811 98'
5354 # "Test
for" [d6f316a] (Gavin Troy)
5356 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5357 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5358 check
6 0 "${MBOX}" '2099098650 122'
5359 check
6-1 - "${BODY}" '794542938 174'
5361 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5364 for(i = 0; i < 10000; ++i)
5366 #printf "\xF0\x90\x87\x90"
5367 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5368 check 7 0 "${MBOX}" '534262374 61816'
5374 # MIME encoding (QP) stress message subject
5375 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5376 'adadaddsssssssddddddddddddddddddddd'\
5377 'ddddddddddddddddddddddddddddddddddd'\
5378 'ddddddddddddddddddddddddddddddddddd'\
5379 'dddddddddddddddddddd Hallelulja? Od'\
5380 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5381 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5382 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5383 'fffffffffffffffffffffffffffffffffff'\
5384 'fffffffffffffffffffff ggggggggggggg'\
5385 'ggggggggggggggggggggggggggggggggggg'\
5386 'ggggggggggggggggggggggggggggggggggg'\
5387 'ggggggggggggggggggggggggggggggggggg'\
5392 # MIME encoding (QP) stress message body
5394 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5395 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5396 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5397 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5398 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5399 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5400 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5401 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5402 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5403 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5404 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5405 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5406 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5407 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5408 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5409 "auf den zeilen vorher.
\r\n"\
5410 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5412 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5414 "Das waren deren zwei.
\r\n"\
5416 "Die letzte Zeile war ein Leerschritt.
\n"\
5417 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5420 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5422 "Das waren deren zwei. ditto.
\n"\
5424 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5425 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5426 "auf den zeilen vorher.
\n"\
5428 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5429 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5431 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5433 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5435 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5437 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5439 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5441 "QP am Zeilenende über soft-nl hinweg
\n"\
5442 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5444 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5446 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5448 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5450 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5452 "Die letzte Zeile war ein Leerschritt.
\n"\
5457 # Test all configs TODO doesn't cover all *combinations*, stupid!
5461 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5462 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5463 NOTME["OPT_CROSS_BUILD
"] = 1
5464 NOTME["OPT_AUTOCC
"] = 1
5465 NOTME["OPT_AMALGAMATION
"] = 1
5466 NOTME["OPT_DEBUG
"] = 1
5467 NOTME["OPT_DEVEL
"] = 1
5468 NOTME["OPT_ASAN_ADDRESS
"] = 1
5469 NOTME["OPT_ASAN_MEMORY
"] = 1
5470 NOTME["OPT_FORCED_STACKPROT
"] = 1
5471 NOTME["OPT_NOMEMDBG
"] = 1
5472 NOTME["OPT_NYD2
"] = 1
5477 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5478 MULVALS["VAL_IDNA
"] = 1
5480 #VALKEYS[0] = "VAL_RANDOM
"
5481 VALVALS["VAL_RANDOM
"] = 1
5484 /^[[:space:]]*OPT_/{
5485 sub(/^[[:space:]]*/, "")
5486 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5487 # does not seem to be a compliant escape for =
5489 $1 = substr($1, 1, index($1, "=") - 1)
5491 OPTVALS[OPTNO++] = $1
5494 /^[[:space:]]*VAL_/{
5495 sub(/^[[:space:]]*/, "")
5496 val = substr($0, index($0, "=") + 1)
5498 val = substr(val, 2)
5499 val = substr(val, 1, length(val) - 1)
5501 $1 = substr($1, 1, index($1, "=") - 1)
5504 else if(VALVALS[$1]){
5505 VALKEYS[VALNO++] = $1
5510 function onepass(addons){
5511 a_onepass__worker(addons, "1", "0")
5512 a_onepass__worker(addons, "0", "1")
5514 function a_onepass__worker(addons, b0, b1){
5515 # Doing this completely sequentially and not doing make distclean in
5516 # between runs should effectively result in lesser compilations.
5517 # It is completely dumb nonetheless... TODO
5518 for(ono = 0; ono < OPTNO; ++ono){
5520 for(i = 0; i < ono; ++i){
5521 myconf = myconf " " OPTVALS[i] "=" b0 " "
5523 j = MULCHOICE[OPTVALS[i]]
5528 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5532 for(i = ono; i < OPTNO; ++i){
5533 myconf = myconf " " OPTVALS[i] "=" b1 " "
5535 j = MULCHOICE[OPTVALS[i]]
5540 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5546 myconf = VALKEYS[i] "=any
" myconf
5548 myconf = myconf " " ALWAYS " " addons
5553 i = split(MULVALS[mula], ia)
5557 print mula "=\"" j "\" " myconf
5563 # We cannot test NULL because of missing UI strings, which will end
5564 # up with different checksums
5565 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5567 j = split(VALVALS[VALKEYS[i]], ia)
5571 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5574 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5575 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5576 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5578 j = split(VALVALS[VALKEYS[i]], ia)
5582 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5585 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5586 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5588 onepass("OPT_DEBUG
=1")
5591 ' | while read c; do
5592 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5593 printf "\n\n##########\n$c\n"
5594 printf "\n\n##########\n$c\n" >&2
5595 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5596 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5597 printf 'Skipping after config, nothing changed\n'
5598 printf 'Skipping after config, nothing changed\n' >&2
5601 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5604 cd .. && ${MAKE} distclean
5607 [ -n "${ERR}" ] && echo > ${ERR}
5608 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5610 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5611 # if have_feat devel; then
5612 # ARGS="${ARGS} -Smemdebug"
5618 while [ ${#} -gt 0 ]; do
5624 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'