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!
14 if [ -f .
/mk-config.ev
]; then
16 elif [ -f snailmail.jpg
] && [ -f .obj
/mk-config.ev
]; then
21 echo >&2 'S-nail/S-mailx is not configured.'
22 echo >&2 'This test script requires the shell environment that only the'
23 echo >&2 'configuration script can figure out, even if it will be used to'
24 echo >&2 'test a different binary than the one that would be produced!'
25 echo >&2 '(The necessary information will be in .obj/mk-config.ev.)'
26 echo >&2 'Hit RETURN to run "make config CONFIG=null'
28 make config CONFIG
=null
32 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
33 MAILX__CC_TEST_RUNNING
=1
34 export MAILX__CC_TEST_RUNNING
35 exec "${SHELL}" "${i}${0}" "${@}"
38 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
39 # such is a compile-time variable
40 ARGS
='-Sv15-compat -:/ -# -Sdotlock-disable -Sexpandaddr=restrict'
41 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
42 ADDARG_UNI
=-Sttycharset=UTF-8
46 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
48 #UTF8_LOCALE= autodetected unless set
50 # Note valgrind has problems with FDs in forked childs, which causes some tests
51 # to fail (the FD is rewound and thus will be dumped twice)
53 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
55 ## -- (>8 -- 8<) -- ##
60 printf >&2 -- "${fmt}\\n" "${@}"
65 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
69 # Wed Oct 2 01:50:07 UTC 1996
70 SOURCE_DATE_EPOCH
=844221007
72 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
73 unset POSIXLY_CORRECT LOGNAME USER
77 Synopsis: cc-test.sh --check-only s-mailx-binary
78 Synopsis: cc-test.sh --mae-test s-mailx-binary [:TEST:]
81 --check-only EXE run the test series, exit success or error;
82 if run in a git(1) checkout then failed tests
83 create test output data files
84 --mae-test EXE [:TEST:] run all or only the given TESTs, and create
85 test output data files; if run in a git(1)
86 checkout with the [test-out] branch available,
87 it will also create file differences
89 Without arguments as many different configurations as possible
90 will be compiled and tested.
95 CHECK_ONLY
= MAE_TEST
= GIT_REPO
= MAILX
=
96 if [ "${1}" = --check-only ]; then
97 [ ${#} -eq 2 ] || usage
98 CHECK_ONLY
=1 MAILX
=${2}
99 [ -x "${MAILX}" ] || usage
100 echo 'Mode: --check-only, binary: '"${MAILX}"
101 [ -d ..
/.git
] && [ -z "${MAILX__CC_TEST_NO_DATA_FILES}" ] && GIT_REPO
=1
102 elif [ "${1}" = --mae-test ]; then
103 [ ${#} -ge 2 ] || usage
104 MAE_TEST
=1 MAILX
=${2}
105 [ -x "${MAILX}" ] || usage
107 echo 'Mode: --mae-test, binary: '"${MAILX}"
108 [ -d ..
/.git
] && GIT_REPO
=1
110 [ ${#} -eq 0 ] || usage
111 echo 'Mode: full compile test, this will take a long time...'
112 MAILX__CC_TEST_NO_DATA_FILES
=1
113 export MAILX__CC_TEST_NO_DATA_FILES
117 MAILX
="${MEMTESTER}${MAILX}"
118 export RAWMAILX MAILX
120 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
121 if [ -z "${UTF8_LOCALE}" ]; then
122 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
123 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
124 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
125 echo 'Trying to detect UTF-8 locale via '"${RAWMAILX}"
126 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
128 \if [ "${ttycharset}" @i=% utf ]
133 \wysh set LC_ALL=${1}
135 \eval xcall cset_test "${@}"
139 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
140 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
142 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
145 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
146 echo 'Trying to detect UTF-8 locale via locale -a'
147 UTF8_LOCALE
=`locale -a | { m=
150 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
153 ${grep} -e POSIX -e en_EN -e en_US; } \
154 >/dev/null 2>&1; then
164 if [ -n "${UTF8_LOCALE}" ]; then
165 echo 'Using Unicode locale '"${UTF8_LOCALE}"
167 echo 'No Unicode locale found, disabling Unicode tests'
175 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
176 trap "exit 1" HUP INT TERM
179 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
180 ${grep} +${1} ) >/dev
/null
2>&1
184 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
186 if [ ${#} -gt 0 ]; then
188 printf '[%s]\n' "${1}"
196 [ ${#} -ge 1 ] && __from
=${1} ||
197 __from
='Silybum Marianum Tue Apr 17 15:55:01 2018'
198 [ ${#} -eq 2 ] && __to=${2} || __to="${MBOX}"
199 ${cat} <<-_EOT > .tmta.sh
201 ( echo 'From '"${__from}" && ${cat} && echo ) >> "${__to}"
207 restat=${?} tid=${1} eestat=${2} f=${3} s=${4}
208 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
209 err "${TESTNAME}-${tid}" 'unexpected status: '"${restat} != ${eestat}"
210 csum="`${cksum} < ${f} | ${sed} -e 's/[ ]\{1,\}/ /g'`"
211 if [ "${csum}" = "${s}" ]; then
213 printf '%s-%s: ok\n' "${TEST_NAME}" "${tid}"
217 printf '%s-%s: error: checksum mismatch (got %s)\n' \
218 "${TEST_NAME}" "${tid}" "${csum}"
221 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
222 x="t.
${TEST_NAME}-${tid}"
223 if [ -n "${MAE_TEST}" ] || [ -n "${maex}" -a -n "${GIT_REPO}" ]; then
224 ${cp} -f "${f}" ./"${x}"
227 if [ -n "${maex}" ] && [ -n "${GIT_REPO}" ] &&
228 command -v diff >/dev
/null
2>&1 &&
229 (git rev-parse
--verify test-out
) >/dev
/null
2>&1 &&
230 git show test-out
:"${x}" > .
/"${x}".old
2>/dev
/null
; then
231 diff -ru .
/"${x}".old ./"${x}" > "${x}".
diff
238 printf '%s: error: %s\n' ${1} "${2}"
242 # $1=test name [$2=status]
244 [ ${#} -gt 1 ] && __qm__
=${2}
245 if [ ${__qm__} -ne 0 ]; then
246 err
"${TEST_NAME}-${1}" 'unexpected non-0 exit status'
249 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
255 # $1=test name [$2=status]
257 [ ${#} -gt 1 ] && __qm__
=${2}
258 if [ ${__qm__} -eq 0 ]; then
259 err
"${TEST_NAME}-${1}" 'unexpected 0 exit status'
262 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
267 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
269 echo "$((${1} + ${2}))"
273 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
277 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
279 echo "$((${1} % ${2}))"
283 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
289 t_X_opt_input_command_stack
292 t_input_inject_semicolon_seq
312 # MIME and RFC basics
320 # Operational basics with easy tests
328 t_rfc2231
# (after attachments)
329 t_mime_types_load_control
331 # Around state machine, after basics
333 t_quote_a_cmd_escapes
337 # Heavy use of/rely on state machine (behaviour) and basics
340 t_lreply_futh_rth_etc
347 t_X_opt_input_command_stack
() {
348 t_prolog X_opt_input_command_stack
349 TRAP_EXIT_ADDONS
="./.t*"
351 ${cat} <<- '__EOT' > "${BODY}"
359 echo "define mac1 {";\
360 echo " echo mac1-1 via1 \$0";\
362 echo " echo mac1-2";\
364 echo " echo mac1-3";\
367 echo "define mac2 {";\
368 echo " echo mac2-1 via1 \$0";\
370 echo " echo mac2-2";\
376 echo echo 1-1-1 via1 \$0;\
388 # The -X option supports multiline arguments, and those can internally use
389 # reverse solidus newline escaping. And all -X options are joined...
391 < "${BODY}" ${MAILX} ${ARGS} \
406 echo "define mac1 {";\
407 echo " echo mac1-1 via2 \$0";\
409 echo " echo mac1-2";\
411 echo " echo mac1-3";\
414 echo "define mac2 {";\
415 echo " echo mac2-1 via2 \$0";\
417 echo " echo mac2-2";\
423 echo echo 1-1-1 via2 \$0;\
437 check 1 0 "${MBOX}" '1786542668 416'
439 # Test for [8412796a] (n_cmd_arg_parse(): FIX token error -> crash
, e.g.
440 # "-RX 'bind;echo $?' -Xx".., 2018-08-02)
441 if have_feat key-bindings
; then
442 ${MAILX} ${ARGS} -RX'bind;echo $?' -Xx > .
/.tall
2>&1
443 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
444 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
445 ${MAILX} ${ARGS} -RX'bind ;echo $?' -Xx >> .
/.tall
2>&1
446 check cmdline
0 .
/.tall
'1867586969 8'
448 echo 'X_opt_input_command_stack-cmdline: unsupported, skipped'
456 if have_feat uistrings
; then :; else
457 echo 'X_errexit: unsupported, skipped'
461 ${cat} <<- '__EOT' > "${BODY}"
467 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
468 -X'echo one' -X' echos nono ' -X'echo two' \
470 check 1 0 "${MBOX}" '916157812 53'
472 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
474 check 2 0 "${MBOX}" '916157812 53'
476 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
478 check
3 0 "${MBOX}" '916157812 53'
482 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
483 -X'echo one' -X' echos nono ' -X'echo two' \
485 check
4 1 "${MBOX}" '2118430867 49'
487 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
489 check 5 1 "${MBOX}" '2118430867 49'
491 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
493 check
6 1 "${MBOX}" '12955965 172'
495 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
497 check 7 1 "${MBOX}" '12955965 172'
499 ## Repeat 4-7 with ignerr set
501 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
503 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
504 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
506 check
8 0 "${BODY}" '916157812 53'
508 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
510 check 9 0 "${BODY}" '916157812 53'
512 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
514 check
10 0 "${BODY}" '916157812 53'
516 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
518 check 11 0 "${BODY}" '916157812 53'
528 # Test basic assumption
529 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
530 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
532 check
1 0 "${MBOX}" '270686329 21'
535 ${cat} <<- '__EOT' > "${BODY}"
540 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
541 -Snoasksub -Sasksub -Snoasksub \
542 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
544 check
2 0 "${MBOX}" '3182942628 37'
546 ${cat} <<- '__EOT' > "${BODY}"
551 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
552 -Snoasksub -Sasksub \
553 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
555 check
3 0 "${MBOX}" '2006554293 39'
558 ${cat} <<- '__EOT' > "${BODY}"
559 echo dietcurd<$dietcurd>
561 echo dietcurd<$dietcurd>
563 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
564 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
565 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
566 -X'echo dietcurd<$dietcurd>' \
568 check
4 0 "${MBOX}" '1985768109 65'
570 ${cat} <<- '__EOT' > "${BODY}"
571 echo dietcurd<$dietcurd>
573 echo dietcurd<$dietcurd>
575 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
576 -Sdietcurd=strawberry
-Snodietcurd \
577 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
578 -X'echo dietcurd<$dietcurd>' \
580 check
5 0 "${MBOX}" '151574279 51'
582 # TODO once we have a detached one with env=1..
583 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
584 echo 's_freeze-{6,7}: shell sets $TERM, skipped'
586 ${cat} <<- '__EOT' > "${BODY}"
587 !echo "shell says TERM<$TERM>"
589 !echo "shell says TERM<$TERM>"
591 !echo "shell says TERM<$TERM>"
593 !echo "shell says TERM<$TERM>"
595 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
596 -STERM=strawberry
-SnoTERM -STERM=vanilla \
597 -X'echo mail<$TERM>' -X'unset TERM' \
598 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
600 check
6 0 "${MBOX}" '1211476036 167'
602 ${cat} <<- '__EOT' > "${BODY}"
603 !echo "shell says TERM<$TERM>"
605 !echo "shell says TERM<$TERM>"
607 !echo "shell says TERM<$TERM>"
609 !echo "shell says TERM<$TERM>"
611 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
612 -STERM=strawberry
-SnoTERM \
613 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
614 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
616 check
7 0 "${MBOX}" '3365080441 132'
623 t_input_inject_semicolon_seq
() {
624 t_prolog input_inject_semicolon_seq
626 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
631 echon this_is_mymac;call mydeepmac;echon ';';
633 echon one';';call mymac;echon two";";call mymac;echo three$';';
635 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
637 echon one';';call mymac;echon two";";call mymac;echo three$';';
640 check 1 0 "${MBOX}" '512117110 140'
648 # XXX the first needs to be checked, it is quite dumb as such
649 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
679 vput shcodec res e abcd
680 echo $?
/$^ERRNAME
$res
683 vput shcodec res d abcd
684 echo $?
/$^ERRNAME
$res
687 vput shcodec res e a
'b'c
'd'
688 echo $?
/$^ERRNAME
$res
691 vput shcodec res d a
'b'c
'd'
692 echo $?
/$^ERRNAME
$res
695 vput shcodec res e a
"b"c
"d"
696 echo $?
/$^ERRNAME
$res
699 vput shcodec res d a
"b"c
"d"
700 echo $?
/$^ERRNAME
$res
703 vput shcodec res e a$
'b'c$
'd'
704 echo $?
/$^ERRNAME
$res
707 vput shcodec res d a$
'b'c$
'd'
708 echo $?
/$^ERRNAME
$res
711 vput shcodec res e
'abcd'
712 echo $?
/$^ERRNAME
$res
715 vput shcodec res d
'abcd'
716 echo $?
/$^ERRNAME
$res
719 vput shcodec res e
"abcd"
720 echo $?
/$^ERRNAME
$res
723 vput shcodec res d
"abcd"
724 echo $?
/$^ERRNAME
$res
727 vput shcodec res e $
'abcd'
728 echo $?
/$^ERRNAME
$res
731 vput shcodec res d $
'abcd'
732 echo $?
/$^ERRNAME
$res
736 vput shcodec res e a b\ c d
737 echo $?
/$^ERRNAME
$res
740 vput shcodec res d a b\ c d
741 echo $?
/$^ERRNAME
$res
742 vput shcodec res e ab
cd
743 echo $?
/$^ERRNAME
$res
746 vput shcodec res d
'ab cd'
747 echo $?
/$^ERRNAME
$res
748 vput shcodec res e a
'b c' d
749 echo $?
/$^ERRNAME
$res
752 vput shcodec res d a
'b c' d
753 echo $?
/$^ERRNAME
$res
754 vput shcodec res e a
"b c" d
755 echo $?
/$^ERRNAME
$res
758 vput shcodec res d a
"b c" d
759 echo $?
/$^ERRNAME
$res
760 vput shcodec res e a $
'b c' d
761 echo $?
/$^ERRNAME
$res
764 vput shcodec res d a $
'b c' d
765 echo $?
/$^ERRNAME
$res
767 vput shcodec res e
'a$`"\'
768 echo $?/$^ERRNAME $res
771 vput shcodec res d 'a$
`"\'
772 echo $?/$^ERRNAME $res
773 vput shcodec res e "a\$\`'\"\\"
774 echo $?/$^ERRNAME $res
777 vput shcodec res d "a\$\`'\"\\"
778 echo $?/$^ERRNAME $res
779 vput shcodec res e $'a\$`\'\"\\'
780 echo $?/$^ERRNAME $res
783 vput shcodec res d $'a\$`\'\"\\'
784 echo $?/$^ERRNAME $res
785 vput shcodec res e $'a\$`\'"\\'
786 echo $?/$^ERRNAME $res
789 vput shcodec res d $'a\$
`\'"\\'
790 echo $?/$^ERRNAME $res
793 vput shcodec res e a${diet}c
794 echo $?/$^ERRNAME $res
797 eval vput shcodec res e a${diet}c
798 echo $?/$^ERRNAME $res
801 vput shcodec res e "a${diet}c"
802 echo $?/$^ERRNAME $res
805 eval vput shcodec res e "a${diet}c"
806 echo $?/$^ERRNAME $res
810 check 1 0 "${MBOX}" '3316745312 1241'
812 if [ -z "${UTF8_LOCALE}" ]; then
813 echo 'Skip shcodec-unicode, no UTF8_LOCALE TODO CANNOT'
815 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
816 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
820 shcodec d $'t\u00E4st'
823 shcodec d $'a\u054Dc'
826 shcodec d $'a\U0001F603c'
828 check unicode 0 "${MBOX}" '4233409480 77'
837 ${cat} <<- '__EOT' > "${BODY}"
856 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
857 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
858 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
860 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
861 echo a$'\u0041\u41\u0C1\U00000041\U41'c
884 echo a$'b\U0000000'dt
885 echo a$'b\U00000000'du
895 if [ -z "${UTF8_LOCALE}" ]; then
896 echo 'Skip wysh-unicode, no UTF8_LOCALE'
898 < "${BODY}" DIET=CURD TIED= \
899 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
900 check unicode 0 "${MBOX}" '475805847 317'
903 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
904 check c 0 "${MBOX}" '1473887148 321'
906 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
907 wysh set mager='\hey\'
909 wysh set mager="\hey\\"
911 wysh set mager=$'\hey\\'
914 check 3 0 "${MBOX}" '1289698238 69'
920 t_prolog commandalias
922 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
923 commandalias echo echo hoho
927 commandalias XxX XxXx
928 commandalias XxXx XxXxX
929 commandalias XxXxX XxXxXx
930 commandalias XxXxXx echo huhu
931 commandalias XxXxXxX echo huhu
933 commandalias XxXxXx XxXxXxX
936 commandalias XxXxXx echo huhu
940 check 1 0 "${MBOX}" '1638809585 36'
948 # Nestable conditions test
949 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
971 if $dietcurd == 'yoho'
976 if $dietcurd @== 'Yoho'
981 if $dietcurd == 'Yoho'
986 if $dietcurd != 'yoho'
991 if $dietcurd @!= 'Yoho'
996 if $dietcurd != 'Yoho'
1057 if $dietcurd == 'yohu
'
1059 elif $dietcurd == 'yoha
'
1061 elif $dietcurd == 'yohe
'
1063 elif $dietcurd == 'yoho
'
1065 if $dietcurd == 'yohu
'
1067 elif $dietcurd == 'yoha
'
1069 elif $dietcurd == 'yohe
'
1071 elif $dietcurd == 'yoho
'
1073 if $dietcurd == 'yohu
'
1075 elif $dietcurd == 'yoha
'
1077 elif $dietcurd == 'yohe
'
1079 elif $dietcurd == 'yoho
'
1135 if $dietcurd @== aBC
1140 if $dietcurd @>= AbC
1145 if $dietcurd @<= ABc
1150 if $dietcurd @>= abd
1155 if $dietcurd @<= abb
1183 if $dietcurd @i=% aB
1228 set diet=abc curd=abc
1234 set diet=abc curd=abcd
1240 # 1. Shitty grouping capabilities as of today
1241 unset diet curd ndefined
1242 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1248 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1253 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1258 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1263 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1268 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1269 && [ no ] || [ yes ]
1274 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1279 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1284 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1289 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1294 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1299 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1304 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1309 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1314 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1319 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1325 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1331 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1336 # 2. Shitty grouping capabilities as of today
1337 unset diet curd ndefined
1338 if [ false || false || true ] && [ false || true ] && yes
1343 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1348 if [ 1 || 0 || 0 || 0 ]
1353 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1358 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1363 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1368 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1373 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1378 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1383 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1388 if 1 || 0 || 0 || 0 && 0
1393 if 1 || 0 || 0 || 0 && 1
1398 if 0 || 0 || 0 || 1 && 0
1403 if 0 || 0 || 0 || 1 && 1
1408 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1413 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1419 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1424 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1430 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1435 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1440 if [ [ [ [ [ [ $diet == 'yo
' && $curd == 'ho
' && $ndefined ] ] ] ] ] ]
1445 # Some more en-braced variables
1447 if ${diet} == ${curd}
1452 if ${diet} != ${curd}
1468 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1473 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1478 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1483 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1488 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1493 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1498 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1503 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1508 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1514 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1519 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1524 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1529 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1534 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1539 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1544 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1549 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1554 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1561 check normal 0 "${MBOX}" '1688759742 719'
1563 if have_feat regex; then
1564 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1566 if $dietcurd =~ '^yo.
*'
1571 if $dietcurd =~ '^Yo.
*'
1576 if $dietcurd @=~ '^Yo.
*'
1581 if $dietcurd =~ '^yOho.
+'
1586 if $dietcurd @!~ '.
*Ho$
'
1591 if $dietcurd !~ '.
+yohO$
'
1596 if [ $dietcurd @i!~ '.
+yoho$
' ]
1601 if ! [ $dietcurd @i=~ '.
+yoho$
' ]
1606 if ! ! [ $dietcurd @i!~ '.
+yoho$
' ]
1611 if ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ]
1616 if [ ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ] ]
1621 if ! [ ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1626 if ! ! ! $dietcurd !~ '.
+yoho$
'
1631 if ! ! ! $dietcurd =~ '.
+yoho$
'
1636 if ! [ ! ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1641 set diet=abc curd='^abc$
'
1647 set diet=abc curd='^abcd$
'
1655 check regex 0 "${MBOX}" '1115671789 95'
1657 printf 'if-regex
: unsupported
, skipped
\n'
1666 # Nestable conditions test
1667 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1682 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1687 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1688 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1697 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1699 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1708 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1715 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1722 echo ----- $1: $2 -> $3 -> $4
1730 call llx 'call off
' on on on
1731 call llx 'call off
' off on on
1732 call llx 'call off
' on off on
1733 call llx 'call off
' on off off
1734 localopts call-fixate on
1735 call llx 'call-fixate on
' on on on
1736 call llx 'call-fixate on
' off on on
1737 call llx 'call-fixate on
' on off on
1738 call llx 'call-fixate on
' on off off
1739 unset x;localopts call on
1740 call llx 'call on
' on on on
1741 call llx 'call on
' off on on
1742 call llx 'call on
' on off on
1743 call llx 'call on
' on off off
1748 check 1 0 "${MBOX}" '4016155249 1246'
1756 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1784 echo ------- global-1 du=$du
1786 echo ------- global-2 du=$du
1789 echo ------- global-3 du=$du
1791 echo ------- global-4 du=$du
1793 echo ------- global-5 du=$du
1796 check 1 0 "${MBOX}" '2411598140 641'
1801 t_macro_param_shift() {
1802 t_prolog macro_param_shift
1804 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1807 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1812 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1813 if [ $# > 1 ] || [ $ignerr == '' ]
1818 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1820 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1824 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1829 call t2 1 you get four args
1830 echo t1.1: $?';' ignerr ($ignerr) should not exist
1831 call t2 1 you get 'three args
'
1832 echo t1.2: $?';' ignerr ($ignerr) should not exist
1833 call t2 1 you 'get two args
'
1834 echo t1.3: $?';' ignerr ($ignerr) should not exist
1835 call t2 1 'you get one arg
'
1836 echo t1.4: $?';' ignerr ($ignerr) should not exist
1837 ignerr call t2 '' 'you get one arg
'
1838 echo t1.5: $?';' ignerr ($ignerr) should not exist
1843 check 1 0 "${MBOX}" '1402489146 1682'
1851 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1852 vput addrcodec res e 1 <doog@def>
1853 echo $?/$^ERRNAME $res
1854 eval vput addrcodec res d $res
1855 echo $?/$^ERRNAME $res
1856 vput addrcodec res e 2 . <doog@def>
1857 echo $?/$^ERRNAME $res
1858 eval vput addrcodec res d $res
1859 echo $?/$^ERRNAME $res
1860 vput addrcodec res e 3 Sauer Dr. <doog@def>
1861 echo $?/$^ERRNAME $res
1862 eval vput addrcodec res d $res
1863 echo $?/$^ERRNAME $res
1864 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1865 echo $?/$^ERRNAME $res
1866 eval vput addrcodec res d $res
1867 echo $?/$^ERRNAME $res
1868 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1869 echo $?/$^ERRNAME $res
1870 eval vput addrcodec res d $res
1871 echo $?/$^ERRNAME $res
1873 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1874 echo $?/$^ERRNAME $res
1875 eval vput addrcodec res d $res
1876 echo $?/$^ERRNAME $res
1877 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1878 echo $?/$^ERRNAME $res
1879 eval vput addrcodec res d $res
1880 echo $?/$^ERRNAME $res
1881 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1882 echo $?/$^ERRNAME $res
1883 eval vput addrcodec res d $res
1884 echo $?/$^ERRNAME $res
1885 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1886 echo $?/$^ERRNAME $res
1887 eval vput addrcodec res d $res
1888 echo $?/$^ERRNAME $res
1889 vput addrcodec res +e 8 \
1890 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1891 echo $?/$^ERRNAME $res
1892 eval vput addrcodec res d $res
1893 echo $?/$^ERRNAME $res
1894 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1895 echo $?/$^ERRNAME $res
1896 eval vput addrcodec res d $res
1897 echo $?/$^ERRNAME $res
1898 vput addrcodec res +e 10 (Ma)Braten Dr. (Heu) <doog@def>
1899 echo $?/$^ERRNAME $res
1900 eval vput addrcodec res d $res
1901 echo $?/$^ERRNAME $res
1902 vput addrcodec res +e 11 (Ma)Braten Dr"." (Heu) <doog@def>
1903 echo $?/$^ERRNAME $res
1904 eval vput addrcodec res d $res
1905 echo $?/$^ERRNAME $res
1906 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1907 echo $?/$^ERRNAME $res
1908 eval vput addrcodec res d $res
1909 echo $?/$^ERRNAME $res
1910 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1911 echo $?/$^ERRNAME $res
1912 eval vput addrcodec res d $res
1913 echo $?/$^ERRNAME $res
1914 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1915 echo $?/$^ERRNAME $res
1916 eval vput addrcodec res d $res
1917 echo $?/$^ERRNAME $res
1918 vput addrcodec res +e 15 \
1919 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1920 echo $?/$^ERRNAME $res
1921 eval vput addrcodec res d $res
1922 echo $?/$^ERRNAME $res
1923 vput addrcodec res +e 16 \
1924 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1925 echo $?/$^ERRNAME $res
1926 eval vput addrcodec res d $res
1927 echo $?/$^ERRNAME $res
1928 vput addrcodec res +e 17 \
1929 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1930 echo $?/$^ERRNAME $res
1931 eval vput addrcodec res d $res
1932 echo $?/$^ERRNAME $res
1933 vput addrcodec res +e 18 \
1934 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1935 echo $?/$^ERRNAME $res
1936 eval vput addrcodec res d $res
1937 echo $?/$^ERRNAME $res
1938 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1939 echo $?/$^ERRNAME $res
1940 eval vput addrcodec res d $res
1941 echo $?/$^ERRNAME $res
1943 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1944 echo $?/$^ERRNAME $res
1945 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1946 echo $?/$^ERRNAME $res
1947 eval vput addrcodec res d $res
1948 echo $?/$^ERRNAME $res
1950 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1951 echo $?/$^ERRNAME $res
1952 eval vput addrcodec res d $res
1953 echo $?/$^ERRNAME $res
1955 vput addrcodec res s \
1956 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1957 echo $?/$^ERRNAME $res
1959 # Fix for [f3852f88]
1960 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot(e)d"
1961 echo $?/$^ERRNAME $res
1962 eval vput addrcodec res d $res
1963 echo $?/$^ERRNAME $res
1964 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot(e)d"
1965 echo $?/$^ERRNAME $res
1966 eval vput addrcodec res d $res
1967 echo $?/$^ERRNAME $res
1970 check 1 0 "${MBOX}" '1047317989 2612'
1972 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1974 mlsubscribe isa2@list
1976 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1977 echo $?/$^ERRNAME $res
1978 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1979 echo $?/$^ERRNAME $res
1980 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1981 echo $?/$^ERRNAME $res
1982 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1983 echo $?/$^ERRNAME $res
1984 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1985 echo $?/$^ERRNAME $res
1986 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1987 echo $?/$^ERRNAME $res
1990 check 2 0 "${MBOX}" '1391779299 104'
1992 if have_feat idna; then
1993 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1994 vput addrcodec res e (heu) <du@blödiän> "stroh" du
1995 echo $?/$^ERRNAME $res
1996 eval vput addrcodec res d $res
1997 echo $?/$^ERRNAME $res
1998 vput addrcodec res e <du@blödiän> du
1999 echo $?/$^ERRNAME $res
2000 eval vput addrcodec res d $res
2001 echo $?/$^ERRNAME $res
2002 vput addrcodec res e du <du@blödiän>
2003 echo $?/$^ERRNAME $res
2004 eval vput addrcodec res d $res
2005 echo $?/$^ERRNAME $res
2006 vput addrcodec res e <du@blödiän>
2007 echo $?/$^ERRNAME $res
2008 eval vput addrcodec res d $res
2009 echo $?/$^ERRNAME $res
2010 vput addrcodec res e du@blödiän
2011 echo $?/$^ERRNAME $res
2012 eval vput addrcodec res d $res
2013 echo $?/$^ERRNAME $res
2016 check idna 0 "${MBOX}" '498775983 326'
2018 printf 'addrcodec-idna
: unsupported
, skipped
\n'
2027 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
2029 vput vexpr res
= 9223372036854775807
2030 echo $?
/$^ERRNAME
$res
2031 vput vexpr res
= 9223372036854775808
2032 echo $?
/$^ERRNAME
$res
2033 vput vexpr res
= u9223372036854775808
2034 echo $?
/$^ERRNAME
$res
2035 vput vexpr res @
= 9223372036854775808
2036 echo $?
/$^ERRNAME
$res
2037 vput vexpr res
= -9223372036854775808
2038 echo $?
/$^ERRNAME
$res
2039 vput vexpr res
= -9223372036854775809
2040 echo $?
/$^ERRNAME
$res
2041 vput vexpr res @
= -9223372036854775809
2042 echo $?
/$^ERRNAME
$res
2043 vput vexpr res
= U9223372036854775809
2044 echo $?
/$^ERRNAME
$res
2047 0b0111111111111111111111111111111111111111111111111111111111111111
2048 echo $?
/$^ERRNAME
$res
2050 S0b1000000000000000000000000000000000000000000000000000000000000000
2051 echo $?
/$^ERRNAME
$res
2053 S0b1000000000000000000000000000000000000000000000000000000000000000
2054 echo $?
/$^ERRNAME
$res
2056 U0b1000000000000000000000000000000000000000000000000000000000000000
2057 echo $?
/$^ERRNAME
$res
2059 0b1000000000000000000000000000000000000000000000000000000000000000
2060 echo $?
/$^ERRNAME
$res
2062 0b1000000000000000000000000000000000000000000000000000000000000000
2063 echo $?
/$^ERRNAME
$res
2065 -0b1000000000000000000000000000000000000000000000000000000000000000
2066 echo $?
/$^ERRNAME
$res
2068 S0b1000000000000000000000000000000000000000000000000000000000000001
2069 echo $?
/$^ERRNAME
$res
2071 S0b1000000000000000000000000000000000000000000000000000000000000001
2072 echo $?
/$^ERRNAME
$res
2074 -0b1000000000000000000000000000000000000000000000000000000000000001
2075 echo $?
/$^ERRNAME
$res
2077 U0b1000000000000000000000000000000000000000000000000000000000000001
2078 echo $?
/$^ERRNAME
$res
2080 vput vexpr res
= 0777777777777777777777
2081 echo $?
/$^ERRNAME
$res
2082 vput vexpr res
= S01000000000000000000000
2083 echo $?
/$^ERRNAME
$res
2084 vput vexpr res @
= S01000000000000000000000
2085 echo $?
/$^ERRNAME
$res
2086 vput vexpr res
= U01000000000000000000000
2087 echo $?
/$^ERRNAME
$res
2088 vput vexpr res
= 01000000000000000000000
2089 echo $?
/$^ERRNAME
$res
2090 vput vexpr res @
= 01000000000000000000000
2091 echo $?
/$^ERRNAME
$res
2092 vput vexpr res
= -01000000000000000000000
2093 echo $?
/$^ERRNAME
$res
2094 vput vexpr res
= S01000000000000000000001
2095 echo $?
/$^ERRNAME
$res
2096 vput vexpr res @
= S01000000000000000000001
2097 echo $?
/$^ERRNAME
$res
2098 vput vexpr res @
= -01000000000000000000001
2099 echo $?
/$^ERRNAME
$res
2100 vput vexpr res
= U01000000000000000000001
2101 echo $?
/$^ERRNAME
$res
2103 vput vexpr res
= 0x7FFFFFFFFFFFFFFF
2104 echo $?
/$^ERRNAME
$res
2105 vput vexpr res
= S0x8000000000000000
2106 echo $?
/$^ERRNAME
$res
2107 vput vexpr res @
= S0x8000000000000000
2108 echo $?
/$^ERRNAME
$res
2109 vput vexpr res
= U0x8000000000000000
2110 echo $?
/$^ERRNAME
$res
2111 vput vexpr res
= 0x8000000000000000
2112 echo $?
/$^ERRNAME
$res
2113 vput vexpr res @
= 0x8000000000000000
2114 echo $?
/$^ERRNAME
$res
2115 vput vexpr res
= -0x8000000000000000
2116 echo $?
/$^ERRNAME
$res
2117 vput vexpr res
= S0x8000000000000001
2118 echo $?
/$^ERRNAME
$res
2119 vput vexpr res @
= S0x8000000000000001
2120 echo $?
/$^ERRNAME
$res
2121 vput vexpr res @
= -0x8000000000000001
2122 echo $?
/$^ERRNAME
$res
2123 vput vexpr res
= u0x8000000000000001
2124 echo $?
/$^ERRNAME
$res
2127 echo $?
/$^ERRNAME
$res
2129 echo $?
/$^ERRNAME
$res
2131 echo $?
/$^ERRNAME
$res
2133 vput vexpr res
+ 0 0
2134 echo $?
/$^ERRNAME
$res
2135 vput vexpr res
+ 0 1
2136 echo $?
/$^ERRNAME
$res
2137 vput vexpr res
+ 1 1
2138 echo $?
/$^ERRNAME
$res
2140 vput vexpr res
+ 9223372036854775807 0
2141 echo $?
/$^ERRNAME
$res
2142 vput vexpr res
+ 9223372036854775807 1
2143 echo $?
/$^ERRNAME
$res
2144 vput vexpr res @
+ 9223372036854775807 1
2145 echo $?
/$^ERRNAME
$res
2146 vput vexpr res
+ 0 9223372036854775807
2147 echo $?
/$^ERRNAME
$res
2148 vput vexpr res
+ 1 9223372036854775807
2149 echo $?
/$^ERRNAME
$res
2150 vput vexpr res @
+ 1 9223372036854775807
2151 echo $?
/$^ERRNAME
$res
2153 vput vexpr res
+ -9223372036854775808 0
2154 echo $?
/$^ERRNAME
$res
2155 vput vexpr res
+ -9223372036854775808 -1
2156 echo $?
/$^ERRNAME
$res
2157 vput vexpr res @
+ -9223372036854775808 -1
2158 echo $?
/$^ERRNAME
$res
2159 vput vexpr res
+ 0 -9223372036854775808
2160 echo $?
/$^ERRNAME
$res
2161 vput vexpr res
+ -1 -9223372036854775808
2162 echo $?
/$^ERRNAME
$res
2163 vput vexpr res @
+ -1 -9223372036854775808
2164 echo $?
/$^ERRNAME
$res
2166 vput vexpr res
- 0 0
2167 echo $?
/$^ERRNAME
$res
2168 vput vexpr res
- 0 1
2169 echo $?
/$^ERRNAME
$res
2170 vput vexpr res
- 1 1
2171 echo $?
/$^ERRNAME
$res
2173 vput vexpr res
- 9223372036854775807 0
2174 echo $?
/$^ERRNAME
$res
2175 vput vexpr res
- 9223372036854775807 -1
2176 echo $?
/$^ERRNAME
$res
2177 vput vexpr res @
- 9223372036854775807 -1
2178 echo $?
/$^ERRNAME
$res
2179 vput vexpr res
- 0 9223372036854775807
2180 echo $?
/$^ERRNAME
$res
2181 vput vexpr res
- -1 9223372036854775807
2182 echo $?
/$^ERRNAME
$res
2183 vput vexpr res
- -2 9223372036854775807
2184 echo $?
/$^ERRNAME
$res
2185 vput vexpr res @
- -2 9223372036854775807
2186 echo $?
/$^ERRNAME
$res
2188 vput vexpr res
- -9223372036854775808 +0
2189 echo $?
/$^ERRNAME
$res
2190 vput vexpr res
- -9223372036854775808 +1
2191 echo $?
/$^ERRNAME
$res
2192 vput vexpr res @
- -9223372036854775808 +1
2193 echo $?
/$^ERRNAME
$res
2194 vput vexpr res
- 0 -9223372036854775808
2195 echo $?
/$^ERRNAME
$res
2196 vput vexpr res
- +1 -9223372036854775808
2197 echo $?
/$^ERRNAME
$res
2198 vput vexpr res @
- +1 -9223372036854775808
2199 echo $?
/$^ERRNAME
$res
2201 vput vexpr res
+ -13 -2
2202 echo $?
/$^ERRNAME
$res
2203 vput vexpr res
- 0 0
2204 echo $?
/$^ERRNAME
$res
2205 vput vexpr res
- 0 1
2206 echo $?
/$^ERRNAME
$res
2207 vput vexpr res
- 1 1
2208 echo $?
/$^ERRNAME
$res
2209 vput vexpr res
- -13 -2
2210 echo $?
/$^ERRNAME
$res
2212 vput vexpr res
* 0 0
2213 echo $?
/$^ERRNAME
$res
2214 vput vexpr res
* 0 1
2215 echo $?
/$^ERRNAME
$res
2216 vput vexpr res
* 1 1
2217 echo $?
/$^ERRNAME
$res
2218 vput vexpr res
* -13 -2
2219 echo $?
/$^ERRNAME
$res
2221 vput vexpr res
/ 0 0
2222 echo $?
/$^ERRNAME
$res
2223 vput vexpr res
/ 0 1
2224 echo $?
/$^ERRNAME
$res
2225 vput vexpr res
/ 1 1
2226 echo $?
/$^ERRNAME
$res
2227 vput vexpr res
/ -13 -2
2228 echo $?
/$^ERRNAME
$res
2230 vput vexpr res
% 0 0
2231 echo $?
/$^ERRNAME
$res
2232 vput vexpr res
% 0 1
2233 echo $?
/$^ERRNAME
$res
2234 vput vexpr res
% 1 1
2235 echo $?
/$^ERRNAME
$res
2236 vput vexpr res
% -13 -2
2237 echo $?
/$^ERRNAME
$res
2240 check numeric
0 "${MBOX}" '960821755 1962'
2242 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2243 vput vexpr res find 'bananarama' 'nana'
2244 echo $?/$^ERRNAME :$res:
2245 vput vexpr res find 'bananarama' 'bana'
2246 echo $?/$^ERRNAME :$res:
2247 vput vexpr res find 'bananarama' 'Bana'
2248 echo $?/$^ERRNAME :$res:
2249 vput vexpr res find 'bananarama' 'rama'
2250 echo $?/$^ERRNAME :$res:
2252 vput vexpr res ifind 'bananarama' 'nana'
2253 echo $?/$^ERRNAME :$res:
2254 vput vexpr res ifind 'bananarama' 'bana'
2255 echo $?/$^ERRNAME :$res:
2256 vput vexpr res ifind 'bananarama' 'Bana'
2257 echo $?/$^ERRNAME :$res:
2258 vput vexpr res ifind 'bananarama' 'rama'
2259 echo $?/$^ERRNAME :$res:
2261 vput vexpr res substring 'bananarama' 1
2262 echo $?/$^ERRNAME :$res:
2263 vput vexpr res substring 'bananarama' 3
2264 echo $?/$^ERRNAME :$res:
2265 vput vexpr res substring 'bananarama' 5
2266 echo $?/$^ERRNAME :$res:
2267 vput vexpr res substring 'bananarama' 7
2268 echo $?/$^ERRNAME :$res:
2269 vput vexpr res substring 'bananarama' 9
2270 echo $?/$^ERRNAME :$res:
2271 vput vexpr res substring 'bananarama' 10
2272 echo $?/$^ERRNAME :$res:
2273 vput vexpr res substring 'bananarama' 1 3
2274 echo $?/$^ERRNAME :$res:
2275 vput vexpr res substring 'bananarama' 3 3
2276 echo $?/$^ERRNAME :$res:
2277 vput vexpr res substring 'bananarama' 5 3
2278 echo $?/$^ERRNAME :$res:
2279 vput vexpr res substring 'bananarama' 7 3
2280 echo $?/$^ERRNAME :$res:
2281 vput vexpr res substring 'bananarama' 9 3
2282 echo $?/$^ERRNAME :$res:
2283 vput vexpr res substring 'bananarama' 10 3
2284 echo $?/$^ERRNAME :$res:
2286 vput vexpr res substring 'bananarama' -1
2287 echo $?/$^ERRNAME :$res:
2288 vput vexpr res substring 'bananarama' -3
2289 echo $?/$^ERRNAME :$res:
2290 vput vexpr res substring 'bananarama' -5
2291 echo $?/$^ERRNAME :$res:
2292 vput vexpr res substring 'bananarama' -7
2293 echo $?/$^ERRNAME :$res:
2294 vput vexpr res substring 'bananarama' -9
2295 echo $?/$^ERRNAME :$res:
2296 vput vexpr res substring 'bananarama' -10
2297 echo $?/$^ERRNAME :$res:
2298 vput vexpr res substring 'bananarama' 1 -3
2299 echo $?/$^ERRNAME :$res:
2300 vput vexpr res substring 'bananarama' 3 -3
2301 echo $?/$^ERRNAME :$res:
2302 vput vexpr res substring 'bananarama' 5 -3
2303 echo $?/$^ERRNAME :$res:
2304 vput vexpr res substring 'bananarama' 7 -3
2305 echo $?/$^ERRNAME :$res:
2306 vput vexpr res substring 'bananarama' 9 -3
2307 echo $?/$^ERRNAME :$res:
2308 vput vexpr res substring 'bananarama' 10 -3
2309 echo $?/$^ERRNAME :$res:
2311 vput vexpr res trim 'Cocoon Cocoon'
2312 echo $?/$^ERRNAME :$res:
2313 vput vexpr res trim ' Cocoon Cocoon '
2314 echo $?/$^ERRNAME :$res:
2315 vput vexpr res trim-front 'Cocoon Cocoon'
2316 echo $?/$^ERRNAME :$res:
2317 vput vexpr res trim-front ' Cocoon Cocoon '
2318 echo $?/$^ERRNAME :$res:
2319 vput vexpr res trim-end 'Cocoon Cocoon'
2320 echo $?/$^ERRNAME :$res:
2321 vput vexpr res trim-end ' Cocoon Cocoon '
2322 echo $?/$^ERRNAME :$res:
2325 check string 0 "${MBOX}" '3182004322 601'
2327 if have_feat regex; then
2328 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2329 vput vexpr res regex
'bananarama' 'nana'
2330 echo $?
/$^ERRNAME
:$res:
2331 vput vexpr res regex
'bananarama' 'bana'
2332 echo $?
/$^ERRNAME
:$res:
2333 vput vexpr res regex
'bananarama' 'Bana'
2334 echo $?
/$^ERRNAME
:$res:
2335 vput vexpr res regex
'bananarama' 'rama'
2336 echo $?
/$^ERRNAME
:$res:
2338 vput vexpr res iregex
'bananarama' 'nana'
2339 echo $?
/$^ERRNAME
:$res:
2340 vput vexpr res iregex
'bananarama' 'bana'
2341 echo $?
/$^ERRNAME
:$res:
2342 vput vexpr res iregex
'bananarama' 'Bana'
2343 echo $?
/$^ERRNAME
:$res:
2344 vput vexpr res iregex
'bananarama' 'rama'
2345 echo $?
/$^ERRNAME
:$res:
2347 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2348 echo $?
/$^ERRNAME
:$res:
2349 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2350 echo $?
/$^ERRNAME
:$res:
2351 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2352 echo $?
/$^ERRNAME
:$res:
2353 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2354 echo $?
/$^ERRNAME
:$res:
2356 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2357 echo $?
/$^ERRNAME
:$res:
2358 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2359 echo $?
/$^ERRNAME
:$res:
2360 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2361 echo $?
/$^ERRNAME
:$res:
2362 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2363 echo $?
/$^ERRNAME
:$res:
2367 check regex
0 "${MBOX}" '3270360157 311'
2369 printf 'vexpr-regex: unsupported, skipped\n'
2378 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2383 vput vexpr j '&' $i 7
2389 vput vexpr j '&' $i 7
2395 echo ! The end for $1
2399 # Transport $?/$! up the call chain
2405 wysh set i=$? j=$! k=$^ERRNAME
2409 echo ! The end for $1
2410 return $i $^ERR-BUSY
2414 # Up and down it goes
2421 vput vexpr k - $1 $2
2425 echo "# <$i/$j> .. "
2429 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2432 echo ! The end
for $1=$i/$2
2436 return $i $^ERR-BUSY
2442 call w1
0; echo ?
=$?
!=$
!; echo -----;
2443 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2444 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2447 check
1 0 "${MBOX}" '1572045517 5922'
2455 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2460 vput vexpr j '&' $i 7
2466 echo ! The end for $1/$2
2468 return $i $^ERR-BUSY
2479 echo ?=$? !=$^ERRNAME
2482 echo ?=$? !=$^ERRNAME
2484 echo ?=$? !=$^ERRNAME
2487 check 1 0 "${MBOX}" '2401702082 23801'
2491 if have_feat uistrings; then
2492 ${cat} <<- '__EOT' > "${BODY}"
2497 vput vexpr j '&' $i 7
2503 echo ! The end for $1
2506 echo would be err with errexit
2515 echo zwei, ?=$? !=$!
2516 localopts yes; set errexit
2518 echo drei, ?=$? !=$^ERRNAME
2520 echo vier, ?=$? !=$^ERRNAME, this is an error
2523 echo outer 1, ?=$? !=$^ERRNAME
2525 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2527 echo outer 3, ?=$? !=$^ERRNAME
2528 echo this is definitely an error
2531 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2532 -Snomemdebug > "${MBOX}" 2>&1
2533 check
2 0 "${MBOX}" '3900716531 4200'
2535 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2536 -Snomemdebug > "${MBOX}" 2>&1
2537 check 3 1 "${MBOX}" '1006776201 2799'
2539 echo 'xcall-2: unsupported, skipped'
2540 echo 'xcall-3: unsupported, skipped'
2549 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2550 vpospar
set hey
, "'you ", world
!
2551 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2552 vput vpospar x quote
; echo x
<$x>
2553 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2554 vput vpospar y quote
;echo y
<$y>
2555 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2556 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2557 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2560 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2561 vput vpospar z quote
;echo infun2
:z
<$z>
2565 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2566 vput vpospar y quote
;echo infun
:y
<$y>
2567 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2568 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2570 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2571 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2574 call infun This
"in a" fun
2575 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2576 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2578 check
1 0 "${MBOX}" '155175639 866'
2581 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2583 echo ifs<$ifs> ifs-ws<$ifs-ws>
2584 vpospar set hey, "'you ", world!
2585 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2586 vput vpospar x quote; echo x<$x>
2587 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2588 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2591 echo ifs<$ifs> ifs-ws<$ifs-ws>
2592 vpospar set hey, "'you
", world!
2593 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2595 vput vpospar x quote; echo x<$x>
2596 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2597 eval vpospar set ${x};\
2598 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2601 echo ifs<$ifs> ifs-ws<$ifs-ws>
2602 vpospar set hey, "'you ", world!
2603 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2605 vput vpospar x quote; echo x<$x>
2606 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2607 eval vpospar set ${x};\
2608 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2610 check ifs 0 "${MBOX}" '2015927702 706'
2617 TRAP_EXIT_ADDONS="./.t*"
2619 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2622 printf " (1/$#: <$1>)"
2624 if [ $# -gt 0 ]; then
2638 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2639 printf xxx;xxx arg ,b u.
2640 printf xxx;xxx arg , .
2641 printf xxx;xxx arg ,ball.
2647 echon " (1/$#: <$1>)"
2662 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2663 echon xxx;call xxx arg ,b u.
2664 echon xxx;call xxx arg , .
2665 echon xxx;call xxx arg ,ball.
2668 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2669 check 1 0 "${MBOX}" '41566293 164'
2671 #${SHELL} ./.t.sh > ./.tshout 2>&1
2672 #check disproof-1 0 ./.tshout '41566293 164'
2679 TRAP_EXIT_ADDONS="./.t*"
2681 ${cat} <<- '__EOT
' > .tin
2682 hey1, "'you
", world!
2683 hey2, "'you ", bugs bunny!
2688 ${cat} <<- '__EOT
' |\
2689 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2691 echo $?/$^ERRNAME / <$a><$b><$c>
2693 echo $?/$^ERRNAME / <$a><$b><$c>
2695 echo $?/$^ERRNAME / <$a><$b><$c>
2697 echo $?/$^ERRNAME / <$a><$b><$c>
2698 unset a b c;read a b c
2699 echo $?/$^ERRNAME / <$a><$b><$c>
2700 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2702 check 1 0 "${MBOX}" '1527910147 173'
2704 ${cat} <<- '__EOT
' > .tin2
2705 hey2.0,:"'you
",:world!:mars.:
2706 hey2.1,:"'you ",:world!
2707 hey2.2,:"'you
",:bugs bunny!
2713 ${cat} <<- '__EOT' |\
2714 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2717 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2719 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2721 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2723 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2725 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2727 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2728 unset a b c
;read a b c
2729 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2731 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2732 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2734 check ifs
0 "${MBOX}" '890153490 298'
2736 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2738 readall d; echo $?/$^ERRNAME / <$d>
2739 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2740 readctl create .tin2
2741 readall d; echo $?/$^ERRNAME / <$d>
2742 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2743 readctl remove .tin;echo $?/$^ERRNAME;\
2744 readctl remove .tin2;echo $?/$^ERRNAME
2745 echo '### now with empty lines'
2746 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2747 readctl create .temptynl;echo $?/$^ERRNAME
2748 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2749 readctl remove .temptynl;echo $?/$^ERRNAME
2751 check readall 0 "${MBOX}" '4113506527 405'
2760 TRAP_EXIT_ADDONS=".
/.t
*"
2764 while [ ${i} -lt 113 ]; do
2765 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2766 "${MBOX}" "${i}" "${i}"
2769 ) | ${MAILX} ${ARGS} > .tall 2>&1
2770 check 1 0 "${MBOX}" '1785801373 13336'
2771 check 1-outerr - ./.tall '4294967295 0' # empty file
2773 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2774 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2775 check 2 0 .tall '3075634057 9103'
2777 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2778 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2779 check
3 0 .tall
'1902668747 9110'
2781 # copy only the odd (but the first), move the even
2783 printf 'File "file://%s"\ncopy ' .tmbox2
2785 while [ ${i} -lt 113 ]; do
2789 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2790 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2791 check
4 0 .tmbox3
'2554734733 6666'
2792 check
5 - .tall
'3168324241 4573'
2795 printf 'file "file://%s"\nmove ' .tmbox2
2797 while [ ${i} -lt 113 ]; do
2801 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2802 .tmbox3 .tmbox3 .tmbox2
2803 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2804 check
6 0 .tmbox3
'1429216753 13336'
2805 if have_feat uistrings
; then
2806 ${sed} 2d
< .tall
> .tallx
2810 check
7 - .tallx
'3604509039 13645'
2812 # Invalid MBOXes (after [f4db93b3])
2814 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2815 check 8 0 .tinvmbox '2848412822 118'
2816 check 9 - ./.tall '461280182 33'
2818 echo ' ' > .tinvmbox
2819 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2820 check
10 0 .tinvmbox
'624770486 120'
2821 check
11 - .
/.tall
'461280182 33'
2823 { echo; echo; } > .tinvmbox
# (not invalid)
2824 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2825 check 12 0 .tinvmbox '1485640875 119'
2826 check 13 - ./.tall '461280182 33'
2828 # *mbox-rfc4155*, plus
2829 ${cat} <<-_EOT > ./.tinv1
2832 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2833 Date: Wed, 02 Oct 1996 01:50:07 +0000
2835 Subject: Bad bad message 1
2837 From me to you, blinde Kuh!
2839 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2840 Date: Wed, 02 Oct 1996 01:50:07 +0000
2842 Subject: Bad bad message 2
2844 From me to you, blindes Kalb!
2846 ${cp} ./.tinv1 ./.tinv2
2850 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2851 \\eval copy * "${2}"
2853 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2855 ${cat} ./.tinv1 ./.tok >> .tall
2856 check 14 - ./.tall '739301109 616'
2859 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2860 wysh File ./.tok # Just move away to nowhere
2862 wysh file ./.tinv2 # Fully repaired
2863 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2865 check 15-1 - ./.tinv1 '3178048820 332'
2866 check 15-2 - ./.tinv2 '4151504442 314'
2873 if have_feat maildir; then :; else
2874 echo 'maildir: unsupported, skipped'
2878 TRAP_EXIT_ADDONS=".
/.t
*"
2882 while [ ${i} -lt 112 ]; do
2883 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2884 "${MBOX}" "${i}" "${i}"
2887 ) | ${MAILX} ${ARGS}
2888 check 1 0 "${MBOX}" '2366902811 13332'
2894 ' "${MBOX}" .tmdir1 .tmdir1 |
2895 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2896 check 2 0 .tlst '1713783045 9103'
2899 copy * "maildir
://%s
"
2902 ' "${MBOX}" .tmdir2 .tmdir2 |
2903 ${MAILX} ${ARGS} -Sshowlast > .tlst
2904 check 3 0 .tlst '1240307893 9113'
2906 printf 'File "maildir
://%s
"
2910 ' .tmdir2 .tmbox1 .tmbox1 |
2911 ${MAILX} ${ARGS} -Sshowlast > .tlst
2912 check 4 0 .tmbox1 '4096198846 12772'
2913 check 5 - .tlst '817337448 9110'
2915 # only the odd (even)
2917 printf 'File "maildir
://%s
"
2920 while [ ${i} -lt 112 ]; do
2922 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2929 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2930 check 6 0 .tmbox2 '4228337024 6386'
2931 check 7 - .tlst '884389294 4573'
2934 printf 'file "maildir
://%s
"
2937 while [ ${i} -lt 112 ]; do
2939 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2947 ' .tmbox2 .tmbox2 .tmdir2
2948 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2949 check
8 0 .tmbox2
'978751761 12656'
2950 ${sed} 2d
< .tlst
> .tlstx
2951 check
9 - .tlstx
'2391942957 13645'
2957 # MIME and RFC basics {{{
2958 t_mime_if_not_ascii
() {
2959 t_prolog mime_if_not_ascii
2961 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
2962 check 1 0 "${MBOX}" '3647956381 106'
2964 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
2966 check
2 0 "${MBOX}" '3964303752 274'
2971 t_xxxheads_rfc2047
() {
2972 t_prolog xxxheads_rfc2047
2973 TRAP_EXIT_ADDONS
="./.t*"
2975 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
2977 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
2978 -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̲' \
2980 check
1 0 "${MBOX}" '3422562347 371'
2982 # Single word (overlong line split -- bad standard! Requires injection of
2983 # artificial data!! But can be prevented by using RFC 2047 encoding)
2985 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2986 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
2987 check 2 0 "${MBOX}" '3317256266 1714'
2989 # Combination of encoded words, space and tabs of varying sort
2991 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
2992 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2993 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2994 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2995 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2996 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2998 check 3 0 "${MBOX}" '786672837 587'
3000 # Overlong multibyte sequence that must be forcefully split
3001 # todo This works even before v15.0, but only by accident
3003 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3004 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3005 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3006 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
3008 check 4 0 "${MBOX}" '2889557767 655'
3012 echo | ${MAILX} ${ARGS} \
3013 -s "1-1 B2 B3 B4 B5 B6 B\
3014 1-2 B2 B3 B4 B5 B6 B\
3015 1-3 B2 B3 B4 B5 B6 B\
3016 1-4 B2 B3 B4 B5 B6 B\
3017 1-5 B2 B3 B4 B5 B6 B\
3018 1-6 B2 B3 B4 B5 B6
" \
3020 check 5 0 "${MBOX}" '3135161683 293'
3022 # Leading and trailing WS
3024 echo | ${MAILX} ${ARGS} \
3025 -s " 2-1 B2 B3 B4 B5 B6 B\
3026 1-2 B2 B3 B4 B5 B6 B\
3027 1-3 B2 B3 B4 B5 B6 B\
3028 1-4 B2 B3 B4 B5 B6
" \
3030 check 6 0 "${MBOX}" '3221845405 232'
3032 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
3034 echo "Dat Früchtchen riecht häußlich
" |
3035 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
3037 'Schnödes "Früchtchen
" <do@du> (Hä!)'
3038 check 7 0 "${MBOX}" '800505986 368'
3040 # RFC 2047 in an address field, and iconv involved
3041 if have_feat iconv; then
3043 ${cat} > ./.trebox <<_EOT
3044 From zaza@exam.ple Fri Mar 2 21:31:56 2018
3045 Date: Fri, 2 Mar 2018 20:31:45 +0000
3046 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
3047 To: dude <dude@exam.ple>
3048 Subject: houston(...)
3049 Message-ID: <abra@1>
3051 Content-Type: text/plain; charset=iso-8859-1
3052 Content-Disposition: inline
3053 Content-Transfer-Encoding: 8bit
3056 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3057 -Sfullnames -Sreply-in-same-charset \
3058 -Smta=./.tmta.sh -Rf ./.trebox
3059 check 8 0 "${MBOX}" '2914485741 280'
3061 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
3067 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
3068 t_prolog iconv_mbyte_base64
3069 TRAP_EXIT_ADDONS=".
/.t
*"
3071 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
3072 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
3073 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
3076 echo 'iconv_mbyte_base64: unsupported, skipped'
3080 echo 'iconv_mbyte_base64: unsupported, skipped'
3084 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
3086 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
3087 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3089 -Sescape=! -Smime-encoding=base64 2>./.terr
3090 set ttycharset=utf-8 sendcharsets=iso-2022-jp
3092 !s Japanese from UTF-8 to ISO-2022-JP
3093 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3095 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3098 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3100 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3103 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
3105 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
3106 \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
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
3111 \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
3113 \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
3116 # May not presume iconv output as long as roundtrip possible [489a7122]
3118 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3119 < "${MBOX}" > .
/.tcksum
3120 check
1 - .
/.tcksum
'2694609714 520'
3121 check
2 - .
/.terr
'4294967295 0'
3123 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3124 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3125 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3126 -Rf "${MBOX}" >.
/.tlog
2>&1
3127 check
3 0 .
/.twrite
'1259742080 686'
3128 #check 4 - ./.tlog '3214068822 2123'
3129 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3130 check
4 - .
/.txlog
'3659773472 2035'
3132 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
3135 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
3136 rm -f "${MBOX}" .
/.twrite
3137 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3139 -Sescape=! -Smime-encoding=base64
2>.
/.terr
3140 set ttycharset
=utf-8 sendcharsets
=euc-jp
3142 !s Japanese from UTF-8 to EUC-JP
3143 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3145 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3148 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3150 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3153 set ttycharset
=EUC-JP sendcharsets
=utf-8
3155 !s Japanese from EUC-JP to UTF-8
3156 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3158 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3161 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3163 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3167 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3168 < "${MBOX}" > .
/.tcksum
3169 check
5 - .
/.tcksum
'2870183985 473'
3170 check
6 - .
/.terr
'4294967295 0'
3172 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3173 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3174 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3175 -Rf "${MBOX}" >.
/.tlog
2>&1
3176 check
7 0 .
/.twrite
'1259742080 686'
3177 #check 8 - ./.tlog '2506063395 2075'
3178 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3179 check
8 - .
/.txlog
'2528199891 1988'
3181 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
3187 t_iconv_mainbody
() {
3188 t_prolog iconv_mainbody
3189 TRAP_EXIT_ADDONS
="./.t*"
3191 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
3194 echo 'iconv_mainbody: unsupported, skipped'
3198 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
3200 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3201 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
3202 -s '–' over-the@rain.bow
2>.
/.terr
3203 check
1 0 "${MBOX}" '3634015017 251'
3204 check
2 - .
/.terr
'4294967295 0'
3206 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3207 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
3208 -s '–' over-the@rain.bow
2>.
/.terr
3210 check
3 - "${MBOX}" '3634015017 251'
3211 if have_feat uistrings
; then
3212 if have_feat docstrings
; then # xxx should not be like that
3213 check
4 - .
/.terr
'2579894983 148'
3215 check
4 - .
/.terr
'271380835 121'
3218 echo 'iconv_mainbody-4: unsupported, skipped'
3221 # The different iconv(3) implementations use different replacement sequence
3222 # types (character-wise, byte-wise, and the character(s) used differ)
3223 i
="${MAILX_ICONV_MODE}"
3224 if [ -n "${i}" ]; then
3225 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
3227 check_ex0 5-1-estat ${j}
3228 check 5-1 - ./.terr '4294967295 0'
3229 if [ ${i} -eq 13 ]; then
3230 check 5-2 - ./.tout '189327996 283'
3231 elif [ ${i} -eq 12 ]; then
3232 check 5-3 - ./.tout '1959197095 283'
3233 elif [ ${i} -eq 3 ]; then
3234 check 5-4 - ./.tout '3196380198 279'
3236 check 5-5 - ./.tout '3760313827 279'
3239 echo 'iconv_mainbody-5: unsupported, skipped'
3245 t_binary_mainbody() {
3246 t_prolog binary_mainbody
3247 TRAP_EXIT_ADDONS=".
/.t
*"
3249 printf 'abra\0\nka\r\ndabra' |
3250 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
3252 check 1 0 "${MBOX}" '1629827 239'
3253 check 2 - ./.terr '4294967295 0'
3255 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
3256 ${MAILX} ${ARGS} -Rf \
3257 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
3258 "${MBOX}" >./.tall 2>&1
3259 check 3 0 ./.tall '733582513 319'
3260 check 4 - ./.tcat '3817108933 15'
3261 check 5 - ./.twrite '3817108933 15'
3266 t_C_opt_customhdr() {
3267 t_prolog C_opt_customhdr
3268 TRAP_EXIT_ADDONS=".
/.t
*"
3270 t_xmta 'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
3273 ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3274 -C 'C-One : Custom One Body' \
3275 -C 'C-Two:CustomTwoBody' \
3276 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3277 this-goes@nowhere >./.tall 2>&1
3279 ${cat} ./.tall >> "${MBOX}"
3280 check 1 0 "${MBOX}" '2400078426 195'
3283 printf 'm this-goes@nowhere\nbody\n!.
3285 m this-goes2@nowhere\nbody2\n!.
3286 set customhdr=%ccustom1 : custom1 body%c
3287 m this-goes2@nowhere\nbody2\n!.
3288 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
3289 m this-goes3@nowhere\nbody3\n!.
3291 ${MAILX} ${ARGS} -Smta=./.tmta.sh -Sescape=! \
3292 -C 'C-One : Custom One Body' \
3293 -C 'C-Two:CustomTwoBody' \
3294 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3297 ${cat} ./.tall >> "${MBOX}"
3298 check 2 0 "${MBOX}" '3546878678 752'
3304 # Operational basics with easy tests {{{
3307 TRAP_EXIT_ADDONS=".
/.t
*"
3309 t_xmta 'Hippocastanum Mon Jun 19 15:07:07 2017'
3311 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tmta.sh > ./.tall 2>&1
3313 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
3315 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3317 alias a4 a5 ex1@a4.ple
3319 alias a6 a7 ex1@a6.ple
3333 check 1 0 "${MBOX}" '2496925843 272'
3334 check 2 - .tall '3548953204 152'
3336 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3337 # TODO need to somehow provide its contents to the test, then test
3344 TRAP_EXIT_ADDONS=".
/.t
*"
3346 t_xmta 'Alchemilla Wed Apr 25 15:12:13 2017'
3348 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3349 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
3350 check
1 0 "${MBOX}" '1594682963 13520'
3352 if (echo |
gzip -c) >/dev
/null
2>&1; then
3354 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3355 "${MBOX}" | ${MAILX} ${ARGS} \
3356 -X'filetype gz gzip\ -dc gzip\ -c'
3357 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3358 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3360 check 2 - ".
/.t.mbox
" '1594682963 13520'
3361 check 3 - ".
/.t.out
" '2392348396 102'
3363 echo 'filetype-2: unsupported, skipped'
3364 echo 'filetype-3: unsupported, skipped'
3369 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
3375 -X'filetype gz gzip\ -dc gzip\ -c' \
3376 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
3377 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
3378 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3380 -X'filetype gz gzip\ -dc gzip\ -c' \
3381 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
3383 check 4 - ".
/.t.mbox
" '2886541147 27060'
3384 check 5 - ".
/.t.out
" '852335377 172'
3389 t_record_a_resend() {
3390 t_prolog record_a_resend
3391 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
3395 m %s\n~s Subject 1.\nHello.\n~.
3396 set record-files add-file-recipients
3397 m %s\n~s Subject 2.\nHello.\n~.
3399 resend 2 ./.t.resent
3400 Resend 1 ./.t.resent
3402 resend 2 ./.t.resent
3403 Resend 1 ./.t.resent
3404 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
3407 check 1 0 "${MBOX}" '2632690399 252'
3408 check 2 - .t.record '3337485450 456'
3409 check 3 - .t.resent '1560890069 640'
3416 TRAP_EXIT_ADDONS=".
/.tmta.sh .
/.t.mbox
"
3418 t_xmta 'Alchemilla Wed Apr 07 17:03:33 2017' ./.t.mbox
3421 ${MAILX} ${ARGS} -ef ./.t.mbox
3422 echo ${?} > "${MBOX}"
3424 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
3425 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3426 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
3427 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3429 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
3430 echo ${?} >> "${MBOX}"
3431 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
3432 echo ${?} >> "${MBOX}"
3433 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
3434 echo ${?} >> "${MBOX}"
3435 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
3436 echo ${?} >> "${MBOX}"
3437 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
3438 echo ${?} >> "${MBOX}"
3439 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
3440 echo ${?} >> "${MBOX}"
3441 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
3442 echo ${?} >> "${MBOX}"
3444 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
3445 echo ${?} >> "${MBOX}"
3446 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
3447 echo ${?} >> "${MBOX}"
3448 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
3449 echo ${?} >> "${MBOX}"
3450 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
3451 echo ${?} >> "${MBOX}"
3452 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
3453 echo ${?} >> "${MBOX}"
3454 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
3455 echo ${?} >> "${MBOX}"
3456 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
3457 echo ${?} >> "${MBOX}"
3459 check
1 - "${MBOX}" '1708955574 678'
3463 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
3464 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3465 -r '' -X 'wysh set from=pony1@$LOGNAME'
3466 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
3467 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3468 -r '' -X 'wysh set from=pony2@$LOGNAME'
3469 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
3470 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3471 -r '' -X 'wysh set from=pony3@$LOGNAME'
3473 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3474 echo fh-test size; set autosort=size showname showto
3475 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3476 check
2-1 0 "${MBOX}" '512787278 418'
3478 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3479 echo fh-test subject; set autosort=subject showname showto
3480 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3481 check
2-2 0 "${MBOX}" '3606067531 421'
3483 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3484 echo fh-test from; set autosort=from showto
3485 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3486 check
2-3 0 "${MBOX}" '2506148572 418'
3488 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3489 echo fh-test to; set autosort=to showto
3490 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3491 check
2-4 0 "${MBOX}" '1221542854 416'
3497 # Simple, if we need more here, place in a later vim fold!
3498 t_prolog q_t_etc_opts
3499 TRAP_EXIT_ADDONS
="./.t*"
3501 # Three tests for MIME encoding and (a bit) content classification.
3502 # At the same time testing -q FILE, < FILE and -t FILE
3503 t__put_body
> .
/.tin
3505 < .
/.tin
${MAILX} ${ARGS} ${ADDARG_UNI} \
3506 -a .
/.tin
-s "`t__put_subject`" "${MBOX}"
3507 check
1 0 "${MBOX}" '1088822685 6642'
3510 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3511 -a .
/.tin
-s "`t__put_subject`" -q .
/.tin
"${MBOX}"
3512 check
2 0 "${MBOX}" '1088822685 6642'
3515 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject`" && echo &&
3517 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a .
/.tin
-t
3518 check
3 0 "${MBOX}" '1088822685 6642'
3520 # Check comments in the header
3522 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
3525 # Noch ein Kommentar
3527 # Nachgestelltes Kommentar
3531 check 4 0 "${MBOX}" '4161555890 124'
3536 t_message_injections() {
3537 # Simple, if we need more here, place in a later vim fold!
3538 t_prolog message_injections
3539 TRAP_EXIT_ADDONS=".
/.t
*"
3541 t_xmta 'Echinacea Tue Jun 20 15:54:02 2017'
3543 echo mysig > ./.tmysig
3545 echo some-body | ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3546 -Smessage-inject-head=head-inject \
3547 -Smessage-inject-tail=tail-inject \
3548 -Ssignature=./.tmysig \
3549 ex@am.ple > ./.tall 2>&1
3550 check 1 0 "${MBOX}" '2434746382 134'
3551 check 2 - .tall '4294967295 0' # empty file
3554 ${cat} <<-_EOT > ./.template
3558 Subject: This subject is
3560 Body, body, body me.
3562 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tmta.sh \
3563 -Smessage-inject-head=head-inject \
3564 -Smessage-inject-tail=tail-inject \
3565 -Ssignature=./.tmysig \
3567 check 3 0 "${MBOX}" '3114203412 198'
3568 check 4 - .tall '4294967295 0' # empty file
3574 # Relatively Simple, if we need more here, place in a later vim fold!
3575 t_prolog attachments
3576 TRAP_EXIT_ADDONS=".
/.t
*"
3578 t_xmta 'Cannabis Sun Feb 18 02:02:46 2018'
3580 ${cat} <<-_EOT > ./.tx
3581 From steffen Sun Feb 18 02:48:40 2018
3582 Date: Sun, 18 Feb 2018 02:48:40 +0100
3585 User-Agent: s-nail v14.9.7
3588 From steffen Sun Feb 18 02:48:42 2018
3589 Date: Sun, 18 Feb 2018 02:48:42 +0100
3592 User-Agent: s-nail v14.9.7
3597 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
3598 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
3599 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3602 '!@ ./.t3 ".
/.t
4" ""
3610 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh \
3611 -a ./.t1 -a './.t 2' \
3612 -s attachment-test \
3613 ex@am.ple > ./.tall 2>&1
3614 check 1 0 "${MBOX}" '4107062253 634'
3615 if have_feat uistrings; then
3616 check 2 - .tall '1928331872 720'
3618 echo 'attachments-2: unsupported, skipped'
3624 !s This the subject is
3625 !@ ./.t3 "#2" "./.t 4" "#1" ""
3635 !@ .
/.t3
"#2" "./.t 4" "#1" ""
3643 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3652 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3666 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3668 check 3 0 "${MBOX}" '798122412 2285'
3669 if have_feat uistrings; then
3670 check 4 - .tall '2526106274 1910'
3672 echo 'attachments-4
: unsupported
, skipped
'
3701 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3703 check 5 0 "${MBOX}" '2165311808 2276'
3704 if have_feat uistrings; then
3705 check 6 - .tall '3662598562 509'
3707 echo 'attachments-6
: unsupported
, skipped
'
3714 # (after attachments)
3716 TRAP_EXIT_ADDONS="./.t*"
3719 mkdir ./.ttt || exit 1
3723 : > 'diet\ is \curd.txt
'
3724 : > 'diet
"is" curd.txt
'
3726 : > 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
3727 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3728 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3729 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3731 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3732 -a "./.ttt/ma'ger.txt
" -a ".
/.ttt
/mä
'ger.txt" \
3733 -a '.
/.ttt
/diet\ is \curd.txt
' -a '.
/.ttt
/diet
"is" curd.txt
' \
3734 -a ./.ttt/höde-tröge.txt \
3735 -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 \
3736 -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 \
3737 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3738 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3740 check 1 0 "${MBOX}" '3720896054 3088'
3742 # `resend' test, reusing
$MBOX
3743 printf "Resend ./.t2\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
3744 check 2 0 ./.t2 '3720896054 3088'
3746 printf "resend .
/.t3
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3747 check
3 0 .
/.t3
'3979736592 3133'
3752 t_mime_types_load_control
() {
3753 t_prolog mime_types_load_control
3754 if have_feat uistrings
; then :; else
3755 echo 'mime_types_load_control: unsupported, skipped'
3758 TRAP_EXIT_ADDONS
="./.t*"
3760 ${cat} <<-_EOT > ./.tmts1
3761 @ application/mathml+xml mathml
3763 ${cat} <<-_EOT > ./.tmts2
3764 @ x-conference/x-cooltalk ice
3766 @ application/aga-aga aga
3769 ${cat} <<-_EOT > ./.tmts1.mathml
3770 <head>nonsense ML</head>
3772 ${cat} <<-_EOT > ./.tmts2.ice
3775 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3776 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3790 ' "${MBOX}" "${MBOX}" |
3792 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3795 ${cat} "${MBOX}" >> .
/.tout
3796 check
1 - .
/.tout
'2716124839 2441'
3798 echo type |
${MAILX} ${ARGS} -R \
3799 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3800 -f "${MBOX}" >> .
/.tout
2>&1
3801 check
2 0 .
/.tout
'2093030907 3634'
3807 # Around state machine, after basics {{{
3810 TRAP_EXIT_ADDONS
="./.t*"
3812 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
3814 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3818 alternates a1@b1 a2@b2 a3@b3
3823 echo $?
/$^ERRNAME
<$rv>
3828 echo $?
/$^ERRNAME
<$rv>
3831 echo $?
/$^ERRNAME
<$rv>
3834 echo $?
/$^ERRNAME
<$rv>
3838 alternates a1@b1 a2@b2 a3@b3
3841 echo $?
/$^ERRNAME
<$rv>
3844 echo $?
/$^ERRNAME
<$rv>
3847 echo $?
/$^ERRNAME
<$rv>
3850 alternates a1@b1 a2@b2 a3@b3
3853 echo $?
/$^ERRNAME
<$rv>
3856 echo $?
/$^ERRNAME
<$rv>
3859 echo $?
/$^ERRNAME
<$rv>
3863 alternates a1@b1 a2@b2 a3@b3
3866 echo $?
/$^ERRNAME
<$rv>
3870 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
3872 ~s all alternates
, only a1@b1 remains
3874 ~b a3@b3 a3@c3 a3@d3
3883 alternates a1@b1 a1@c1 a2@b2 a3@b3
3885 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
3887 ~b a3@b3 a3@c3 a3@d3
3894 alternates a1@b1 a2@b2 a3
; set allnet
3896 ~s all alternates via allnet
, only a1@b1 remains
3898 ~b a3@b3 a3@c3 a3@d3
3909 echo $?
/$^ERRNAME
<$rv>
3913 echo $?
/$^ERRNAME
<$rv>
3917 echo $?
/$^ERRNAME
<$rv>
3921 echo $?
/$^ERRNAME
<$rv>
3925 echo $?
/$^ERRNAME
<$rv>
3929 alternates a1@b1 a2@b2
3932 echo $?
/$^ERRNAME
<$rv>
3933 alternates a3@b3 a4@b4
3936 echo $?
/$^ERRNAME
<$rv>
3939 check
1 0 "${MBOX}" '142184864 515'
3940 if have_feat uistrings
; then
3941 check
2 - .tall
'1878598364 505'
3943 echo 'alternates-2: unsupported, skipped'
3946 # Automatic alternates, also from command line (freezing etc.)
3948 ${cat} <<- __EOT > ./.tin
3949 From trouble-report@desy Wed Jun 6 20:19:28 2018
3950 Date: Wed, 06 Jun 2018 19:58:02 +0200
3951 From: a@b.org, b@b.org, c@c.org
3954 Cc: a@b.org, c@c.org
3956 Message-ID: <20180606175802.dw-cn%a@b.org>
3966 a@b.org b@b.org c@c.org
3971 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3972 -S from
=a@b.org
,b@b.org
,c@c.org
-S sender
=a@b.org \
3973 -Rf .
/.tin
> .
/.tall
2>&1
3974 check
3 0 "${MBOX}" '287250471 256'
3975 check
4 - .tall
'4294967295 0'
3979 set from=a@b.org,b@b.org,c@c.org sender=a@b.org
3983 a@b.org b@b.org c@c.org
3988 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3989 -Rf .
/.tin
> .
/.tall
2>&1
3990 check
5 0 "${MBOX}" '2618762028 512'
3991 check
6 - .tall
'4294967295 0'
3993 # And more, with/out -r
3994 # TODO -r should be the Sender:, which should automatically propagate to
3995 # TODO From: if possible and/or necessary. It should be possible to
3996 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
3997 # TODO arg as appropriate.
3998 # TODO For now we are a bit messy
4001 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4002 -c a@b.example
,b@b.example
,c@c.example \
4003 -S from
=a@b.example
,b@b.example
,c@c.example \
4004 -S sender
=a@b.example \
4005 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4006 check
7 0 "${MBOX}" '3510981487 192'
4007 check
8 - .tout
'2052716617 201'
4008 check
9 - .tall
'4294967295 0'
4010 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4011 -c a@b.example
,b@b.example
,c@c.example \
4012 -S from
=a@b.example
,b@b.example
,c@c.example \
4013 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4014 check
10 0 "${MBOX}" '2282326606 364'
4015 check
11 - .tout
'3213404599 382'
4016 check
12 - .tall
'4294967295 0'
4018 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4019 -c a@b.example
,b@b.example
,c@c.example \
4020 -S from
=a@b.example
,b@b.example
,c@c.example \
4021 -S sender
=a@b.example \
4022 b@b.example
>.
/.tall
2>&1
4023 check
13 0 "${MBOX}" '1460017970 582'
4024 check
14 - .tall
'4294967295 0'
4029 t_quote_a_cmd_escapes
() {
4030 t_prolog quote_a_cmd_escapes
4031 TRAP_EXIT_ADDONS
="./.t*"
4035 echo 'included file' > .
/.ttxt
4037 ${cat} <<-_EOT > ./.tmbox
4038 From neverneverland Sun Jul 23 13:46:25 2017
4039 Subject: Bugstop: five miles out 1
4040 Reply-To: mister originator1 <mr1@originator>
4041 From: mister originator1 <mr1@originator>
4042 To: bugstop-commit@five.miles.out
4044 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4045 Date: Wed, 19 Jul 2017 09:22:57 -0400
4046 Message-Id: <20170719132257.766AF781267-1@originator>
4049 That's appalling, I.
4051 From neverneverland Sun Jul 23 13:47:25 2017
4052 Subject: Bugstop: five miles out 2
4053 Reply-To: mister originator2 <mr2@originator>
4054 From: mister originator2 <mr2@originator>
4055 To: bugstop-commit@five.miles.out
4057 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4058 Date: Wed, 19 Jul 2017 09:23:57 -0400
4059 Message-Id: <20170719132257.766AF781267-2@originator>
4062 That's appalling, II.
4064 From neverneverland Sun Jul 23 13:48:25 2017
4065 Subject: Bugstop: five miles out 3
4066 Reply-To: mister originator3 <mr3@originator>
4067 From: mister originator3 <mr3@originator>
4068 To: bugstop-commit@five.miles.out
4070 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4071 Date: Wed, 19 Jul 2017 09:24:57 -0400
4072 Message-Id: <20170719132257.766AF781267-3@originator>
4075 That's appalling, III.
4080 set indentprefix=" |"
4087 headerpick type retain cc date from message-id reply-to subject to
4091 set quote=allheaders
4094 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4095 -Sescape=! -Sindentprefix=' >' \
4096 .
/.tmbox
>.
/.tall
2>&1
4098 ${cat} .
/.tall
>> "${MBOX}"
4099 check
1 0 "${MBOX}" '2181726970 2023'
4101 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4104 set Sign=SignVar sign=signvar DEAD=./.ttxt
4105 headerpick type retain Subject
4107 !!1 Not escaped. And shell test last, right before !..
4108 !: echo 2 only echoed via colon
4109 !_ echo 3 only echoed via underscore
4111 !<! echo 5 shell echo included
4112 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4113 7 and 8 are ~A and ~a:
4116 !b 9 added ~b cc <ex1@am.ple>
4117 !c 10 added ~c c <ex2@am.ple>
4124 14: ~f (headerpick: subject)
4128 16, 17: ~I Sign, ~i Sign
4149 set quote-inject-head quote-inject-tail indentprefix
4150 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4154 !:unset quote quote-inject-head quote-inject-tail
4159 24: ~s this new subject
4160 !s 24 did new ~s ubject
4161 !t 25 added ~t o <ex3@am.ple>
4166 and i ~w rite this out to ./.tmsg
4168 !:wysh set x=$escape;set escape=~
4169 ~!echo shell command output
4170 ~:wysh set escape=$x
4172 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4173 -Sescape=! -Sindentprefix=' |' \
4174 .
/.tmbox
>.
/.tall
2>&1
4176 ${cat} .
/.tall
>> "${MBOX}"
4177 check
2 - "${MBOX}" '2613898218 4090'
4178 check
3 - .
/.tmsg
'2771314896 3186'
4183 t_compose_edits
() { # XXX very rudimentary
4184 t_prolog compose_edits
4185 TRAP_EXIT_ADDONS
="./.t*"
4187 ${cat} <<-_EOT > ./.ted.sh
4189 ${cat} <<-__EOT > \${1}
4202 # > All these are in-a-row!
4204 printf 'mail ./.tout\n~s This subject is\nThis body is\n~.' |
4205 ${MAILX} ${ARGS} -Seditheaders >.
/.tall
2>&1
4206 check
1 0 .
/.tout
'3993703854 127'
4207 check
2 - .
/.tall
'4294967295 0'
4209 ${mv} .
/.tall .
/.tout
4210 printf 'mail ./.tout\n~s This subject is\nThis body is\n~e\n~.' |
4211 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=.
/.ted.sh
>.
/.tall
2>&1
4212 check
3 0 .
/.tout1
'285981670 116'
4213 check
4 - .
/.tout2
'285981670 116'
4214 check
5 - .
/.tout3
'285981670 116'
4215 check
6 - .
/.tout
'4294967295 0'
4216 check
7 - .
/.tall
'4294967295 0'
4217 ${rm} .
/.tout1 .
/.tout2 .
/.tout3
4219 # t_compose_hooks will test ~^ at edge
4220 ${mv} .
/.tout .
/.tout1
4221 ${mv} .
/.tall .
/.tout2
4223 mail ./.tout\n!s This subject is\nThis body is
4228 !^header insert fcc ./.tout
4229 !^header insert fcc .tout1
4230 !^header insert fcc ./.tout2
4233 !^header remove-at fcc 2
4234 !^header remove-at fcc 2
4238 !^header insert fcc ./.tout
4242 ' |
${MAILX} ${ARGS} -Sescape=! >.
/.tall
2>&1
4243 check
8 0 .
/.tout
'3993703854 127'
4244 check
9 - .
/.tout1
'4294967295 0'
4245 check
10 - .
/.tout2
'4294967295 0'
4246 check
11 - .
/.tall
'4280910245 300'
4248 # < No longer in-a-row
4250 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >.
/.tall
2>&1
4252 Subject
: Fcc via
-t test
4256 check
12 0 .
/.ttout
'1289478830 122'
4257 check
13 - .
/.tall
'4294967295 0'
4262 t_digmsg
() { # XXX rudimentary
4264 TRAP_EXIT_ADDONS
="./.t*"
4267 mail ./.tout\n!s This subject is\nThis body is
4270 !:digmsg - header list
4271 !:digmsg - header show subject
4272 !:digmsg - header show to
4273 !:digmsg - header remove to
4274 !:digmsg - header list
4275 !:digmsg - header show to
4279 !:digmsg - header list; readall x; echon "<$x>";
4280 !:digmsg - header show subject;readall x;echon "<$x>";;
4283 !: # nothing here as is comment
4284 !^header insert fcc ./.tbox
4287 !:digmsg - header list
4288 !:digmsg - header show fcc
4292 !:digmsg - header list
4293 !:digmsg - header show fcc
4294 !:digmsg - header insert fcc ./.tfcc
4303 digmsg 1 header list
4304 digmsg 1 header show subject
4309 digmsg 1 header list; echo $?/$^ERRNAME
4310 digmsg create -; echo $?/$^ERRNAME
4312 ! %s ./.tfcc > ./.tcat
4313 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
4315 mail nowhere@exam.ple
4317 !:digmsg create -; echo $?/$^ERRNAME;\\
4318 digmsg create 1; echo $?/$^ERRNAME;\\
4319 digmsg create 2; echo $?/$^ERRNAME
4321 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4323 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4327 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4329 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4331 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4335 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4337 !:digmsg remove -; echo $?/$^ERRNAME;\\
4338 digmsg remove 1; echo $?/$^ERRNAME;\\
4339 digmsg remove 2; echo $?/$^ERRNAME;
4342 ' "${cat}" "${sed}" | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
4344 if have_feat uistrings; then
4345 check 1 - ./.tall '362777535 1087'
4347 check 1 - ./.tall '4281367066 967'
4349 check 2 - ./.tfcc '3993703854 127'
4350 check 3 - ./.tempty '4294967295 0'
4351 check 4 - ./.tcat '2157992522 256'
4358 # Heavy use of/rely on state machine (behaviour) and basics {{{
4359 t_compose_hooks() { # {{{ TODO monster
4360 t_prolog compose_hooks
4361 if have_feat uistrings; then :; else
4362 echo 'compose_hooks: unsupported, skipped'
4365 TRAP_EXIT_ADDONS=".
/.t
*"
4367 t_xmta 'PrimulaVeris Wed Apr 10 22:59:00 2017'
4369 (echo line one&&echo line two&&echo line three) > ./.treadctl
4370 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
4372 ${cat} <<'__EOT__' > ./.trc
4374 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4377 vput vexpr es substr "$1" 0 1
4382 define read_mline_res {
4383 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4384 echo $len/$es/$^ERRNAME: $hl
4385 if [ $es -ne $^ERR-NONE ]
4386 xcall bail read_mline_res
4388 \xcall read_mline_res
4393 echo "~^header list
"; read hl; echo $hl;\
4394 call xerr "$hl" "in_addr
($xh) 0-1"
4396 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4397 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
4398 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4399 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
4400 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4401 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
4402 echo "~^header list
$xh"; read hl; echo $hl;\
4403 call xerr "$hl" "ins_addr
$xh 1-4"
4404 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
4407 if [ "$t_remove" == "" ]
4411 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
4412 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
4414 xcall bail "ins_addr
$xh 2-2"
4416 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
4418 xcall bail "ins_addr
$xh 2-3"
4420 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
4422 xcall bail "ins_addr
$xh 2-4"
4426 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4427 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
4428 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4429 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
4430 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4431 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
4432 echo "~^header list
$xh"; read hl; echo $hl;\
4433 call xerr "$hl" "ins_addr
$xh 3-4"
4434 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
4437 echo "~^header remove-at
$xh 1"; read es;\
4438 call xerr $es "ins_addr
$xh 3-6"
4439 echo "~^header remove-at
$xh 1"; read es;\
4440 call xerr $es "ins_addr
$xh 3-7"
4441 echo "~^header remove-at
$xh 1"; read es;\
4442 call xerr $es "ins_addr
$xh 3-8"
4443 echo "~^header remove-at
$xh 1"; read es;\
4444 vput vexpr es substr $es 0 3
4446 xcall bail "ins_addr
$xh 3-9"
4448 echo "~^header remove-at
$xh T
"; read es;\
4449 vput vexpr es substr $es 0 3
4451 xcall bail "ins_addr
$xh 3-10"
4453 echo "~^header list
$xh"; read es;\
4454 vput vexpr es substr $es 0 3
4456 xcall bail "ins_addr
$xh 3-11"
4458 echo "~^header show
$xh"; read es;\
4459 vput vexpr es substr $es 0 3
4461 xcall bail "ins_addr
$xh 3-12"
4465 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4466 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
4467 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
4468 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
4469 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4470 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
4471 echo "~^header list
$xh"; read hl; echo $hl;\
4472 call xerr "$hl" "header list
$xh 3-4"
4473 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
4476 echo "~^header remove-at
$xh 3"; read es;\
4477 call xerr $es "ins_addr
$xh 4-6"
4478 echo "~^header remove-at
$xh 2"; read es;\
4479 call xerr $es "ins_addr
$xh 4-7"
4480 echo "~^header remove-at
$xh 1"; read es;\
4481 call xerr $es "ins_addr
$xh 4-8"
4482 echo "~^header remove-at
$xh 1"; read es;\
4483 vput vexpr es substr $es 0 3
4485 xcall bail "ins_addr
$xh 4-9"
4487 echo "~^header remove-at
$xh T
"; read es;\
4488 vput vexpr es substr $es 0 3
4490 xcall bail "ins_addr
$xh 4-10"
4492 echo "~^header list
$xh"; read es;\
4493 vput vexpr es substr $es 0 3
4495 xcall bail "ins_addr
$xh 4-11"
4497 echo "~^header show
$xh"; read es;\
4498 vput vexpr es substr $es 0 3
4500 xcall bail "ins_addr
$xh 4-12"
4504 wysh set xh=$1 mult=$2
4505 echo "~^header list
"; read hl; echo $hl;\
4506 call xerr "$hl" "ins_ref
($xh) 0-1"
4508 echo "~^header insert
$xh <$xh@exam.ple
>";\
4509 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
4511 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4512 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
4513 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4514 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
4516 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
4517 vput vexpr es substr $es 0 3
4519 xcall bail "ins_ref
$xh 1-4"
4523 echo "~^header list
$xh"; read hl; echo $hl;\
4524 call xerr "$hl" "ins_ref
$xh 1-5"
4525 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
4528 if [ "$t_remove" == "" ]
4532 echo "~^header remove
$xh"; read es;\
4533 call xerr $es "ins_ref
$xh 2-1"
4534 echo "~^header remove
$xh"; read es;\
4535 vput vexpr es substr $es 0 3
4537 xcall bail "ins_ref
$xh 2-2"
4539 echo "~^header list
$xh"; read es;\
4540 vput vexpr es substr $es 0 3
4542 xcall bail "$es ins_ref
$xh 2-3"
4544 echo "~^header show
$xh"; read es;\
4545 vput vexpr es substr $es 0 3
4547 xcall bail "ins_ref
$xh 2-4"
4551 echo "~^header insert
$xh <$xh@exam.ple
>";\
4552 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
4554 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4555 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
4556 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4557 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
4559 echo "~^header list
$xh";\
4560 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
4561 echo "~^header show
$xh";\
4562 read es; call xerr $es "ins_ref
$xh 3-5"
4565 echo "~^header remove-at
$xh 1"; read es;\
4566 call xerr $es "ins_ref
$xh 3-6"
4567 if [ $mult -ne 0 ] && [ $xh != subject ]
4568 echo "~^header remove-at
$xh 1"; read es;\
4569 call xerr $es "ins_ref
$xh 3-7"
4570 echo "~^header remove-at
$xh 1"; read es;\
4571 call xerr $es "ins_ref
$xh 3-8"
4573 echo "~^header remove-at
$xh 1"; read es;\
4574 vput vexpr es substr $es 0 3
4576 xcall bail "ins_ref
$xh 3-9"
4578 echo "~^header remove-at
$xh T
"; read es;\
4579 vput vexpr es substr $es 0 3
4581 xcall bail "ins_ref
$xh 3-10"
4583 echo "~^header show
$xh"; read es;\
4584 vput vexpr es substr $es 0 3
4586 xcall bail "ins_ref
$xh 3-11"
4590 echo "~^header insert
$xh <$xh@exam.ple
> ";\
4591 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
4593 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
4594 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
4595 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4596 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
4598 echo "~^header list
$xh"; read hl; echo $hl;\
4599 call xerr "$hl" "ins_ref
$xh 4-4"
4600 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
4603 if [ $mult -ne 0 ] && [ $xh != subject ]
4604 echo "~^header remove-at
$xh 3"; read es;\
4605 call xerr $es "ins_ref
$xh 4-6"
4606 echo "~^header remove-at
$xh 2"; read es;\
4607 call xerr $es "ins_ref
$xh 4-7"
4609 echo "~^header remove-at
$xh 1"; read es;\
4610 call xerr $es "ins_ref
$xh 4-8"
4611 echo "~^header remove-at
$xh 1"; read es;\
4612 vput vexpr es substr $es 0 3
4614 xcall bail "ins_ref
$xh 4-9"
4616 echo "~^header remove-at
$xh T
"; read es;\
4617 vput vexpr es substr $es 0 3
4619 xcall bail "ins_ref
$xh 4-10"
4621 echo "~^header show
$xh"; read es;\
4622 vput vexpr es substr $es 0 3
4624 xcall bail "ins_ref
$xh 4-11"
4629 # In collect.c order
4631 call ins_ref sender 0 # Not a "ref
", but works
4635 call ins_addr reply-To
4636 call ins_addr mail-Followup-to
4637 call ins_ref messAge-id 0
4638 call ins_ref rEfErEncEs 1
4639 call ins_ref in-Reply-to 1
4640 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
4641 call ins_addr freeForm1
4642 call ins_addr freeform2
4644 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
4646 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
4654 echo "~^attachment
";\
4655 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4657 xcall bail "attach
0-1"
4660 echo "~^attach attribute .
/.treadctl
";\
4661 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4663 xcall bail "attach
0-2"
4665 echo "~^attachment attribute-at
1";\
4666 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4668 xcall bail "attach
0-3"
4671 echo "~^attachment insert .
/.treadctl
=ascii
";\
4672 read hl; echo $hl; call xerr "$hl" "attach
1-1"
4673 echo "~^attachment list
";\
4674 read es; echo $es;call xerr "$es" "attach
1-2"
4676 echo "~^attachment attribute .
/.treadctl
";\
4677 read es; echo $es;call xerr "$es" "attach
1-3"
4679 echo "~^attachment attribute .treadctl
";\
4680 read es; echo $es;call xerr "$es" "attach
1-4"
4682 echo "~^attachment attribute-at
1";\
4683 read es; echo $es;call xerr "$es" "attach
1-5"
4686 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
4687 read es; echo $es;call xerr "$es" "attach
1-6"
4688 echo "~^attachment attribute-set .treadctl content-description Au
";\
4689 read es; echo $es;call xerr "$es" "attach
1-7"
4690 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
4691 read es; echo $es;call xerr "$es" "attach
1-8"
4693 echo "~^attachment attribute .
/.treadctl
";\
4694 read es; echo $es;call xerr "$es" "attach
1-9"
4696 echo "~^attachment attribute .treadctl
";\
4697 read es; echo $es;call xerr "$es" "attach
1-10"
4699 echo "~^attachment attribute rctl
";\
4700 read es; echo $es;call xerr "$es" "attach
1-11"
4702 echo "~^attachment attribute-at
1";\
4703 read es; echo $es;call xerr "$es" "attach
1-12"
4707 echo "~^attachment insert .
/.tattach
=latin1
";\
4708 read hl; echo $hl; call xerr "$hl" "attach
2-1"
4709 echo "~^attachment list
";\
4710 read es; echo $es;call xerr "$es" "attach
2-2"
4712 echo "~^attachment attribute .
/.tattach
";\
4713 read es; echo $es;call xerr "$es" "attach
2-3"
4715 echo "~^attachment attribute .tattach
";\
4716 read es; echo $es;call xerr "$es" "attach
2-4"
4718 echo "~^attachment attribute-at
2";\
4719 read es; echo $es;call xerr "$es" "attach
2-5"
4722 echo "~^attachment attribute-set .
/.tattach filename tat
";\
4723 read es; echo $es;call xerr "$es" "attach
2-6"
4725 "~^attachment attribute-set .tattach content-description Au2
";\
4726 read es; echo $es;call xerr "$es" "attach
2-7"
4727 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
4728 read es; echo $es;call xerr "$es" "attach
2-8"
4730 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
4731 read es; echo $es;call xerr "$es" "attach
2-9"
4733 echo "~^attachment attribute .
/.tattach
";\
4734 read es; echo $es;call xerr "$es" "attach
2-10"
4736 echo "~^attachment attribute .tattach
";\
4737 read es; echo $es;call xerr "$es" "attach
2-11"
4739 echo "~^attachment attribute tat
";\
4740 read es; echo $es;call xerr "$es" "attach
2-12"
4742 echo "~^attachment attribute-at
2";\
4743 read es; echo $es;call xerr "$es" "attach
2-13"
4747 if [ "$t_remove" == "" ]
4751 echo "~^attachment remove .
/.treadctl
"; read es;\
4752 call xerr $es "attach
3-1"
4753 echo "~^attachment remove .
/.tattach
"; read es;\
4754 call xerr $es "attach
3-2"
4755 echo "~^ attachment remove .
/.treadctl
"; read es;\
4756 vput vexpr es substr $es 0 3
4758 xcall bail "attach
3-3"
4760 echo "~^ attachment remove .
/.tattach
"; read es;\
4761 vput vexpr es substr $es 0 3
4763 xcall bail "attach
3-4"
4765 echo "~^attachment list
"; read es;\
4766 vput vexpr es substr $es 0 3
4768 xcall bail "attach
3-5"
4772 echo "~^attachment insert .
/.tattach
=latin1
";\
4773 read hl; echo $hl; call xerr "$hl" "attach
4-1"
4774 echo "~^attachment insert .
/.tattach
=latin1
";\
4775 read hl; echo $hl; call xerr "$hl" "attach
4-2"
4776 echo "~^attachment list
";\
4777 read es; echo $es;call xerr "$es" "attach
4-3"
4779 echo "~^ attachment remove .tattach
"; read es;\
4780 vput vexpr es substr $es 0 3
4782 xcall bail "attach
4-4 $es"
4784 echo "~^attachment remove-at T
"; read es;\
4785 vput vexpr es substr $es 0 3
4787 xcall bail "attach
4-5"
4789 echo "~^attachment remove .
/.tattach
"; read es;\
4790 call xerr $es "attach
4-6"
4791 echo "~^attachment remove .
/.tattach
"; read es;\
4792 call xerr $es "attach
4-7"
4793 echo "~^ attachment remove .
/.tattach
"; read es;\
4794 vput vexpr es substr $es 0 3
4796 xcall bail "attach
4-8 $es"
4798 echo "~^attachment list
"; read es;\
4799 vput vexpr es substr $es 0 3
4801 xcall bail "attach
4-9"
4805 echo "~^attachment insert .
/.tattach
=latin1
";\
4806 read hl; echo $hl; call xerr "$hl" "attach
5-1"
4807 echo "~^attachment insert .
/.tattach
=latin1
";\
4808 read hl; echo $hl; call xerr "$hl" "attach
5-2"
4809 echo "~^attachment insert .
/.tattach
=latin1
";\
4810 read hl; echo $hl; call xerr "$hl" "attach
5-3"
4811 echo "~^attachment list
";\
4812 read es; echo $es;call xerr "$es" "attach
5-4"
4815 echo "~^attachment remove-at
3"; read es;\
4816 call xerr $es "attach
5-5"
4817 echo "~^attachment remove-at
3"; read es;\
4818 vput vexpr es substr $es 0 3
4820 xcall bail "attach
5-6"
4822 echo "~^attachment remove-at
2"; read es;\
4823 call xerr $es "attach
5-7"
4824 echo "~^attachment remove-at
2"; read es;\
4825 vput vexpr es substr $es 0 3
4827 xcall bail "attach
5-8"
4829 echo "~^attachment remove-at
1"; read es;\
4830 call xerr $es "attach
5-9"
4831 echo "~^attachment remove-at
1"; read es;\
4832 vput vexpr es substr $es 0 3
4834 xcall bail "attach
5-10"
4837 echo "~^attachment list
"; read es;\
4838 vput vexpr es substr $es 0 3
4840 xcall bail "attach
5-11"
4844 echo "~^attachment insert .
/.tattach
=latin1
";\
4845 read hl; echo $hl; call xerr "$hl" "attach
6-1"
4846 echo "~^attachment insert .
/.tattach
=latin1
";\
4847 read hl; echo $hl; call xerr "$hl" "attach
6-2"
4848 echo "~^attachment insert .
/.tattach
=latin1
";\
4849 read hl; echo $hl; call xerr "$hl" "attach
6-3"
4850 echo "~^attachment list
";\
4851 read es; echo $es;call xerr "$es" "attach
6-4"
4854 echo "~^attachment remove-at
1"; read es;\
4855 call xerr $es "attach
6-5"
4856 echo "~^attachment remove-at
1"; read es;\
4857 call xerr $es "attach
6-6"
4858 echo "~^attachment remove-at
1"; read es;\
4859 call xerr $es "attach
6-7"
4860 echo "~^attachment remove-at
1"; read es;\
4861 vput vexpr es substr $es 0 3
4863 xcall bail "attach
6-8"
4866 echo "~^attachment list
"; read es;\
4867 vput vexpr es substr $es 0 3
4869 xcall bail "attach
6-9"
4881 echo on-compose-enter, mailx-command<$mailx-command>
4882 alternates alter1@exam.ple alter2@exam.ple
4884 set autocc='alter1@exam.ple alter2@exam.ple'
4885 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4886 echo mailx-subject<$mailx-subject>
4887 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4888 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4889 mailx-raw-bcc<$mailx-raw-bcc>
4890 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4891 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4894 echo on-compose-leave, mailx-command<$mailx-command>
4896 eval alternates $al alter3@exam.ple alter4@exam.ple
4898 set autobcc='alter3@exam.ple alter4@exam.ple'
4899 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4900 echo mailx-subject<$mailx-subject>
4901 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4902 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4903 mailx-raw-bcc<$mailx-raw-bcc>
4904 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4905 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4908 echo on-compose-cleanup, mailx-command<$mailx-command>
4911 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4912 echo mailx-subject<$mailx-subject>
4913 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4914 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4915 mailx-raw-bcc<$mailx-raw-bcc>
4916 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4917 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4919 wysh set on-compose-splice=t_ocs \
4920 on-compose-enter=t_oce on-compose-leave=t_ocl \
4921 on-compose-cleanup=t_occ
4924 printf 'm this-goes@nowhere\nbody\n!.\n' |
4925 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4926 -X'source ./.trc' -Smta=./.tmta.sh \
4928 ${cat} ./.tall >> "${MBOX}"
4929 check 1 0 "${MBOX}" '2481823179 10101'
4932 printf 'm this-goes@nowhere\nbody\n!.\n' |
4933 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4934 -St_remove=1 -X'source ./.trc' -Smta=./.tmta.sh \
4936 ${cat} ./.tall >> "${MBOX}"
4937 check 2 0 "${MBOX}" '3654000499 12535'
4941 # Some state machine stress, shell compose hook, localopts for hook, etc.
4942 # readctl in child. ~r as HERE document
4944 printf 'm ex@am.ple\nbody\n!.
4945 echon ${mailx-command}${mailx-subject}
4946 echon ${mailx-from}${mailx-sender}
4947 echon ${mailx-to}${mailx-cc}${mailx-bcc}
4948 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
4949 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
4950 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
4951 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4955 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4958 vput vexpr es substr "$1" 0 1
4963 define read_mline_res {
4964 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4965 echo $len/$es/$^ERRNAME: $hl
4966 if [ $es -ne $^ERR-NONE ]
4967 xcall bail read_mline_res
4969 \xcall read_mline_res
4973 vput vexpr i + 1 "$2"
4975 vput vexpr j % $i 10
4982 eval \\$j _work $1 $i
4985 vput vexpr i + $i "$1"
4989 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
4990 echo read:$es/$en: $line
4991 if [ "${es}" -ne -1 ]
4994 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
4999 echo "~^header list
"; read hl; echo $hl;\
5000 vput vexpr es substr "$hl" 0 1
5002 xcall bail "header list
"
5005 call _work 1; echo $?
5006 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
5007 read es; echo $es; vput vexpr es substr "$es" 0 1
5009 xcall bail "be diet
"
5011 echo "~^header insert cc
<splice2@exam.ple
>";\
5012 read es; echo $es; vput vexpr es substr "$es" 0 1
5014 xcall bail "be diet2
"
5017 call _work 2; echo $?
5018 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
5019 read es; echo $es;vput vexpr es substr "$es" 0 1
5021 xcall bail "be juicy
"
5023 echo "~^header insert bcc juice2@exam.ple
";\
5024 read es; echo $es;vput vexpr es substr "$es" 0 1
5026 xcall bail "be juicy2
"
5028 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
5029 read es; echo $es;vput vexpr es substr "$es" 0 1
5031 xcall bail "be juicy3
"
5033 echo "~^header insert bcc juice4@exam.ple
";\
5034 read es; echo $es;vput vexpr es substr "$es" 0 1
5036 xcall bail "be juicy4
"
5039 echo "~^header remove-at bcc
3";\
5040 read es; echo $es;vput vexpr es substr "$es" 0 1
5042 xcall bail "remove juicy5
"
5044 echo "~^header remove-at bcc
2";\
5045 read es; echo $es;vput vexpr es substr "$es" 0 1
5047 xcall bail "remove juicy6
"
5049 echo "~^header remove-at bcc
3";\
5050 read es; echo $es;vput vexpr es substr "$es" 0 3
5052 xcall bail "failed to remove-at
"
5054 # Add duplicates which ought to be removed!
5055 echo "~^header insert bcc juice4@exam.ple
";\
5056 read es; echo $es;vput vexpr es substr "$es" 0 1
5058 xcall bail "be juicy4-1
"
5060 echo "~^header insert bcc juice4@exam.ple
";\
5061 read es; echo $es;vput vexpr es substr "$es" 0 1
5063 xcall bail "be juicy4-2
"
5065 echo "~^header insert bcc juice4@exam.ple
";\
5066 read es; echo $es;vput vexpr es substr "$es" 0 1
5068 xcall bail "be juicy4-3
"
5073 call _work 3; echo $?
5075 vput ! i echo just knock if you can hear me;\
5077 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
5079 echon shell-cmd says $?/$^ERRNAME: $i
5080 echo "~x will not become interpreted
, we are reading
until __EOT
"
5082 read r_status; echo "~~r status output
: $r_status"
5083 echo "~
:echo $? $
! $^ERRNAME
"
5085 echo "~~r status from parent
: $r_status"
5088 call _work 4; echo $?
5089 vput cwd cwd;echo cwd:$?
5090 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
5094 call _work 5; echo $?
5095 echo "~^header show MAILX-Command
"; read es;\
5096 call xerr $es "t_header
1000"; call read_mline_res
5097 echo "~^header show MAILX-raw-TO
"; read es;\
5098 call xerr $es "t_header
1001"; xcall read_mline_res
5100 echoerr IT IS WRONG IF YOU SEE THIS
5103 echo on-compose-enter, mailx-command<$mailx-command>
5104 set t_oce autobcc=oce@exam.ple
5105 alternates alter1@exam.ple alter2@exam.ple
5107 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5108 echo mailx-subject<$mailx-subject>
5109 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5110 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5111 mailx-raw-bcc<$mailx-raw-bcc>
5112 echo mailx-orig-from<$mailx-orig-from> \
5113 mailx-orig-to<$mailx-orig-to> \
5114 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5117 echo on-compose-leave, mailx-command<$mailx-command>
5118 set t_ocl autocc=ocl@exam.ple
5120 alternates alter3@exam.ple alter4@exam.ple
5122 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5123 echo mailx-subject<$mailx-subject>
5124 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5125 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5126 mailx-raw-bcc<$mailx-raw-bcc>
5127 echo mailx-orig-from<$mailx-orig-from> \
5128 mailx-orig-to<$mailx-orig-to> \
5129 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5132 echo on-compose-cleanup, mailx-command<$mailx-command>
5133 set t_occ autocc=occ@exam.ple
5136 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5137 echo mailx-subject<$mailx-subject>
5138 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5139 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5140 mailx-raw-bcc<$mailx-raw-bcc>
5141 echo mailx-orig-from<$mailx-orig-from> \
5142 mailx-orig-to<$mailx-orig-to> \
5143 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5145 wysh set on-compose-splice=t_ocs \
5146 on-compose-splice-shell="read ver
;echo t_ocs-shell
;\
5147 echo \"~t shell@exam.ple
\"; echo \"~
:set t_ocs_sh
\"" \
5148 on-compose-enter=t_oce on-compose-leave=t_ocl \
5149 on-compose-cleanup=t_occ
5152 ${cat} ./.tnotes >> "${MBOX}"
5153 check 3 - "${MBOX}" '679526364 2431'
5155 # Reply, forward, resend, Resend
5163 set from
="du <f2@z>" stealthmua
=noagent
5167 ' | ${MAILX} ${ARGS} -Smta=./.tmta.sh -Snomemdebug -Sescape=!
5170 echo start
: $? $
! $^ERRNAME
5172 echo File
: $? $
! $^ERRNAME
;echo;echo
5174 this is content of reply
1
5176 echo reply
1: $? $
! $^ERRNAME
;echo;echo
5178 this is content of Reply
1 2
5180 echo Reply
1 2: $? $
! $^ERRNAME
;echo;echo
5181 forward
1 fwdex@am.ple
5182 this is content of forward
1
5184 echo forward
1: $? $
! $^ERRNAME
;echo;echo
5185 wysh
set forward-inject-head
=$
'"'"'-- \\
5186 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
5187 wysh
set forward-inject-tail
=$
'"'"'-- \\
5188 end of forward (%%i) --\\n'"'"'
5189 forward
2 fwdex@am.ple
5190 this is content of forward
2
5192 echo forward
2: $? $
! $^ERRNAME
;echo;echo
5194 forward
2 fwdex2@am.ple
5195 this is content of forward
2, 2nd
, with showname
set
5197 echo forward
2, 2nd
: $? $
! $^ERRNAME
;echo;echo
5198 resend
1 2 resendex@am.ple
5199 echo resend
1 2: $? $
! $^ERRNAME
;echo;echo
5200 Resend
1 2 Resendex@am.ple
5201 echo Resend
1 2: $? $
! $^ERRNAME
;echo;echo
5203 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
5207 echoerr
"Failed: $1. Bailing out"; echo "~x"; xit
5210 vput vexpr es substr
"$1" 0 1
5215 define read_mline_res
{
5216 read hl
; wysh
set len
=$? es
=$
! en
=$^ERRNAME
;\
5217 echo mline_res
:$len/$es/$^ERRNAME
: $hl
5218 if [ $es -ne $^ERR-NONE
]
5219 xcall bail read_mline_res
5221 \xcall read_mline_res
5225 echo "~^header show $1"; read es
;\
5226 call xerr
$es "work_hl $1"; echo $1; call read_mline_res
5234 echo t_ocs version
$ver
5235 echo "~^header list"; read hl
; echo $hl;\
5236 echoerr the header list is
$hl;\
5237 call xerr
"$hl" "header list"
5238 eval vpospar
set $hl
5241 echoerr IT IS WRONG IF YOU SEE THIS
5244 echo on-XY-enter
, mailx-command
<$mailx-command>
5245 set t_oce autobcc
=oce@exam.ple
5246 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5247 echo mailx-subject
<$mailx-subject>
5248 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5249 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5250 mailx-raw-bcc
<$mailx-raw-bcc>
5251 echo mailx-orig-from
<$mailx-orig-from> \
5252 mailx-orig-to
<$mailx-orig-to> \
5253 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5256 echo on-XY-leave
, mailx-command
<$mailx-command>
5257 set t_ocl autocc
=ocl@exam.ple
5258 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5259 echo mailx-subject
<$mailx-subject>
5260 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5261 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5262 mailx-raw-bcc
<$mailx-raw-bcc>
5263 echo mailx-orig-from
<$mailx-orig-from> \
5264 mailx-orig-to
<$mailx-orig-to> \
5265 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5268 echo on-XY-cleanup
, mailx-command
<$mailx-command>
5269 set t_occ autocc
=occ@exam.ple
5270 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5271 echo mailx-subject
<$mailx-subject>
5272 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5273 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5274 mailx-raw-bcc
<$mailx-raw-bcc>
5275 echo mailx-orig-from
<$mailx-orig-from> \
5276 mailx-orig-to
<$mailx-orig-to> \
5277 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5279 wysh
set on-compose-splice
=t_ocs \
5280 on-compose-enter
=t_oce on-compose-leave
=t_ocl \
5281 on-compose-cleanup
=t_occ \
5282 on-resend-enter
=t_oce on-resend-cleanup
=t_occ
5285 ${cat} ./.tnotes >> "${MBOX}"
5286 check 4 - "${MBOX}" '2151712038 11184'
5291 t_mass_recipients() {
5292 t_prolog mass_recipients
5293 TRAP_EXIT_ADDONS="./.t*"
5295 t_xmta 'Eucalyptus Sat Jul
08 21:14:57 2017'
5297 ${cat} <<'__EOT__' > ./.trc
5299 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
5302 wysh set nr=$1 hn=$2
5303 echo "~$hn $hn$nr@$hn"; echo '~
:echo $?
'; read es
5305 xcall bail "ins_addr $hn 1-$nr"
5307 vput vexpr nr + $nr 1
5308 if [ "$nr" -le "$maximum" ]
5309 xcall ins_addr $nr $hn
5313 wysh set nr=$1 hn=$2
5314 alternates $hn$nr@$hn
5315 vput vexpr nr + $nr 2
5316 if [ "$nr" -le "$maximum" ]
5317 xcall bld_alter $nr $hn
5327 if [ "$t_remove" != '' ]
5332 set on-compose-splice=t_ocs on-compose-leave=t_ocl
5335 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5336 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5337 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5340 ${cat} ./.tall >> "${MBOX}"
5341 check 1 - "${MBOX}" '2912243346 51526'
5344 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5345 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5346 -St_remove=1 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5349 ${cat} ./.tall >> "${MBOX}"
5350 check 2 - "${MBOX}" '4097804632 34394'
5355 t_lreply_futh_rth_etc() {
5356 t_prolog lreply_futh_rth_etc
5357 TRAP_EXIT_ADDONS="./.t*"
5359 t_xmta 'HumulusLupulus Thu Jul
27 14:41:20 2017'
5361 ${cat} <<-_EOT > ./.tmbox
5362 From neverneverland Sun Jul 23 13:46:25 2017
5363 Subject: Bugstop: five miles out 1
5364 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5365 From: mister originator <mr@originator>
5366 To: bugstop-commit@five.miles.out, laber@backe.eu
5368 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
5369 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
5370 Date: Wed, 19 Jul 2017 09:22:57 -0400
5371 Message-Id: <20170719132257.766AF781267@originator>
5374 > |Sorry, I think I misunderstand something. I would think that
5378 From neverneverland Fri Jul
7 22:39:11 2017
5379 Subject
: Bugstop
: five miles out
2
5380 Reply-To
: mister originator2
<mr2@originator
>,bugstop@five.miles.out
,is@a.list
5381 Content-Transfer-Encoding
: 7bit
5382 From
: mister originator
<mr@originator
>
5383 To
: bugstop-commit@five.miles.out
5385 Message-ID
: <149945963975.28888.6950788126957753723.reportbug@five.miles.out
>
5386 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5389 capable of changing back.
5391 From neverneverland Fri Jul
7 22:42:00 2017
5392 Subject
: Bugstop
: five miles out
3
5393 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5394 Content-Transfer-Encoding
: 7bit
5395 From
: mister originator
<mr@originator
>
5396 To
: bugstop-commit@five.miles.out
5398 Message-ID
: <149945963975.28888.6950788126957753746.reportbug@five.miles.out
>
5399 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5400 List-Post
: <mailto
:bugstop@five.miles.out
>
5403 are you ready
, boots?
5405 From neverneverland Sat Aug
19 23:15:00 2017
5406 Subject
: Bugstop
: five miles out
4
5407 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5408 Content-Transfer-Encoding
: 7bit
5409 From
: mister originator
<mr@originator
>
5410 To
: bugstop@five.miles.out
5412 Message-ID
: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out
>
5413 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5414 List-Post
: <mailto
:bugstop@five.miles.out
>
5417 are you ready
, boots?
5422 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
5423 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
5425 wysh
set m
="This is text of \"reply ${1}."
5436 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
5439 wysh set m="This is text of
\"Reply
${1}.
"
5445 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
5454 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
5458 # We need two indirections for this test: one for the case that Lreply
5459 # fails because of missing recipients: we need to read EOF next, thus
5460 # place this in _Ls last; and second for the succeeding cases EOF is
5461 # not what these should read, so go over the backside and splice it in!
5463 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
5466 localopts call-fixate
yes
5468 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
5469 call L
$1 1; call L
$1 2; call L
$1 3
5472 echo;echo '===== CHANGING === '"$*"' =====';echo
5476 set from
=laber@backe.eu
5479 call tweak
set reply-to-honour
5481 call tweak
set followup-to
5483 call tweak
set followup-to-honour
5485 call tweak mlist bugstop@five.miles.out
5487 call tweak mlsubscribe bugstop@five.miles.out
5489 call tweak
set recipients-in-cc
5491 # While here, test that *fullnames* works (also here)
5494 This message should have
*fullnames
* in the header.
5499 if have_feat uistrings
; then
5500 check
1 - "${MBOX}" '1530821219 29859'
5502 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
5507 ${cat} <<-_EOT > ./.tmbox
5508 From tom@i-i.example Thu Oct 26 03:15:55 2017
5509 Date: Wed, 25 Oct 2017 21:15:46 -0400
5510 From: tom <tom@i-i.example>
5511 To: Steffen Nurpmeso <steffen@sdaoden.eu>
5512 Cc: tom <tom@i-i.example>
5513 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
5514 Message-ID: <20171026011546.GA11643@i-i.example>
5515 Reply-To: tom@i-i.example
5516 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
5517 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
5520 The report's useful :-)
5523 # Let us test In-Reply-To: removal starts a new thread..
5524 # This needs adjustment of *stealthmua*
5525 argadd
='-Sstealthmua=noagent -Shostname'
5528 printf 'reply 1\nthread\n!.\n' |
5529 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5530 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
5531 check
2 0 "${MBOX}" '3321764338 429'
5532 check
3 - .tall
'4294967295 0'
5534 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
5535 "${sed}" '/^In-Reply-To:/d' |
5536 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5537 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5538 check
4 0 "${MBOX}" '1682552516 763'
5539 check
5 - .tall
'4294967295 0'
5541 printf 'reply 2\nold <- new <- thread!\n!.\n' |
5542 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5543 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5544 check
6 0 "${MBOX}" '2900984135 1219'
5545 check
7 - .tall
'4294967295 0'
5547 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
5548 "${sed}" '/^In-Reply-To:/d' |
5549 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5550 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5551 check
8 0 "${MBOX}" '794031200 1567'
5552 check
9 - .tall
'4294967295 0'
5560 have_feat smime ||
{
5561 echo 's_mime: unsupported, skipped'
5566 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5567 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5568 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5570 ${cat} <<-_EOT > ./.t.conf
5573 default_keyfile = keyfile.pem
5574 distinguished_name = req_distinguished_name
5575 attributes = req_attributes
5579 [ req_distinguished_name ]
5586 emailAddress = test@localhost
5591 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5592 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5594 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5597 echo bla |
${MAILX} ${ARGS} \
5598 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5599 -Ssmime-sign-digest=sha1 \
5600 -s 'S/MIME test' .
/.VERIFY
5604 /^Content-Description: /{ skip = 2; print; next }
5605 /^$/{ if(skip) --skip }
5608 < .
/.VERIFY
> "${MBOX}"
5609 check
1 - "${MBOX}" '335634014 644'
5611 printf 'verify\nx\n' |
5612 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5613 -R -f .
/.VERIFY
>>${ERR} 2>&1
5616 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5619 # (signing +) encryption / decryption
5620 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5625 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5626 -Ssmime-sign-digest=sha1 \
5627 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5628 -s 'S/MIME test' recei@ver.com
5630 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5631 check
4 - "${MBOX}" '1937410597 327'
5633 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5636 -Ssmime-ca-file=.
/.tcert.pem \
5637 -Ssmime-sign-cert=.
/.tpair.pem \
5638 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5642 /^Content-Description: /{ skip = 2; print; next }
5643 /^$/{ if(skip) --skip }
5646 < .
/.DECRYPT
> "${MBOX}"
5647 check
5 - "${MBOX}" '1019076159 931'
5649 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5650 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5654 echo bla |
${MAILX} ${ARGS} \
5656 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5657 -Sfrom=test@localhost \
5658 -s 'S/MIME test' recei@ver.com
5660 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5661 check
7 - "${MBOX}" '1937410597 327'
5664 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5666 -Ssmime-sign-cert=.
/.tpair.pem \
5667 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5668 check
8 0 "./.DECRYPT" '2624716890 422'
5670 openssl smime
-decrypt -inkey .
/.tkey.pem \
5671 -in .
/.ENCRYPT
>>${ERR} 2>&1
5678 # xxx Note: t_z() was the first test (series) written. Today many
5679 # xxx aspects are (better) covered by other tests above, some are not.
5680 # xxx At some future date and time, convert the last remains not covered
5681 # xxx elsewhere to a real t_* test and drop it
5685 # Test for [260e19d] (Juergen Daubert)
5686 echo body |
${MAILX} ${ARGS} "${MBOX}"
5687 check 4 0 "${MBOX}" '2948857341 94'
5689 # "Test
for" [d6f316a] (Gavin Troy)
5691 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5692 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5693 check
6 0 "${MBOX}" '3942990636 118'
5694 check
6-1 - "${BODY}" '3951695530 170'
5696 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5699 for(i = 0; i < 10000; ++i)
5701 #printf "\xF0\x90\x87\x90"
5702 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5703 check 7 0 "${MBOX}" '1707496413 61812'
5709 # MIME encoding (QP) stress message subject
5710 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5711 'adadaddsssssssddddddddddddddddddddd'\
5712 'ddddddddddddddddddddddddddddddddddd'\
5713 'ddddddddddddddddddddddddddddddddddd'\
5714 'dddddddddddddddddddd Hallelulja? Od'\
5715 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5716 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5717 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5718 'fffffffffffffffffffffffffffffffffff'\
5719 'fffffffffffffffffffff ggggggggggggg'\
5720 'ggggggggggggggggggggggggggggggggggg'\
5721 'ggggggggggggggggggggggggggggggggggg'\
5722 'ggggggggggggggggggggggggggggggggggg'\
5727 # MIME encoding (QP) stress message body
5729 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5730 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5731 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5732 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5733 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5734 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5735 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5736 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5737 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5738 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5739 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5740 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5741 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5742 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5743 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5744 "auf den zeilen vorher.
\r\n"\
5745 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5747 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5749 "Das waren deren zwei.
\r\n"\
5751 "Die letzte Zeile war ein Leerschritt.
\n"\
5752 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5755 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5757 "Das waren deren zwei. ditto.
\n"\
5759 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5760 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5761 "auf den zeilen vorher.
\n"\
5763 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5764 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5766 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5768 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5770 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5772 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5774 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5776 "QP am Zeilenende über soft-nl hinweg
\n"\
5777 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5779 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5781 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5783 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5785 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5787 "Die letzte Zeile war ein Leerschritt.
\n"\
5792 # Test all configs TODO doesn't cover all *combinations*, stupid!
5796 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5797 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5798 NOTME["OPT_CROSS_BUILD
"] = 1
5799 NOTME["OPT_AUTOCC
"] = 1
5800 NOTME["OPT_AMALGAMATION
"] = 1
5801 NOTME["OPT_DEBUG
"] = 1
5802 NOTME["OPT_DEVEL
"] = 1
5803 NOTME["OPT_ASAN_ADDRESS
"] = 1
5804 NOTME["OPT_ASAN_MEMORY
"] = 1
5805 NOTME["OPT_FORCED_STACKPROT
"] = 1
5806 NOTME["OPT_NOMEMDBG
"] = 1
5807 NOTME["OPT_NYD2
"] = 1
5812 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5813 MULVALS["VAL_IDNA
"] = 1
5815 #VALKEYS[0] = "VAL_RANDOM
"
5816 VALVALS["VAL_RANDOM
"] = 1
5819 /^[[:space:]]*OPT_/{
5820 sub(/^[[:space:]]*/, "")
5821 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5822 # does not seem to be a compliant escape for =
5824 $1 = substr($1, 1, index($1, "=") - 1)
5826 OPTVALS[OPTNO++] = $1
5829 /^[[:space:]]*VAL_/{
5830 sub(/^[[:space:]]*/, "")
5831 val = substr($0, index($0, "=") + 1)
5833 val = substr(val, 2)
5834 val = substr(val, 1, length(val) - 1)
5836 $1 = substr($1, 1, index($1, "=") - 1)
5839 else if(VALVALS[$1]){
5840 VALKEYS[VALNO++] = $1
5845 function onepass(addons){
5846 a_onepass__worker(addons, "1", "0")
5847 a_onepass__worker(addons, "0", "1")
5849 function a_onepass__worker(addons, b0, b1){
5850 # Doing this completely sequentially and not doing make distclean in
5851 # between runs should effectively result in lesser compilations.
5852 # It is completely dumb nonetheless... TODO
5853 for(ono = 0; ono < OPTNO; ++ono){
5855 for(i = 0; i < ono; ++i){
5856 myconf = myconf " " OPTVALS[i] "=" b0 " "
5858 j = MULCHOICE[OPTVALS[i]]
5863 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5867 for(i = ono; i < OPTNO; ++i){
5868 myconf = myconf " " OPTVALS[i] "=" b1 " "
5870 j = MULCHOICE[OPTVALS[i]]
5875 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5881 myconf = VALKEYS[i] "=any
" myconf
5883 myconf = myconf " " ALWAYS " " addons
5888 i = split(MULVALS[mula], ia)
5892 print mula "=\"" j "\" " myconf
5898 # We cannot test NULL because of missing UI strings, which will end
5899 # up with different checksums
5900 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5902 j = split(VALVALS[VALKEYS[i]], ia)
5906 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5909 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5910 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5911 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5913 j = split(VALVALS[VALKEYS[i]], ia)
5917 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5920 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5921 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5923 onepass("OPT_DEBUG
=1")
5926 ' | while read c; do
5927 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5928 printf "\n\n##########\n$c\n"
5929 printf "\n\n##########\n$c\n" >&2
5930 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5931 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5932 printf 'Skipping after config, nothing changed\n'
5933 printf 'Skipping after config, nothing changed\n' >&2
5936 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5939 cd .. && ${MAKE} distclean
5942 [ -n "${ERR}" ] && echo > ${ERR}
5943 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5945 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5946 # if have_feat devel; then
5947 # ARGS="${ARGS} -Smemdebug"
5953 while [ ${#} -gt 0 ]; do
5959 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'