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
='-Sv15-compat -:/ -# -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} | ${sed} -e 's/[ ]\{1,\}/ /g'`"
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}'}'`
286 t_X_opt_input_command_stack
289 t_input_inject_semicolon_seq
309 # MIME and RFC basics
317 # Operational basics with easy tests
325 t_rfc2231
# (after attachments)
326 t_mime_types_load_control
328 # Around state machine, after basics
330 t_quote_a_cmd_escapes
334 # Heavy use of/rely on state machine (behaviour) and basics
337 t_lreply_futh_rth_etc
344 t_X_opt_input_command_stack
() {
345 t_prolog X_opt_input_command_stack
346 TRAP_EXIT_ADDONS
="./.t*"
348 ${cat} <<- '__EOT' > "${BODY}"
356 echo "define mac1 {";\
357 echo " echo mac1-1 via1 \$0";\
359 echo " echo mac1-2";\
361 echo " echo mac1-3";\
364 echo "define mac2 {";\
365 echo " echo mac2-1 via1 \$0";\
367 echo " echo mac2-2";\
373 echo echo 1-1-1 via1 \$0;\
385 # The -X option supports multiline arguments, and those can internally use
386 # reverse solidus newline escaping. And all -X options are joined...
388 < "${BODY}" ${MAILX} ${ARGS} \
403 echo "define mac1 {";\
404 echo " echo mac1-1 via2 \$0";\
406 echo " echo mac1-2";\
408 echo " echo mac1-3";\
411 echo "define mac2 {";\
412 echo " echo mac2-1 via2 \$0";\
414 echo " echo mac2-2";\
420 echo echo 1-1-1 via2 \$0;\
434 check 1 0 "${MBOX}" '1786542668 416'
436 # Test for [8412796a] (n_cmd_arg_parse(): FIX token error -> crash
, e.g.
437 # "-RX 'bind;echo $?' -Xx".., 2018-08-02)
438 if have_feat key-bindings
; then
439 ${MAILX} ${ARGS} -RX'bind;echo $?' -Xx > .
/.tall
2>&1
440 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
441 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
442 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
443 check cmdline
0 .
/.tall
'1867586969 8'
445 echo 'X_opt_input_command_stack-cmdline: unsupported, skipped'
453 if have_feat uistrings
; then :; else
454 echo 'X_errexit: unsupported, skipped'
458 ${cat} <<- '__EOT' > "${BODY}"
464 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
465 -X'echo one' -X' echos nono ' -X'echo two' \
467 check 1 0 "${MBOX}" '916157812 53'
469 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
471 check 2 0 "${MBOX}" '916157812 53'
473 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
475 check
3 0 "${MBOX}" '916157812 53'
479 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
480 -X'echo one' -X' echos nono ' -X'echo two' \
482 check
4 1 "${MBOX}" '2118430867 49'
484 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
486 check 5 1 "${MBOX}" '2118430867 49'
488 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
490 check
6 1 "${MBOX}" '12955965 172'
492 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
494 check 7 1 "${MBOX}" '12955965 172'
496 ## Repeat 4-7 with ignerr set
498 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
500 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
501 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
503 check
8 0 "${BODY}" '916157812 53'
505 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
507 check 9 0 "${BODY}" '916157812 53'
509 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
511 check
10 0 "${BODY}" '916157812 53'
513 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
515 check 11 0 "${BODY}" '916157812 53'
525 # Test basic assumption
526 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
527 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
529 check
1 0 "${MBOX}" '270686329 21'
532 ${cat} <<- '__EOT' > "${BODY}"
537 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
538 -Snoasksub -Sasksub -Snoasksub \
539 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
541 check
2 0 "${MBOX}" '3182942628 37'
543 ${cat} <<- '__EOT' > "${BODY}"
548 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
549 -Snoasksub -Sasksub \
550 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
552 check
3 0 "${MBOX}" '2006554293 39'
555 ${cat} <<- '__EOT' > "${BODY}"
556 echo dietcurd<$dietcurd>
558 echo dietcurd<$dietcurd>
560 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
561 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
562 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
563 -X'echo dietcurd<$dietcurd>' \
565 check
4 0 "${MBOX}" '1985768109 65'
567 ${cat} <<- '__EOT' > "${BODY}"
568 echo dietcurd<$dietcurd>
570 echo dietcurd<$dietcurd>
572 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
573 -Sdietcurd=strawberry
-Snodietcurd \
574 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
575 -X'echo dietcurd<$dietcurd>' \
577 check
5 0 "${MBOX}" '151574279 51'
579 # TODO once we have a detached one with env=1..
580 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
581 echo 's_freeze-{6,7}: shell sets $TERM, skipped'
583 ${cat} <<- '__EOT' > "${BODY}"
584 !echo "shell says TERM<$TERM>"
586 !echo "shell says TERM<$TERM>"
588 !echo "shell says TERM<$TERM>"
590 !echo "shell says TERM<$TERM>"
592 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
593 -STERM=strawberry
-SnoTERM -STERM=vanilla \
594 -X'echo mail<$TERM>' -X'unset TERM' \
595 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
597 check
6 0 "${MBOX}" '1211476036 167'
599 ${cat} <<- '__EOT' > "${BODY}"
600 !echo "shell says TERM<$TERM>"
602 !echo "shell says TERM<$TERM>"
604 !echo "shell says TERM<$TERM>"
606 !echo "shell says TERM<$TERM>"
608 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
609 -STERM=strawberry
-SnoTERM \
610 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
611 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
613 check
7 0 "${MBOX}" '3365080441 132'
620 t_input_inject_semicolon_seq
() {
621 t_prolog input_inject_semicolon_seq
623 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
628 echon this_is_mymac;call mydeepmac;echon ';';
630 echon one';';call mymac;echon two";";call mymac;echo three$';';
632 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
634 echon one';';call mymac;echon two";";call mymac;echo three$';';
637 check 1 0 "${MBOX}" '512117110 140'
645 # XXX the first needs to be checked, it is quite dumb as such
646 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
676 vput shcodec res e abcd
677 echo $?
/$^ERRNAME
$res
680 vput shcodec res d abcd
681 echo $?
/$^ERRNAME
$res
684 vput shcodec res e a
'b'c
'd'
685 echo $?
/$^ERRNAME
$res
688 vput shcodec res d a
'b'c
'd'
689 echo $?
/$^ERRNAME
$res
692 vput shcodec res e a
"b"c
"d"
693 echo $?
/$^ERRNAME
$res
696 vput shcodec res d a
"b"c
"d"
697 echo $?
/$^ERRNAME
$res
700 vput shcodec res e a$
'b'c$
'd'
701 echo $?
/$^ERRNAME
$res
704 vput shcodec res d a$
'b'c$
'd'
705 echo $?
/$^ERRNAME
$res
708 vput shcodec res e
'abcd'
709 echo $?
/$^ERRNAME
$res
712 vput shcodec res d
'abcd'
713 echo $?
/$^ERRNAME
$res
716 vput shcodec res e
"abcd"
717 echo $?
/$^ERRNAME
$res
720 vput shcodec res d
"abcd"
721 echo $?
/$^ERRNAME
$res
724 vput shcodec res e $
'abcd'
725 echo $?
/$^ERRNAME
$res
728 vput shcodec res d $
'abcd'
729 echo $?
/$^ERRNAME
$res
733 vput shcodec res e a b\ c d
734 echo $?
/$^ERRNAME
$res
737 vput shcodec res d a b\ c d
738 echo $?
/$^ERRNAME
$res
739 vput shcodec res e ab
cd
740 echo $?
/$^ERRNAME
$res
743 vput shcodec res d
'ab cd'
744 echo $?
/$^ERRNAME
$res
745 vput shcodec res e a
'b c' d
746 echo $?
/$^ERRNAME
$res
749 vput shcodec res d a
'b c' d
750 echo $?
/$^ERRNAME
$res
751 vput shcodec res e a
"b c" d
752 echo $?
/$^ERRNAME
$res
755 vput shcodec res d a
"b c" d
756 echo $?
/$^ERRNAME
$res
757 vput shcodec res e a $
'b c' d
758 echo $?
/$^ERRNAME
$res
761 vput shcodec res d a $
'b c' d
762 echo $?
/$^ERRNAME
$res
764 vput shcodec res e
'a$`"\'
765 echo $?/$^ERRNAME $res
768 vput shcodec res d 'a$
`"\'
769 echo $?/$^ERRNAME $res
770 vput shcodec res e "a\$\`'\"\\"
771 echo $?/$^ERRNAME $res
774 vput shcodec res d "a\$\`'\"\\"
775 echo $?/$^ERRNAME $res
776 vput shcodec res e $'a\$`\'\"\\'
777 echo $?/$^ERRNAME $res
780 vput shcodec res d $'a\$`\'\"\\'
781 echo $?/$^ERRNAME $res
782 vput shcodec res e $'a\$`\'"\\'
783 echo $?/$^ERRNAME $res
786 vput shcodec res d $'a\$
`\'"\\'
787 echo $?/$^ERRNAME $res
790 vput shcodec res e a${diet}c
791 echo $?/$^ERRNAME $res
794 eval vput shcodec res e a${diet}c
795 echo $?/$^ERRNAME $res
798 vput shcodec res e "a${diet}c"
799 echo $?/$^ERRNAME $res
802 eval vput shcodec res e "a${diet}c"
803 echo $?/$^ERRNAME $res
807 check 1 0 "${MBOX}" '3316745312 1241'
809 if [ -z "${UTF8_LOCALE}" ]; then
810 echo 'Skip shcodec-unicode, no UTF8_LOCALE TODO CANNOT'
812 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
813 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
817 shcodec d $'t\u00E4st'
820 shcodec d $'a\u054Dc'
823 shcodec d $'a\U0001F603c'
825 check unicode 0 "${MBOX}" '4233409480 77'
834 ${cat} <<- '__EOT' > "${BODY}"
853 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
854 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
855 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
857 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
858 echo a$'\u0041\u41\u0C1\U00000041\U41'c
881 echo a$'b\U0000000'dt
882 echo a$'b\U00000000'du
892 if [ -z "${UTF8_LOCALE}" ]; then
893 echo 'Skip wysh-unicode, no UTF8_LOCALE'
895 < "${BODY}" DIET=CURD TIED= \
896 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
897 check unicode 0 "${MBOX}" '475805847 317'
900 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
901 check c 0 "${MBOX}" '1473887148 321'
903 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
904 wysh set mager='\hey\'
906 wysh set mager="\hey\\"
908 wysh set mager=$'\hey\\'
911 check 3 0 "${MBOX}" '1289698238 69'
917 t_prolog commandalias
919 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
920 commandalias echo echo hoho
924 commandalias XxX XxXx
925 commandalias XxXx XxXxX
926 commandalias XxXxX XxXxXx
927 commandalias XxXxXx echo huhu
928 commandalias XxXxXxX echo huhu
930 commandalias XxXxXx XxXxXxX
933 commandalias XxXxXx echo huhu
937 check 1 0 "${MBOX}" '1638809585 36'
945 # Nestable conditions test
946 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
968 if $dietcurd == 'yoho'
973 if $dietcurd @== 'Yoho'
978 if $dietcurd == 'Yoho'
983 if $dietcurd != 'yoho'
988 if $dietcurd @!= 'Yoho'
993 if $dietcurd != 'Yoho'
1054 if $dietcurd == 'yohu
'
1056 elif $dietcurd == 'yoha
'
1058 elif $dietcurd == 'yohe
'
1060 elif $dietcurd == 'yoho
'
1062 if $dietcurd == 'yohu
'
1064 elif $dietcurd == 'yoha
'
1066 elif $dietcurd == 'yohe
'
1068 elif $dietcurd == 'yoho
'
1070 if $dietcurd == 'yohu
'
1072 elif $dietcurd == 'yoha
'
1074 elif $dietcurd == 'yohe
'
1076 elif $dietcurd == 'yoho
'
1132 if $dietcurd @== aBC
1137 if $dietcurd @>= AbC
1142 if $dietcurd @<= ABc
1147 if $dietcurd @>= abd
1152 if $dietcurd @<= abb
1180 if $dietcurd @i=% aB
1225 set diet=abc curd=abc
1231 set diet=abc curd=abcd
1237 # 1. Shitty grouping capabilities as of today
1238 unset diet curd ndefined
1239 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1245 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1250 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1255 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1260 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1265 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1266 && [ no ] || [ yes ]
1271 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1276 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1281 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1286 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1291 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1296 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1301 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1306 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1311 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1316 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1322 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1328 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1333 # 2. Shitty grouping capabilities as of today
1334 unset diet curd ndefined
1335 if [ false || false || true ] && [ false || true ] && yes
1340 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1345 if [ 1 || 0 || 0 || 0 ]
1350 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1355 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1360 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1365 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1370 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1375 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1380 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1385 if 1 || 0 || 0 || 0 && 0
1390 if 1 || 0 || 0 || 0 && 1
1395 if 0 || 0 || 0 || 1 && 0
1400 if 0 || 0 || 0 || 1 && 1
1405 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1410 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1416 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1421 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1427 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1432 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1437 if [ [ [ [ [ [ $diet == 'yo
' && $curd == 'ho
' && $ndefined ] ] ] ] ] ]
1442 # Some more en-braced variables
1444 if ${diet} == ${curd}
1449 if ${diet} != ${curd}
1465 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1470 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1475 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1480 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1485 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1490 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1495 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1500 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1505 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1511 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1516 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1521 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1526 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1531 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1536 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1541 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1546 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1551 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1558 check normal 0 "${MBOX}" '1688759742 719'
1560 if have_feat regex; then
1561 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1563 if $dietcurd =~ '^yo.
*'
1568 if $dietcurd =~ '^Yo.
*'
1573 if $dietcurd @=~ '^Yo.
*'
1578 if $dietcurd =~ '^yOho.
+'
1583 if $dietcurd @!~ '.
*Ho$
'
1588 if $dietcurd !~ '.
+yohO$
'
1593 if [ $dietcurd @i!~ '.
+yoho$
' ]
1598 if ! [ $dietcurd @i=~ '.
+yoho$
' ]
1603 if ! ! [ $dietcurd @i!~ '.
+yoho$
' ]
1608 if ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ]
1613 if [ ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ] ]
1618 if ! [ ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1623 if ! ! ! $dietcurd !~ '.
+yoho$
'
1628 if ! ! ! $dietcurd =~ '.
+yoho$
'
1633 if ! [ ! ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1638 set diet=abc curd='^abc$
'
1644 set diet=abc curd='^abcd$
'
1652 check regex 0 "${MBOX}" '1115671789 95'
1654 printf 'if-regex
: unsupported
, skipped
\n'
1663 # Nestable conditions test
1664 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1679 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1684 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1685 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1694 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1696 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1705 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1712 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1719 echo ----- $1: $2 -> $3 -> $4
1727 call llx 'call off
' on on on
1728 call llx 'call off
' off on on
1729 call llx 'call off
' on off on
1730 call llx 'call off
' on off off
1731 localopts call-fixate on
1732 call llx 'call-fixate on
' on on on
1733 call llx 'call-fixate on
' off on on
1734 call llx 'call-fixate on
' on off on
1735 call llx 'call-fixate on
' on off off
1736 unset x;localopts call on
1737 call llx 'call on
' on on on
1738 call llx 'call on
' off on on
1739 call llx 'call on
' on off on
1740 call llx 'call on
' on off off
1745 check 1 0 "${MBOX}" '4016155249 1246'
1753 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1781 echo ------- global-1 du=$du
1783 echo ------- global-2 du=$du
1786 echo ------- global-3 du=$du
1788 echo ------- global-4 du=$du
1790 echo ------- global-5 du=$du
1793 check 1 0 "${MBOX}" '2411598140 641'
1798 t_macro_param_shift() {
1799 t_prolog macro_param_shift
1801 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1804 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1809 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1810 if [ $# > 1 ] || [ $ignerr == '' ]
1815 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1817 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1821 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1826 call t2 1 you get four args
1827 echo t1.1: $?';' ignerr ($ignerr) should not exist
1828 call t2 1 you get 'three args
'
1829 echo t1.2: $?';' ignerr ($ignerr) should not exist
1830 call t2 1 you 'get two args
'
1831 echo t1.3: $?';' ignerr ($ignerr) should not exist
1832 call t2 1 'you get one arg
'
1833 echo t1.4: $?';' ignerr ($ignerr) should not exist
1834 ignerr call t2 '' 'you get one arg
'
1835 echo t1.5: $?';' ignerr ($ignerr) should not exist
1840 check 1 0 "${MBOX}" '1402489146 1682'
1848 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1849 vput addrcodec res e 1 <doog@def>
1850 echo $?/$^ERRNAME $res
1851 eval vput addrcodec res d $res
1852 echo $?/$^ERRNAME $res
1853 vput addrcodec res e 2 . <doog@def>
1854 echo $?/$^ERRNAME $res
1855 eval vput addrcodec res d $res
1856 echo $?/$^ERRNAME $res
1857 vput addrcodec res e 3 Sauer Dr. <doog@def>
1858 echo $?/$^ERRNAME $res
1859 eval vput addrcodec res d $res
1860 echo $?/$^ERRNAME $res
1861 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1862 echo $?/$^ERRNAME $res
1863 eval vput addrcodec res d $res
1864 echo $?/$^ERRNAME $res
1865 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1866 echo $?/$^ERRNAME $res
1867 eval vput addrcodec res d $res
1868 echo $?/$^ERRNAME $res
1870 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1871 echo $?/$^ERRNAME $res
1872 eval vput addrcodec res d $res
1873 echo $?/$^ERRNAME $res
1874 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1875 echo $?/$^ERRNAME $res
1876 eval vput addrcodec res d $res
1877 echo $?/$^ERRNAME $res
1878 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1879 echo $?/$^ERRNAME $res
1880 eval vput addrcodec res d $res
1881 echo $?/$^ERRNAME $res
1882 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1883 echo $?/$^ERRNAME $res
1884 eval vput addrcodec res d $res
1885 echo $?/$^ERRNAME $res
1886 vput addrcodec res +e 8 \
1887 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1888 echo $?/$^ERRNAME $res
1889 eval vput addrcodec res d $res
1890 echo $?/$^ERRNAME $res
1891 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1892 echo $?/$^ERRNAME $res
1893 eval vput addrcodec res d $res
1894 echo $?/$^ERRNAME $res
1895 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1896 echo $?/$^ERRNAME $res
1897 eval vput addrcodec res d $res
1898 echo $?/$^ERRNAME $res
1899 vput addrcodec res +e 11 (Ma)Braten Dr"." (Heu) <doog@def>
1900 echo $?/$^ERRNAME $res
1901 eval vput addrcodec res d $res
1902 echo $?/$^ERRNAME $res
1903 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1904 echo $?/$^ERRNAME $res
1905 eval vput addrcodec res d $res
1906 echo $?/$^ERRNAME $res
1907 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1908 echo $?/$^ERRNAME $res
1909 eval vput addrcodec res d $res
1910 echo $?/$^ERRNAME $res
1911 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1912 echo $?/$^ERRNAME $res
1913 eval vput addrcodec res d $res
1914 echo $?/$^ERRNAME $res
1915 vput addrcodec res +e 15 \
1916 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1917 echo $?/$^ERRNAME $res
1918 eval vput addrcodec res d $res
1919 echo $?/$^ERRNAME $res
1920 vput addrcodec res +e 16 \
1921 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1922 echo $?/$^ERRNAME $res
1923 eval vput addrcodec res d $res
1924 echo $?/$^ERRNAME $res
1925 vput addrcodec res +e 17 \
1926 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1927 echo $?/$^ERRNAME $res
1928 eval vput addrcodec res d $res
1929 echo $?/$^ERRNAME $res
1930 vput addrcodec res +e 18 \
1931 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1932 echo $?/$^ERRNAME $res
1933 eval vput addrcodec res d $res
1934 echo $?/$^ERRNAME $res
1935 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1936 echo $?/$^ERRNAME $res
1937 eval vput addrcodec res d $res
1938 echo $?/$^ERRNAME $res
1940 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1941 echo $?/$^ERRNAME $res
1942 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1943 echo $?/$^ERRNAME $res
1944 eval vput addrcodec res d $res
1945 echo $?/$^ERRNAME $res
1947 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1948 echo $?/$^ERRNAME $res
1949 eval vput addrcodec res d $res
1950 echo $?/$^ERRNAME $res
1952 vput addrcodec res s \
1953 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1954 echo $?/$^ERRNAME $res
1956 # Fix for [f3852f88]
1957 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot(e)d"
1958 echo $?/$^ERRNAME $res
1959 eval vput addrcodec res d $res
1960 echo $?/$^ERRNAME $res
1961 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot(e)d"
1962 echo $?/$^ERRNAME $res
1963 eval vput addrcodec res d $res
1964 echo $?/$^ERRNAME $res
1967 check 1 0 "${MBOX}" '1047317989 2612'
1969 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1971 mlsubscribe isa2@list
1973 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1974 echo $?/$^ERRNAME $res
1975 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1976 echo $?/$^ERRNAME $res
1977 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1978 echo $?/$^ERRNAME $res
1979 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1980 echo $?/$^ERRNAME $res
1981 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1982 echo $?/$^ERRNAME $res
1983 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1984 echo $?/$^ERRNAME $res
1987 check 2 0 "${MBOX}" '1391779299 104'
1989 if have_feat idna; then
1990 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1991 vput addrcodec res e (heu) <du@blödiän> "stroh" du
1992 echo $?/$^ERRNAME $res
1993 eval vput addrcodec res d $res
1994 echo $?/$^ERRNAME $res
1995 vput addrcodec res e <du@blödiän> du
1996 echo $?/$^ERRNAME $res
1997 eval vput addrcodec res d $res
1998 echo $?/$^ERRNAME $res
1999 vput addrcodec res e du <du@blödiän>
2000 echo $?/$^ERRNAME $res
2001 eval vput addrcodec res d $res
2002 echo $?/$^ERRNAME $res
2003 vput addrcodec res e <du@blödiän>
2004 echo $?/$^ERRNAME $res
2005 eval vput addrcodec res d $res
2006 echo $?/$^ERRNAME $res
2007 vput addrcodec res e du@blödiän
2008 echo $?/$^ERRNAME $res
2009 eval vput addrcodec res d $res
2010 echo $?/$^ERRNAME $res
2013 check idna 0 "${MBOX}" '498775983 326'
2015 printf 'addrcodec-idna
: unsupported
, skipped
\n'
2024 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
2026 vput vexpr res
= 9223372036854775807
2027 echo $?
/$^ERRNAME
$res
2028 vput vexpr res
= 9223372036854775808
2029 echo $?
/$^ERRNAME
$res
2030 vput vexpr res
= u9223372036854775808
2031 echo $?
/$^ERRNAME
$res
2032 vput vexpr res @
= 9223372036854775808
2033 echo $?
/$^ERRNAME
$res
2034 vput vexpr res
= -9223372036854775808
2035 echo $?
/$^ERRNAME
$res
2036 vput vexpr res
= -9223372036854775809
2037 echo $?
/$^ERRNAME
$res
2038 vput vexpr res @
= -9223372036854775809
2039 echo $?
/$^ERRNAME
$res
2040 vput vexpr res
= U9223372036854775809
2041 echo $?
/$^ERRNAME
$res
2044 0b0111111111111111111111111111111111111111111111111111111111111111
2045 echo $?
/$^ERRNAME
$res
2047 S0b1000000000000000000000000000000000000000000000000000000000000000
2048 echo $?
/$^ERRNAME
$res
2050 S0b1000000000000000000000000000000000000000000000000000000000000000
2051 echo $?
/$^ERRNAME
$res
2053 U0b1000000000000000000000000000000000000000000000000000000000000000
2054 echo $?
/$^ERRNAME
$res
2056 0b1000000000000000000000000000000000000000000000000000000000000000
2057 echo $?
/$^ERRNAME
$res
2059 0b1000000000000000000000000000000000000000000000000000000000000000
2060 echo $?
/$^ERRNAME
$res
2062 -0b1000000000000000000000000000000000000000000000000000000000000000
2063 echo $?
/$^ERRNAME
$res
2065 S0b1000000000000000000000000000000000000000000000000000000000000001
2066 echo $?
/$^ERRNAME
$res
2068 S0b1000000000000000000000000000000000000000000000000000000000000001
2069 echo $?
/$^ERRNAME
$res
2071 -0b1000000000000000000000000000000000000000000000000000000000000001
2072 echo $?
/$^ERRNAME
$res
2074 U0b1000000000000000000000000000000000000000000000000000000000000001
2075 echo $?
/$^ERRNAME
$res
2077 vput vexpr res
= 0777777777777777777777
2078 echo $?
/$^ERRNAME
$res
2079 vput vexpr res
= S01000000000000000000000
2080 echo $?
/$^ERRNAME
$res
2081 vput vexpr res @
= S01000000000000000000000
2082 echo $?
/$^ERRNAME
$res
2083 vput vexpr res
= U01000000000000000000000
2084 echo $?
/$^ERRNAME
$res
2085 vput vexpr res
= 01000000000000000000000
2086 echo $?
/$^ERRNAME
$res
2087 vput vexpr res @
= 01000000000000000000000
2088 echo $?
/$^ERRNAME
$res
2089 vput vexpr res
= -01000000000000000000000
2090 echo $?
/$^ERRNAME
$res
2091 vput vexpr res
= S01000000000000000000001
2092 echo $?
/$^ERRNAME
$res
2093 vput vexpr res @
= S01000000000000000000001
2094 echo $?
/$^ERRNAME
$res
2095 vput vexpr res @
= -01000000000000000000001
2096 echo $?
/$^ERRNAME
$res
2097 vput vexpr res
= U01000000000000000000001
2098 echo $?
/$^ERRNAME
$res
2100 vput vexpr res
= 0x7FFFFFFFFFFFFFFF
2101 echo $?
/$^ERRNAME
$res
2102 vput vexpr res
= S0x8000000000000000
2103 echo $?
/$^ERRNAME
$res
2104 vput vexpr res @
= S0x8000000000000000
2105 echo $?
/$^ERRNAME
$res
2106 vput vexpr res
= U0x8000000000000000
2107 echo $?
/$^ERRNAME
$res
2108 vput vexpr res
= 0x8000000000000000
2109 echo $?
/$^ERRNAME
$res
2110 vput vexpr res @
= 0x8000000000000000
2111 echo $?
/$^ERRNAME
$res
2112 vput vexpr res
= -0x8000000000000000
2113 echo $?
/$^ERRNAME
$res
2114 vput vexpr res
= S0x8000000000000001
2115 echo $?
/$^ERRNAME
$res
2116 vput vexpr res @
= S0x8000000000000001
2117 echo $?
/$^ERRNAME
$res
2118 vput vexpr res @
= -0x8000000000000001
2119 echo $?
/$^ERRNAME
$res
2120 vput vexpr res
= u0x8000000000000001
2121 echo $?
/$^ERRNAME
$res
2124 echo $?
/$^ERRNAME
$res
2126 echo $?
/$^ERRNAME
$res
2128 echo $?
/$^ERRNAME
$res
2130 vput vexpr res
+ 0 0
2131 echo $?
/$^ERRNAME
$res
2132 vput vexpr res
+ 0 1
2133 echo $?
/$^ERRNAME
$res
2134 vput vexpr res
+ 1 1
2135 echo $?
/$^ERRNAME
$res
2137 vput vexpr res
+ 9223372036854775807 0
2138 echo $?
/$^ERRNAME
$res
2139 vput vexpr res
+ 9223372036854775807 1
2140 echo $?
/$^ERRNAME
$res
2141 vput vexpr res @
+ 9223372036854775807 1
2142 echo $?
/$^ERRNAME
$res
2143 vput vexpr res
+ 0 9223372036854775807
2144 echo $?
/$^ERRNAME
$res
2145 vput vexpr res
+ 1 9223372036854775807
2146 echo $?
/$^ERRNAME
$res
2147 vput vexpr res @
+ 1 9223372036854775807
2148 echo $?
/$^ERRNAME
$res
2150 vput vexpr res
+ -9223372036854775808 0
2151 echo $?
/$^ERRNAME
$res
2152 vput vexpr res
+ -9223372036854775808 -1
2153 echo $?
/$^ERRNAME
$res
2154 vput vexpr res @
+ -9223372036854775808 -1
2155 echo $?
/$^ERRNAME
$res
2156 vput vexpr res
+ 0 -9223372036854775808
2157 echo $?
/$^ERRNAME
$res
2158 vput vexpr res
+ -1 -9223372036854775808
2159 echo $?
/$^ERRNAME
$res
2160 vput vexpr res @
+ -1 -9223372036854775808
2161 echo $?
/$^ERRNAME
$res
2163 vput vexpr res
- 0 0
2164 echo $?
/$^ERRNAME
$res
2165 vput vexpr res
- 0 1
2166 echo $?
/$^ERRNAME
$res
2167 vput vexpr res
- 1 1
2168 echo $?
/$^ERRNAME
$res
2170 vput vexpr res
- 9223372036854775807 0
2171 echo $?
/$^ERRNAME
$res
2172 vput vexpr res
- 9223372036854775807 -1
2173 echo $?
/$^ERRNAME
$res
2174 vput vexpr res @
- 9223372036854775807 -1
2175 echo $?
/$^ERRNAME
$res
2176 vput vexpr res
- 0 9223372036854775807
2177 echo $?
/$^ERRNAME
$res
2178 vput vexpr res
- -1 9223372036854775807
2179 echo $?
/$^ERRNAME
$res
2180 vput vexpr res
- -2 9223372036854775807
2181 echo $?
/$^ERRNAME
$res
2182 vput vexpr res @
- -2 9223372036854775807
2183 echo $?
/$^ERRNAME
$res
2185 vput vexpr res
- -9223372036854775808 +0
2186 echo $?
/$^ERRNAME
$res
2187 vput vexpr res
- -9223372036854775808 +1
2188 echo $?
/$^ERRNAME
$res
2189 vput vexpr res @
- -9223372036854775808 +1
2190 echo $?
/$^ERRNAME
$res
2191 vput vexpr res
- 0 -9223372036854775808
2192 echo $?
/$^ERRNAME
$res
2193 vput vexpr res
- +1 -9223372036854775808
2194 echo $?
/$^ERRNAME
$res
2195 vput vexpr res @
- +1 -9223372036854775808
2196 echo $?
/$^ERRNAME
$res
2198 vput vexpr res
+ -13 -2
2199 echo $?
/$^ERRNAME
$res
2200 vput vexpr res
- 0 0
2201 echo $?
/$^ERRNAME
$res
2202 vput vexpr res
- 0 1
2203 echo $?
/$^ERRNAME
$res
2204 vput vexpr res
- 1 1
2205 echo $?
/$^ERRNAME
$res
2206 vput vexpr res
- -13 -2
2207 echo $?
/$^ERRNAME
$res
2209 vput vexpr res
* 0 0
2210 echo $?
/$^ERRNAME
$res
2211 vput vexpr res
* 0 1
2212 echo $?
/$^ERRNAME
$res
2213 vput vexpr res
* 1 1
2214 echo $?
/$^ERRNAME
$res
2215 vput vexpr res
* -13 -2
2216 echo $?
/$^ERRNAME
$res
2218 vput vexpr res
/ 0 0
2219 echo $?
/$^ERRNAME
$res
2220 vput vexpr res
/ 0 1
2221 echo $?
/$^ERRNAME
$res
2222 vput vexpr res
/ 1 1
2223 echo $?
/$^ERRNAME
$res
2224 vput vexpr res
/ -13 -2
2225 echo $?
/$^ERRNAME
$res
2227 vput vexpr res
% 0 0
2228 echo $?
/$^ERRNAME
$res
2229 vput vexpr res
% 0 1
2230 echo $?
/$^ERRNAME
$res
2231 vput vexpr res
% 1 1
2232 echo $?
/$^ERRNAME
$res
2233 vput vexpr res
% -13 -2
2234 echo $?
/$^ERRNAME
$res
2237 check numeric
0 "${MBOX}" '960821755 1962'
2239 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2240 vput vexpr res find 'bananarama' 'nana'
2241 echo $?/$^ERRNAME :$res:
2242 vput vexpr res find 'bananarama' 'bana'
2243 echo $?/$^ERRNAME :$res:
2244 vput vexpr res find 'bananarama' 'Bana'
2245 echo $?/$^ERRNAME :$res:
2246 vput vexpr res find 'bananarama' 'rama'
2247 echo $?/$^ERRNAME :$res:
2249 vput vexpr res ifind 'bananarama' 'nana'
2250 echo $?/$^ERRNAME :$res:
2251 vput vexpr res ifind 'bananarama' 'bana'
2252 echo $?/$^ERRNAME :$res:
2253 vput vexpr res ifind 'bananarama' 'Bana'
2254 echo $?/$^ERRNAME :$res:
2255 vput vexpr res ifind 'bananarama' 'rama'
2256 echo $?/$^ERRNAME :$res:
2258 vput vexpr res substring 'bananarama' 1
2259 echo $?/$^ERRNAME :$res:
2260 vput vexpr res substring 'bananarama' 3
2261 echo $?/$^ERRNAME :$res:
2262 vput vexpr res substring 'bananarama' 5
2263 echo $?/$^ERRNAME :$res:
2264 vput vexpr res substring 'bananarama' 7
2265 echo $?/$^ERRNAME :$res:
2266 vput vexpr res substring 'bananarama' 9
2267 echo $?/$^ERRNAME :$res:
2268 vput vexpr res substring 'bananarama' 10
2269 echo $?/$^ERRNAME :$res:
2270 vput vexpr res substring 'bananarama' 1 3
2271 echo $?/$^ERRNAME :$res:
2272 vput vexpr res substring 'bananarama' 3 3
2273 echo $?/$^ERRNAME :$res:
2274 vput vexpr res substring 'bananarama' 5 3
2275 echo $?/$^ERRNAME :$res:
2276 vput vexpr res substring 'bananarama' 7 3
2277 echo $?/$^ERRNAME :$res:
2278 vput vexpr res substring 'bananarama' 9 3
2279 echo $?/$^ERRNAME :$res:
2280 vput vexpr res substring 'bananarama' 10 3
2281 echo $?/$^ERRNAME :$res:
2283 vput vexpr res substring 'bananarama' -1
2284 echo $?/$^ERRNAME :$res:
2285 vput vexpr res substring 'bananarama' -3
2286 echo $?/$^ERRNAME :$res:
2287 vput vexpr res substring 'bananarama' -5
2288 echo $?/$^ERRNAME :$res:
2289 vput vexpr res substring 'bananarama' -7
2290 echo $?/$^ERRNAME :$res:
2291 vput vexpr res substring 'bananarama' -9
2292 echo $?/$^ERRNAME :$res:
2293 vput vexpr res substring 'bananarama' -10
2294 echo $?/$^ERRNAME :$res:
2295 vput vexpr res substring 'bananarama' 1 -3
2296 echo $?/$^ERRNAME :$res:
2297 vput vexpr res substring 'bananarama' 3 -3
2298 echo $?/$^ERRNAME :$res:
2299 vput vexpr res substring 'bananarama' 5 -3
2300 echo $?/$^ERRNAME :$res:
2301 vput vexpr res substring 'bananarama' 7 -3
2302 echo $?/$^ERRNAME :$res:
2303 vput vexpr res substring 'bananarama' 9 -3
2304 echo $?/$^ERRNAME :$res:
2305 vput vexpr res substring 'bananarama' 10 -3
2306 echo $?/$^ERRNAME :$res:
2308 vput vexpr res trim 'Cocoon Cocoon'
2309 echo $?/$^ERRNAME :$res:
2310 vput vexpr res trim ' Cocoon Cocoon '
2311 echo $?/$^ERRNAME :$res:
2312 vput vexpr res trim-front 'Cocoon Cocoon'
2313 echo $?/$^ERRNAME :$res:
2314 vput vexpr res trim-front ' Cocoon Cocoon '
2315 echo $?/$^ERRNAME :$res:
2316 vput vexpr res trim-end 'Cocoon Cocoon'
2317 echo $?/$^ERRNAME :$res:
2318 vput vexpr res trim-end ' Cocoon Cocoon '
2319 echo $?/$^ERRNAME :$res:
2322 check string 0 "${MBOX}" '3182004322 601'
2324 if have_feat regex; then
2325 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2326 vput vexpr res regex
'bananarama' 'nana'
2327 echo $?
/$^ERRNAME
:$res:
2328 vput vexpr res regex
'bananarama' 'bana'
2329 echo $?
/$^ERRNAME
:$res:
2330 vput vexpr res regex
'bananarama' 'Bana'
2331 echo $?
/$^ERRNAME
:$res:
2332 vput vexpr res regex
'bananarama' 'rama'
2333 echo $?
/$^ERRNAME
:$res:
2335 vput vexpr res iregex
'bananarama' 'nana'
2336 echo $?
/$^ERRNAME
:$res:
2337 vput vexpr res iregex
'bananarama' 'bana'
2338 echo $?
/$^ERRNAME
:$res:
2339 vput vexpr res iregex
'bananarama' 'Bana'
2340 echo $?
/$^ERRNAME
:$res:
2341 vput vexpr res iregex
'bananarama' 'rama'
2342 echo $?
/$^ERRNAME
:$res:
2344 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2345 echo $?
/$^ERRNAME
:$res:
2346 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2347 echo $?
/$^ERRNAME
:$res:
2348 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2349 echo $?
/$^ERRNAME
:$res:
2350 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2351 echo $?
/$^ERRNAME
:$res:
2353 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2354 echo $?
/$^ERRNAME
:$res:
2355 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2356 echo $?
/$^ERRNAME
:$res:
2357 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2358 echo $?
/$^ERRNAME
:$res:
2359 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2360 echo $?
/$^ERRNAME
:$res:
2364 check regex
0 "${MBOX}" '3270360157 311'
2366 printf 'vexpr-regex: unsupported, skipped\n'
2375 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2380 vput vexpr j '&' $i 7
2386 vput vexpr j '&' $i 7
2392 echo ! The end for $1
2396 # Transport $?/$! up the call chain
2402 wysh set i=$? j=$! k=$^ERRNAME
2406 echo ! The end for $1
2407 return $i $^ERR-BUSY
2411 # Up and down it goes
2418 vput vexpr k - $1 $2
2422 echo "# <$i/$j> .. "
2426 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2429 echo ! The end
for $1=$i/$2
2433 return $i $^ERR-BUSY
2439 call w1
0; echo ?
=$?
!=$
!; echo -----;
2440 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2441 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2444 check
1 0 "${MBOX}" '1572045517 5922'
2452 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2457 vput vexpr j '&' $i 7
2463 echo ! The end for $1/$2
2465 return $i $^ERR-BUSY
2476 echo ?=$? !=$^ERRNAME
2479 echo ?=$? !=$^ERRNAME
2481 echo ?=$? !=$^ERRNAME
2484 check 1 0 "${MBOX}" '2401702082 23801'
2488 if have_feat uistrings; then
2489 ${cat} <<- '__EOT' > "${BODY}"
2494 vput vexpr j '&' $i 7
2500 echo ! The end for $1
2503 echo would be err with errexit
2512 echo zwei, ?=$? !=$!
2513 localopts yes; set errexit
2515 echo drei, ?=$? !=$^ERRNAME
2517 echo vier, ?=$? !=$^ERRNAME, this is an error
2520 echo outer 1, ?=$? !=$^ERRNAME
2522 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2524 echo outer 3, ?=$? !=$^ERRNAME
2525 echo this is definitely an error
2528 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2529 -Snomemdebug > "${MBOX}" 2>&1
2530 check
2 0 "${MBOX}" '3900716531 4200'
2532 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2533 -Snomemdebug > "${MBOX}" 2>&1
2534 check 3 1 "${MBOX}" '1006776201 2799'
2536 echo 'xcall-2: unsupported, skipped'
2537 echo 'xcall-3: unsupported, skipped'
2546 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2547 vpospar
set hey
, "'you ", world
!
2548 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2549 vput vpospar x quote
; echo x
<$x>
2550 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2551 vput vpospar y quote
;echo y
<$y>
2552 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2553 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2554 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2557 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2558 vput vpospar z quote
;echo infun2
:z
<$z>
2562 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2563 vput vpospar y quote
;echo infun
:y
<$y>
2564 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2565 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2567 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2568 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2571 call infun This
"in a" fun
2572 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2573 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2575 check
1 0 "${MBOX}" '155175639 866'
2578 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2580 echo ifs<$ifs> ifs-ws<$ifs-ws>
2581 vpospar set hey, "'you ", world!
2582 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2583 vput vpospar x quote; echo x<$x>
2584 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2585 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2588 echo ifs<$ifs> ifs-ws<$ifs-ws>
2589 vpospar set hey, "'you
", world!
2590 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2592 vput vpospar x quote; echo x<$x>
2593 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2594 eval vpospar set ${x};\
2595 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2598 echo ifs<$ifs> ifs-ws<$ifs-ws>
2599 vpospar set hey, "'you ", world!
2600 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2602 vput vpospar x quote; echo x<$x>
2603 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2604 eval vpospar set ${x};\
2605 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2607 check ifs 0 "${MBOX}" '2015927702 706'
2614 TRAP_EXIT_ADDONS="./.t*"
2616 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2619 printf " (1/$#: <$1>)"
2621 if [ $# -gt 0 ]; then
2635 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2636 printf xxx;xxx arg ,b u.
2637 printf xxx;xxx arg , .
2638 printf xxx;xxx arg ,ball.
2644 echon " (1/$#: <$1>)"
2659 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2660 echon xxx;call xxx arg ,b u.
2661 echon xxx;call xxx arg , .
2662 echon xxx;call xxx arg ,ball.
2665 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2666 check 1 0 "${MBOX}" '41566293 164'
2668 #${SHELL} ./.t.sh > ./.tshout 2>&1
2669 #check disproof-1 0 ./.tshout '41566293 164'
2676 TRAP_EXIT_ADDONS="./.t*"
2678 ${cat} <<- '__EOT
' > .tin
2679 hey1, "'you
", world!
2680 hey2, "'you ", bugs bunny!
2685 ${cat} <<- '__EOT
' |\
2686 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2688 echo $?/$^ERRNAME / <$a><$b><$c>
2690 echo $?/$^ERRNAME / <$a><$b><$c>
2692 echo $?/$^ERRNAME / <$a><$b><$c>
2694 echo $?/$^ERRNAME / <$a><$b><$c>
2695 unset a b c;read a b c
2696 echo $?/$^ERRNAME / <$a><$b><$c>
2697 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2699 check 1 0 "${MBOX}" '1527910147 173'
2701 ${cat} <<- '__EOT
' > .tin2
2702 hey2.0,:"'you
",:world!:mars.:
2703 hey2.1,:"'you ",:world!
2704 hey2.2,:"'you
",:bugs bunny!
2710 ${cat} <<- '__EOT' |\
2711 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2714 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2716 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2718 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2720 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2722 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2724 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2725 unset a b c
;read a b c
2726 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2728 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2729 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2731 check ifs
0 "${MBOX}" '890153490 298'
2733 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2735 readall d; echo $?/$^ERRNAME / <$d>
2736 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2737 readctl create .tin2
2738 readall d; echo $?/$^ERRNAME / <$d>
2739 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2740 readctl remove .tin;echo $?/$^ERRNAME;\
2741 readctl remove .tin2;echo $?/$^ERRNAME
2742 echo '### now with empty lines'
2743 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2744 readctl create .temptynl;echo $?/$^ERRNAME
2745 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2746 readctl remove .temptynl;echo $?/$^ERRNAME
2748 check readall 0 "${MBOX}" '4113506527 405'
2757 TRAP_EXIT_ADDONS=".
/.t
*"
2761 while [ ${i} -lt 113 ]; do
2762 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2763 "${MBOX}" "${i}" "${i}"
2766 ) | ${MAILX} ${ARGS} > .tall 2>&1
2767 check 1 0 "${MBOX}" '1785801373 13336'
2768 check 1-outerr - ./.tall '4294967295 0' # empty file
2770 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2771 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2772 check 2 0 .tall '3075634057 9103'
2774 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2775 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2776 check
3 0 .tall
'1902668747 9110'
2778 # copy only the odd (but the first), move the even
2780 printf 'File "file://%s"\ncopy ' .tmbox2
2782 while [ ${i} -lt 113 ]; do
2786 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2787 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2788 check
4 0 .tmbox3
'2554734733 6666'
2789 check
5 - .tall
'3168324241 4573'
2792 printf 'file "file://%s"\nmove ' .tmbox2
2794 while [ ${i} -lt 113 ]; do
2798 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2799 .tmbox3 .tmbox3 .tmbox2
2800 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2801 check
6 0 .tmbox3
'1429216753 13336'
2802 if have_feat uistrings
; then
2803 ${sed} 2d
< .tall
> .tallx
2807 check
7 - .tallx
'3604509039 13645'
2809 # Invalid MBOXes (after [f4db93b3])
2811 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2812 check 8 0 .tinvmbox '2848412822 118'
2813 check 9 - ./.tall '461280182 33'
2815 echo ' ' > .tinvmbox
2816 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2817 check
10 0 .tinvmbox
'624770486 120'
2818 check
11 - .
/.tall
'461280182 33'
2820 { echo; echo; } > .tinvmbox
# (not invalid)
2821 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2822 check 12 0 .tinvmbox '1485640875 119'
2823 check 13 - ./.tall '461280182 33'
2825 # *mbox-rfc4155*, plus
2826 ${cat} <<-_EOT > ./.tinv1
2829 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2830 Date: Wed, 02 Oct 1996 01:50:07 +0000
2832 Subject: Bad bad message 1
2834 From me to you, blinde Kuh!
2836 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2837 Date: Wed, 02 Oct 1996 01:50:07 +0000
2839 Subject: Bad bad message 2
2841 From me to you, blindes Kalb!
2843 ${cp} ./.tinv1 ./.tinv2
2847 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2848 \\eval copy * "${2}"
2850 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2852 ${cat} ./.tinv1 ./.tok >> .tall
2853 check 14 - ./.tall '739301109 616'
2856 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2857 wysh File ./.tok # Just move away to nowhere
2859 wysh file ./.tinv2 # Fully repaired
2860 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2862 check 15-1 - ./.tinv1 '3178048820 332'
2863 check 15-2 - ./.tinv2 '4151504442 314'
2870 if have_feat maildir; then :; else
2871 echo 'maildir: unsupported, skipped'
2875 TRAP_EXIT_ADDONS=".
/.t
*"
2879 while [ ${i} -lt 112 ]; do
2880 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2881 "${MBOX}" "${i}" "${i}"
2884 ) | ${MAILX} ${ARGS}
2885 check 1 0 "${MBOX}" '2366902811 13332'
2891 ' "${MBOX}" .tmdir1 .tmdir1 |
2892 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2893 check 2 0 .tlst '1713783045 9103'
2896 copy * "maildir
://%s
"
2899 ' "${MBOX}" .tmdir2 .tmdir2 |
2900 ${MAILX} ${ARGS} -Sshowlast > .tlst
2901 check 3 0 .tlst '1240307893 9113'
2903 printf 'File "maildir
://%s
"
2907 ' .tmdir2 .tmbox1 .tmbox1 |
2908 ${MAILX} ${ARGS} -Sshowlast > .tlst
2909 check 4 0 .tmbox1 '4096198846 12772'
2910 check 5 - .tlst '817337448 9110'
2912 # only the odd (even)
2914 printf 'File "maildir
://%s
"
2917 while [ ${i} -lt 112 ]; do
2919 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2926 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2927 check 6 0 .tmbox2 '4228337024 6386'
2928 check 7 - .tlst '884389294 4573'
2931 printf 'file "maildir
://%s
"
2934 while [ ${i} -lt 112 ]; do
2936 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2944 ' .tmbox2 .tmbox2 .tmdir2
2945 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2946 check
8 0 .tmbox2
'978751761 12656'
2947 ${sed} 2d
< .tlst
> .tlstx
2948 check
9 - .tlstx
'2391942957 13645'
2954 # MIME and RFC basics {{{
2955 t_mime_if_not_ascii
() {
2956 t_prolog mime_if_not_ascii
2958 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
2959 check 1 0 "${MBOX}" '3647956381 106'
2961 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
2963 check
2 0 "${MBOX}" '3964303752 274'
2968 t_xxxheads_rfc2047
() {
2969 t_prolog xxxheads_rfc2047
2970 TRAP_EXIT_ADDONS
="./.t*"
2972 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
2974 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
2975 -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̲' \
2977 check
1 0 "${MBOX}" '3422562347 371'
2979 # Single word (overlong line split -- bad standard! Requires injection of
2980 # artificial data!! But can be prevented by using RFC 2047 encoding)
2982 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2983 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
2984 check 2 0 "${MBOX}" '3317256266 1714'
2986 # Combination of encoded words, space and tabs of varying sort
2988 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
2989 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2990 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2991 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2992 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2993 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2995 check 3 0 "${MBOX}" '786672837 587'
2997 # Overlong multibyte sequence that must be forcefully split
2998 # todo This works even before v15.0, but only by accident
3000 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3001 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3002 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3003 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
3005 check 4 0 "${MBOX}" '2889557767 655'
3009 echo | ${MAILX} ${ARGS} \
3010 -s "1-1 B2 B3 B4 B5 B6 B\
3011 1-2 B2 B3 B4 B5 B6 B\
3012 1-3 B2 B3 B4 B5 B6 B\
3013 1-4 B2 B3 B4 B5 B6 B\
3014 1-5 B2 B3 B4 B5 B6 B\
3015 1-6 B2 B3 B4 B5 B6
" \
3017 check 5 0 "${MBOX}" '3135161683 293'
3019 # Leading and trailing WS
3021 echo | ${MAILX} ${ARGS} \
3022 -s " 2-1 B2 B3 B4 B5 B6 B\
3023 1-2 B2 B3 B4 B5 B6 B\
3024 1-3 B2 B3 B4 B5 B6 B\
3025 1-4 B2 B3 B4 B5 B6
" \
3027 check 6 0 "${MBOX}" '3221845405 232'
3029 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
3031 echo "Dat Früchtchen riecht häußlich
" |
3032 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
3034 'Schnödes "Früchtchen
" <do@du> (Hä!)'
3035 check 7 0 "${MBOX}" '800505986 368'
3037 # RFC 2047 in an address field, and iconv involved
3038 if have_feat iconv; then
3040 ${cat} > ./.trebox <<_EOT
3041 From zaza@exam.ple Fri Mar 2 21:31:56 2018
3042 Date: Fri, 2 Mar 2018 20:31:45 +0000
3043 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
3044 To: dude <dude@exam.ple>
3045 Subject: houston(...)
3046 Message-ID: <abra@1>
3048 Content-Type: text/plain; charset=iso-8859-1
3049 Content-Disposition: inline
3050 Content-Transfer-Encoding: 8bit
3053 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3054 -Sfullnames -Sreply-in-same-charset \
3055 -Smta=./.tmta.sh -Rf ./.trebox
3056 check 8 0 "${MBOX}" '2914485741 280'
3058 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
3064 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
3065 t_prolog iconv_mbyte_base64
3066 TRAP_EXIT_ADDONS=".
/.t
*"
3068 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
3069 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
3070 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
3073 echo 'iconv_mbyte_base64: unsupported, skipped'
3077 echo 'iconv_mbyte_base64: unsupported, skipped'
3081 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
3083 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
3084 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3086 -Sescape=! -Smime-encoding=base64 2>./.terr
3087 set ttycharset=utf-8 sendcharsets=iso-2022-jp
3089 !s Japanese from UTF-8 to ISO-2022-JP
3090 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3092 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3095 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3097 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3100 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
3102 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
3103 \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
3105 \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
3108 \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
3110 \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
3113 # May not presume iconv output as long as roundtrip possible [489a7122]
3115 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3116 < "${MBOX}" > .
/.tcksum
3117 check
1 - .
/.tcksum
'2694609714 520'
3118 check
2 - .
/.terr
'4294967295 0'
3120 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3121 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3122 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3123 -Rf "${MBOX}" >.
/.tlog
2>&1
3124 check
3 0 .
/.twrite
'1259742080 686'
3125 #check 4 - ./.tlog '3214068822 2123'
3126 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3127 check
4 - .
/.txlog
'3659773472 2035'
3129 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
3132 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
3133 rm -f "${MBOX}" .
/.twrite
3134 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3136 -Sescape=! -Smime-encoding=base64
2>.
/.terr
3137 set ttycharset
=utf-8 sendcharsets
=euc-jp
3139 !s Japanese from UTF-8 to EUC-JP
3140 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3142 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3145 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3147 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3150 set ttycharset
=EUC-JP sendcharsets
=utf-8
3152 !s Japanese from EUC-JP to UTF-8
3153 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3155 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3158 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3160 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3164 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3165 < "${MBOX}" > .
/.tcksum
3166 check
5 - .
/.tcksum
'2870183985 473'
3167 check
6 - .
/.terr
'4294967295 0'
3169 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3170 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3171 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3172 -Rf "${MBOX}" >.
/.tlog
2>&1
3173 check
7 0 .
/.twrite
'1259742080 686'
3174 #check 8 - ./.tlog '2506063395 2075'
3175 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3176 check
8 - .
/.txlog
'2528199891 1988'
3178 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
3184 t_iconv_mainbody
() {
3185 t_prolog iconv_mainbody
3186 TRAP_EXIT_ADDONS
="./.t*"
3188 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
3191 echo 'iconv_mainbody: unsupported, skipped'
3195 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
3197 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3198 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
3199 -s '–' over-the@rain.bow
2>.
/.terr
3200 check
1 0 "${MBOX}" '3634015017 251'
3201 check
2 - .
/.terr
'4294967295 0'
3203 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3204 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
3205 -s '–' over-the@rain.bow
2>.
/.terr
3207 check
3 - "${MBOX}" '3634015017 251'
3208 if have_feat uistrings
; then
3209 if have_feat docstrings
; then # xxx should not be like that
3210 check
4 - .
/.terr
'2579894983 148'
3212 check
4 - .
/.terr
'271380835 121'
3215 echo 'iconv_mainbody-4: unsupported, skipped'
3218 # The different iconv(3) implementations use different replacement sequence
3219 # types (character-wise, byte-wise, and the character(s) used differ)
3220 i
="${MAILX_ICONV_MODE}"
3221 if [ -n "${i}" ]; then
3222 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
3224 check_ex0 5-1-estat ${j}
3225 check 5-1 - ./.terr '4294967295 0'
3226 if [ ${i} -eq 13 ]; then
3227 check 5-2 - ./.tout '189327996 283'
3228 elif [ ${i} -eq 12 ]; then
3229 check 5-3 - ./.tout '1959197095 283'
3230 elif [ ${i} -eq 3 ]; then
3231 check 5-4 - ./.tout '3196380198 279'
3233 check 5-5 - ./.tout '3760313827 279'
3236 echo 'iconv_mainbody-5: unsupported, skipped'
3242 t_binary_mainbody() {
3243 t_prolog binary_mainbody
3244 TRAP_EXIT_ADDONS=".
/.t
*"
3246 printf 'abra\0\nka\r\ndabra' |
3247 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
3249 check 1 0 "${MBOX}" '1629827 239'
3250 check 2 - ./.terr '4294967295 0'
3252 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
3253 ${MAILX} ${ARGS} -Rf \
3254 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
3255 "${MBOX}" >./.tall 2>&1
3256 check 3 0 ./.tall '733582513 319'
3257 check 4 - ./.tcat '3817108933 15'
3258 check 5 - ./.twrite '3817108933 15'
3263 t_C_opt_customhdr() {
3264 t_prolog C_opt_customhdr
3265 TRAP_EXIT_ADDONS=".
/.t
*"
3267 t_xmta 'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
3270 ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3271 -C 'C-One : Custom One Body' \
3272 -C 'C-Two:CustomTwoBody' \
3273 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3274 this-goes@nowhere >./.tall 2>&1
3276 ${cat} ./.tall >> "${MBOX}"
3277 check 1 0 "${MBOX}" '2400078426 195'
3280 printf 'm this-goes@nowhere\nbody\n!.
3282 m this-goes2@nowhere\nbody2\n!.
3283 set customhdr=%ccustom1 : custom1 body%c
3284 m this-goes2@nowhere\nbody2\n!.
3285 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
3286 m this-goes3@nowhere\nbody3\n!.
3288 ${MAILX} ${ARGS} -Smta=./.tmta.sh -Sescape=! \
3289 -C 'C-One : Custom One Body' \
3290 -C 'C-Two:CustomTwoBody' \
3291 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3294 ${cat} ./.tall >> "${MBOX}"
3295 check 2 0 "${MBOX}" '3546878678 752'
3301 # Operational basics with easy tests {{{
3304 TRAP_EXIT_ADDONS=".
/.t
*"
3306 t_xmta 'Hippocastanum Mon Jun 19 15:07:07 2017'
3308 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tmta.sh > ./.tall 2>&1
3310 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
3312 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3314 alias a4 a5 ex1@a4.ple
3316 alias a6 a7 ex1@a6.ple
3330 check 1 0 "${MBOX}" '2496925843 272'
3331 check 2 - .tall '3548953204 152'
3333 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3334 # TODO need to somehow provide its contents to the test, then test
3341 TRAP_EXIT_ADDONS=".
/.t
*"
3343 t_xmta 'Alchemilla Wed Apr 25 15:12:13 2017'
3345 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3346 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
3347 check
1 0 "${MBOX}" '1594682963 13520'
3349 if (echo |
gzip -c) >/dev
/null
2>&1; then
3351 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3352 "${MBOX}" | ${MAILX} ${ARGS} \
3353 -X'filetype gz gzip\ -dc gzip\ -c'
3354 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3355 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3357 check 2 - ".
/.t.mbox
" '1594682963 13520'
3358 check 3 - ".
/.t.out
" '2392348396 102'
3360 echo 'filetype-2: unsupported, skipped'
3361 echo 'filetype-3: unsupported, skipped'
3366 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
3372 -X'filetype gz gzip\ -dc gzip\ -c' \
3373 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
3374 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
3375 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3377 -X'filetype gz gzip\ -dc gzip\ -c' \
3378 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
3380 check 4 - ".
/.t.mbox
" '2886541147 27060'
3381 check 5 - ".
/.t.out
" '852335377 172'
3386 t_record_a_resend() {
3387 t_prolog record_a_resend
3388 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
3392 m %s\n~s Subject 1.\nHello.\n~.
3393 set record-files add-file-recipients
3394 m %s\n~s Subject 2.\nHello.\n~.
3396 resend 2 ./.t.resent
3397 Resend 1 ./.t.resent
3399 resend 2 ./.t.resent
3400 Resend 1 ./.t.resent
3401 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
3404 check 1 0 "${MBOX}" '2632690399 252'
3405 check 2 - .t.record '3337485450 456'
3406 check 3 - .t.resent '1560890069 640'
3413 TRAP_EXIT_ADDONS=".
/.tmta.sh .
/.t.mbox
"
3415 t_xmta 'Alchemilla Wed Apr 07 17:03:33 2017' ./.t.mbox
3418 ${MAILX} ${ARGS} -ef ./.t.mbox
3419 echo ${?} > "${MBOX}"
3421 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
3422 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3423 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
3424 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3426 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
3427 echo ${?} >> "${MBOX}"
3428 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
3429 echo ${?} >> "${MBOX}"
3430 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
3431 echo ${?} >> "${MBOX}"
3432 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
3433 echo ${?} >> "${MBOX}"
3434 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
3435 echo ${?} >> "${MBOX}"
3436 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
3437 echo ${?} >> "${MBOX}"
3438 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
3439 echo ${?} >> "${MBOX}"
3441 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
3442 echo ${?} >> "${MBOX}"
3443 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
3444 echo ${?} >> "${MBOX}"
3445 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
3446 echo ${?} >> "${MBOX}"
3447 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
3448 echo ${?} >> "${MBOX}"
3449 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
3450 echo ${?} >> "${MBOX}"
3451 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
3452 echo ${?} >> "${MBOX}"
3453 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
3454 echo ${?} >> "${MBOX}"
3456 check
1 - "${MBOX}" '1708955574 678'
3460 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
3461 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3462 -r '' -X 'wysh set from=pony1@$LOGNAME'
3463 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
3464 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3465 -r '' -X 'wysh set from=pony2@$LOGNAME'
3466 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
3467 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3468 -r '' -X 'wysh set from=pony3@$LOGNAME'
3470 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3471 echo fh-test size; set autosort=size showname showto
3472 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3473 check
2-1 0 "${MBOX}" '512787278 418'
3475 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3476 echo fh-test subject; set autosort=subject showname showto
3477 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3478 check
2-2 0 "${MBOX}" '3606067531 421'
3480 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3481 echo fh-test from; set autosort=from showto
3482 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3483 check
2-3 0 "${MBOX}" '2506148572 418'
3485 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3486 echo fh-test to; set autosort=to showto
3487 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3488 check
2-4 0 "${MBOX}" '1221542854 416'
3494 # Simple, if we need more here, place in a later vim fold!
3495 t_prolog q_t_etc_opts
3496 TRAP_EXIT_ADDONS
="./.t*"
3498 # Three tests for MIME encoding and (a bit) content classification.
3499 # At the same time testing -q FILE, < FILE and -t FILE
3500 t__put_body
> .
/.tin
3502 < .
/.tin
${MAILX} ${ARGS} ${ADDARG_UNI} \
3503 -a .
/.tin
-s "`t__put_subject`" "${MBOX}"
3504 check
1 0 "${MBOX}" '1088822685 6642'
3507 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3508 -a .
/.tin
-s "`t__put_subject`" -q .
/.tin
"${MBOX}"
3509 check
2 0 "${MBOX}" '1088822685 6642'
3512 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject`" && echo &&
3514 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a .
/.tin
-t
3515 check
3 0 "${MBOX}" '1088822685 6642'
3517 # Check comments in the header
3519 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
3522 # Noch ein Kommentar
3524 # Nachgestelltes Kommentar
3528 check 4 0 "${MBOX}" '4161555890 124'
3533 t_message_injections() {
3534 # Simple, if we need more here, place in a later vim fold!
3535 t_prolog message_injections
3536 TRAP_EXIT_ADDONS=".
/.t
*"
3538 t_xmta 'Echinacea Tue Jun 20 15:54:02 2017'
3540 echo mysig > ./.tmysig
3542 echo some-body | ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3543 -Smessage-inject-head=head-inject \
3544 -Smessage-inject-tail=tail-inject \
3545 -Ssignature=./.tmysig \
3546 ex@am.ple > ./.tall 2>&1
3547 check 1 0 "${MBOX}" '2434746382 134'
3548 check 2 - .tall '4294967295 0' # empty file
3551 ${cat} <<-_EOT > ./.template
3555 Subject: This subject is
3557 Body, body, body me.
3559 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tmta.sh \
3560 -Smessage-inject-head=head-inject \
3561 -Smessage-inject-tail=tail-inject \
3562 -Ssignature=./.tmysig \
3564 check 3 0 "${MBOX}" '3114203412 198'
3565 check 4 - .tall '4294967295 0' # empty file
3571 # Relatively Simple, if we need more here, place in a later vim fold!
3572 t_prolog attachments
3573 TRAP_EXIT_ADDONS=".
/.t
*"
3575 t_xmta 'Cannabis Sun Feb 18 02:02:46 2018'
3577 ${cat} <<-_EOT > ./.tx
3578 From steffen Sun Feb 18 02:48:40 2018
3579 Date: Sun, 18 Feb 2018 02:48:40 +0100
3582 User-Agent: s-nail v14.9.7
3585 From steffen Sun Feb 18 02:48:42 2018
3586 Date: Sun, 18 Feb 2018 02:48:42 +0100
3589 User-Agent: s-nail v14.9.7
3594 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
3595 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
3596 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3599 '!@ ./.t3 ".
/.t
4" ""
3607 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh \
3608 -a ./.t1 -a './.t 2' \
3609 -s attachment-test \
3610 ex@am.ple > ./.tall 2>&1
3611 check 1 0 "${MBOX}" '4107062253 634'
3612 if have_feat uistrings; then
3613 check 2 - .tall '1928331872 720'
3615 echo 'attachments-2: unsupported, skipped'
3621 !s This the subject is
3622 !@ ./.t3 "#2" "./.t 4" "#1" ""
3632 !@ .
/.t3
"#2" "./.t 4" "#1" ""
3640 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3649 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3663 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3665 check 3 0 "${MBOX}" '798122412 2285'
3666 if have_feat uistrings; then
3667 check 4 - .tall '2526106274 1910'
3669 echo 'attachments-4
: unsupported
, skipped
'
3698 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3700 check 5 0 "${MBOX}" '2165311808 2276'
3701 if have_feat uistrings; then
3702 check 6 - .tall '3662598562 509'
3704 echo 'attachments-6
: unsupported
, skipped
'
3711 # (after attachments)
3713 TRAP_EXIT_ADDONS="./.t*"
3716 mkdir ./.ttt || exit 1
3720 : > 'diet\ is \curd.txt
'
3721 : > 'diet
"is" curd.txt
'
3723 : > 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
3724 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3725 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3726 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3728 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3729 -a "./.ttt/ma'ger.txt
" -a ".
/.ttt
/mä
'ger.txt" \
3730 -a '.
/.ttt
/diet\ is \curd.txt
' -a '.
/.ttt
/diet
"is" curd.txt
' \
3731 -a ./.ttt/höde-tröge.txt \
3732 -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 \
3733 -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 \
3734 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3735 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3737 check 1 0 "${MBOX}" '3720896054 3088'
3739 # `resend' test, reusing
$MBOX
3740 printf "Resend ./.t2\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
3741 check 2 0 ./.t2 '3720896054 3088'
3743 printf "resend .
/.t3
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3744 check
3 0 .
/.t3
'3979736592 3133'
3749 t_mime_types_load_control
() {
3750 t_prolog mime_types_load_control
3751 if have_feat uistrings
; then :; else
3752 echo 'mime_types_load_control: unsupported, skipped'
3755 TRAP_EXIT_ADDONS
="./.t*"
3757 ${cat} <<-_EOT > ./.tmts1
3758 @ application/mathml+xml mathml
3760 ${cat} <<-_EOT > ./.tmts2
3761 @ x-conference/x-cooltalk ice
3763 @ application/aga-aga aga
3766 ${cat} <<-_EOT > ./.tmts1.mathml
3767 <head>nonsense ML</head>
3769 ${cat} <<-_EOT > ./.tmts2.ice
3772 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3773 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3787 ' "${MBOX}" "${MBOX}" |
3789 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3792 ${cat} "${MBOX}" >> .
/.tout
3793 check
1 - .
/.tout
'2716124839 2441'
3795 echo type |
${MAILX} ${ARGS} -R \
3796 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3797 -f "${MBOX}" >> .
/.tout
2>&1
3798 check
2 0 .
/.tout
'2093030907 3634'
3804 # Around state machine, after basics {{{
3807 TRAP_EXIT_ADDONS
="./.t*"
3809 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
3811 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3815 alternates a1@b1 a2@b2 a3@b3
3820 echo $?
/$^ERRNAME
<$rv>
3825 echo $?
/$^ERRNAME
<$rv>
3828 echo $?
/$^ERRNAME
<$rv>
3831 echo $?
/$^ERRNAME
<$rv>
3835 alternates a1@b1 a2@b2 a3@b3
3838 echo $?
/$^ERRNAME
<$rv>
3841 echo $?
/$^ERRNAME
<$rv>
3844 echo $?
/$^ERRNAME
<$rv>
3847 alternates a1@b1 a2@b2 a3@b3
3850 echo $?
/$^ERRNAME
<$rv>
3853 echo $?
/$^ERRNAME
<$rv>
3856 echo $?
/$^ERRNAME
<$rv>
3860 alternates a1@b1 a2@b2 a3@b3
3863 echo $?
/$^ERRNAME
<$rv>
3867 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
3869 ~s all alternates
, only a1@b1 remains
3871 ~b a3@b3 a3@c3 a3@d3
3880 alternates a1@b1 a1@c1 a2@b2 a3@b3
3882 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
3884 ~b a3@b3 a3@c3 a3@d3
3891 alternates a1@b1 a2@b2 a3
; set allnet
3893 ~s all alternates via allnet
, only a1@b1 remains
3895 ~b a3@b3 a3@c3 a3@d3
3906 echo $?
/$^ERRNAME
<$rv>
3910 echo $?
/$^ERRNAME
<$rv>
3914 echo $?
/$^ERRNAME
<$rv>
3918 echo $?
/$^ERRNAME
<$rv>
3922 echo $?
/$^ERRNAME
<$rv>
3926 alternates a1@b1 a2@b2
3929 echo $?
/$^ERRNAME
<$rv>
3930 alternates a3@b3 a4@b4
3933 echo $?
/$^ERRNAME
<$rv>
3936 check
1 0 "${MBOX}" '142184864 515'
3937 if have_feat uistrings
; then
3938 check
2 - .tall
'1878598364 505'
3940 echo 'alternates-2: unsupported, skipped'
3943 # Automatic alternates, also from command line (freezing etc.)
3945 ${cat} <<- __EOT > ./.tin
3946 From trouble-report@desy Wed Jun 6 20:19:28 2018
3947 Date: Wed, 06 Jun 2018 19:58:02 +0200
3948 From: a@b.org, b@b.org, c@c.org
3951 Cc: a@b.org, c@c.org
3953 Message-ID: <20180606175802.dw-cn%a@b.org>
3963 a@b.org b@b.org c@c.org
3968 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3969 -S from
=a@b.org
,b@b.org
,c@c.org
-S sender
=a@b.org \
3970 -Rf .
/.tin
> .
/.tall
2>&1
3971 check
3 0 "${MBOX}" '287250471 256'
3972 check
4 - .tall
'4294967295 0'
3976 set from=a@b.org,b@b.org,c@c.org sender=a@b.org
3980 a@b.org b@b.org c@c.org
3985 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3986 -Rf .
/.tin
> .
/.tall
2>&1
3987 check
5 0 "${MBOX}" '2618762028 512'
3988 check
6 - .tall
'4294967295 0'
3990 # And more, with/out -r
3991 # TODO -r should be the Sender:, which should automatically propagate to
3992 # TODO From: if possible and/or necessary. It should be possible to
3993 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
3994 # TODO arg as appropriate.
3995 # TODO For now we are a bit messy
3998 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3999 -c a@b.example
,b@b.example
,c@c.example \
4000 -S from
=a@b.example
,b@b.example
,c@c.example \
4001 -S sender
=a@b.example \
4002 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4003 check
7 0 "${MBOX}" '3510981487 192'
4004 check
8 - .tout
'2052716617 201'
4005 check
9 - .tall
'4294967295 0'
4007 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4008 -c a@b.example
,b@b.example
,c@c.example \
4009 -S from
=a@b.example
,b@b.example
,c@c.example \
4010 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4011 check
10 0 "${MBOX}" '2282326606 364'
4012 check
11 - .tout
'3213404599 382'
4013 check
12 - .tall
'4294967295 0'
4015 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4016 -c a@b.example
,b@b.example
,c@c.example \
4017 -S from
=a@b.example
,b@b.example
,c@c.example \
4018 -S sender
=a@b.example \
4019 b@b.example
>.
/.tall
2>&1
4020 check
13 0 "${MBOX}" '1460017970 582'
4021 check
14 - .tall
'4294967295 0'
4026 t_quote_a_cmd_escapes
() {
4027 t_prolog quote_a_cmd_escapes
4028 TRAP_EXIT_ADDONS
="./.t*"
4032 echo 'included file' > .
/.ttxt
4034 ${cat} <<-_EOT > ./.tmbox
4035 From neverneverland Sun Jul 23 13:46:25 2017
4036 Subject: Bugstop: five miles out 1
4037 Reply-To: mister originator1 <mr1@originator>
4038 From: mister originator1 <mr1@originator>
4039 To: bugstop-commit@five.miles.out
4041 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4042 Date: Wed, 19 Jul 2017 09:22:57 -0400
4043 Message-Id: <20170719132257.766AF781267-1@originator>
4046 That's appalling, I.
4048 From neverneverland Sun Jul 23 13:47:25 2017
4049 Subject: Bugstop: five miles out 2
4050 Reply-To: mister originator2 <mr2@originator>
4051 From: mister originator2 <mr2@originator>
4052 To: bugstop-commit@five.miles.out
4054 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4055 Date: Wed, 19 Jul 2017 09:23:57 -0400
4056 Message-Id: <20170719132257.766AF781267-2@originator>
4059 That's appalling, II.
4061 From neverneverland Sun Jul 23 13:48:25 2017
4062 Subject: Bugstop: five miles out 3
4063 Reply-To: mister originator3 <mr3@originator>
4064 From: mister originator3 <mr3@originator>
4065 To: bugstop-commit@five.miles.out
4067 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4068 Date: Wed, 19 Jul 2017 09:24:57 -0400
4069 Message-Id: <20170719132257.766AF781267-3@originator>
4072 That's appalling, III.
4077 set indentprefix=" |"
4084 headerpick type retain cc date from message-id reply-to subject to
4088 set quote=allheaders
4091 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4092 -Sescape=! -Sindentprefix=' >' \
4093 .
/.tmbox
>.
/.tall
2>&1
4095 ${cat} .
/.tall
>> "${MBOX}"
4096 check
1 0 "${MBOX}" '2181726970 2023'
4098 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4101 set Sign=SignVar sign=signvar DEAD=./.ttxt
4102 headerpick type retain Subject
4104 !!1 Not escaped. And shell test last, right before !..
4105 !: echo 2 only echoed via colon
4106 !_ echo 3 only echoed via underscore
4108 !<! echo 5 shell echo included
4109 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4110 7 and 8 are ~A and ~a:
4113 !b 9 added ~b cc <ex1@am.ple>
4114 !c 10 added ~c c <ex2@am.ple>
4121 14: ~f (headerpick: subject)
4125 16, 17: ~I Sign, ~i Sign
4146 set quote-inject-head quote-inject-tail indentprefix
4147 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4151 !:unset quote quote-inject-head quote-inject-tail
4156 24: ~s this new subject
4157 !s 24 did new ~s ubject
4158 !t 25 added ~t o <ex3@am.ple>
4163 and i ~w rite this out to ./.tmsg
4165 !:wysh set x=$escape;set escape=~
4166 ~!echo shell command output
4167 ~:wysh set escape=$x
4169 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4170 -Sescape=! -Sindentprefix=' |' \
4171 .
/.tmbox
>.
/.tall
2>&1
4173 ${cat} .
/.tall
>> "${MBOX}"
4174 check
2 - "${MBOX}" '2613898218 4090'
4175 check
3 - .
/.tmsg
'2771314896 3186'
4180 t_compose_edits
() { # XXX very rudimentary
4181 t_prolog compose_edits
4182 TRAP_EXIT_ADDONS
="./.t*"
4184 ${cat} <<-_EOT > ./.ted.sh
4186 ${cat} <<-__EOT > \${1}
4199 # > All these are in-a-row!
4201 printf 'mail ./.tout\n~s This subject is\nThis body is\n~.' |
4202 ${MAILX} ${ARGS} -Seditheaders >.
/.tall
2>&1
4203 check
1 0 .
/.tout
'3993703854 127'
4204 check
2 - .
/.tall
'4294967295 0'
4206 ${mv} .
/.tall .
/.tout
4207 printf 'mail ./.tout\n~s This subject is\nThis body is\n~e\n~.' |
4208 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=.
/.ted.sh
>.
/.tall
2>&1
4209 check
3 0 .
/.tout1
'285981670 116'
4210 check
4 - .
/.tout2
'285981670 116'
4211 check
5 - .
/.tout3
'285981670 116'
4212 check
6 - .
/.tout
'4294967295 0'
4213 check
7 - .
/.tall
'4294967295 0'
4214 ${rm} .
/.tout1 .
/.tout2 .
/.tout3
4216 # t_compose_hooks will test ~^ at edge
4217 ${mv} .
/.tout .
/.tout1
4218 ${mv} .
/.tall .
/.tout2
4220 mail ./.tout\n!s This subject is\nThis body is
4225 !^header insert fcc ./.tout
4226 !^header insert fcc .tout1
4227 !^header insert fcc ./.tout2
4230 !^header remove-at fcc 2
4231 !^header remove-at fcc 2
4235 !^header insert fcc ./.tout
4239 ' |
${MAILX} ${ARGS} -Sescape=! >.
/.tall
2>&1
4240 check
8 0 .
/.tout
'3993703854 127'
4241 check
9 - .
/.tout1
'4294967295 0'
4242 check
10 - .
/.tout2
'4294967295 0'
4243 check
11 - .
/.tall
'4280910245 300'
4245 # < No longer in-a-row
4247 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >.
/.tall
2>&1
4249 Subject
: Fcc via
-t test
4253 check
12 0 .
/.ttout
'1289478830 122'
4254 check
13 - .
/.tall
'4294967295 0'
4259 t_digmsg
() { # XXX rudimentary
4261 TRAP_EXIT_ADDONS
="./.t*"
4264 mail ./.tout\n!s This subject is\nThis body is
4267 !:digmsg - header list
4268 !:digmsg - header show subject
4269 !:digmsg - header show to
4270 !:digmsg - header remove to
4271 !:digmsg - header list
4272 !:digmsg - header show to
4276 !:digmsg - header list; readall x; echon "<$x>";
4277 !:digmsg - header show subject;readall x;echon "<$x>";;
4280 !: # nothing here as is comment
4281 !^header insert fcc ./.tbox
4284 !:digmsg - header list
4285 !:digmsg - header show fcc
4289 !:digmsg - header list
4290 !:digmsg - header show fcc
4291 !:digmsg - header insert fcc ./.tfcc
4300 digmsg 1 header list
4301 digmsg 1 header show subject
4306 digmsg 1 header list; echo $?/$^ERRNAME
4307 digmsg create -; echo $?/$^ERRNAME
4309 ! %s ./.tfcc > ./.tcat
4310 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
4312 mail nowhere@exam.ple
4314 !:digmsg create -; echo $?/$^ERRNAME;\\
4315 digmsg create 1; echo $?/$^ERRNAME;\\
4316 digmsg create 2; echo $?/$^ERRNAME
4318 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4320 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4324 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4326 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4328 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4332 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4334 !:digmsg remove -; echo $?/$^ERRNAME;\\
4335 digmsg remove 1; echo $?/$^ERRNAME;\\
4336 digmsg remove 2; echo $?/$^ERRNAME;
4339 ' "${cat}" "${sed}" | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
4341 if have_feat uistrings; then
4342 check 1 - ./.tall '362777535 1087'
4344 check 1 - ./.tall '4281367066 967'
4346 check 2 - ./.tfcc '3993703854 127'
4347 check 3 - ./.tempty '4294967295 0'
4348 check 4 - ./.tcat '2157992522 256'
4355 # Heavy use of/rely on state machine (behaviour) and basics {{{
4356 t_compose_hooks() { # {{{ TODO monster
4357 t_prolog compose_hooks
4358 if have_feat uistrings; then :; else
4359 echo 'compose_hooks: unsupported, skipped'
4362 TRAP_EXIT_ADDONS=".
/.t
*"
4364 t_xmta 'PrimulaVeris Wed Apr 10 22:59:00 2017'
4366 (echo line one&&echo line two&&echo line three) > ./.treadctl
4367 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
4369 ${cat} <<'__EOT__' > ./.trc
4371 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4374 vput vexpr es substr "$1" 0 1
4379 define read_mline_res {
4380 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4381 echo $len/$es/$^ERRNAME: $hl
4382 if [ $es -ne $^ERR-NONE ]
4383 xcall bail read_mline_res
4385 \xcall read_mline_res
4390 echo "~^header list
"; read hl; echo $hl;\
4391 call xerr "$hl" "in_addr
($xh) 0-1"
4393 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4394 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
4395 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4396 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
4397 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4398 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
4399 echo "~^header list
$xh"; read hl; echo $hl;\
4400 call xerr "$hl" "ins_addr
$xh 1-4"
4401 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
4404 if [ "$t_remove" == "" ]
4408 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
4409 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
4411 xcall bail "ins_addr
$xh 2-2"
4413 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
4415 xcall bail "ins_addr
$xh 2-3"
4417 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
4419 xcall bail "ins_addr
$xh 2-4"
4423 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4424 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
4425 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4426 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
4427 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4428 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
4429 echo "~^header list
$xh"; read hl; echo $hl;\
4430 call xerr "$hl" "ins_addr
$xh 3-4"
4431 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
4434 echo "~^header remove-at
$xh 1"; read es;\
4435 call xerr $es "ins_addr
$xh 3-6"
4436 echo "~^header remove-at
$xh 1"; read es;\
4437 call xerr $es "ins_addr
$xh 3-7"
4438 echo "~^header remove-at
$xh 1"; read es;\
4439 call xerr $es "ins_addr
$xh 3-8"
4440 echo "~^header remove-at
$xh 1"; read es;\
4441 vput vexpr es substr $es 0 3
4443 xcall bail "ins_addr
$xh 3-9"
4445 echo "~^header remove-at
$xh T
"; read es;\
4446 vput vexpr es substr $es 0 3
4448 xcall bail "ins_addr
$xh 3-10"
4450 echo "~^header list
$xh"; read es;\
4451 vput vexpr es substr $es 0 3
4453 xcall bail "ins_addr
$xh 3-11"
4455 echo "~^header show
$xh"; read es;\
4456 vput vexpr es substr $es 0 3
4458 xcall bail "ins_addr
$xh 3-12"
4462 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4463 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
4464 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
4465 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
4466 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4467 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
4468 echo "~^header list
$xh"; read hl; echo $hl;\
4469 call xerr "$hl" "header list
$xh 3-4"
4470 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
4473 echo "~^header remove-at
$xh 3"; read es;\
4474 call xerr $es "ins_addr
$xh 4-6"
4475 echo "~^header remove-at
$xh 2"; read es;\
4476 call xerr $es "ins_addr
$xh 4-7"
4477 echo "~^header remove-at
$xh 1"; read es;\
4478 call xerr $es "ins_addr
$xh 4-8"
4479 echo "~^header remove-at
$xh 1"; read es;\
4480 vput vexpr es substr $es 0 3
4482 xcall bail "ins_addr
$xh 4-9"
4484 echo "~^header remove-at
$xh T
"; read es;\
4485 vput vexpr es substr $es 0 3
4487 xcall bail "ins_addr
$xh 4-10"
4489 echo "~^header list
$xh"; read es;\
4490 vput vexpr es substr $es 0 3
4492 xcall bail "ins_addr
$xh 4-11"
4494 echo "~^header show
$xh"; read es;\
4495 vput vexpr es substr $es 0 3
4497 xcall bail "ins_addr
$xh 4-12"
4501 wysh set xh=$1 mult=$2
4502 echo "~^header list
"; read hl; echo $hl;\
4503 call xerr "$hl" "ins_ref
($xh) 0-1"
4505 echo "~^header insert
$xh <$xh@exam.ple
>";\
4506 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
4508 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4509 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
4510 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4511 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
4513 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
4514 vput vexpr es substr $es 0 3
4516 xcall bail "ins_ref
$xh 1-4"
4520 echo "~^header list
$xh"; read hl; echo $hl;\
4521 call xerr "$hl" "ins_ref
$xh 1-5"
4522 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
4525 if [ "$t_remove" == "" ]
4529 echo "~^header remove
$xh"; read es;\
4530 call xerr $es "ins_ref
$xh 2-1"
4531 echo "~^header remove
$xh"; read es;\
4532 vput vexpr es substr $es 0 3
4534 xcall bail "ins_ref
$xh 2-2"
4536 echo "~^header list
$xh"; read es;\
4537 vput vexpr es substr $es 0 3
4539 xcall bail "$es ins_ref
$xh 2-3"
4541 echo "~^header show
$xh"; read es;\
4542 vput vexpr es substr $es 0 3
4544 xcall bail "ins_ref
$xh 2-4"
4548 echo "~^header insert
$xh <$xh@exam.ple
>";\
4549 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
4551 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4552 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
4553 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4554 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
4556 echo "~^header list
$xh";\
4557 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
4558 echo "~^header show
$xh";\
4559 read es; call xerr $es "ins_ref
$xh 3-5"
4562 echo "~^header remove-at
$xh 1"; read es;\
4563 call xerr $es "ins_ref
$xh 3-6"
4564 if [ $mult -ne 0 ] && [ $xh != subject ]
4565 echo "~^header remove-at
$xh 1"; read es;\
4566 call xerr $es "ins_ref
$xh 3-7"
4567 echo "~^header remove-at
$xh 1"; read es;\
4568 call xerr $es "ins_ref
$xh 3-8"
4570 echo "~^header remove-at
$xh 1"; read es;\
4571 vput vexpr es substr $es 0 3
4573 xcall bail "ins_ref
$xh 3-9"
4575 echo "~^header remove-at
$xh T
"; read es;\
4576 vput vexpr es substr $es 0 3
4578 xcall bail "ins_ref
$xh 3-10"
4580 echo "~^header show
$xh"; read es;\
4581 vput vexpr es substr $es 0 3
4583 xcall bail "ins_ref
$xh 3-11"
4587 echo "~^header insert
$xh <$xh@exam.ple
> ";\
4588 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
4590 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
4591 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
4592 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4593 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
4595 echo "~^header list
$xh"; read hl; echo $hl;\
4596 call xerr "$hl" "ins_ref
$xh 4-4"
4597 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
4600 if [ $mult -ne 0 ] && [ $xh != subject ]
4601 echo "~^header remove-at
$xh 3"; read es;\
4602 call xerr $es "ins_ref
$xh 4-6"
4603 echo "~^header remove-at
$xh 2"; read es;\
4604 call xerr $es "ins_ref
$xh 4-7"
4606 echo "~^header remove-at
$xh 1"; read es;\
4607 call xerr $es "ins_ref
$xh 4-8"
4608 echo "~^header remove-at
$xh 1"; read es;\
4609 vput vexpr es substr $es 0 3
4611 xcall bail "ins_ref
$xh 4-9"
4613 echo "~^header remove-at
$xh T
"; read es;\
4614 vput vexpr es substr $es 0 3
4616 xcall bail "ins_ref
$xh 4-10"
4618 echo "~^header show
$xh"; read es;\
4619 vput vexpr es substr $es 0 3
4621 xcall bail "ins_ref
$xh 4-11"
4626 # In collect.c order
4628 call ins_ref sender 0 # Not a "ref
", but works
4632 call ins_addr reply-To
4633 call ins_addr mail-Followup-to
4634 call ins_ref messAge-id 0
4635 call ins_ref rEfErEncEs 1
4636 call ins_ref in-Reply-to 1
4637 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
4638 call ins_addr freeForm1
4639 call ins_addr freeform2
4641 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
4643 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
4651 echo "~^attachment
";\
4652 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4654 xcall bail "attach
0-1"
4657 echo "~^attach attribute .
/.treadctl
";\
4658 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4660 xcall bail "attach
0-2"
4662 echo "~^attachment attribute-at
1";\
4663 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4665 xcall bail "attach
0-3"
4668 echo "~^attachment insert .
/.treadctl
=ascii
";\
4669 read hl; echo $hl; call xerr "$hl" "attach
1-1"
4670 echo "~^attachment list
";\
4671 read es; echo $es;call xerr "$es" "attach
1-2"
4673 echo "~^attachment attribute .
/.treadctl
";\
4674 read es; echo $es;call xerr "$es" "attach
1-3"
4676 echo "~^attachment attribute .treadctl
";\
4677 read es; echo $es;call xerr "$es" "attach
1-4"
4679 echo "~^attachment attribute-at
1";\
4680 read es; echo $es;call xerr "$es" "attach
1-5"
4683 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
4684 read es; echo $es;call xerr "$es" "attach
1-6"
4685 echo "~^attachment attribute-set .treadctl content-description Au
";\
4686 read es; echo $es;call xerr "$es" "attach
1-7"
4687 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
4688 read es; echo $es;call xerr "$es" "attach
1-8"
4690 echo "~^attachment attribute .
/.treadctl
";\
4691 read es; echo $es;call xerr "$es" "attach
1-9"
4693 echo "~^attachment attribute .treadctl
";\
4694 read es; echo $es;call xerr "$es" "attach
1-10"
4696 echo "~^attachment attribute rctl
";\
4697 read es; echo $es;call xerr "$es" "attach
1-11"
4699 echo "~^attachment attribute-at
1";\
4700 read es; echo $es;call xerr "$es" "attach
1-12"
4704 echo "~^attachment insert .
/.tattach
=latin1
";\
4705 read hl; echo $hl; call xerr "$hl" "attach
2-1"
4706 echo "~^attachment list
";\
4707 read es; echo $es;call xerr "$es" "attach
2-2"
4709 echo "~^attachment attribute .
/.tattach
";\
4710 read es; echo $es;call xerr "$es" "attach
2-3"
4712 echo "~^attachment attribute .tattach
";\
4713 read es; echo $es;call xerr "$es" "attach
2-4"
4715 echo "~^attachment attribute-at
2";\
4716 read es; echo $es;call xerr "$es" "attach
2-5"
4719 echo "~^attachment attribute-set .
/.tattach filename tat
";\
4720 read es; echo $es;call xerr "$es" "attach
2-6"
4722 "~^attachment attribute-set .tattach content-description Au2
";\
4723 read es; echo $es;call xerr "$es" "attach
2-7"
4724 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
4725 read es; echo $es;call xerr "$es" "attach
2-8"
4727 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
4728 read es; echo $es;call xerr "$es" "attach
2-9"
4730 echo "~^attachment attribute .
/.tattach
";\
4731 read es; echo $es;call xerr "$es" "attach
2-10"
4733 echo "~^attachment attribute .tattach
";\
4734 read es; echo $es;call xerr "$es" "attach
2-11"
4736 echo "~^attachment attribute tat
";\
4737 read es; echo $es;call xerr "$es" "attach
2-12"
4739 echo "~^attachment attribute-at
2";\
4740 read es; echo $es;call xerr "$es" "attach
2-13"
4744 if [ "$t_remove" == "" ]
4748 echo "~^attachment remove .
/.treadctl
"; read es;\
4749 call xerr $es "attach
3-1"
4750 echo "~^attachment remove .
/.tattach
"; read es;\
4751 call xerr $es "attach
3-2"
4752 echo "~^ attachment remove .
/.treadctl
"; read es;\
4753 vput vexpr es substr $es 0 3
4755 xcall bail "attach
3-3"
4757 echo "~^ attachment remove .
/.tattach
"; read es;\
4758 vput vexpr es substr $es 0 3
4760 xcall bail "attach
3-4"
4762 echo "~^attachment list
"; read es;\
4763 vput vexpr es substr $es 0 3
4765 xcall bail "attach
3-5"
4769 echo "~^attachment insert .
/.tattach
=latin1
";\
4770 read hl; echo $hl; call xerr "$hl" "attach
4-1"
4771 echo "~^attachment insert .
/.tattach
=latin1
";\
4772 read hl; echo $hl; call xerr "$hl" "attach
4-2"
4773 echo "~^attachment list
";\
4774 read es; echo $es;call xerr "$es" "attach
4-3"
4776 echo "~^ attachment remove .tattach
"; read es;\
4777 vput vexpr es substr $es 0 3
4779 xcall bail "attach
4-4 $es"
4781 echo "~^attachment remove-at T
"; read es;\
4782 vput vexpr es substr $es 0 3
4784 xcall bail "attach
4-5"
4786 echo "~^attachment remove .
/.tattach
"; read es;\
4787 call xerr $es "attach
4-6"
4788 echo "~^attachment remove .
/.tattach
"; read es;\
4789 call xerr $es "attach
4-7"
4790 echo "~^ attachment remove .
/.tattach
"; read es;\
4791 vput vexpr es substr $es 0 3
4793 xcall bail "attach
4-8 $es"
4795 echo "~^attachment list
"; read es;\
4796 vput vexpr es substr $es 0 3
4798 xcall bail "attach
4-9"
4802 echo "~^attachment insert .
/.tattach
=latin1
";\
4803 read hl; echo $hl; call xerr "$hl" "attach
5-1"
4804 echo "~^attachment insert .
/.tattach
=latin1
";\
4805 read hl; echo $hl; call xerr "$hl" "attach
5-2"
4806 echo "~^attachment insert .
/.tattach
=latin1
";\
4807 read hl; echo $hl; call xerr "$hl" "attach
5-3"
4808 echo "~^attachment list
";\
4809 read es; echo $es;call xerr "$es" "attach
5-4"
4812 echo "~^attachment remove-at
3"; read es;\
4813 call xerr $es "attach
5-5"
4814 echo "~^attachment remove-at
3"; read es;\
4815 vput vexpr es substr $es 0 3
4817 xcall bail "attach
5-6"
4819 echo "~^attachment remove-at
2"; read es;\
4820 call xerr $es "attach
5-7"
4821 echo "~^attachment remove-at
2"; read es;\
4822 vput vexpr es substr $es 0 3
4824 xcall bail "attach
5-8"
4826 echo "~^attachment remove-at
1"; read es;\
4827 call xerr $es "attach
5-9"
4828 echo "~^attachment remove-at
1"; read es;\
4829 vput vexpr es substr $es 0 3
4831 xcall bail "attach
5-10"
4834 echo "~^attachment list
"; read es;\
4835 vput vexpr es substr $es 0 3
4837 xcall bail "attach
5-11"
4841 echo "~^attachment insert .
/.tattach
=latin1
";\
4842 read hl; echo $hl; call xerr "$hl" "attach
6-1"
4843 echo "~^attachment insert .
/.tattach
=latin1
";\
4844 read hl; echo $hl; call xerr "$hl" "attach
6-2"
4845 echo "~^attachment insert .
/.tattach
=latin1
";\
4846 read hl; echo $hl; call xerr "$hl" "attach
6-3"
4847 echo "~^attachment list
";\
4848 read es; echo $es;call xerr "$es" "attach
6-4"
4851 echo "~^attachment remove-at
1"; read es;\
4852 call xerr $es "attach
6-5"
4853 echo "~^attachment remove-at
1"; read es;\
4854 call xerr $es "attach
6-6"
4855 echo "~^attachment remove-at
1"; read es;\
4856 call xerr $es "attach
6-7"
4857 echo "~^attachment remove-at
1"; read es;\
4858 vput vexpr es substr $es 0 3
4860 xcall bail "attach
6-8"
4863 echo "~^attachment list
"; read es;\
4864 vput vexpr es substr $es 0 3
4866 xcall bail "attach
6-9"
4878 echo on-compose-enter, mailx-command<$mailx-command>
4879 alternates alter1@exam.ple alter2@exam.ple
4881 set autocc='alter1@exam.ple alter2@exam.ple'
4882 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4883 echo mailx-subject<$mailx-subject>
4884 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4885 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4886 mailx-raw-bcc<$mailx-raw-bcc>
4887 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4888 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4891 echo on-compose-leave, mailx-command<$mailx-command>
4893 eval alternates $al alter3@exam.ple alter4@exam.ple
4895 set autobcc='alter3@exam.ple alter4@exam.ple'
4896 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4897 echo mailx-subject<$mailx-subject>
4898 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4899 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4900 mailx-raw-bcc<$mailx-raw-bcc>
4901 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4902 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4905 echo on-compose-cleanup, mailx-command<$mailx-command>
4908 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4909 echo mailx-subject<$mailx-subject>
4910 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4911 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4912 mailx-raw-bcc<$mailx-raw-bcc>
4913 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4914 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4916 wysh set on-compose-splice=t_ocs \
4917 on-compose-enter=t_oce on-compose-leave=t_ocl \
4918 on-compose-cleanup=t_occ
4921 printf 'm this-goes@nowhere\nbody\n!.\n' |
4922 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4923 -X'source ./.trc' -Smta=./.tmta.sh \
4925 ${cat} ./.tall >> "${MBOX}"
4926 check 1 0 "${MBOX}" '2481823179 10101'
4929 printf 'm this-goes@nowhere\nbody\n!.\n' |
4930 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4931 -St_remove=1 -X'source ./.trc' -Smta=./.tmta.sh \
4933 ${cat} ./.tall >> "${MBOX}"
4934 check 2 0 "${MBOX}" '3654000499 12535'
4938 # Some state machine stress, shell compose hook, localopts for hook, etc.
4939 # readctl in child. ~r as HERE document
4941 printf 'm ex@am.ple\nbody\n!.
4942 echon ${mailx-command}${mailx-subject}
4943 echon ${mailx-from}${mailx-sender}
4944 echon ${mailx-to}${mailx-cc}${mailx-bcc}
4945 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
4946 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
4947 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
4948 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4952 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4955 vput vexpr es substr "$1" 0 1
4960 define read_mline_res {
4961 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4962 echo $len/$es/$^ERRNAME: $hl
4963 if [ $es -ne $^ERR-NONE ]
4964 xcall bail read_mline_res
4966 \xcall read_mline_res
4970 vput vexpr i + 1 "$2"
4972 vput vexpr j % $i 10
4979 eval \\$j _work $1 $i
4982 vput vexpr i + $i "$1"
4986 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
4987 echo read:$es/$en: $line
4988 if [ "${es}" -ne -1 ]
4991 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
4996 echo "~^header list
"; read hl; echo $hl;\
4997 vput vexpr es substr "$hl" 0 1
4999 xcall bail "header list
"
5002 call _work 1; echo $?
5003 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
5004 read es; echo $es; vput vexpr es substr "$es" 0 1
5006 xcall bail "be diet
"
5008 echo "~^header insert cc
<splice2@exam.ple
>";\
5009 read es; echo $es; vput vexpr es substr "$es" 0 1
5011 xcall bail "be diet2
"
5014 call _work 2; echo $?
5015 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
5016 read es; echo $es;vput vexpr es substr "$es" 0 1
5018 xcall bail "be juicy
"
5020 echo "~^header insert bcc juice2@exam.ple
";\
5021 read es; echo $es;vput vexpr es substr "$es" 0 1
5023 xcall bail "be juicy2
"
5025 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
5026 read es; echo $es;vput vexpr es substr "$es" 0 1
5028 xcall bail "be juicy3
"
5030 echo "~^header insert bcc juice4@exam.ple
";\
5031 read es; echo $es;vput vexpr es substr "$es" 0 1
5033 xcall bail "be juicy4
"
5036 echo "~^header remove-at bcc
3";\
5037 read es; echo $es;vput vexpr es substr "$es" 0 1
5039 xcall bail "remove juicy5
"
5041 echo "~^header remove-at bcc
2";\
5042 read es; echo $es;vput vexpr es substr "$es" 0 1
5044 xcall bail "remove juicy6
"
5046 echo "~^header remove-at bcc
3";\
5047 read es; echo $es;vput vexpr es substr "$es" 0 3
5049 xcall bail "failed to remove-at
"
5051 # Add duplicates which ought to be removed!
5052 echo "~^header insert bcc juice4@exam.ple
";\
5053 read es; echo $es;vput vexpr es substr "$es" 0 1
5055 xcall bail "be juicy4-1
"
5057 echo "~^header insert bcc juice4@exam.ple
";\
5058 read es; echo $es;vput vexpr es substr "$es" 0 1
5060 xcall bail "be juicy4-2
"
5062 echo "~^header insert bcc juice4@exam.ple
";\
5063 read es; echo $es;vput vexpr es substr "$es" 0 1
5065 xcall bail "be juicy4-3
"
5070 call _work 3; echo $?
5072 vput ! i echo just knock if you can hear me;\
5074 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
5076 echon shell-cmd says $?/$^ERRNAME: $i
5077 echo "~x will not become interpreted
, we are reading
until __EOT
"
5079 read r_status; echo "~~r status output
: $r_status"
5080 echo "~
:echo $? $
! $^ERRNAME
"
5082 echo "~~r status from parent
: $r_status"
5085 call _work 4; echo $?
5086 vput cwd cwd;echo cwd:$?
5087 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
5091 call _work 5; echo $?
5092 echo "~^header show MAILX-Command
"; read es;\
5093 call xerr $es "t_header
1000"; call read_mline_res
5094 echo "~^header show MAILX-raw-TO
"; read es;\
5095 call xerr $es "t_header
1001"; xcall read_mline_res
5097 echoerr IT IS WRONG IF YOU SEE THIS
5100 echo on-compose-enter, mailx-command<$mailx-command>
5101 set t_oce autobcc=oce@exam.ple
5102 alternates alter1@exam.ple alter2@exam.ple
5104 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5105 echo mailx-subject<$mailx-subject>
5106 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5107 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5108 mailx-raw-bcc<$mailx-raw-bcc>
5109 echo mailx-orig-from<$mailx-orig-from> \
5110 mailx-orig-to<$mailx-orig-to> \
5111 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5114 echo on-compose-leave, mailx-command<$mailx-command>
5115 set t_ocl autocc=ocl@exam.ple
5117 alternates alter3@exam.ple alter4@exam.ple
5119 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5120 echo mailx-subject<$mailx-subject>
5121 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5122 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5123 mailx-raw-bcc<$mailx-raw-bcc>
5124 echo mailx-orig-from<$mailx-orig-from> \
5125 mailx-orig-to<$mailx-orig-to> \
5126 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5129 echo on-compose-cleanup, mailx-command<$mailx-command>
5130 set t_occ autocc=occ@exam.ple
5133 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5134 echo mailx-subject<$mailx-subject>
5135 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5136 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5137 mailx-raw-bcc<$mailx-raw-bcc>
5138 echo mailx-orig-from<$mailx-orig-from> \
5139 mailx-orig-to<$mailx-orig-to> \
5140 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5142 wysh set on-compose-splice=t_ocs \
5143 on-compose-splice-shell="read ver
;echo t_ocs-shell
;\
5144 echo \"~t shell@exam.ple
\"; echo \"~
:set t_ocs_sh
\"" \
5145 on-compose-enter=t_oce on-compose-leave=t_ocl \
5146 on-compose-cleanup=t_occ
5149 ${cat} ./.tnotes >> "${MBOX}"
5150 check 3 - "${MBOX}" '679526364 2431'
5152 # Reply, forward, resend, Resend
5160 set from
="du <f2@z>" stealthmua
=noagent
5164 ' | ${MAILX} ${ARGS} -Smta=./.tmta.sh -Snomemdebug -Sescape=!
5167 echo start
: $? $
! $^ERRNAME
5169 echo File
: $? $
! $^ERRNAME
;echo;echo
5171 this is content of reply
1
5173 echo reply
1: $? $
! $^ERRNAME
;echo;echo
5175 this is content of Reply
1 2
5177 echo Reply
1 2: $? $
! $^ERRNAME
;echo;echo
5178 forward
1 fwdex@am.ple
5179 this is content of forward
1
5181 echo forward
1: $? $
! $^ERRNAME
;echo;echo
5182 wysh
set forward-inject-head
=$
'"'"'-- \\
5183 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
5184 wysh
set forward-inject-tail
=$
'"'"'-- \\
5185 end of forward (%%i) --\\n'"'"'
5186 forward
2 fwdex@am.ple
5187 this is content of forward
2
5189 echo forward
2: $? $
! $^ERRNAME
;echo;echo
5191 forward
2 fwdex2@am.ple
5192 this is content of forward
2, 2nd
, with showname
set
5194 echo forward
2, 2nd
: $? $
! $^ERRNAME
;echo;echo
5195 resend
1 2 resendex@am.ple
5196 echo resend
1 2: $? $
! $^ERRNAME
;echo;echo
5197 Resend
1 2 Resendex@am.ple
5198 echo Resend
1 2: $? $
! $^ERRNAME
;echo;echo
5200 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
5204 echoerr
"Failed: $1. Bailing out"; echo "~x"; xit
5207 vput vexpr es substr
"$1" 0 1
5212 define read_mline_res
{
5213 read hl
; wysh
set len
=$? es
=$
! en
=$^ERRNAME
;\
5214 echo mline_res
:$len/$es/$^ERRNAME
: $hl
5215 if [ $es -ne $^ERR-NONE
]
5216 xcall bail read_mline_res
5218 \xcall read_mline_res
5222 echo "~^header show $1"; read es
;\
5223 call xerr
$es "work_hl $1"; echo $1; call read_mline_res
5231 echo t_ocs version
$ver
5232 echo "~^header list"; read hl
; echo $hl;\
5233 echoerr the header list is
$hl;\
5234 call xerr
"$hl" "header list"
5235 eval vpospar
set $hl
5238 echoerr IT IS WRONG IF YOU SEE THIS
5241 echo on-XY-enter
, mailx-command
<$mailx-command>
5242 set t_oce autobcc
=oce@exam.ple
5243 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5244 echo mailx-subject
<$mailx-subject>
5245 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5246 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5247 mailx-raw-bcc
<$mailx-raw-bcc>
5248 echo mailx-orig-from
<$mailx-orig-from> \
5249 mailx-orig-to
<$mailx-orig-to> \
5250 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5253 echo on-XY-leave
, mailx-command
<$mailx-command>
5254 set t_ocl autocc
=ocl@exam.ple
5255 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5256 echo mailx-subject
<$mailx-subject>
5257 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5258 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5259 mailx-raw-bcc
<$mailx-raw-bcc>
5260 echo mailx-orig-from
<$mailx-orig-from> \
5261 mailx-orig-to
<$mailx-orig-to> \
5262 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5265 echo on-XY-cleanup
, mailx-command
<$mailx-command>
5266 set t_occ autocc
=occ@exam.ple
5267 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5268 echo mailx-subject
<$mailx-subject>
5269 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5270 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5271 mailx-raw-bcc
<$mailx-raw-bcc>
5272 echo mailx-orig-from
<$mailx-orig-from> \
5273 mailx-orig-to
<$mailx-orig-to> \
5274 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5276 wysh
set on-compose-splice
=t_ocs \
5277 on-compose-enter
=t_oce on-compose-leave
=t_ocl \
5278 on-compose-cleanup
=t_occ \
5279 on-resend-enter
=t_oce on-resend-cleanup
=t_occ
5282 ${cat} ./.tnotes >> "${MBOX}"
5283 check 4 - "${MBOX}" '2151712038 11184'
5288 t_mass_recipients() {
5289 t_prolog mass_recipients
5290 TRAP_EXIT_ADDONS="./.t*"
5292 t_xmta 'Eucalyptus Sat Jul
08 21:14:57 2017'
5294 ${cat} <<'__EOT__' > ./.trc
5296 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
5299 wysh set nr=$1 hn=$2
5300 echo "~$hn $hn$nr@$hn"; echo '~
:echo $?
'; read es
5302 xcall bail "ins_addr $hn 1-$nr"
5304 vput vexpr nr + $nr 1
5305 if [ "$nr" -le "$maximum" ]
5306 xcall ins_addr $nr $hn
5310 wysh set nr=$1 hn=$2
5311 alternates $hn$nr@$hn
5312 vput vexpr nr + $nr 2
5313 if [ "$nr" -le "$maximum" ]
5314 xcall bld_alter $nr $hn
5324 if [ "$t_remove" != '' ]
5329 set on-compose-splice=t_ocs on-compose-leave=t_ocl
5332 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5333 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5334 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5337 ${cat} ./.tall >> "${MBOX}"
5338 check 1 - "${MBOX}" '2912243346 51526'
5341 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5342 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5343 -St_remove=1 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5346 ${cat} ./.tall >> "${MBOX}"
5347 check 2 - "${MBOX}" '4097804632 34394'
5352 t_lreply_futh_rth_etc() {
5353 t_prolog lreply_futh_rth_etc
5354 TRAP_EXIT_ADDONS="./.t*"
5356 t_xmta 'HumulusLupulus Thu Jul
27 14:41:20 2017'
5358 ${cat} <<-_EOT > ./.tmbox
5359 From neverneverland Sun Jul 23 13:46:25 2017
5360 Subject: Bugstop: five miles out 1
5361 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5362 From: mister originator <mr@originator>
5363 To: bugstop-commit@five.miles.out, laber@backe.eu
5365 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
5366 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
5367 Date: Wed, 19 Jul 2017 09:22:57 -0400
5368 Message-Id: <20170719132257.766AF781267@originator>
5371 > |Sorry, I think I misunderstand something. I would think that
5375 From neverneverland Fri Jul
7 22:39:11 2017
5376 Subject
: Bugstop
: five miles out
2
5377 Reply-To
: mister originator2
<mr2@originator
>,bugstop@five.miles.out
,is@a.list
5378 Content-Transfer-Encoding
: 7bit
5379 From
: mister originator
<mr@originator
>
5380 To
: bugstop-commit@five.miles.out
5382 Message-ID
: <149945963975.28888.6950788126957753723.reportbug@five.miles.out
>
5383 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5386 capable of changing back.
5388 From neverneverland Fri Jul
7 22:42:00 2017
5389 Subject
: Bugstop
: five miles out
3
5390 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5391 Content-Transfer-Encoding
: 7bit
5392 From
: mister originator
<mr@originator
>
5393 To
: bugstop-commit@five.miles.out
5395 Message-ID
: <149945963975.28888.6950788126957753746.reportbug@five.miles.out
>
5396 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5397 List-Post
: <mailto
:bugstop@five.miles.out
>
5400 are you ready
, boots?
5402 From neverneverland Sat Aug
19 23:15:00 2017
5403 Subject
: Bugstop
: five miles out
4
5404 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5405 Content-Transfer-Encoding
: 7bit
5406 From
: mister originator
<mr@originator
>
5407 To
: bugstop@five.miles.out
5409 Message-ID
: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out
>
5410 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5411 List-Post
: <mailto
:bugstop@five.miles.out
>
5414 are you ready
, boots?
5419 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
5420 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
5422 wysh
set m
="This is text of \"reply ${1}."
5433 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
5436 wysh set m="This is text of
\"Reply
${1}.
"
5442 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
5451 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
5455 # We need two indirections for this test: one for the case that Lreply
5456 # fails because of missing recipients: we need to read EOF next, thus
5457 # place this in _Ls last; and second for the succeeding cases EOF is
5458 # not what these should read, so go over the backside and splice it in!
5460 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
5463 localopts call-fixate
yes
5465 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
5466 call L
$1 1; call L
$1 2; call L
$1 3
5469 echo;echo '===== CHANGING === '"$*"' =====';echo
5473 set from
=laber@backe.eu
5476 call tweak
set reply-to-honour
5478 call tweak
set followup-to
5480 call tweak
set followup-to-honour
5482 call tweak mlist bugstop@five.miles.out
5484 call tweak mlsubscribe bugstop@five.miles.out
5486 call tweak
set recipients-in-cc
5488 # While here, test that *fullnames* works (also here)
5491 This message should have
*fullnames
* in the header.
5496 if have_feat uistrings
; then
5497 check
1 - "${MBOX}" '1530821219 29859'
5499 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
5504 ${cat} <<-_EOT > ./.tmbox
5505 From tom@i-i.example Thu Oct 26 03:15:55 2017
5506 Date: Wed, 25 Oct 2017 21:15:46 -0400
5507 From: tom <tom@i-i.example>
5508 To: Steffen Nurpmeso <steffen@sdaoden.eu>
5509 Cc: tom <tom@i-i.example>
5510 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
5511 Message-ID: <20171026011546.GA11643@i-i.example>
5512 Reply-To: tom@i-i.example
5513 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
5514 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
5517 The report's useful :-)
5520 # Let us test In-Reply-To: removal starts a new thread..
5521 # This needs adjustment of *stealthmua*
5522 argadd
='-Sstealthmua=noagent -Shostname'
5525 printf 'reply 1\nthread\n!.\n' |
5526 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5527 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
5528 check
2 0 "${MBOX}" '3321764338 429'
5529 check
3 - .tall
'4294967295 0'
5531 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
5532 "${sed}" '/^In-Reply-To:/d' |
5533 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5534 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5535 check
4 0 "${MBOX}" '1682552516 763'
5536 check
5 - .tall
'4294967295 0'
5538 printf 'reply 2\nold <- new <- thread!\n!.\n' |
5539 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5540 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5541 check
6 0 "${MBOX}" '2900984135 1219'
5542 check
7 - .tall
'4294967295 0'
5544 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
5545 "${sed}" '/^In-Reply-To:/d' |
5546 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5547 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5548 check
8 0 "${MBOX}" '794031200 1567'
5549 check
9 - .tall
'4294967295 0'
5557 have_feat smime ||
{
5558 echo 's_mime: unsupported, skipped'
5563 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5564 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5565 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5567 ${cat} <<-_EOT > ./.t.conf
5570 default_keyfile = keyfile.pem
5571 distinguished_name = req_distinguished_name
5572 attributes = req_attributes
5576 [ req_distinguished_name ]
5583 emailAddress = test@localhost
5588 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5589 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5591 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5594 echo bla |
${MAILX} ${ARGS} \
5595 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5596 -Ssmime-sign-digest=sha1 \
5597 -s 'S/MIME test' .
/.VERIFY
5601 /^Content-Description: /{ skip = 2; print; next }
5602 /^$/{ if(skip) --skip }
5605 < .
/.VERIFY
> "${MBOX}"
5606 check
1 - "${MBOX}" '335634014 644'
5608 printf 'verify\nx\n' |
5609 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5610 -R -f .
/.VERIFY
>>${ERR} 2>&1
5613 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5616 # (signing +) encryption / decryption
5617 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5622 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5623 -Ssmime-sign-digest=sha1 \
5624 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5625 -s 'S/MIME test' recei@ver.com
5627 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5628 check
4 - "${MBOX}" '1937410597 327'
5630 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5633 -Ssmime-ca-file=.
/.tcert.pem \
5634 -Ssmime-sign-cert=.
/.tpair.pem \
5635 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5639 /^Content-Description: /{ skip = 2; print; next }
5640 /^$/{ if(skip) --skip }
5643 < .
/.DECRYPT
> "${MBOX}"
5644 check
5 - "${MBOX}" '1019076159 931'
5646 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5647 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5651 echo bla |
${MAILX} ${ARGS} \
5653 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5654 -Sfrom=test@localhost \
5655 -s 'S/MIME test' recei@ver.com
5657 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5658 check
7 - "${MBOX}" '1937410597 327'
5661 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5663 -Ssmime-sign-cert=.
/.tpair.pem \
5664 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5665 check
8 0 "./.DECRYPT" '2624716890 422'
5667 openssl smime
-decrypt -inkey .
/.tkey.pem \
5668 -in .
/.ENCRYPT
>>${ERR} 2>&1
5675 # xxx Note: t_z() was the first test (series) written. Today many
5676 # xxx aspects are (better) covered by other tests above, some are not.
5677 # xxx At some future date and time, convert the last remains not covered
5678 # xxx elsewhere to a real t_* test and drop it
5682 # Test for [260e19d] (Juergen Daubert)
5683 echo body |
${MAILX} ${ARGS} "${MBOX}"
5684 check 4 0 "${MBOX}" '2948857341 94'
5686 # "Test
for" [d6f316a] (Gavin Troy)
5688 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5689 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5690 check
6 0 "${MBOX}" '3942990636 118'
5691 check
6-1 - "${BODY}" '3951695530 170'
5693 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5696 for(i = 0; i < 10000; ++i)
5698 #printf "\xF0\x90\x87\x90"
5699 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5700 check 7 0 "${MBOX}" '1707496413 61812'
5706 # MIME encoding (QP) stress message subject
5707 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5708 'adadaddsssssssddddddddddddddddddddd'\
5709 'ddddddddddddddddddddddddddddddddddd'\
5710 'ddddddddddddddddddddddddddddddddddd'\
5711 'dddddddddddddddddddd Hallelulja? Od'\
5712 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5713 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5714 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5715 'fffffffffffffffffffffffffffffffffff'\
5716 'fffffffffffffffffffff ggggggggggggg'\
5717 'ggggggggggggggggggggggggggggggggggg'\
5718 'ggggggggggggggggggggggggggggggggggg'\
5719 'ggggggggggggggggggggggggggggggggggg'\
5724 # MIME encoding (QP) stress message body
5726 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5727 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5728 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5729 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5730 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5731 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5732 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5733 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5734 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5735 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5736 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5737 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5738 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5739 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5740 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5741 "auf den zeilen vorher.
\r\n"\
5742 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5744 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5746 "Das waren deren zwei.
\r\n"\
5748 "Die letzte Zeile war ein Leerschritt.
\n"\
5749 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5752 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5754 "Das waren deren zwei. ditto.
\n"\
5756 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5757 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5758 "auf den zeilen vorher.
\n"\
5760 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5761 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5763 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5765 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5767 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5769 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5771 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5773 "QP am Zeilenende über soft-nl hinweg
\n"\
5774 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5776 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5778 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5780 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5782 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5784 "Die letzte Zeile war ein Leerschritt.
\n"\
5789 # Test all configs TODO doesn't cover all *combinations*, stupid!
5793 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5794 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5795 NOTME["OPT_CROSS_BUILD
"] = 1
5796 NOTME["OPT_AUTOCC
"] = 1
5797 NOTME["OPT_AMALGAMATION
"] = 1
5798 NOTME["OPT_DEBUG
"] = 1
5799 NOTME["OPT_DEVEL
"] = 1
5800 NOTME["OPT_ASAN_ADDRESS
"] = 1
5801 NOTME["OPT_ASAN_MEMORY
"] = 1
5802 NOTME["OPT_FORCED_STACKPROT
"] = 1
5803 NOTME["OPT_NOMEMDBG
"] = 1
5804 NOTME["OPT_NYD2
"] = 1
5809 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5810 MULVALS["VAL_IDNA
"] = 1
5812 #VALKEYS[0] = "VAL_RANDOM
"
5813 VALVALS["VAL_RANDOM
"] = 1
5816 /^[[:space:]]*OPT_/{
5817 sub(/^[[:space:]]*/, "")
5818 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5819 # does not seem to be a compliant escape for =
5821 $1 = substr($1, 1, index($1, "=") - 1)
5823 OPTVALS[OPTNO++] = $1
5826 /^[[:space:]]*VAL_/{
5827 sub(/^[[:space:]]*/, "")
5828 val = substr($0, index($0, "=") + 1)
5830 val = substr(val, 2)
5831 val = substr(val, 1, length(val) - 1)
5833 $1 = substr($1, 1, index($1, "=") - 1)
5836 else if(VALVALS[$1]){
5837 VALKEYS[VALNO++] = $1
5842 function onepass(addons){
5843 a_onepass__worker(addons, "1", "0")
5844 a_onepass__worker(addons, "0", "1")
5846 function a_onepass__worker(addons, b0, b1){
5847 # Doing this completely sequentially and not doing make distclean in
5848 # between runs should effectively result in lesser compilations.
5849 # It is completely dumb nonetheless... TODO
5850 for(ono = 0; ono < OPTNO; ++ono){
5852 for(i = 0; i < ono; ++i){
5853 myconf = myconf " " OPTVALS[i] "=" b0 " "
5855 j = MULCHOICE[OPTVALS[i]]
5860 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5864 for(i = ono; i < OPTNO; ++i){
5865 myconf = myconf " " OPTVALS[i] "=" b1 " "
5867 j = MULCHOICE[OPTVALS[i]]
5872 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5878 myconf = VALKEYS[i] "=any
" myconf
5880 myconf = myconf " " ALWAYS " " addons
5885 i = split(MULVALS[mula], ia)
5889 print mula "=\"" j "\" " myconf
5895 # We cannot test NULL because of missing UI strings, which will end
5896 # up with different checksums
5897 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5899 j = split(VALVALS[VALKEYS[i]], ia)
5903 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5906 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5907 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5908 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5910 j = split(VALVALS[VALKEYS[i]], ia)
5914 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5917 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5918 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5920 onepass("OPT_DEBUG
=1")
5923 ' | while read c; do
5924 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5925 printf "\n\n##########\n$c\n"
5926 printf "\n\n##########\n$c\n" >&2
5927 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5928 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5929 printf 'Skipping after config, nothing changed\n'
5930 printf 'Skipping after config, nothing changed\n' >&2
5933 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5936 cd .. && ${MAKE} distclean
5939 [ -n "${ERR}" ] && echo > ${ERR}
5940 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5942 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5943 # if have_feat devel; then
5944 # ARGS="${ARGS} -Smemdebug"
5950 while [ ${#} -gt 0 ]; do
5956 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'