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:
2365 vput vexpr res regex
'banana' '(club )?(.*)(nana)(.*)' \
2366 '\$1\${2}\$4\${3}rama'
2367 echo $?
/$^ERRNAME
:$res:
2368 vput vexpr res regex
'Banana' '(club )?(.*)(nana)(.*)' \
2369 '\$1\$2\${2}\$2\$4\${3}rama'
2370 echo $?
/$^ERRNAME
:$res:
2371 vput vexpr res regex
'Club banana' '(club )?(.*)(nana)(.*)' \
2372 '\$1\${2}\$4\${3}rama'
2373 echo $?
/$^ERRNAME
:$res:
2377 check regex
0 "${MBOX}" '3949279959 384'
2379 printf 'vexpr-regex: unsupported, skipped\n'
2388 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2393 vput vexpr j '&' $i 7
2399 vput vexpr j '&' $i 7
2405 echo ! The end for $1
2409 # Transport $?/$! up the call chain
2415 wysh set i=$? j=$! k=$^ERRNAME
2419 echo ! The end for $1
2420 return $i $^ERR-BUSY
2424 # Up and down it goes
2431 vput vexpr k - $1 $2
2435 echo "# <$i/$j> .. "
2439 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2442 echo ! The end
for $1=$i/$2
2446 return $i $^ERR-BUSY
2452 call w1
0; echo ?
=$?
!=$
!; echo -----;
2453 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2454 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2457 check
1 0 "${MBOX}" '1572045517 5922'
2465 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2470 vput vexpr j '&' $i 7
2476 echo ! The end for $1/$2
2478 return $i $^ERR-BUSY
2489 echo ?=$? !=$^ERRNAME
2492 echo ?=$? !=$^ERRNAME
2494 echo ?=$? !=$^ERRNAME
2497 check 1 0 "${MBOX}" '2401702082 23801'
2501 if have_feat uistrings; then
2502 ${cat} <<- '__EOT' > "${BODY}"
2507 vput vexpr j '&' $i 7
2513 echo ! The end for $1
2516 echo would be err with errexit
2525 echo zwei, ?=$? !=$!
2526 localopts yes; set errexit
2528 echo drei, ?=$? !=$^ERRNAME
2530 echo vier, ?=$? !=$^ERRNAME, this is an error
2533 echo outer 1, ?=$? !=$^ERRNAME
2535 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2537 echo outer 3, ?=$? !=$^ERRNAME
2538 echo this is definitely an error
2541 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2542 -Snomemdebug > "${MBOX}" 2>&1
2543 check
2 0 "${MBOX}" '3900716531 4200'
2545 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2546 -Snomemdebug > "${MBOX}" 2>&1
2547 check 3 1 "${MBOX}" '1006776201 2799'
2549 echo 'xcall-2: unsupported, skipped'
2550 echo 'xcall-3: unsupported, skipped'
2559 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2560 vpospar
set hey
, "'you ", world
!
2561 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2562 vput vpospar x quote
; echo x
<$x>
2563 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2564 vput vpospar y quote
;echo y
<$y>
2565 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2566 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2567 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2570 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2571 vput vpospar z quote
;echo infun2
:z
<$z>
2575 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2576 vput vpospar y quote
;echo infun
:y
<$y>
2577 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2578 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2580 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2581 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2584 call infun This
"in a" fun
2585 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2586 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2588 check
1 0 "${MBOX}" '155175639 866'
2591 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2593 echo ifs<$ifs> ifs-ws<$ifs-ws>
2594 vpospar set hey, "'you ", world!
2595 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2596 vput vpospar x quote; echo x<$x>
2597 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2598 eval vpospar set ${x};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>
2611 echo ifs<$ifs> ifs-ws<$ifs-ws>
2612 vpospar set hey, "'you ", world!
2613 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2615 vput vpospar x quote; echo x<$x>
2616 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2617 eval vpospar set ${x};\
2618 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2620 check ifs 0 "${MBOX}" '2015927702 706'
2627 TRAP_EXIT_ADDONS="./.t*"
2629 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2632 printf " (1/$#: <$1>)"
2634 if [ $# -gt 0 ]; then
2648 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2649 printf xxx;xxx arg ,b u.
2650 printf xxx;xxx arg , .
2651 printf xxx;xxx arg ,ball.
2657 echon " (1/$#: <$1>)"
2672 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2673 echon xxx;call xxx arg ,b u.
2674 echon xxx;call xxx arg , .
2675 echon xxx;call xxx arg ,ball.
2678 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2679 check 1 0 "${MBOX}" '41566293 164'
2681 #${SHELL} ./.t.sh > ./.tshout 2>&1
2682 #check disproof-1 0 ./.tshout '41566293 164'
2689 TRAP_EXIT_ADDONS="./.t*"
2691 ${cat} <<- '__EOT
' > .tin
2692 hey1, "'you
", world!
2693 hey2, "'you ", bugs bunny!
2698 ${cat} <<- '__EOT
' |\
2699 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2701 echo $?/$^ERRNAME / <$a><$b><$c>
2703 echo $?/$^ERRNAME / <$a><$b><$c>
2705 echo $?/$^ERRNAME / <$a><$b><$c>
2707 echo $?/$^ERRNAME / <$a><$b><$c>
2708 unset a b c;read a b c
2709 echo $?/$^ERRNAME / <$a><$b><$c>
2710 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2712 check 1 0 "${MBOX}" '1527910147 173'
2714 ${cat} <<- '__EOT
' > .tin2
2715 hey2.0,:"'you
",:world!:mars.:
2716 hey2.1,:"'you ",:world!
2717 hey2.2,:"'you
",:bugs bunny!
2723 ${cat} <<- '__EOT' |\
2724 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2727 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2729 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2731 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2733 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2735 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2737 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2738 unset a b c
;read a b c
2739 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2741 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2742 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2744 check ifs
0 "${MBOX}" '890153490 298'
2746 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2748 readall d; echo $?/$^ERRNAME / <$d>
2749 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2750 readctl create .tin2
2751 readall d; echo $?/$^ERRNAME / <$d>
2752 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2753 readctl remove .tin;echo $?/$^ERRNAME;\
2754 readctl remove .tin2;echo $?/$^ERRNAME
2755 echo '### now with empty lines'
2756 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2757 readctl create .temptynl;echo $?/$^ERRNAME
2758 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2759 readctl remove .temptynl;echo $?/$^ERRNAME
2761 check readall 0 "${MBOX}" '4113506527 405'
2770 TRAP_EXIT_ADDONS=".
/.t
*"
2774 while [ ${i} -lt 113 ]; do
2775 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2776 "${MBOX}" "${i}" "${i}"
2779 ) | ${MAILX} ${ARGS} > .tall 2>&1
2780 check 1 0 "${MBOX}" '1785801373 13336'
2781 check 1-outerr - ./.tall '4294967295 0' # empty file
2783 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2784 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2785 check 2 0 .tall '3075634057 9103'
2787 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2788 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2789 check
3 0 .tall
'1902668747 9110'
2791 # copy only the odd (but the first), move the even
2793 printf 'File "file://%s"\ncopy ' .tmbox2
2795 while [ ${i} -lt 113 ]; do
2799 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2800 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2801 check
4 0 .tmbox3
'2554734733 6666'
2802 check
5 - .tall
'3168324241 4573'
2805 printf 'file "file://%s"\nmove ' .tmbox2
2807 while [ ${i} -lt 113 ]; do
2811 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2812 .tmbox3 .tmbox3 .tmbox2
2813 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2814 check
6 0 .tmbox3
'1429216753 13336'
2815 if have_feat uistrings
; then
2816 ${sed} 2d
< .tall
> .tallx
2820 check
7 - .tallx
'3604509039 13645'
2822 # Invalid MBOXes (after [f4db93b3])
2824 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2825 check 8 0 .tinvmbox '2848412822 118'
2826 check 9 - ./.tall '461280182 33'
2828 echo ' ' > .tinvmbox
2829 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2830 check
10 0 .tinvmbox
'624770486 120'
2831 check
11 - .
/.tall
'461280182 33'
2833 { echo; echo; } > .tinvmbox
# (not invalid)
2834 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2835 check 12 0 .tinvmbox '1485640875 119'
2836 check 13 - ./.tall '461280182 33'
2838 # *mbox-rfc4155*, plus
2839 ${cat} <<-_EOT > ./.tinv1
2842 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2843 Date: Wed, 02 Oct 1996 01:50:07 +0000
2845 Subject: Bad bad message 1
2847 From me to you, blinde Kuh!
2849 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2850 Date: Wed, 02 Oct 1996 01:50:07 +0000
2852 Subject: Bad bad message 2
2854 From me to you, blindes Kalb!
2856 ${cp} ./.tinv1 ./.tinv2
2860 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2861 \\eval copy * "${2}"
2863 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2865 ${cat} ./.tinv1 ./.tok >> .tall
2866 check 14 - ./.tall '739301109 616'
2869 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2870 wysh File ./.tok # Just move away to nowhere
2872 wysh file ./.tinv2 # Fully repaired
2873 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2875 check 15-1 - ./.tinv1 '3178048820 332'
2876 check 15-2 - ./.tinv2 '4151504442 314'
2883 if have_feat maildir; then :; else
2884 echo 'maildir: unsupported, skipped'
2888 TRAP_EXIT_ADDONS=".
/.t
*"
2892 while [ ${i} -lt 112 ]; do
2893 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2894 "${MBOX}" "${i}" "${i}"
2897 ) | ${MAILX} ${ARGS}
2898 check 1 0 "${MBOX}" '2366902811 13332'
2904 ' "${MBOX}" .tmdir1 .tmdir1 |
2905 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2906 check 2 0 .tlst '1713783045 9103'
2909 copy * "maildir
://%s
"
2912 ' "${MBOX}" .tmdir2 .tmdir2 |
2913 ${MAILX} ${ARGS} -Sshowlast > .tlst
2914 check 3 0 .tlst '1240307893 9113'
2916 printf 'File "maildir
://%s
"
2920 ' .tmdir2 .tmbox1 .tmbox1 |
2921 ${MAILX} ${ARGS} -Sshowlast > .tlst
2922 check 4 0 .tmbox1 '4096198846 12772'
2923 check 5 - .tlst '817337448 9110'
2925 # only the odd (even)
2927 printf 'File "maildir
://%s
"
2930 while [ ${i} -lt 112 ]; do
2932 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2939 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2940 check 6 0 .tmbox2 '4228337024 6386'
2941 check 7 - .tlst '884389294 4573'
2944 printf 'file "maildir
://%s
"
2947 while [ ${i} -lt 112 ]; do
2949 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2957 ' .tmbox2 .tmbox2 .tmdir2
2958 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2959 check
8 0 .tmbox2
'978751761 12656'
2960 ${sed} 2d
< .tlst
> .tlstx
2961 check
9 - .tlstx
'2391942957 13645'
2967 # MIME and RFC basics {{{
2968 t_mime_if_not_ascii
() {
2969 t_prolog mime_if_not_ascii
2971 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
2972 check 1 0 "${MBOX}" '3647956381 106'
2974 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
2976 check
2 0 "${MBOX}" '3964303752 274'
2981 t_xxxheads_rfc2047
() {
2982 t_prolog xxxheads_rfc2047
2983 TRAP_EXIT_ADDONS
="./.t*"
2985 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
2987 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
2988 -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̲' \
2990 check
1 0 "${MBOX}" '3422562347 371'
2992 # Single word (overlong line split -- bad standard! Requires injection of
2993 # artificial data!! But can be prevented by using RFC 2047 encoding)
2995 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2996 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
2997 check 2 0 "${MBOX}" '3317256266 1714'
2999 # Combination of encoded words, space and tabs of varying sort
3001 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3002 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
3003 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
3004 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
3005 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
3006 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
3008 check 3 0 "${MBOX}" '786672837 587'
3010 # Overlong multibyte sequence that must be forcefully split
3011 # todo This works even before v15.0, but only by accident
3013 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3014 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3015 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
3016 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
3018 check 4 0 "${MBOX}" '2889557767 655'
3022 echo | ${MAILX} ${ARGS} \
3023 -s "1-1 B2 B3 B4 B5 B6 B\
3024 1-2 B2 B3 B4 B5 B6 B\
3025 1-3 B2 B3 B4 B5 B6 B\
3026 1-4 B2 B3 B4 B5 B6 B\
3027 1-5 B2 B3 B4 B5 B6 B\
3028 1-6 B2 B3 B4 B5 B6
" \
3030 check 5 0 "${MBOX}" '3135161683 293'
3032 # Leading and trailing WS
3034 echo | ${MAILX} ${ARGS} \
3035 -s " 2-1 B2 B3 B4 B5 B6 B\
3036 1-2 B2 B3 B4 B5 B6 B\
3037 1-3 B2 B3 B4 B5 B6 B\
3038 1-4 B2 B3 B4 B5 B6
" \
3040 check 6 0 "${MBOX}" '3221845405 232'
3042 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
3044 echo "Dat Früchtchen riecht häußlich
" |
3045 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
3047 'Schnödes "Früchtchen
" <do@du> (Hä!)'
3048 check 7 0 "${MBOX}" '800505986 368'
3050 # RFC 2047 in an address field, and iconv involved
3051 if have_feat iconv; then
3053 ${cat} > ./.trebox <<_EOT
3054 From zaza@exam.ple Fri Mar 2 21:31:56 2018
3055 Date: Fri, 2 Mar 2018 20:31:45 +0000
3056 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
3057 To: dude <dude@exam.ple>
3058 Subject: houston(...)
3059 Message-ID: <abra@1>
3061 Content-Type: text/plain; charset=iso-8859-1
3062 Content-Disposition: inline
3063 Content-Transfer-Encoding: 8bit
3066 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3067 -Sfullnames -Sreply-in-same-charset \
3068 -Smta=./.tmta.sh -Rf ./.trebox
3069 check 8 0 "${MBOX}" '2914485741 280'
3071 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
3077 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
3078 t_prolog iconv_mbyte_base64
3079 TRAP_EXIT_ADDONS=".
/.t
*"
3081 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
3082 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
3083 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
3086 echo 'iconv_mbyte_base64: unsupported, skipped'
3090 echo 'iconv_mbyte_base64: unsupported, skipped'
3094 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
3096 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
3097 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3099 -Sescape=! -Smime-encoding=base64 2>./.terr
3100 set ttycharset=utf-8 sendcharsets=iso-2022-jp
3102 !s Japanese from UTF-8 to ISO-2022-JP
3103 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3105 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3108 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3110 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3113 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
3115 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
3116 \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
3118 \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
3121 \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
3123 \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
3126 # May not presume iconv output as long as roundtrip possible [489a7122]
3128 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3129 < "${MBOX}" > .
/.tcksum
3130 check
1 - .
/.tcksum
'2694609714 520'
3131 check
2 - .
/.terr
'4294967295 0'
3133 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3134 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3135 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3136 -Rf "${MBOX}" >.
/.tlog
2>&1
3137 check
3 0 .
/.twrite
'1259742080 686'
3138 #check 4 - ./.tlog '3214068822 2123'
3139 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3140 check
4 - .
/.txlog
'3659773472 2035'
3142 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
3145 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
3146 rm -f "${MBOX}" .
/.twrite
3147 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3149 -Sescape=! -Smime-encoding=base64
2>.
/.terr
3150 set ttycharset
=utf-8 sendcharsets
=euc-jp
3152 !s Japanese from UTF-8 to EUC-JP
3153 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3155 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3158 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3160 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3163 set ttycharset
=EUC-JP sendcharsets
=utf-8
3165 !s Japanese from EUC-JP to UTF-8
3166 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3168 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3171 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3173 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3177 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3178 < "${MBOX}" > .
/.tcksum
3179 check
5 - .
/.tcksum
'2870183985 473'
3180 check
6 - .
/.terr
'4294967295 0'
3182 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3183 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3184 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3185 -Rf "${MBOX}" >.
/.tlog
2>&1
3186 check
7 0 .
/.twrite
'1259742080 686'
3187 #check 8 - ./.tlog '2506063395 2075'
3188 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3189 check
8 - .
/.txlog
'2528199891 1988'
3191 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
3197 t_iconv_mainbody
() {
3198 t_prolog iconv_mainbody
3199 TRAP_EXIT_ADDONS
="./.t*"
3201 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
3204 echo 'iconv_mainbody: unsupported, skipped'
3208 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
3210 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3211 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
3212 -s '–' over-the@rain.bow
2>.
/.terr
3213 check
1 0 "${MBOX}" '3634015017 251'
3214 check
2 - .
/.terr
'4294967295 0'
3216 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3217 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
3218 -s '–' over-the@rain.bow
2>.
/.terr
3220 check
3 - "${MBOX}" '3634015017 251'
3221 if have_feat uistrings
; then
3222 if have_feat docstrings
; then # xxx should not be like that
3223 check
4 - .
/.terr
'2579894983 148'
3225 check
4 - .
/.terr
'271380835 121'
3228 echo 'iconv_mainbody-4: unsupported, skipped'
3231 # The different iconv(3) implementations use different replacement sequence
3232 # types (character-wise, byte-wise, and the character(s) used differ)
3233 i
="${MAILX_ICONV_MODE}"
3234 if [ -n "${i}" ]; then
3235 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
3237 check_ex0 5-1-estat ${j}
3238 check 5-1 - ./.terr '4294967295 0'
3239 if [ ${i} -eq 13 ]; then
3240 check 5-2 - ./.tout '189327996 283'
3241 elif [ ${i} -eq 12 ]; then
3242 check 5-3 - ./.tout '1959197095 283'
3243 elif [ ${i} -eq 3 ]; then
3244 check 5-4 - ./.tout '3196380198 279'
3246 check 5-5 - ./.tout '3760313827 279'
3249 echo 'iconv_mainbody-5: unsupported, skipped'
3255 t_binary_mainbody() {
3256 t_prolog binary_mainbody
3257 TRAP_EXIT_ADDONS=".
/.t
*"
3259 printf 'abra\0\nka\r\ndabra' |
3260 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
3262 check 1 0 "${MBOX}" '1629827 239'
3263 check 2 - ./.terr '4294967295 0'
3265 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
3266 ${MAILX} ${ARGS} -Rf \
3267 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
3268 "${MBOX}" >./.tall 2>&1
3269 check 3 0 ./.tall '733582513 319'
3270 check 4 - ./.tcat '3817108933 15'
3271 check 5 - ./.twrite '3817108933 15'
3276 t_C_opt_customhdr() {
3277 t_prolog C_opt_customhdr
3278 TRAP_EXIT_ADDONS=".
/.t
*"
3280 t_xmta 'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
3283 ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3284 -C 'C-One : Custom One Body' \
3285 -C 'C-Two:CustomTwoBody' \
3286 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3287 this-goes@nowhere >./.tall 2>&1
3289 ${cat} ./.tall >> "${MBOX}"
3290 check 1 0 "${MBOX}" '2400078426 195'
3293 printf 'm this-goes@nowhere\nbody\n!.
3295 m this-goes2@nowhere\nbody2\n!.
3296 set customhdr=%ccustom1 : custom1 body%c
3297 m this-goes2@nowhere\nbody2\n!.
3298 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
3299 m this-goes3@nowhere\nbody3\n!.
3301 ${MAILX} ${ARGS} -Smta=./.tmta.sh -Sescape=! \
3302 -C 'C-One : Custom One Body' \
3303 -C 'C-Two:CustomTwoBody' \
3304 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3307 ${cat} ./.tall >> "${MBOX}"
3308 check 2 0 "${MBOX}" '3546878678 752'
3314 # Operational basics with easy tests {{{
3317 TRAP_EXIT_ADDONS=".
/.t
*"
3319 t_xmta 'Hippocastanum Mon Jun 19 15:07:07 2017'
3321 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tmta.sh > ./.tall 2>&1
3323 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
3325 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3327 alias a4 a5 ex1@a4.ple
3329 alias a6 a7 ex1@a6.ple
3343 check 1 0 "${MBOX}" '2496925843 272'
3344 check 2 - .tall '3548953204 152'
3346 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3347 # TODO need to somehow provide its contents to the test, then test
3354 TRAP_EXIT_ADDONS=".
/.t
*"
3356 t_xmta 'Alchemilla Wed Apr 25 15:12:13 2017'
3358 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3359 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
3360 check
1 0 "${MBOX}" '1594682963 13520'
3362 if (echo |
gzip -c) >/dev
/null
2>&1; then
3364 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3365 "${MBOX}" | ${MAILX} ${ARGS} \
3366 -X'filetype gz gzip\ -dc gzip\ -c'
3367 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3368 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3370 check 2 - ".
/.t.mbox
" '1594682963 13520'
3371 check 3 - ".
/.t.out
" '2392348396 102'
3373 echo 'filetype-2: unsupported, skipped'
3374 echo 'filetype-3: unsupported, skipped'
3379 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
3385 -X'filetype gz gzip\ -dc gzip\ -c' \
3386 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
3387 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
3388 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3390 -X'filetype gz gzip\ -dc gzip\ -c' \
3391 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
3393 check 4 - ".
/.t.mbox
" '2886541147 27060'
3394 check 5 - ".
/.t.out
" '852335377 172'
3399 t_record_a_resend() {
3400 t_prolog record_a_resend
3401 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
3405 m %s\n~s Subject 1.\nHello.\n~.
3406 set record-files add-file-recipients
3407 m %s\n~s Subject 2.\nHello.\n~.
3409 resend 2 ./.t.resent
3410 Resend 1 ./.t.resent
3412 resend 2 ./.t.resent
3413 Resend 1 ./.t.resent
3414 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
3417 check 1 0 "${MBOX}" '2632690399 252'
3418 check 2 - .t.record '3337485450 456'
3419 check 3 - .t.resent '1560890069 640'
3426 TRAP_EXIT_ADDONS=".
/.tmta.sh .
/.t.mbox
"
3428 t_xmta 'Alchemilla Wed Apr 07 17:03:33 2017' ./.t.mbox
3431 ${MAILX} ${ARGS} -ef ./.t.mbox
3432 echo ${?} > "${MBOX}"
3434 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
3435 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3436 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
3437 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3439 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
3440 echo ${?} >> "${MBOX}"
3441 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
3442 echo ${?} >> "${MBOX}"
3443 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
3444 echo ${?} >> "${MBOX}"
3445 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
3446 echo ${?} >> "${MBOX}"
3447 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
3448 echo ${?} >> "${MBOX}"
3449 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
3450 echo ${?} >> "${MBOX}"
3451 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
3452 echo ${?} >> "${MBOX}"
3454 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
3455 echo ${?} >> "${MBOX}"
3456 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
3457 echo ${?} >> "${MBOX}"
3458 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
3459 echo ${?} >> "${MBOX}"
3460 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
3461 echo ${?} >> "${MBOX}"
3462 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
3463 echo ${?} >> "${MBOX}"
3464 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
3465 echo ${?} >> "${MBOX}"
3466 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
3467 echo ${?} >> "${MBOX}"
3469 check
1 - "${MBOX}" '1708955574 678'
3473 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
3474 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3475 -r '' -X 'wysh set from=pony1@$LOGNAME'
3476 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
3477 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3478 -r '' -X 'wysh set from=pony2@$LOGNAME'
3479 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
3480 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3481 -r '' -X 'wysh set from=pony3@$LOGNAME'
3483 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3484 echo fh-test size; set autosort=size showname showto
3485 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3486 check
2-1 0 "${MBOX}" '512787278 418'
3488 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3489 echo fh-test subject; set autosort=subject showname showto
3490 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3491 check
2-2 0 "${MBOX}" '3606067531 421'
3493 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3494 echo fh-test from; set autosort=from showto
3495 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3496 check
2-3 0 "${MBOX}" '2506148572 418'
3498 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3499 echo fh-test to; set autosort=to showto
3500 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3501 check
2-4 0 "${MBOX}" '1221542854 416'
3507 # Simple, if we need more here, place in a later vim fold!
3508 t_prolog q_t_etc_opts
3509 TRAP_EXIT_ADDONS
="./.t*"
3511 # Three tests for MIME encoding and (a bit) content classification.
3512 # At the same time testing -q FILE, < FILE and -t FILE
3513 t__put_body
> .
/.tin
3515 < .
/.tin
${MAILX} ${ARGS} ${ADDARG_UNI} \
3516 -a .
/.tin
-s "`t__put_subject`" "${MBOX}"
3517 check
1 0 "${MBOX}" '1088822685 6642'
3520 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3521 -a .
/.tin
-s "`t__put_subject`" -q .
/.tin
"${MBOX}"
3522 check
2 0 "${MBOX}" '1088822685 6642'
3525 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject`" && echo &&
3527 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a .
/.tin
-t
3528 check
3 0 "${MBOX}" '1088822685 6642'
3530 # Check comments in the header
3532 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
3535 # Noch ein Kommentar
3537 # Nachgestelltes Kommentar
3541 check 4 0 "${MBOX}" '4161555890 124'
3546 t_message_injections() {
3547 # Simple, if we need more here, place in a later vim fold!
3548 t_prolog message_injections
3549 TRAP_EXIT_ADDONS=".
/.t
*"
3551 t_xmta 'Echinacea Tue Jun 20 15:54:02 2017'
3553 echo mysig > ./.tmysig
3555 echo some-body | ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3556 -Smessage-inject-head=head-inject \
3557 -Smessage-inject-tail=tail-inject \
3558 -Ssignature=./.tmysig \
3559 ex@am.ple > ./.tall 2>&1
3560 check 1 0 "${MBOX}" '2434746382 134'
3561 check 2 - .tall '4294967295 0' # empty file
3564 ${cat} <<-_EOT > ./.template
3568 Subject: This subject is
3570 Body, body, body me.
3572 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tmta.sh \
3573 -Smessage-inject-head=head-inject \
3574 -Smessage-inject-tail=tail-inject \
3575 -Ssignature=./.tmysig \
3577 check 3 0 "${MBOX}" '3114203412 198'
3578 check 4 - .tall '4294967295 0' # empty file
3584 # Relatively Simple, if we need more here, place in a later vim fold!
3585 t_prolog attachments
3586 TRAP_EXIT_ADDONS=".
/.t
*"
3588 t_xmta 'Cannabis Sun Feb 18 02:02:46 2018'
3590 ${cat} <<-_EOT > ./.tx
3591 From steffen Sun Feb 18 02:48:40 2018
3592 Date: Sun, 18 Feb 2018 02:48:40 +0100
3595 User-Agent: s-nail v14.9.7
3598 From steffen Sun Feb 18 02:48:42 2018
3599 Date: Sun, 18 Feb 2018 02:48:42 +0100
3602 User-Agent: s-nail v14.9.7
3607 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
3608 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
3609 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3612 '!@ ./.t3 ".
/.t
4" ""
3620 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh \
3621 -a ./.t1 -a './.t 2' \
3622 -s attachment-test \
3623 ex@am.ple > ./.tall 2>&1
3624 check 1 0 "${MBOX}" '4107062253 634'
3625 if have_feat uistrings; then
3626 check 2 - .tall '1928331872 720'
3628 echo 'attachments-2: unsupported, skipped'
3634 !s This the subject is
3635 !@ ./.t3 "#2" "./.t 4" "#1" ""
3645 !@ .
/.t3
"#2" "./.t 4" "#1" ""
3653 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3662 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3676 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3678 check 3 0 "${MBOX}" '798122412 2285'
3679 if have_feat uistrings; then
3680 check 4 - .tall '2526106274 1910'
3682 echo 'attachments-4
: unsupported
, skipped
'
3711 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3713 check 5 0 "${MBOX}" '2165311808 2276'
3714 if have_feat uistrings; then
3715 check 6 - .tall '3662598562 509'
3717 echo 'attachments-6
: unsupported
, skipped
'
3724 # (after attachments)
3726 TRAP_EXIT_ADDONS="./.t*"
3729 mkdir ./.ttt || exit 1
3733 : > 'diet\ is \curd.txt
'
3734 : > 'diet
"is" curd.txt
'
3736 : > 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
3737 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3738 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3739 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3741 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3742 -a "./.ttt/ma'ger.txt
" -a ".
/.ttt
/mä
'ger.txt" \
3743 -a '.
/.ttt
/diet\ is \curd.txt
' -a '.
/.ttt
/diet
"is" curd.txt
' \
3744 -a ./.ttt/höde-tröge.txt \
3745 -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 \
3746 -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 \
3747 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3748 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3750 check 1 0 "${MBOX}" '3720896054 3088'
3752 # `resend' test, reusing
$MBOX
3753 printf "Resend ./.t2\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
3754 check 2 0 ./.t2 '3720896054 3088'
3756 printf "resend .
/.t3
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3757 check
3 0 .
/.t3
'3979736592 3133'
3762 t_mime_types_load_control
() {
3763 t_prolog mime_types_load_control
3764 if have_feat uistrings
; then :; else
3765 echo 'mime_types_load_control: unsupported, skipped'
3768 TRAP_EXIT_ADDONS
="./.t*"
3770 ${cat} <<-_EOT > ./.tmts1
3771 @ application/mathml+xml mathml
3773 ${cat} <<-_EOT > ./.tmts2
3774 @ x-conference/x-cooltalk ice
3776 @ application/aga-aga aga
3779 ${cat} <<-_EOT > ./.tmts1.mathml
3780 <head>nonsense ML</head>
3782 ${cat} <<-_EOT > ./.tmts2.ice
3785 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3786 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3800 ' "${MBOX}" "${MBOX}" |
3802 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3805 ${cat} "${MBOX}" >> .
/.tout
3806 check
1 - .
/.tout
'2716124839 2441'
3808 echo type |
${MAILX} ${ARGS} -R \
3809 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3810 -f "${MBOX}" >> .
/.tout
2>&1
3811 check
2 0 .
/.tout
'2093030907 3634'
3817 # Around state machine, after basics {{{
3820 TRAP_EXIT_ADDONS
="./.t*"
3822 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
3824 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3828 alternates a1@b1 a2@b2 a3@b3
3833 echo $?
/$^ERRNAME
<$rv>
3838 echo $?
/$^ERRNAME
<$rv>
3841 echo $?
/$^ERRNAME
<$rv>
3844 echo $?
/$^ERRNAME
<$rv>
3848 alternates a1@b1 a2@b2 a3@b3
3851 echo $?
/$^ERRNAME
<$rv>
3854 echo $?
/$^ERRNAME
<$rv>
3857 echo $?
/$^ERRNAME
<$rv>
3860 alternates a1@b1 a2@b2 a3@b3
3863 echo $?
/$^ERRNAME
<$rv>
3866 echo $?
/$^ERRNAME
<$rv>
3869 echo $?
/$^ERRNAME
<$rv>
3873 alternates a1@b1 a2@b2 a3@b3
3876 echo $?
/$^ERRNAME
<$rv>
3880 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
3882 ~s all alternates
, only a1@b1 remains
3884 ~b a3@b3 a3@c3 a3@d3
3893 alternates a1@b1 a1@c1 a2@b2 a3@b3
3895 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
3897 ~b a3@b3 a3@c3 a3@d3
3904 alternates a1@b1 a2@b2 a3
; set allnet
3906 ~s all alternates via allnet
, only a1@b1 remains
3908 ~b a3@b3 a3@c3 a3@d3
3919 echo $?
/$^ERRNAME
<$rv>
3923 echo $?
/$^ERRNAME
<$rv>
3927 echo $?
/$^ERRNAME
<$rv>
3931 echo $?
/$^ERRNAME
<$rv>
3935 echo $?
/$^ERRNAME
<$rv>
3939 alternates a1@b1 a2@b2
3942 echo $?
/$^ERRNAME
<$rv>
3943 alternates a3@b3 a4@b4
3946 echo $?
/$^ERRNAME
<$rv>
3949 check
1 0 "${MBOX}" '142184864 515'
3950 if have_feat uistrings
; then
3951 check
2 - .tall
'1878598364 505'
3953 echo 'alternates-2: unsupported, skipped'
3956 # Automatic alternates, also from command line (freezing etc.)
3958 ${cat} <<- __EOT > ./.tin
3959 From trouble-report@desy Wed Jun 6 20:19:28 2018
3960 Date: Wed, 06 Jun 2018 19:58:02 +0200
3961 From: a@b.org, b@b.org, c@c.org
3964 Cc: a@b.org, c@c.org
3966 Message-ID: <20180606175802.dw-cn%a@b.org>
3976 a@b.org b@b.org c@c.org
3981 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3982 -S from
=a@b.org
,b@b.org
,c@c.org
-S sender
=a@b.org \
3983 -Rf .
/.tin
> .
/.tall
2>&1
3984 check
3 0 "${MBOX}" '287250471 256'
3985 check
4 - .tall
'4294967295 0'
3989 set from=a@b.org,b@b.org,c@c.org sender=a@b.org
3993 a@b.org b@b.org c@c.org
3998 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3999 -Rf .
/.tin
> .
/.tall
2>&1
4000 check
5 0 "${MBOX}" '2618762028 512'
4001 check
6 - .tall
'4294967295 0'
4003 # And more, with/out -r
4004 # TODO -r should be the Sender:, which should automatically propagate to
4005 # TODO From: if possible and/or necessary. It should be possible to
4006 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
4007 # TODO arg as appropriate.
4008 # TODO For now we are a bit messy
4011 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4012 -c a@b.example
,b@b.example
,c@c.example \
4013 -S from
=a@b.example
,b@b.example
,c@c.example \
4014 -S sender
=a@b.example \
4015 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4016 check
7 0 "${MBOX}" '3510981487 192'
4017 check
8 - .tout
'2052716617 201'
4018 check
9 - .tall
'4294967295 0'
4020 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4021 -c a@b.example
,b@b.example
,c@c.example \
4022 -S from
=a@b.example
,b@b.example
,c@c.example \
4023 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
4024 check
10 0 "${MBOX}" '2282326606 364'
4025 check
11 - .tout
'3213404599 382'
4026 check
12 - .tall
'4294967295 0'
4028 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4029 -c a@b.example
,b@b.example
,c@c.example \
4030 -S from
=a@b.example
,b@b.example
,c@c.example \
4031 -S sender
=a@b.example \
4032 b@b.example
>.
/.tall
2>&1
4033 check
13 0 "${MBOX}" '1460017970 582'
4034 check
14 - .tall
'4294967295 0'
4039 t_quote_a_cmd_escapes
() {
4040 t_prolog quote_a_cmd_escapes
4041 TRAP_EXIT_ADDONS
="./.t*"
4045 echo 'included file' > .
/.ttxt
4047 ${cat} <<-_EOT > ./.tmbox
4048 From neverneverland Sun Jul 23 13:46:25 2017
4049 Subject: Bugstop: five miles out 1
4050 Reply-To: mister originator1 <mr1@originator>
4051 From: mister originator1 <mr1@originator>
4052 To: bugstop-commit@five.miles.out
4054 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4055 Date: Wed, 19 Jul 2017 09:22:57 -0400
4056 Message-Id: <20170719132257.766AF781267-1@originator>
4059 That's appalling, I.
4061 From neverneverland Sun Jul 23 13:47:25 2017
4062 Subject: Bugstop: five miles out 2
4063 Reply-To: mister originator2 <mr2@originator>
4064 From: mister originator2 <mr2@originator>
4065 To: bugstop-commit@five.miles.out
4067 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4068 Date: Wed, 19 Jul 2017 09:23:57 -0400
4069 Message-Id: <20170719132257.766AF781267-2@originator>
4072 That's appalling, II.
4074 From neverneverland Sun Jul 23 13:48:25 2017
4075 Subject: Bugstop: five miles out 3
4076 Reply-To: mister originator3 <mr3@originator>
4077 From: mister originator3 <mr3@originator>
4078 To: bugstop-commit@five.miles.out
4080 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4081 Date: Wed, 19 Jul 2017 09:24:57 -0400
4082 Message-Id: <20170719132257.766AF781267-3@originator>
4085 That's appalling, III.
4090 set indentprefix=" |"
4097 headerpick type retain cc date from message-id reply-to subject to
4101 set quote=allheaders
4104 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4105 -Sescape=! -Sindentprefix=' >' \
4106 .
/.tmbox
>.
/.tall
2>&1
4108 ${cat} .
/.tall
>> "${MBOX}"
4109 check
1 0 "${MBOX}" '2181726970 2023'
4111 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4114 set Sign=SignVar sign=signvar DEAD=./.ttxt
4115 headerpick type retain Subject
4117 !!1 Not escaped. And shell test last, right before !..
4118 !: echo 2 only echoed via colon
4119 !_ echo 3 only echoed via underscore
4121 !<! echo 5 shell echo included
4122 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4123 7 and 8 are ~A and ~a:
4126 !b 9 added ~b cc <ex1@am.ple>
4127 !c 10 added ~c c <ex2@am.ple>
4134 14: ~f (headerpick: subject)
4138 16, 17: ~I Sign, ~i Sign
4159 set quote-inject-head quote-inject-tail indentprefix
4160 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4164 !:unset quote quote-inject-head quote-inject-tail
4169 24: ~s this new subject
4170 !s 24 did new ~s ubject
4171 !t 25 added ~t o <ex3@am.ple>
4176 and i ~w rite this out to ./.tmsg
4178 !:wysh set x=$escape;set escape=~
4179 ~!echo shell command output
4180 ~:wysh set escape=$x
4182 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4183 -Sescape=! -Sindentprefix=' |' \
4184 .
/.tmbox
>.
/.tall
2>&1
4186 ${cat} .
/.tall
>> "${MBOX}"
4187 check
2 - "${MBOX}" '2613898218 4090'
4188 check
3 - .
/.tmsg
'2771314896 3186'
4193 t_compose_edits
() { # XXX very rudimentary
4194 t_prolog compose_edits
4195 TRAP_EXIT_ADDONS
="./.t*"
4197 ${cat} <<-_EOT > ./.ted.sh
4199 ${cat} <<-__EOT > \${1}
4212 # > All these are in-a-row!
4214 printf 'mail ./.tout\n~s This subject is\nThis body is\n~.' |
4215 ${MAILX} ${ARGS} -Seditheaders >.
/.tall
2>&1
4216 check
1 0 .
/.tout
'3993703854 127'
4217 check
2 - .
/.tall
'4294967295 0'
4219 ${mv} .
/.tall .
/.tout
4220 printf 'mail ./.tout\n~s This subject is\nThis body is\n~e\n~.' |
4221 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=.
/.ted.sh
>.
/.tall
2>&1
4222 check
3 0 .
/.tout1
'285981670 116'
4223 check
4 - .
/.tout2
'285981670 116'
4224 check
5 - .
/.tout3
'285981670 116'
4225 check
6 - .
/.tout
'4294967295 0'
4226 check
7 - .
/.tall
'4294967295 0'
4227 ${rm} .
/.tout1 .
/.tout2 .
/.tout3
4229 # t_compose_hooks will test ~^ at edge
4230 ${mv} .
/.tout .
/.tout1
4231 ${mv} .
/.tall .
/.tout2
4233 mail ./.tout\n!s This subject is\nThis body is
4238 !^header insert fcc ./.tout
4239 !^header insert fcc .tout1
4240 !^header insert fcc ./.tout2
4243 !^header remove-at fcc 2
4244 !^header remove-at fcc 2
4248 !^header insert fcc ./.tout
4252 ' |
${MAILX} ${ARGS} -Sescape=! >.
/.tall
2>&1
4253 check
8 0 .
/.tout
'3993703854 127'
4254 check
9 - .
/.tout1
'4294967295 0'
4255 check
10 - .
/.tout2
'4294967295 0'
4256 check
11 - .
/.tall
'4280910245 300'
4258 # < No longer in-a-row
4260 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >.
/.tall
2>&1
4262 Subject
: Fcc via
-t test
4266 check
12 0 .
/.ttout
'1289478830 122'
4267 check
13 - .
/.tall
'4294967295 0'
4272 t_digmsg
() { # XXX rudimentary
4274 TRAP_EXIT_ADDONS
="./.t*"
4277 mail ./.tout\n!s This subject is\nThis body is
4280 !:digmsg - header list
4281 !:digmsg - header show subject
4282 !:digmsg - header show to
4283 !:digmsg - header remove to
4284 !:digmsg - header list
4285 !:digmsg - header show to
4289 !:digmsg - header list; readall x; echon "<$x>";
4290 !:digmsg - header show subject;readall x;echon "<$x>";;
4293 !: # nothing here as is comment
4294 !^header insert fcc ./.tbox
4297 !:digmsg - header list
4298 !:digmsg - header show fcc
4302 !:digmsg - header list
4303 !:digmsg - header show fcc
4304 !:digmsg - header insert fcc ./.tfcc
4313 digmsg 1 header list
4314 digmsg 1 header show subject
4319 digmsg 1 header list; echo $?/$^ERRNAME
4320 digmsg create -; echo $?/$^ERRNAME
4322 ! %s ./.tfcc > ./.tcat
4323 ! %s "s/This subject is/There subject was/" < ./.tfcc >> ./.tcat
4325 mail nowhere@exam.ple
4327 !:digmsg create -; echo $?/$^ERRNAME;\\
4328 digmsg create 1; echo $?/$^ERRNAME;\\
4329 digmsg create 2; echo $?/$^ERRNAME
4331 !:digmsg - h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4333 !:digmsg 1 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4337 !:digmsg 2 h l;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4339 !:digmsg - h s to;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4341 !:digmsg 1 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4345 !:digmsg 2 h s subject;echo $?/$^ERRNAME;readall d;echo "$?/$^ERRNAME <$d>"
4347 !:digmsg remove -; echo $?/$^ERRNAME;\\
4348 digmsg remove 1; echo $?/$^ERRNAME;\\
4349 digmsg remove 2; echo $?/$^ERRNAME;
4352 ' "${cat}" "${sed}" | ${MAILX} ${ARGS} -Sescape=! >./.tall 2>&1
4354 if have_feat uistrings; then
4355 check 1 - ./.tall '362777535 1087'
4357 check 1 - ./.tall '4281367066 967'
4359 check 2 - ./.tfcc '3993703854 127'
4360 check 3 - ./.tempty '4294967295 0'
4361 check 4 - ./.tcat '2157992522 256'
4368 # Heavy use of/rely on state machine (behaviour) and basics {{{
4369 t_compose_hooks() { # {{{ TODO monster
4370 t_prolog compose_hooks
4371 if have_feat uistrings; then :; else
4372 echo 'compose_hooks: unsupported, skipped'
4375 TRAP_EXIT_ADDONS=".
/.t
*"
4377 t_xmta 'PrimulaVeris Wed Apr 10 22:59:00 2017'
4379 (echo line one&&echo line two&&echo line three) > ./.treadctl
4380 (echo echo four&&echo echo five&&echo echo six) > ./.tattach
4382 ${cat} <<'__EOT__' > ./.trc
4384 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4387 vput vexpr es substr "$1" 0 1
4392 define read_mline_res {
4393 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4394 echo $len/$es/$^ERRNAME: $hl
4395 if [ $es -ne $^ERR-NONE ]
4396 xcall bail read_mline_res
4398 \xcall read_mline_res
4403 echo "~^header list
"; read hl; echo $hl;\
4404 call xerr "$hl" "in_addr
($xh) 0-1"
4406 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4407 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-1"
4408 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4409 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-2"
4410 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4411 read es; echo $es; call xerr "$es" "ins_addr
$xh 1-3"
4412 echo "~^header list
$xh"; read hl; echo $hl;\
4413 call xerr "$hl" "ins_addr
$xh 1-4"
4414 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 1-5"
4417 if [ "$t_remove" == "" ]
4421 echo "~^header remove
$xh"; read es; call xerr $es "ins_addr
$xh 2-1"
4422 echo "~^header remove
$xh"; read es; vput vexpr es substr $es 0 3
4424 xcall bail "ins_addr
$xh 2-2"
4426 echo "~^header list
$xh"; read es; vput vexpr es substr $es 0 3
4428 xcall bail "ins_addr
$xh 2-3"
4430 echo "~^header show
$xh"; read es; vput vexpr es substr $es 0 3
4432 xcall bail "ins_addr
$xh 2-4"
4436 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4437 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-1"
4438 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4439 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-2"
4440 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4441 read es; echo $es; call xerr "$es" "ins_addr
$xh 3-3"
4442 echo "~^header list
$xh"; read hl; echo $hl;\
4443 call xerr "$hl" "ins_addr
$xh 3-4"
4444 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 3-5"
4447 echo "~^header remove-at
$xh 1"; read es;\
4448 call xerr $es "ins_addr
$xh 3-6"
4449 echo "~^header remove-at
$xh 1"; read es;\
4450 call xerr $es "ins_addr
$xh 3-7"
4451 echo "~^header remove-at
$xh 1"; read es;\
4452 call xerr $es "ins_addr
$xh 3-8"
4453 echo "~^header remove-at
$xh 1"; read es;\
4454 vput vexpr es substr $es 0 3
4456 xcall bail "ins_addr
$xh 3-9"
4458 echo "~^header remove-at
$xh T
"; read es;\
4459 vput vexpr es substr $es 0 3
4461 xcall bail "ins_addr
$xh 3-10"
4463 echo "~^header list
$xh"; read es;\
4464 vput vexpr es substr $es 0 3
4466 xcall bail "ins_addr
$xh 3-11"
4468 echo "~^header show
$xh"; read es;\
4469 vput vexpr es substr $es 0 3
4471 xcall bail "ins_addr
$xh 3-12"
4475 echo "~^header insert
$xh diet
<$xh@exam.ple
> spliced
";\
4476 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-1"
4477 echo "~^header insert
$xh <${xh}2@exam.ple
> (comment
) \"Quot
(e
)d
\"";\
4478 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-2"
4479 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4480 read es; echo $es; call xerr "$es" "ins_addr
$xh 4-3"
4481 echo "~^header list
$xh"; read hl; echo $hl;\
4482 call xerr "$hl" "header list
$xh 3-4"
4483 echo "~^header show
$xh"; read es; call xerr $es "ins_addr
$xh 4-5"
4486 echo "~^header remove-at
$xh 3"; read es;\
4487 call xerr $es "ins_addr
$xh 4-6"
4488 echo "~^header remove-at
$xh 2"; read es;\
4489 call xerr $es "ins_addr
$xh 4-7"
4490 echo "~^header remove-at
$xh 1"; read es;\
4491 call xerr $es "ins_addr
$xh 4-8"
4492 echo "~^header remove-at
$xh 1"; read es;\
4493 vput vexpr es substr $es 0 3
4495 xcall bail "ins_addr
$xh 4-9"
4497 echo "~^header remove-at
$xh T
"; read es;\
4498 vput vexpr es substr $es 0 3
4500 xcall bail "ins_addr
$xh 4-10"
4502 echo "~^header list
$xh"; read es;\
4503 vput vexpr es substr $es 0 3
4505 xcall bail "ins_addr
$xh 4-11"
4507 echo "~^header show
$xh"; read es;\
4508 vput vexpr es substr $es 0 3
4510 xcall bail "ins_addr
$xh 4-12"
4514 wysh set xh=$1 mult=$2
4515 echo "~^header list
"; read hl; echo $hl;\
4516 call xerr "$hl" "ins_ref
($xh) 0-1"
4518 echo "~^header insert
$xh <$xh@exam.ple
>";\
4519 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-1"
4521 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4522 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-2"
4523 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4524 read es; echo $es; call xerr "$es" "ins_ref
$xh 1-3"
4526 echo "~^header insert
$xh <${xh}2@exam.ple
>"; read es;\
4527 vput vexpr es substr $es 0 3
4529 xcall bail "ins_ref
$xh 1-4"
4533 echo "~^header list
$xh"; read hl; echo $hl;\
4534 call xerr "$hl" "ins_ref
$xh 1-5"
4535 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 1-6"
4538 if [ "$t_remove" == "" ]
4542 echo "~^header remove
$xh"; read es;\
4543 call xerr $es "ins_ref
$xh 2-1"
4544 echo "~^header remove
$xh"; read es;\
4545 vput vexpr es substr $es 0 3
4547 xcall bail "ins_ref
$xh 2-2"
4549 echo "~^header list
$xh"; read es;\
4550 vput vexpr es substr $es 0 3
4552 xcall bail "$es ins_ref
$xh 2-3"
4554 echo "~^header show
$xh"; read es;\
4555 vput vexpr es substr $es 0 3
4557 xcall bail "ins_ref
$xh 2-4"
4561 echo "~^header insert
$xh <$xh@exam.ple
>";\
4562 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-1"
4564 echo "~^header insert
$xh <${xh}2@exam.ple
>";\
4565 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-2"
4566 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4567 read es; echo $es; call xerr "$es" "ins_ref
$xh 3-3"
4569 echo "~^header list
$xh";\
4570 read hl; echo $hl; call xerr "$hl" "ins_ref
$xh 3-4"
4571 echo "~^header show
$xh";\
4572 read es; call xerr $es "ins_ref
$xh 3-5"
4575 echo "~^header remove-at
$xh 1"; read es;\
4576 call xerr $es "ins_ref
$xh 3-6"
4577 if [ $mult -ne 0 ] && [ $xh != subject ]
4578 echo "~^header remove-at
$xh 1"; read es;\
4579 call xerr $es "ins_ref
$xh 3-7"
4580 echo "~^header remove-at
$xh 1"; read es;\
4581 call xerr $es "ins_ref
$xh 3-8"
4583 echo "~^header remove-at
$xh 1"; read es;\
4584 vput vexpr es substr $es 0 3
4586 xcall bail "ins_ref
$xh 3-9"
4588 echo "~^header remove-at
$xh T
"; read es;\
4589 vput vexpr es substr $es 0 3
4591 xcall bail "ins_ref
$xh 3-10"
4593 echo "~^header show
$xh"; read es;\
4594 vput vexpr es substr $es 0 3
4596 xcall bail "ins_ref
$xh 3-11"
4600 echo "~^header insert
$xh <$xh@exam.ple
> ";\
4601 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-1"
4603 echo "~^header insert
$xh <${xh}2@exam.ple
> ";\
4604 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-2"
4605 echo "~^header insert
$xh ${xh}3@exam.ple
";\
4606 read es; echo $es; call xerr "$es" "ins_ref
$xh 4-3"
4608 echo "~^header list
$xh"; read hl; echo $hl;\
4609 call xerr "$hl" "ins_ref
$xh 4-4"
4610 echo "~^header show
$xh"; read es; call xerr $es "ins_ref
$xh 4-5"
4613 if [ $mult -ne 0 ] && [ $xh != subject ]
4614 echo "~^header remove-at
$xh 3"; read es;\
4615 call xerr $es "ins_ref
$xh 4-6"
4616 echo "~^header remove-at
$xh 2"; read es;\
4617 call xerr $es "ins_ref
$xh 4-7"
4619 echo "~^header remove-at
$xh 1"; read es;\
4620 call xerr $es "ins_ref
$xh 4-8"
4621 echo "~^header remove-at
$xh 1"; read es;\
4622 vput vexpr es substr $es 0 3
4624 xcall bail "ins_ref
$xh 4-9"
4626 echo "~^header remove-at
$xh T
"; read es;\
4627 vput vexpr es substr $es 0 3
4629 xcall bail "ins_ref
$xh 4-10"
4631 echo "~^header show
$xh"; read es;\
4632 vput vexpr es substr $es 0 3
4634 xcall bail "ins_ref
$xh 4-11"
4639 # In collect.c order
4641 call ins_ref sender 0 # Not a "ref
", but works
4645 call ins_addr reply-To
4646 call ins_addr mail-Followup-to
4647 call ins_ref messAge-id 0
4648 call ins_ref rEfErEncEs 1
4649 call ins_ref in-Reply-to 1
4650 call ins_ref subject 1 # Not a "ref
", but works (with tweaks)
4651 call ins_addr freeForm1
4652 call ins_addr freeform2
4654 echo "~^header show MAILX-Command
"; read es; call xerr $es "t_header
1000"
4656 echo "~^header show MAILX-raw-TO
"; read es; call xerr $es "t_header
1001"
4664 echo "~^attachment
";\
4665 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4667 xcall bail "attach
0-1"
4670 echo "~^attach attribute .
/.treadctl
";\
4671 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4673 xcall bail "attach
0-2"
4675 echo "~^attachment attribute-at
1";\
4676 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4678 xcall bail "attach
0-3"
4681 echo "~^attachment insert .
/.treadctl
=ascii
";\
4682 read hl; echo $hl; call xerr "$hl" "attach
1-1"
4683 echo "~^attachment list
";\
4684 read es; echo $es;call xerr "$es" "attach
1-2"
4686 echo "~^attachment attribute .
/.treadctl
";\
4687 read es; echo $es;call xerr "$es" "attach
1-3"
4689 echo "~^attachment attribute .treadctl
";\
4690 read es; echo $es;call xerr "$es" "attach
1-4"
4692 echo "~^attachment attribute-at
1";\
4693 read es; echo $es;call xerr "$es" "attach
1-5"
4696 echo "~^attachment attribute-set .
/.treadctl filename rctl
";\
4697 read es; echo $es;call xerr "$es" "attach
1-6"
4698 echo "~^attachment attribute-set .treadctl content-description Au
";\
4699 read es; echo $es;call xerr "$es" "attach
1-7"
4700 echo "~^attachment attribute-set-at
1 content-id
<10.du@ich
>";\
4701 read es; echo $es;call xerr "$es" "attach
1-8"
4703 echo "~^attachment attribute .
/.treadctl
";\
4704 read es; echo $es;call xerr "$es" "attach
1-9"
4706 echo "~^attachment attribute .treadctl
";\
4707 read es; echo $es;call xerr "$es" "attach
1-10"
4709 echo "~^attachment attribute rctl
";\
4710 read es; echo $es;call xerr "$es" "attach
1-11"
4712 echo "~^attachment attribute-at
1";\
4713 read es; echo $es;call xerr "$es" "attach
1-12"
4717 echo "~^attachment insert .
/.tattach
=latin1
";\
4718 read hl; echo $hl; call xerr "$hl" "attach
2-1"
4719 echo "~^attachment list
";\
4720 read es; echo $es;call xerr "$es" "attach
2-2"
4722 echo "~^attachment attribute .
/.tattach
";\
4723 read es; echo $es;call xerr "$es" "attach
2-3"
4725 echo "~^attachment attribute .tattach
";\
4726 read es; echo $es;call xerr "$es" "attach
2-4"
4728 echo "~^attachment attribute-at
2";\
4729 read es; echo $es;call xerr "$es" "attach
2-5"
4732 echo "~^attachment attribute-set .
/.tattach filename tat
";\
4733 read es; echo $es;call xerr "$es" "attach
2-6"
4735 "~^attachment attribute-set .tattach content-description Au2
";\
4736 read es; echo $es;call xerr "$es" "attach
2-7"
4737 echo "~^attachment attribute-set-at
2 content-id
<20.du@wir
>";\
4738 read es; echo $es;call xerr "$es" "attach
2-8"
4740 "~^attachment attribute-set-at
2 content-type application
/x-sh
";\
4741 read es; echo $es;call xerr "$es" "attach
2-9"
4743 echo "~^attachment attribute .
/.tattach
";\
4744 read es; echo $es;call xerr "$es" "attach
2-10"
4746 echo "~^attachment attribute .tattach
";\
4747 read es; echo $es;call xerr "$es" "attach
2-11"
4749 echo "~^attachment attribute tat
";\
4750 read es; echo $es;call xerr "$es" "attach
2-12"
4752 echo "~^attachment attribute-at
2";\
4753 read es; echo $es;call xerr "$es" "attach
2-13"
4757 if [ "$t_remove" == "" ]
4761 echo "~^attachment remove .
/.treadctl
"; read es;\
4762 call xerr $es "attach
3-1"
4763 echo "~^attachment remove .
/.tattach
"; read es;\
4764 call xerr $es "attach
3-2"
4765 echo "~^ attachment remove .
/.treadctl
"; read es;\
4766 vput vexpr es substr $es 0 3
4768 xcall bail "attach
3-3"
4770 echo "~^ attachment remove .
/.tattach
"; read es;\
4771 vput vexpr es substr $es 0 3
4773 xcall bail "attach
3-4"
4775 echo "~^attachment list
"; read es;\
4776 vput vexpr es substr $es 0 3
4778 xcall bail "attach
3-5"
4782 echo "~^attachment insert .
/.tattach
=latin1
";\
4783 read hl; echo $hl; call xerr "$hl" "attach
4-1"
4784 echo "~^attachment insert .
/.tattach
=latin1
";\
4785 read hl; echo $hl; call xerr "$hl" "attach
4-2"
4786 echo "~^attachment list
";\
4787 read es; echo $es;call xerr "$es" "attach
4-3"
4789 echo "~^ attachment remove .tattach
"; read es;\
4790 vput vexpr es substr $es 0 3
4792 xcall bail "attach
4-4 $es"
4794 echo "~^attachment remove-at T
"; read es;\
4795 vput vexpr es substr $es 0 3
4797 xcall bail "attach
4-5"
4799 echo "~^attachment remove .
/.tattach
"; read es;\
4800 call xerr $es "attach
4-6"
4801 echo "~^attachment remove .
/.tattach
"; read es;\
4802 call xerr $es "attach
4-7"
4803 echo "~^ attachment remove .
/.tattach
"; read es;\
4804 vput vexpr es substr $es 0 3
4806 xcall bail "attach
4-8 $es"
4808 echo "~^attachment list
"; read es;\
4809 vput vexpr es substr $es 0 3
4811 xcall bail "attach
4-9"
4815 echo "~^attachment insert .
/.tattach
=latin1
";\
4816 read hl; echo $hl; call xerr "$hl" "attach
5-1"
4817 echo "~^attachment insert .
/.tattach
=latin1
";\
4818 read hl; echo $hl; call xerr "$hl" "attach
5-2"
4819 echo "~^attachment insert .
/.tattach
=latin1
";\
4820 read hl; echo $hl; call xerr "$hl" "attach
5-3"
4821 echo "~^attachment list
";\
4822 read es; echo $es;call xerr "$es" "attach
5-4"
4825 echo "~^attachment remove-at
3"; read es;\
4826 call xerr $es "attach
5-5"
4827 echo "~^attachment remove-at
3"; read es;\
4828 vput vexpr es substr $es 0 3
4830 xcall bail "attach
5-6"
4832 echo "~^attachment remove-at
2"; read es;\
4833 call xerr $es "attach
5-7"
4834 echo "~^attachment remove-at
2"; read es;\
4835 vput vexpr es substr $es 0 3
4837 xcall bail "attach
5-8"
4839 echo "~^attachment remove-at
1"; read es;\
4840 call xerr $es "attach
5-9"
4841 echo "~^attachment remove-at
1"; read es;\
4842 vput vexpr es substr $es 0 3
4844 xcall bail "attach
5-10"
4847 echo "~^attachment list
"; read es;\
4848 vput vexpr es substr $es 0 3
4850 xcall bail "attach
5-11"
4854 echo "~^attachment insert .
/.tattach
=latin1
";\
4855 read hl; echo $hl; call xerr "$hl" "attach
6-1"
4856 echo "~^attachment insert .
/.tattach
=latin1
";\
4857 read hl; echo $hl; call xerr "$hl" "attach
6-2"
4858 echo "~^attachment insert .
/.tattach
=latin1
";\
4859 read hl; echo $hl; call xerr "$hl" "attach
6-3"
4860 echo "~^attachment list
";\
4861 read es; echo $es;call xerr "$es" "attach
6-4"
4864 echo "~^attachment remove-at
1"; read es;\
4865 call xerr $es "attach
6-5"
4866 echo "~^attachment remove-at
1"; read es;\
4867 call xerr $es "attach
6-6"
4868 echo "~^attachment remove-at
1"; read es;\
4869 call xerr $es "attach
6-7"
4870 echo "~^attachment remove-at
1"; read es;\
4871 vput vexpr es substr $es 0 3
4873 xcall bail "attach
6-8"
4876 echo "~^attachment list
"; read es;\
4877 vput vexpr es substr $es 0 3
4879 xcall bail "attach
6-9"
4891 echo on-compose-enter, mailx-command<$mailx-command>
4892 alternates alter1@exam.ple alter2@exam.ple
4894 set autocc='alter1@exam.ple alter2@exam.ple'
4895 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4896 echo mailx-subject<$mailx-subject>
4897 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4898 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4899 mailx-raw-bcc<$mailx-raw-bcc>
4900 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4901 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4902 digmsg create - -;echo $?/$!/$^ERRNAME;\
4903 digmsg - header list;\
4904 digmsg remove -;echo $?/$!/$^ERRNAME
4905 digmsg create -;echo $?/$!/$^ERRNAME;\
4906 digmsg - header list;readall x;echon $x;\
4907 digmsg remove -;echo $?/$!/$^ERRNAME
4910 echo on-compose-leave, mailx-command<$mailx-command>
4912 eval alternates $al alter3@exam.ple alter4@exam.ple
4914 set autobcc='alter3@exam.ple alter4@exam.ple'
4915 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4916 echo mailx-subject<$mailx-subject>
4917 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4918 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4919 mailx-raw-bcc<$mailx-raw-bcc>
4920 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4921 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4922 digmsg create - -;echo $?/$!/$^ERRNAME;\
4923 digmsg - header list;\
4924 digmsg remove -;echo $?/$!/$^ERRNAME
4925 digmsg create -;echo $?/$!/$^ERRNAME;\
4926 digmsg - header list;readall x;echon $x;\
4927 digmsg remove -;echo $?/$!/$^ERRNAME
4930 echo on-compose-cleanup, mailx-command<$mailx-command>
4933 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4934 echo mailx-subject<$mailx-subject>
4935 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4936 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4937 mailx-raw-bcc<$mailx-raw-bcc>
4938 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4939 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4940 # XXX error message variable digmsg create - -;echo $?/$!/$^ERRNAME;\
4941 digmsg - header list;\
4942 digmsg remove -;echo $?/$!/$^ERRNAME
4943 # ditto digmsg create -;echo $?/$!/$^ERRNAME;\
4944 digmsg - header list;readall x;echon $x;\
4945 digmsg remove -;echo $?/$!/$^ERRNAME
4947 wysh set on-compose-splice=t_ocs \
4948 on-compose-enter=t_oce on-compose-leave=t_ocl \
4949 on-compose-cleanup=t_occ
4952 printf 'm this-goes@nowhere\nbody\n!.\n' |
4953 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4954 -X'source ./.trc' -Smta=./.tmta.sh \
4956 ${cat} ./.tall >> "${MBOX}"
4957 check 1 0 "${MBOX}" '3049397940 10523'
4960 printf 'm this-goes@nowhere\nbody\n!.\n' |
4961 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4962 -St_remove=1 -X'source ./.trc' -Smta=./.tmta.sh \
4964 ${cat} ./.tall >> "${MBOX}"
4965 check 2 0 "${MBOX}" '2131370361 12737'
4969 # Some state machine stress, shell compose hook, localopts for hook, etc.
4970 # readctl in child. ~r as HERE document
4972 printf 'm ex@am.ple\nbody\n!.
4973 echon ${mailx-command}${mailx-subject}
4974 echon ${mailx-from}${mailx-sender}
4975 echon ${mailx-to}${mailx-cc}${mailx-bcc}
4976 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
4977 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
4978 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
4979 ' | ${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4983 echoerr "Failed
: $1. Bailing out
"; echo "~x
"; xit
4986 vput vexpr es substr "$1" 0 1
4991 define read_mline_res {
4992 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4993 echo $len/$es/$^ERRNAME: $hl
4994 if [ $es -ne $^ERR-NONE ]
4995 xcall bail read_mline_res
4997 \xcall read_mline_res
5001 vput vexpr i + 1 "$2"
5003 vput vexpr j % $i 10
5010 eval \\$j _work $1 $i
5013 vput vexpr i + $i "$1"
5017 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
5018 echo read:$es/$en: $line
5019 if [ "${es}" -ne -1 ]
5022 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
5027 echo "~^header list
"; read hl; echo $hl;\
5028 vput vexpr es substr "$hl" 0 1
5030 xcall bail "header list
"
5033 call _work 1; echo $?
5034 echo "~^header insert cc splicy diet
<splice@exam.ple
> spliced
";\
5035 read es; echo $es; vput vexpr es substr "$es" 0 1
5037 xcall bail "be diet
"
5039 echo "~^header insert cc
<splice2@exam.ple
>";\
5040 read es; echo $es; vput vexpr es substr "$es" 0 1
5042 xcall bail "be diet2
"
5045 call _work 2; echo $?
5046 echo "~^header insert bcc juicy juice
<juice@exam.ple
> spliced
";\
5047 read es; echo $es;vput vexpr es substr "$es" 0 1
5049 xcall bail "be juicy
"
5051 echo "~^header insert bcc juice2@exam.ple
";\
5052 read es; echo $es;vput vexpr es substr "$es" 0 1
5054 xcall bail "be juicy2
"
5056 echo "~^header insert bcc juice3
<juice3@exam.ple
>";\
5057 read es; echo $es;vput vexpr es substr "$es" 0 1
5059 xcall bail "be juicy3
"
5061 echo "~^header insert bcc juice4@exam.ple
";\
5062 read es; echo $es;vput vexpr es substr "$es" 0 1
5064 xcall bail "be juicy4
"
5067 echo "~^header remove-at bcc
3";\
5068 read es; echo $es;vput vexpr es substr "$es" 0 1
5070 xcall bail "remove juicy5
"
5072 echo "~^header remove-at bcc
2";\
5073 read es; echo $es;vput vexpr es substr "$es" 0 1
5075 xcall bail "remove juicy6
"
5077 echo "~^header remove-at bcc
3";\
5078 read es; echo $es;vput vexpr es substr "$es" 0 3
5080 xcall bail "failed to remove-at
"
5082 # Add duplicates which ought to be removed!
5083 echo "~^header insert bcc juice4@exam.ple
";\
5084 read es; echo $es;vput vexpr es substr "$es" 0 1
5086 xcall bail "be juicy4-1
"
5088 echo "~^header insert bcc juice4@exam.ple
";\
5089 read es; echo $es;vput vexpr es substr "$es" 0 1
5091 xcall bail "be juicy4-2
"
5093 echo "~^header insert bcc juice4@exam.ple
";\
5094 read es; echo $es;vput vexpr es substr "$es" 0 1
5096 xcall bail "be juicy4-3
"
5101 call _work 3; echo $?
5103 vput ! i echo just knock if you can hear me;\
5105 while [ $i -lt 24 ]; do printf "%s
" $i; i=`expr $i + 1`; done;\
5107 echon shell-cmd says $?/$^ERRNAME: $i
5108 echo "~x will not become interpreted
, we are reading
until __EOT
"
5110 read r_status; echo "~~r status output
: $r_status"
5111 echo "~
:echo $? $
! $^ERRNAME
"
5113 echo "~~r status from parent
: $r_status"
5116 call _work 4; echo $?
5117 vput cwd cwd;echo cwd:$?
5118 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
5122 call _work 5; echo $?
5123 echo "~^header show MAILX-Command
"; read es;\
5124 call xerr $es "t_header
1000"; call read_mline_res
5125 echo "~^header show MAILX-raw-TO
"; read es;\
5126 call xerr $es "t_header
1001"; xcall read_mline_res
5128 echoerr IT IS WRONG IF YOU SEE THIS
5131 echo on-compose-enter, mailx-command<$mailx-command>
5132 set t_oce autobcc=oce@exam.ple
5133 alternates alter1@exam.ple alter2@exam.ple
5135 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5136 echo mailx-subject<$mailx-subject>
5137 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5138 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5139 mailx-raw-bcc<$mailx-raw-bcc>
5140 echo mailx-orig-from<$mailx-orig-from> \
5141 mailx-orig-to<$mailx-orig-to> \
5142 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5145 echo on-compose-leave, mailx-command<$mailx-command>
5146 set t_ocl autocc=ocl@exam.ple
5148 alternates alter3@exam.ple alter4@exam.ple
5150 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5151 echo mailx-subject<$mailx-subject>
5152 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5153 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5154 mailx-raw-bcc<$mailx-raw-bcc>
5155 echo mailx-orig-from<$mailx-orig-from> \
5156 mailx-orig-to<$mailx-orig-to> \
5157 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5160 echo on-compose-cleanup, mailx-command<$mailx-command>
5161 set t_occ autocc=occ@exam.ple
5164 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5165 echo mailx-subject<$mailx-subject>
5166 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5167 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5168 mailx-raw-bcc<$mailx-raw-bcc>
5169 echo mailx-orig-from<$mailx-orig-from> \
5170 mailx-orig-to<$mailx-orig-to> \
5171 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5173 wysh set on-compose-splice=t_ocs \
5174 on-compose-splice-shell="read ver
;echo t_ocs-shell
;\
5175 echo \"~t shell@exam.ple
\"; echo \"~
:set t_ocs_sh
\"" \
5176 on-compose-enter=t_oce on-compose-leave=t_ocl \
5177 on-compose-cleanup=t_occ
5180 ${cat} ./.tnotes >> "${MBOX}"
5181 check 3 - "${MBOX}" '679526364 2431'
5183 # Reply, forward, resend, Resend
5191 set from
="du <f2@z>" stealthmua
=noagent
5195 ' | ${MAILX} ${ARGS} -Smta=./.tmta.sh -Snomemdebug -Sescape=!
5198 echo start
: $? $
! $^ERRNAME
5200 echo File
: $? $
! $^ERRNAME
;echo;echo
5202 this is content of reply
1
5204 echo reply
1: $? $
! $^ERRNAME
;echo;echo
5206 this is content of Reply
1 2
5208 echo Reply
1 2: $? $
! $^ERRNAME
;echo;echo
5209 forward
1 fwdex@am.ple
5210 this is content of forward
1
5212 echo forward
1: $? $
! $^ERRNAME
;echo;echo
5213 wysh
set forward-inject-head
=$
'"'"'-- \\
5214 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
5215 wysh
set forward-inject-tail
=$
'"'"'-- \\
5216 end of forward (%%i) --\\n'"'"'
5217 forward
2 fwdex@am.ple
5218 this is content of forward
2
5220 echo forward
2: $? $
! $^ERRNAME
;echo;echo
5222 forward
2 fwdex2@am.ple
5223 this is content of forward
2, 2nd
, with showname
set
5225 echo forward
2, 2nd
: $? $
! $^ERRNAME
;echo;echo
5226 resend
1 2 resendex@am.ple
5227 echo resend
1 2: $? $
! $^ERRNAME
;echo;echo
5228 Resend
1 2 Resendex@am.ple
5229 echo Resend
1 2: $? $
! $^ERRNAME
;echo;echo
5231 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
5235 echoerr
"Failed: $1. Bailing out"; echo "~x"; xit
5238 vput vexpr es substr
"$1" 0 1
5243 define read_mline_res
{
5244 read hl
; wysh
set len
=$? es
=$
! en
=$^ERRNAME
;\
5245 echo mline_res
:$len/$es/$^ERRNAME
: $hl
5246 if [ $es -ne $^ERR-NONE
]
5247 xcall bail read_mline_res
5249 \xcall read_mline_res
5253 echo "~^header show $1"; read es
;\
5254 call xerr
$es "work_hl $1"; echo $1; call read_mline_res
5262 echo t_ocs version
$ver
5263 echo "~^header list"; read hl
; echo $hl;\
5264 echoerr the header list is
$hl;\
5265 call xerr
"$hl" "header list"
5266 eval vpospar
set $hl
5269 echoerr IT IS WRONG IF YOU SEE THIS
5272 echo on-XY-enter
, mailx-command
<$mailx-command>
5273 set t_oce autobcc
=oce@exam.ple
5274 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5275 echo mailx-subject
<$mailx-subject>
5276 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5277 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5278 mailx-raw-bcc
<$mailx-raw-bcc>
5279 echo mailx-orig-from
<$mailx-orig-from> \
5280 mailx-orig-to
<$mailx-orig-to> \
5281 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5284 echo on-XY-leave
, mailx-command
<$mailx-command>
5285 set t_ocl autocc
=ocl@exam.ple
5286 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5287 echo mailx-subject
<$mailx-subject>
5288 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5289 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5290 mailx-raw-bcc
<$mailx-raw-bcc>
5291 echo mailx-orig-from
<$mailx-orig-from> \
5292 mailx-orig-to
<$mailx-orig-to> \
5293 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5296 echo on-XY-cleanup
, mailx-command
<$mailx-command>
5297 set t_occ autocc
=occ@exam.ple
5298 echo mailx-from
<$mailx-from> mailx-sender
<$mailx-sender>
5299 echo mailx-subject
<$mailx-subject>
5300 echo mailx-to
<$mailx-to> mailx-cc
<$mailx-cc> mailx-bcc
<$mailx-bcc>
5301 echo mailx-raw-to
<$mailx-raw-to> mailx-raw-cc
<$mailx-raw-cc> \
5302 mailx-raw-bcc
<$mailx-raw-bcc>
5303 echo mailx-orig-from
<$mailx-orig-from> \
5304 mailx-orig-to
<$mailx-orig-to> \
5305 mailx-orig-cc
<$mailx-orig-cc> mailx-orig-bcc
<$mailx-orig-bcc>
5307 wysh
set on-compose-splice
=t_ocs \
5308 on-compose-enter
=t_oce on-compose-leave
=t_ocl \
5309 on-compose-cleanup
=t_occ \
5310 on-resend-enter
=t_oce on-resend-cleanup
=t_occ
5313 ${cat} ./.tnotes >> "${MBOX}"
5314 check 4 - "${MBOX}" '2151712038 11184'
5319 t_mass_recipients() {
5320 t_prolog mass_recipients
5321 TRAP_EXIT_ADDONS="./.t*"
5323 t_xmta 'Eucalyptus Sat Jul
08 21:14:57 2017'
5325 ${cat} <<'__EOT__' > ./.trc
5327 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
5330 wysh set nr=$1 hn=$2
5331 echo "~$hn $hn$nr@$hn"; echo '~
:echo $?
'; read es
5333 xcall bail "ins_addr $hn 1-$nr"
5335 vput vexpr nr + $nr 1
5336 if [ "$nr" -le "$maximum" ]
5337 xcall ins_addr $nr $hn
5341 wysh set nr=$1 hn=$2
5342 alternates $hn$nr@$hn
5343 vput vexpr nr + $nr 2
5344 if [ "$nr" -le "$maximum" ]
5345 xcall bld_alter $nr $hn
5355 if [ "$t_remove" != '' ]
5360 set on-compose-splice=t_ocs on-compose-leave=t_ocl
5363 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5364 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5365 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5368 ${cat} ./.tall >> "${MBOX}"
5369 check 1 - "${MBOX}" '2912243346 51526'
5372 printf 'm this-goes@nowhere
\nbody
\n!.
\n' |
5373 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5374 -St_remove=1 -X'source .
/.trc
' -Smta=./.tmta.sh -Smaximum=2001 \
5377 ${cat} ./.tall >> "${MBOX}"
5378 check 2 - "${MBOX}" '4097804632 34394'
5383 t_lreply_futh_rth_etc() {
5384 t_prolog lreply_futh_rth_etc
5385 TRAP_EXIT_ADDONS="./.t*"
5387 t_xmta 'HumulusLupulus Thu Jul
27 14:41:20 2017'
5389 ${cat} <<-_EOT > ./.tmbox
5390 From neverneverland Sun Jul 23 13:46:25 2017
5391 Subject: Bugstop: five miles out 1
5392 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5393 From: mister originator <mr@originator>
5394 To: bugstop-commit@five.miles.out, laber@backe.eu
5396 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
5397 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
5398 Date: Wed, 19 Jul 2017 09:22:57 -0400
5399 Message-Id: <20170719132257.766AF781267@originator>
5402 > |Sorry, I think I misunderstand something. I would think that
5406 From neverneverland Fri Jul
7 22:39:11 2017
5407 Subject
: Bugstop
: five miles out
2
5408 Reply-To
: mister originator2
<mr2@originator
>,bugstop@five.miles.out
,is@a.list
5409 Content-Transfer-Encoding
: 7bit
5410 From
: mister originator
<mr@originator
>
5411 To
: bugstop-commit@five.miles.out
5413 Message-ID
: <149945963975.28888.6950788126957753723.reportbug@five.miles.out
>
5414 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5417 capable of changing back.
5419 From neverneverland Fri Jul
7 22:42:00 2017
5420 Subject
: Bugstop
: five miles out
3
5421 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5422 Content-Transfer-Encoding
: 7bit
5423 From
: mister originator
<mr@originator
>
5424 To
: bugstop-commit@five.miles.out
5426 Message-ID
: <149945963975.28888.6950788126957753746.reportbug@five.miles.out
>
5427 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5428 List-Post
: <mailto
:bugstop@five.miles.out
>
5431 are you ready
, boots?
5433 From neverneverland Sat Aug
19 23:15:00 2017
5434 Subject
: Bugstop
: five miles out
4
5435 Reply-To
: mister originator2
<mr2@originator
>, bugstop@five.miles.out
5436 Content-Transfer-Encoding
: 7bit
5437 From
: mister originator
<mr@originator
>
5438 To
: bugstop@five.miles.out
5440 Message-ID
: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out
>
5441 Date
: Fri
, 07 Jul
2017 16:33:59 -0400
5442 List-Post
: <mailto
:bugstop@five.miles.out
>
5445 are you ready
, boots?
5450 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
5451 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
5453 wysh
set m
="This is text of \"reply ${1}."
5464 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
5467 wysh set m="This is text of
\"Reply
${1}.
"
5473 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
5482 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
5486 # We need two indirections for this test: one for the case that Lreply
5487 # fails because of missing recipients: we need to read EOF next, thus
5488 # place this in _Ls last; and second for the succeeding cases EOF is
5489 # not what these should read, so go over the backside and splice it in!
5491 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
5494 localopts call-fixate
yes
5496 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
5497 call L
$1 1; call L
$1 2; call L
$1 3
5500 echo;echo '===== CHANGING === '"$*"' =====';echo
5504 set from
=laber@backe.eu
5507 call tweak
set reply-to-honour
5509 call tweak
set followup-to
5511 call tweak
set followup-to-honour
5513 call tweak mlist bugstop@five.miles.out
5515 call tweak mlsubscribe bugstop@five.miles.out
5517 call tweak
set recipients-in-cc
5519 # While here, test that *fullnames* works (also here)
5522 This message should have
*fullnames
* in the header.
5527 if have_feat uistrings
; then
5528 check
1 - "${MBOX}" '1530821219 29859'
5530 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
5535 ${cat} <<-_EOT > ./.tmbox
5536 From tom@i-i.example Thu Oct 26 03:15:55 2017
5537 Date: Wed, 25 Oct 2017 21:15:46 -0400
5538 From: tom <tom@i-i.example>
5539 To: Steffen Nurpmeso <steffen@sdaoden.eu>
5540 Cc: tom <tom@i-i.example>
5541 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
5542 Message-ID: <20171026011546.GA11643@i-i.example>
5543 Reply-To: tom@i-i.example
5544 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
5545 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
5548 The report's useful :-)
5551 # Let us test In-Reply-To: removal starts a new thread..
5552 # This needs adjustment of *stealthmua*
5553 argadd
='-Sstealthmua=noagent -Shostname'
5556 printf 'reply 1\nthread\n!.\n' |
5557 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5558 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
5559 check
2 0 "${MBOX}" '3321764338 429'
5560 check
3 - .tall
'4294967295 0'
5562 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
5563 "${sed}" '/^In-Reply-To:/d' |
5564 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5565 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5566 check
4 0 "${MBOX}" '1682552516 763'
5567 check
5 - .tall
'4294967295 0'
5569 printf 'reply 2\nold <- new <- thread!\n!.\n' |
5570 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5571 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5572 check
6 0 "${MBOX}" '2900984135 1219'
5573 check
7 - .tall
'4294967295 0'
5575 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
5576 "${sed}" '/^In-Reply-To:/d' |
5577 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5578 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5579 check
8 0 "${MBOX}" '794031200 1567'
5580 check
9 - .tall
'4294967295 0'
5588 have_feat smime ||
{
5589 echo 's_mime: unsupported, skipped'
5594 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5595 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5596 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5598 ${cat} <<-_EOT > ./.t.conf
5601 default_keyfile = keyfile.pem
5602 distinguished_name = req_distinguished_name
5603 attributes = req_attributes
5607 [ req_distinguished_name ]
5614 emailAddress = test@localhost
5619 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5620 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5622 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5625 echo bla |
${MAILX} ${ARGS} \
5626 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5627 -Ssmime-sign-digest=sha1 \
5628 -s 'S/MIME test' .
/.VERIFY
5632 /^Content-Description: /{ skip = 2; print; next }
5633 /^$/{ if(skip) --skip }
5636 < .
/.VERIFY
> "${MBOX}"
5637 check
1 - "${MBOX}" '335634014 644'
5639 printf 'verify\nx\n' |
5640 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5641 -R -f .
/.VERIFY
>>${ERR} 2>&1
5644 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5647 # (signing +) encryption / decryption
5648 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5653 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5654 -Ssmime-sign-digest=sha1 \
5655 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5656 -s 'S/MIME test' recei@ver.com
5658 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5659 check
4 - "${MBOX}" '1937410597 327'
5661 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5664 -Ssmime-ca-file=.
/.tcert.pem \
5665 -Ssmime-sign-cert=.
/.tpair.pem \
5666 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5670 /^Content-Description: /{ skip = 2; print; next }
5671 /^$/{ if(skip) --skip }
5674 < .
/.DECRYPT
> "${MBOX}"
5675 check
5 - "${MBOX}" '1019076159 931'
5677 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5678 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5682 echo bla |
${MAILX} ${ARGS} \
5684 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5685 -Sfrom=test@localhost \
5686 -s 'S/MIME test' recei@ver.com
5688 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5689 check
7 - "${MBOX}" '1937410597 327'
5692 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5694 -Ssmime-sign-cert=.
/.tpair.pem \
5695 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5696 check
8 0 "./.DECRYPT" '2624716890 422'
5698 openssl smime
-decrypt -inkey .
/.tkey.pem \
5699 -in .
/.ENCRYPT
>>${ERR} 2>&1
5706 # xxx Note: t_z() was the first test (series) written. Today many
5707 # xxx aspects are (better) covered by other tests above, some are not.
5708 # xxx At some future date and time, convert the last remains not covered
5709 # xxx elsewhere to a real t_* test and drop it
5713 # Test for [260e19d] (Juergen Daubert)
5714 echo body |
${MAILX} ${ARGS} "${MBOX}"
5715 check 4 0 "${MBOX}" '2948857341 94'
5717 # "Test
for" [d6f316a] (Gavin Troy)
5719 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5720 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5721 check
6 0 "${MBOX}" '3942990636 118'
5722 check
6-1 - "${BODY}" '3951695530 170'
5724 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5727 for(i = 0; i < 10000; ++i)
5729 #printf "\xF0\x90\x87\x90"
5730 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5731 check 7 0 "${MBOX}" '1707496413 61812'
5737 # MIME encoding (QP) stress message subject
5738 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5739 'adadaddsssssssddddddddddddddddddddd'\
5740 'ddddddddddddddddddddddddddddddddddd'\
5741 'ddddddddddddddddddddddddddddddddddd'\
5742 'dddddddddddddddddddd Hallelulja? Od'\
5743 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5744 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5745 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5746 'fffffffffffffffffffffffffffffffffff'\
5747 'fffffffffffffffffffff ggggggggggggg'\
5748 'ggggggggggggggggggggggggggggggggggg'\
5749 'ggggggggggggggggggggggggggggggggggg'\
5750 'ggggggggggggggggggggggggggggggggggg'\
5755 # MIME encoding (QP) stress message body
5757 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5758 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5759 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5760 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5761 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5762 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5763 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5764 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5765 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5766 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5767 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5768 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5769 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5770 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5771 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5772 "auf den zeilen vorher.
\r\n"\
5773 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5775 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5777 "Das waren deren zwei.
\r\n"\
5779 "Die letzte Zeile war ein Leerschritt.
\n"\
5780 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5783 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5785 "Das waren deren zwei. ditto.
\n"\
5787 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5788 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5789 "auf den zeilen vorher.
\n"\
5791 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5792 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5794 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5796 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5798 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5800 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5802 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5804 "QP am Zeilenende über soft-nl hinweg
\n"\
5805 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5807 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5809 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5811 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5813 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5815 "Die letzte Zeile war ein Leerschritt.
\n"\
5820 # Test all configs TODO doesn't cover all *combinations*, stupid!
5824 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5825 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5826 NOTME["OPT_CROSS_BUILD
"] = 1
5827 NOTME["OPT_AUTOCC
"] = 1
5828 NOTME["OPT_AMALGAMATION
"] = 1
5829 NOTME["OPT_DEBUG
"] = 1
5830 NOTME["OPT_DEVEL
"] = 1
5831 NOTME["OPT_ASAN_ADDRESS
"] = 1
5832 NOTME["OPT_ASAN_MEMORY
"] = 1
5833 NOTME["OPT_FORCED_STACKPROT
"] = 1
5834 NOTME["OPT_NOMEMDBG
"] = 1
5835 NOTME["OPT_NYD2
"] = 1
5840 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5841 MULVALS["VAL_IDNA
"] = 1
5843 #VALKEYS[0] = "VAL_RANDOM
"
5844 VALVALS["VAL_RANDOM
"] = 1
5847 /^[[:space:]]*OPT_/{
5848 sub(/^[[:space:]]*/, "")
5849 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5850 # does not seem to be a compliant escape for =
5852 $1 = substr($1, 1, index($1, "=") - 1)
5854 OPTVALS[OPTNO++] = $1
5857 /^[[:space:]]*VAL_/{
5858 sub(/^[[:space:]]*/, "")
5859 val = substr($0, index($0, "=") + 1)
5861 val = substr(val, 2)
5862 val = substr(val, 1, length(val) - 1)
5864 $1 = substr($1, 1, index($1, "=") - 1)
5867 else if(VALVALS[$1]){
5868 VALKEYS[VALNO++] = $1
5873 function onepass(addons){
5874 a_onepass__worker(addons, "1", "0")
5875 a_onepass__worker(addons, "0", "1")
5877 function a_onepass__worker(addons, b0, b1){
5878 # Doing this completely sequentially and not doing make distclean in
5879 # between runs should effectively result in lesser compilations.
5880 # It is completely dumb nonetheless... TODO
5881 for(ono = 0; ono < OPTNO; ++ono){
5883 for(i = 0; i < ono; ++i){
5884 myconf = myconf " " OPTVALS[i] "=" b0 " "
5886 j = MULCHOICE[OPTVALS[i]]
5891 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5895 for(i = ono; i < OPTNO; ++i){
5896 myconf = myconf " " OPTVALS[i] "=" b1 " "
5898 j = MULCHOICE[OPTVALS[i]]
5903 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5909 myconf = VALKEYS[i] "=any
" myconf
5911 myconf = myconf " " ALWAYS " " addons
5916 i = split(MULVALS[mula], ia)
5920 print mula "=\"" j "\" " myconf
5926 # We cannot test NULL because of missing UI strings, which will end
5927 # up with different checksums
5928 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5930 j = split(VALVALS[VALKEYS[i]], ia)
5934 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5937 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5938 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5939 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5941 j = split(VALVALS[VALKEYS[i]], ia)
5945 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5948 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5949 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5951 onepass("OPT_DEBUG
=1")
5954 ' | while read c; do
5955 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5956 printf "\n\n##########\n$c\n"
5957 printf "\n\n##########\n$c\n" >&2
5958 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5959 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5960 printf 'Skipping after config, nothing changed\n'
5961 printf 'Skipping after config, nothing changed\n' >&2
5964 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5967 cd .. && ${MAKE} distclean
5970 [ -n "${ERR}" ] && echo > ${ERR}
5971 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5973 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5974 # if have_feat devel; then
5975 # ARGS="${ARGS} -Smemdebug"
5981 while [ ${#} -gt 0 ]; do
5987 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'