2 #@ Synopsis: ./cc-test.sh --check-only [s-mailx-binary]
3 #@ ./cc-test.sh --mae-test s-mailx-binary [:TESTNAME:]
4 #@ [./cc-test.sh # Note: performs hundreds of compilations!]
5 #@ The latter generates output files.
6 #@ TODO _All_ the tests should happen in a temporary subdir.
9 # Instead of figuring out the environment in here, require a configured build
10 # system and include that! Our makefile and configure ensure that this test
11 # does not run in the configured, but the user environment nonetheless!
13 if [ -f .
/mk-config.ev
]; then
15 elif [ -f snailmail.jpg
] && [ -f .obj
/mk-config.ev
]; then
19 echo >&2 'S-nail/S-mailx is not configured.'
20 echo >&2 'This test script requires the shell environment that only the'
21 echo >&2 'configuration script can figure out, even if it will be used to'
22 echo >&2 'test a different binary than the one that would be produced!'
23 echo >&2 '(The necessary information will be in .obj/mk-config.ev.)'
24 echo >&2 'Hit RETURN to run "make config CONFIG=null'
26 make config CONFIG
=null
29 if [ -z "${MAILX__CC_TEST_RUNNING}" ]; then
30 MAILX__CC_TEST_RUNNING
=1
31 export MAILX__CC_TEST_RUNNING
32 exec "${SHELL}" "${i}${0}" "${@}"
35 # We need *stealthmua* regardless of $SOURCE_DATE_EPOCH, the program name as
36 # such is a compile-time variable
37 ARGS
='-Sv15-compat -:/ -# -Sdotlock-disable -Sexpandaddr=restrict'
38 ARGS
="${ARGS}"' -Smime-encoding=quoted-printable -Snosave -Sstealthmua'
39 ADDARG_UNI
=-Sttycharset=UTF-8
43 ERR
=.
/.cc-test.err
# Covers only some which cannot be checksummed; not quoted!
45 #UTF8_LOCALE= autodetected unless set
47 # Note valgrind has problems with FDs in forked childs, which causes some tests
48 # to fail (the FD is rewound and thus will be dumped twice)
50 #MEMTESTER='valgrind --leak-check=full --log-file=.vl-%p '
52 ## -- (>8 -- 8<) -- ##
57 printf >&2 -- "${fmt}\\n" "${@}"
62 export ARGS ADDARG_UNI CONF BODY MBOX MAIL MAKE
awk cat cksum rm sed grep
66 # Wed Oct 2 01:50:07 UTC 1996
67 SOURCE_DATE_EPOCH
=844221007
69 export LC_ALL LANG TZ SOURCE_DATE_EPOCH
70 unset POSIXLY_CORRECT LOGNAME USER
74 Synopsis: cc-test.sh --check-only s-mailx-binary
75 Synopsis: cc-test.sh --mae-test s-mailx-binary [:TEST:]
78 --check-only EXE run the test series, exit success or error;
79 if run in a git(1) checkout then failed tests
80 create test output data files
81 --mae-test EXE [:TEST:] run all or only the given TESTs, and create
82 test output data files; if run in a git(1)
83 checkout with the [test-out] branch available,
84 it will also create file differences
86 Without arguments as many different configurations as possible
87 will be compiled and tested.
92 CHECK_ONLY
= MAE_TEST
= GIT_REPO
= MAILX
=
93 if [ "${1}" = --check-only ]; then
94 [ ${#} -eq 2 ] || usage
95 CHECK_ONLY
=1 MAILX
=${2}
96 [ -x "${MAILX}" ] || usage
97 echo 'Mode: --check-only, binary: '"${MAILX}"
98 [ -d ..
/.git
] && [ -z "${MAILX__CC_TEST_NO_DATA_FILES}" ] && GIT_REPO
=1
99 elif [ "${1}" = --mae-test ]; then
100 [ ${#} -ge 2 ] || usage
101 MAE_TEST
=1 MAILX
=${2}
102 [ -x "${MAILX}" ] || usage
104 echo 'Mode: --mae-test, binary: '"${MAILX}"
105 [ -d ..
/.git
] && GIT_REPO
=1
107 [ ${#} -eq 0 ] || usage
108 echo 'Mode: full compile test, this will take a long time...'
109 MAILX__CC_TEST_NO_DATA_FILES
=1
110 export MAILX__CC_TEST_NO_DATA_FILES
114 MAILX
="${MEMTESTER}${MAILX}"
115 export RAWMAILX MAILX
117 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
118 if [ -z "${UTF8_LOCALE}" ]; then
119 # Try ourselfs via nl_langinfo(CODESET) first (requires a new version)
120 if command -v "${RAWMAILX}" >/dev
/null
2>&1 &&
121 ("${RAWMAILX}" -:/ -Xxit) >/dev
/null
2>&1; then
122 echo 'Trying to detect UTF-8 locale via '"${RAWMAILX}"
123 i
=`LC_ALL=C.utf8 "${RAWMAILX}" ${ARGS} -X '
125 \if [ "${ttycharset}" @i=% utf ]
130 \wysh set LC_ALL=${1}
132 \eval xcall cset_test "${@}"
136 \call cset_test C.UTF-8 POSIX.utf8 POSIX.UTF-8 \
137 en_EN.utf8 en_EN.UTF-8 en_US.utf8 en_US.UTF-8
139 [ $?
-eq 0 ] && UTF8_LOCALE
=$i
142 if [ -z "${UTF8_LOCALE}" ] && (locale yesexpr
) >/dev
/null
2>&1; then
143 echo 'Trying to detect UTF-8 locale via locale -a'
144 UTF8_LOCALE
=`locale -a | { m=
147 ${grep} -i -e utf8 -e utf-8; } >/dev/null 2>&1; then
150 ${grep} -e POSIX -e en_EN -e en_US; } \
151 >/dev/null 2>&1; then
161 if [ -n "${UTF8_LOCALE}" ]; then
162 echo 'Using Unicode locale '"${UTF8_LOCALE}"
164 echo 'No Unicode locale found, disabling Unicode tests'
172 trap "${rm} -rf \"${BODY}\" \"${MBOX}\" \"${ERR}\" \${TRAP_EXIT_ADDONS}" EXIT
173 trap "exit 1" HUP INT TERM
176 ( "${RAWMAILX}" ${ARGS} -X'echo $features' -Xx |
177 ${grep} +${1} ) >/dev
/null
2>&1
181 ${rm} -rf "${BODY}" "${MBOX}" ${TRAP_EXIT_ADDONS}
183 if [ ${#} -gt 0 ]; then
185 printf '[%s]\n' "${1}"
193 [ ${#} -ge 1 ] && __from
=${1} ||
194 __from
='Silybum Marianum Tue Apr 17 15:55:01 2018'
195 [ ${#} -eq 2 ] && __to=${2} || __to="${MBOX}"
196 ${cat} <<-_EOT > .tmta.sh
198 ( echo 'From '"${__from}" && ${cat} && echo ) >> "${__to}"
204 restat=${?} tid=${1} eestat=${2} f=${3} s=${4}
205 [ "${eestat}" != - ] && [ "${restat}" != "${eestat}" ] &&
206 err "${TESTNAME}-${tid}" 'unexpected status: '"${restat} != ${eestat}"
207 csum="`${cksum} < ${f}`"
208 if [ "${csum}" = "${s}" ]; then
210 printf '%s-%s: ok\n' "${TEST_NAME}" "${tid}"
214 printf '%s-%s: error: checksum mismatch (got %s)\n' \
215 "${TEST_NAME}" "${tid}" "${csum}"
218 if [ -n "${CHECK_ONLY}${MAE_TEST}" ]; then
219 x="t.
${TEST_NAME}-${tid}"
220 if [ -n "${MAE_TEST}" ] || [ -n "${maex}" -a -n "${GIT_REPO}" ]; then
221 ${cp} -f "${f}" ./"${x}"
224 if [ -n "${maex}" ] && [ -n "${GIT_REPO}" ] &&
225 command -v diff >/dev
/null
2>&1 &&
226 (git rev-parse
--verify test-out
) >/dev
/null
2>&1 &&
227 git show test-out
:"${x}" > .
/"${x}".old
2>/dev
/null
; then
228 diff -ru .
/"${x}".old ./"${x}" > "${x}".
diff
235 printf '%s: error: %s\n' ${1} "${2}"
239 # $1=test name [$2=status]
241 [ ${#} -gt 1 ] && __qm__
=${2}
242 if [ ${__qm__} -ne 0 ]; then
243 err
"${TEST_NAME}-${1}" 'unexpected non-0 exit status'
246 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
252 # $1=test name [$2=status]
254 [ ${#} -gt 1 ] && __qm__
=${2}
255 if [ ${__qm__} -eq 0 ]; then
256 err
"${TEST_NAME}-${1}" 'unexpected 0 exit status'
259 printf '%s-%s: ok\n' "${TEST_NAME}" "${1}"
264 if ( [ "$((1 + 1))" = 2 ] ) >/dev
/null
2>&1; then
266 echo "$((${1} + ${2}))"
270 echo `${awk} 'BEGIN{print '${1}' + '${2}'}'`
274 if ( [ "$((2 % 3))" = 2 ] ) >/dev
/null
2>&1; then
276 echo "$((${1} % ${2}))"
280 echo `${awk} 'BEGIN{print '${1}' % '${2}'}'`
286 t_X_opt_input_command_stack
289 t_input_inject_semicolon_seq
309 # MIME and RFC basics
317 # Operational basics with easy tests
325 t_rfc2231
# (after attachments)
326 t_mime_types_load_control
328 # Around state machine, after basics
330 t_quote_a_cmd_escapes
333 # Heavy use of/rely on state machine (behaviour) and basics
336 t_lreply_futh_rth_etc
343 t_X_opt_input_command_stack
() {
344 t_prolog X_opt_input_command_stack
346 ${cat} <<- '__EOT' > "${BODY}"
354 echo "define mac1 {";\
355 echo " echo mac1-1 via1 \$0";\
357 echo " echo mac1-2";\
359 echo " echo mac1-3";\
362 echo "define mac2 {";\
363 echo " echo mac2-1 via1 \$0";\
365 echo " echo mac2-2";\
371 echo echo 1-1-1 via1 \$0;\
383 # The -X option supports multiline arguments, and those can internally use
384 # reverse solidus newline escaping. And all -X options are joined...
386 < "${BODY}" ${MAILX} ${ARGS} \
401 echo "define mac1 {";\
402 echo " echo mac1-1 via2 \$0";\
404 echo " echo mac1-2";\
406 echo " echo mac1-3";\
409 echo "define mac2 {";\
410 echo " echo mac2-1 via2 \$0";\
412 echo " echo mac2-2";\
418 echo echo 1-1-1 via2 \$0;\
432 check 1 0 "${MBOX}" '1786542668 416'
439 if have_feat uistrings; then :; else
440 echo 'x_errexit: unsupported, skipped'
444 ${cat} <<- '__EOT' > "${BODY}"
450 </dev/null ${MAILX} ${ARGS} -Snomemdebug \
451 -X'echo one' -X' echos nono ' -X'echo two' \
453 check 1 0 "${MBOX}" '916157812 53'
455 </dev/null ${MAILX} ${ARGS} -X'source '"${BODY}" -Snomemdebug \
457 check 2 0 "${MBOX}" '916157812 53'
459 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Snomemdebug \
461 check
3 0 "${MBOX}" '916157812 53'
465 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
466 -X'echo one' -X' echos nono ' -X'echo two' \
468 check
4 1 "${MBOX}" '2118430867 49'
470 </dev
/null
${MAILX} ${ARGS} -X'source '"${BODY}" -Serrexit -Snomemdebug \
472 check 5 1 "${MBOX}" '2118430867 49'
474 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
476 check
6 1 "${MBOX}" '12955965 172'
478 </dev
/null MAILRC
="${BODY}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
480 check 7 1 "${MBOX}" '12955965 172'
482 ## Repeat 4-7 with ignerr set
484 ${sed} -e 's/^echos /ignerr echos /' < "${BODY}" > "${MBOX}"
486 </dev
/null
${MAILX} ${ARGS} -Serrexit -Snomemdebug \
487 -X'echo one' -X'ignerr echos nono ' -X'echo two' \
489 check
8 0 "${BODY}" '916157812 53'
491 </dev
/null
${MAILX} ${ARGS} -X'source '"${MBOX}" -Serrexit -Snomemdebug \
493 check 9 0 "${BODY}" '916157812 53'
495 </dev/null MAILRC="${MBOX}" ${MAILX} ${ARGS} -:u
-Serrexit -Snomemdebug \
497 check
10 0 "${BODY}" '916157812 53'
499 </dev
/null MAILRC
="${MBOX}" ${MAILX} ${ARGS} -:u -Sposix -Snomemdebug \
501 check 11 0 "${BODY}" '916157812 53'
511 # Test basic assumption
512 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} \
513 -X'echo asksub<$asksub> dietcurd<$dietcurd>' \
515 check
1 0 "${MBOX}" '270686329 21'
518 ${cat} <<- '__EOT' > "${BODY}"
523 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
524 -Snoasksub -Sasksub -Snoasksub \
525 -X'echo asksub<$asksub>' -X'set asksub' -X'echo asksub<$asksub>' \
527 check
2 0 "${MBOX}" '3182942628 37'
529 ${cat} <<- '__EOT' > "${BODY}"
534 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
535 -Snoasksub -Sasksub \
536 -X'echo asksub<$asksub>' -X'unset asksub' -X'echo asksub<$asksub>' \
538 check
3 0 "${MBOX}" '2006554293 39'
541 ${cat} <<- '__EOT' > "${BODY}"
542 echo dietcurd<$dietcurd>
544 echo dietcurd<$dietcurd>
546 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
547 -Sdietcurd=strawberry
-Snodietcurd -Sdietcurd=vanilla \
548 -X'echo dietcurd<$dietcurd>' -X'unset dietcurd' \
549 -X'echo dietcurd<$dietcurd>' \
551 check
4 0 "${MBOX}" '1985768109 65'
553 ${cat} <<- '__EOT' > "${BODY}"
554 echo dietcurd<$dietcurd>
556 echo dietcurd<$dietcurd>
558 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
559 -Sdietcurd=strawberry
-Snodietcurd \
560 -X'echo dietcurd<$dietcurd>' -X'set dietcurd=vanilla' \
561 -X'echo dietcurd<$dietcurd>' \
563 check
5 0 "${MBOX}" '151574279 51'
565 # TODO once we have a detached one with env=1..
566 if [ -n "`</dev/null ${MAILX} ${ARGS} -X'!echo \$TERM' -Xx`" ]; then
567 echo 's_freeze-{6,7}: shell sets $TERM, skipped'
569 ${cat} <<- '__EOT' > "${BODY}"
570 !echo "shell says TERM<$TERM>"
572 !echo "shell says TERM<$TERM>"
574 !echo "shell says TERM<$TERM>"
576 !echo "shell says TERM<$TERM>"
578 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
579 -STERM=strawberry
-SnoTERM -STERM=vanilla \
580 -X'echo mail<$TERM>' -X'unset TERM' \
581 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
583 check
6 0 "${MBOX}" '1211476036 167'
585 ${cat} <<- '__EOT' > "${BODY}"
586 !echo "shell says TERM<$TERM>"
588 !echo "shell says TERM<$TERM>"
590 !echo "shell says TERM<$TERM>"
592 !echo "shell says TERM<$TERM>"
594 </dev/null MAILRC="${BODY}" ${MAILX} ${ARGS} -:u \
595 -STERM=strawberry
-SnoTERM \
596 -X'echo TERM<$TERM>' -X'set TERM=vanilla' \
597 -X'!echo "shell says TERM<$TERM>"' -X'echo TERM<$TERM>' \
599 check
7 0 "${MBOX}" '3365080441 132'
606 t_input_inject_semicolon_seq
() {
607 t_prolog input_inject_semicolon_seq
609 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
614 echon this_is_mymac;call mydeepmac;echon ';';
616 echon one';';call mymac;echon two";";call mymac;echo three$';';
618 echon this_is_mymac;call mydeepmac;echon ,TOO'!;';
620 echon one';';call mymac;echon two";";call mymac;echo three$';';
623 check 1 0 "${MBOX}" '512117110 140'
631 # XXX the first needs to be checked, it is quite dumb as such
632 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
662 vput shcodec res e abcd
663 echo $?
/$^ERRNAME
$res
666 vput shcodec res d abcd
667 echo $?
/$^ERRNAME
$res
670 vput shcodec res e a
'b'c
'd'
671 echo $?
/$^ERRNAME
$res
674 vput shcodec res d a
'b'c
'd'
675 echo $?
/$^ERRNAME
$res
678 vput shcodec res e a
"b"c
"d"
679 echo $?
/$^ERRNAME
$res
682 vput shcodec res d a
"b"c
"d"
683 echo $?
/$^ERRNAME
$res
686 vput shcodec res e a$
'b'c$
'd'
687 echo $?
/$^ERRNAME
$res
690 vput shcodec res d a$
'b'c$
'd'
691 echo $?
/$^ERRNAME
$res
694 vput shcodec res e
'abcd'
695 echo $?
/$^ERRNAME
$res
698 vput shcodec res d
'abcd'
699 echo $?
/$^ERRNAME
$res
702 vput shcodec res e
"abcd"
703 echo $?
/$^ERRNAME
$res
706 vput shcodec res d
"abcd"
707 echo $?
/$^ERRNAME
$res
710 vput shcodec res e $
'abcd'
711 echo $?
/$^ERRNAME
$res
714 vput shcodec res d $
'abcd'
715 echo $?
/$^ERRNAME
$res
719 vput shcodec res e a b\ c d
720 echo $?
/$^ERRNAME
$res
723 vput shcodec res d a b\ c d
724 echo $?
/$^ERRNAME
$res
725 vput shcodec res e ab
cd
726 echo $?
/$^ERRNAME
$res
729 vput shcodec res d
'ab cd'
730 echo $?
/$^ERRNAME
$res
731 vput shcodec res e a
'b c' d
732 echo $?
/$^ERRNAME
$res
735 vput shcodec res d a
'b c' d
736 echo $?
/$^ERRNAME
$res
737 vput shcodec res e a
"b c" d
738 echo $?
/$^ERRNAME
$res
741 vput shcodec res d a
"b c" d
742 echo $?
/$^ERRNAME
$res
743 vput shcodec res e a $
'b c' d
744 echo $?
/$^ERRNAME
$res
747 vput shcodec res d a $
'b c' d
748 echo $?
/$^ERRNAME
$res
750 vput shcodec res e
'a$`"\'
751 echo $?/$^ERRNAME $res
754 vput shcodec res d 'a$
`"\'
755 echo $?/$^ERRNAME $res
756 vput shcodec res e "a\$\`'\"\\"
757 echo $?/$^ERRNAME $res
760 vput shcodec res d "a\$\`'\"\\"
761 echo $?/$^ERRNAME $res
762 vput shcodec res e $'a\$`\'\"\\'
763 echo $?/$^ERRNAME $res
766 vput shcodec res d $'a\$`\'\"\\'
767 echo $?/$^ERRNAME $res
768 vput shcodec res e $'a\$`\'"\\'
769 echo $?/$^ERRNAME $res
772 vput shcodec res d $'a\$
`\'"\\'
773 echo $?/$^ERRNAME $res
776 vput shcodec res e a${diet}c
777 echo $?/$^ERRNAME $res
780 eval vput shcodec res e a${diet}c
781 echo $?/$^ERRNAME $res
784 vput shcodec res e "a${diet}c"
785 echo $?/$^ERRNAME $res
788 eval vput shcodec res e "a${diet}c"
789 echo $?/$^ERRNAME $res
793 check 1 0 "${MBOX}" '3316745312 1241'
795 if [ -z "${UTF8_LOCALE}" ]; then
796 echo 'Skip shcodec-unicode, no UTF8_LOCALE TODO CANNOT'
798 ${cat} <<- '__EOT' | LC_ALL=${UTF8_LOCALE} \
799 ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
803 shcodec d $'t\u00E4st'
806 shcodec d $'a\u054Dc'
809 shcodec d $'a\U0001F603c'
811 check unicode 0 "${MBOX}" '4233409480 77'
820 ${cat} <<- '__EOT' > "${BODY}"
839 echo 'a${DIET}b${TIED}c\${DIET}d\${TIED}e' # COMMENT
840 echo "a${DIET}b${TIED}c\${DIET}d\${TIED}e"
841 echo $'a${DIET}b${TIED}c\${DIET}d\${TIED}e'
843 echo a$'\101\0101\x41\u0041\u41\U00000041\U41'c
844 echo a$'\u0041\u41\u0C1\U00000041\U41'c
867 echo a$'b\U0000000'dt
868 echo a$'b\U00000000'du
878 if [ -z "${UTF8_LOCALE}" ]; then
879 echo 'Skip wysh-unicode, no UTF8_LOCALE'
881 < "${BODY}" DIET=CURD TIED= \
882 LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
883 check unicode 0 "${MBOX}" '475805847 317'
886 < "${BODY}" DIET=CURD TIED= ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
887 check c 0 "${MBOX}" '1473887148 321'
889 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
890 wysh set mager='\hey\'
892 wysh set mager="\hey\\"
894 wysh set mager=$'\hey\\'
897 check 3 0 "${MBOX}" '1289698238 69'
903 t_prolog commandalias
905 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
906 commandalias echo echo hoho
910 commandalias XxX XxXx
911 commandalias XxXx XxXxX
912 commandalias XxXxX XxXxXx
913 commandalias XxXxXx echo huhu
914 commandalias XxXxXxX echo huhu
916 commandalias XxXxXx XxXxXxX
919 commandalias XxXxXx echo huhu
923 check 1 0 "${MBOX}" '1638809585 36'
931 # Nestable conditions test
932 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
954 if $dietcurd == 'yoho'
959 if $dietcurd @== 'Yoho'
964 if $dietcurd == 'Yoho'
969 if $dietcurd != 'yoho'
974 if $dietcurd @!= 'Yoho'
979 if $dietcurd != 'Yoho'
1040 if $dietcurd == 'yohu
'
1042 elif $dietcurd == 'yoha
'
1044 elif $dietcurd == 'yohe
'
1046 elif $dietcurd == 'yoho
'
1048 if $dietcurd == 'yohu
'
1050 elif $dietcurd == 'yoha
'
1052 elif $dietcurd == 'yohe
'
1054 elif $dietcurd == 'yoho
'
1056 if $dietcurd == 'yohu
'
1058 elif $dietcurd == 'yoha
'
1060 elif $dietcurd == 'yohe
'
1062 elif $dietcurd == 'yoho
'
1118 if $dietcurd @== aBC
1123 if $dietcurd @>= AbC
1128 if $dietcurd @<= ABc
1133 if $dietcurd @>= abd
1138 if $dietcurd @<= abb
1166 if $dietcurd @i=% aB
1211 set diet=abc curd=abc
1217 set diet=abc curd=abcd
1223 # 1. Shitty grouping capabilities as of today
1224 unset diet curd ndefined
1225 if [ [ false ] || [ false ] || [ true ] ] && [ [ false ] || [ true ] ] && \
1231 if [ [ [ [ 0 ] || [ 1 ] ] && [ [ 1 ] || [ 0 ] ] ] && [ 1 ] ] && [ yes ]
1236 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] ]
1241 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] ]
1246 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] && [ no ]
1251 if [ [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] || [ [ 1 ] ] || [ 1 ] ] \
1252 && [ no ] || [ yes ]
1257 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1262 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 0 ] ]
1267 if [ [ [ [ [ [ [ 1 ] ] && [ 1 ] ] && [ 0 ] ] && [ 1 ] ] ] && [ 1 ] ]
1272 if [ [ [ [ [ [ [ 0 ] ] && [ 1 ] ] && [ 1 ] ] && [ 1 ] ] ] && [ 1 ] ]
1277 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 0 ]
1282 if [ 1 ] || [ 0 ] || [ 0 ] || [ 0 ] && [ 1 ]
1287 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ]
1292 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 1 ]
1297 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 0 ]
1302 if [ 0 ] || [ 0 ] || [ 0 ] || [ 1 ] && [ 0 ] || [ 1 ] && [ 1 ]
1308 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1314 if [ [ $diet == 'yo
' ] && [ $curd == 'ho
' ] ] && [ $ndefined ]
1319 # 2. Shitty grouping capabilities as of today
1320 unset diet curd ndefined
1321 if [ false || false || true ] && [ false || true ] && yes
1326 if [ [ [ 0 || 1 ] && [ 1 || 0 ] ] && 1 ] && [ yes ]
1331 if [ 1 || 0 || 0 || 0 ]
1336 if [ 1 || 0 || 0 || 0 || [ 1 ] ]
1341 if [ 1 || 0 || 0 || 0 || [ 1 ] || 1 ] && no
1346 if [ 1 || 0 || 0 || 0 || 1 || [ 1 ] ] && no || [ yes ]
1351 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && 1 ] ] && [ 1 ] ]
1356 if [ [ [ [ [ [ 1 ] && 1 ] && 1 ] && [ 1 ] ] ] && 0 ]
1361 if [ [ [ [ [ [ [ 1 ] ] && 1 ] && 0 ] && [ 1 ] ] ] && 1 ]
1366 if [ [ [ [ [ [ 0 ] && 1 ] && 1 ] && 1 ] ] && 1 ]
1371 if 1 || 0 || 0 || 0 && 0
1376 if 1 || 0 || 0 || 0 && 1
1381 if 0 || 0 || 0 || 1 && 0
1386 if 0 || 0 || 0 || 1 && 1
1391 if 0 || 0 || 0 || 1 && 0 || 1 && 0
1396 if 0 || 0 || 0 || 1 && 0 || 1 && 1
1402 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1407 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1413 if [ $diet == 'yo
' && $curd == 'ho
' ] && $ndefined
1418 if $diet == 'yo
' && $curd == 'ho
' && $ndefined
1423 if [ [ [ [ [ [ $diet == 'yo
' && $curd == 'ho
' && $ndefined ] ] ] ] ] ]
1428 # Some more en-braced variables
1430 if ${diet} == ${curd}
1435 if ${diet} != ${curd}
1451 if ! 0 && ! ! 1 && ! ! ! ! 2 && 3
1456 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ ! 2 ] ] ] && 3
1461 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1466 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1471 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ [ ! [ ! [ ! [ 2 ] ] ] ] ] && ! 3
1476 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1481 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] && 3
1486 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ 2 ] ] ] ] ] || 3
1491 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! ! [ 2 ] ] ] ] ]
1497 if ! 0 && ! ! 1 && ! ! ! 0 && 3
1502 if ! 0 && ! [ ! 1 ] && ! [ ! [ ! [ 0 ] ] ] && 3
1507 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ [ 0 ] ] ] ] ] && 3
1512 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! ! [ ! [ ! 0 ] ] ] ] && ! 3
1517 if [ ! 0 ] && [ ! [ ! 1 ] ] && ! [ ! [ ! [ ! [ ! 0 ] ] ] ] && 3
1522 if [ ! 0 ] && ! [ ! [ ! 1 ] ] && [ ! ! [ ! [ ! [ ! [ 0 ] ] ] ] ] && 3
1527 if ! [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! ! 0 ] ] ] ] && 3
1532 if [ ! 0 ] && [ ! [ ! 1 ] ] && [ ! [ ! [ ! [ ! [ ! 0 ] ] ] ] ] || 3
1537 if [ ! 0 ] && [ ! ! [ ! ! 1 ] ] && [ ! ! [ ! ! [ ! ! [ ! [ 0 ] ] ] ] ]
1544 check normal 0 "${MBOX}" '1688759742 719'
1546 if have_feat regex; then
1547 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}"
1549 if $dietcurd =~ '^yo.
*'
1554 if $dietcurd =~ '^Yo.
*'
1559 if $dietcurd @=~ '^Yo.
*'
1564 if $dietcurd =~ '^yOho.
+'
1569 if $dietcurd @!~ '.
*Ho$
'
1574 if $dietcurd !~ '.
+yohO$
'
1579 if [ $dietcurd @i!~ '.
+yoho$
' ]
1584 if ! [ $dietcurd @i=~ '.
+yoho$
' ]
1589 if ! ! [ $dietcurd @i!~ '.
+yoho$
' ]
1594 if ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ]
1599 if [ ! [ ! [ $dietcurd @i!~ '.
+yoho$
' ] ] ]
1604 if ! [ ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1609 if ! ! ! $dietcurd !~ '.
+yoho$
'
1614 if ! ! ! $dietcurd =~ '.
+yoho$
'
1619 if ! [ ! ! [ ! [ $dietcurd !~ '.
+yoho$
' ] ] ]
1624 set diet=abc curd='^abc$
'
1630 set diet=abc curd='^abcd$
'
1638 check regex 0 "${MBOX}" '1115671789 95'
1640 printf 'if-regex
: unsupported
, skipped
\n'
1649 # Nestable conditions test
1650 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1665 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1670 echo $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2
1671 echo "$gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t2"
1680 echo active trouble: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1682 echo active null: $gv1 $lv1 ${lv2} ${lv3} ${gv2}, $t3
1691 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1698 wysh set y=$1; shift; eval localopts $y; localopts $1; shift
1705 echo ----- $1: $2 -> $3 -> $4
1713 call llx 'call off
' on on on
1714 call llx 'call off
' off on on
1715 call llx 'call off
' on off on
1716 call llx 'call off
' on off off
1717 localopts call-fixate on
1718 call llx 'call-fixate on
' on on on
1719 call llx 'call-fixate on
' off on on
1720 call llx 'call-fixate on
' on off on
1721 call llx 'call-fixate on
' on off off
1722 unset x;localopts call on
1723 call llx 'call on
' on on on
1724 call llx 'call on
' off on on
1725 call llx 'call on
' on off on
1726 call llx 'call on
' on off off
1731 check 1 0 "${MBOX}" '4016155249 1246'
1739 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1767 echo ------- global-1 du=$du
1769 echo ------- global-2 du=$du
1772 echo ------- global-3 du=$du
1774 echo ------- global-4 du=$du
1776 echo ------- global-5 du=$du
1779 check 1 0 "${MBOX}" '2411598140 641'
1784 t_macro_param_shift() {
1785 t_prolog macro_param_shift
1787 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
1790 echo t2.0 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1795 echo t2.1 has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1796 if [ $# > 1 ] || [ $ignerr == '' ]
1801 echo t2.2:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1803 echo t2.3:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1807 echo t2.4:$? has $#/${#} parameters: "$1,${2},$3" (${*}) [$@]
1812 call t2 1 you get four args
1813 echo t1.1: $?';' ignerr ($ignerr) should not exist
1814 call t2 1 you get 'three args
'
1815 echo t1.2: $?';' ignerr ($ignerr) should not exist
1816 call t2 1 you 'get two args
'
1817 echo t1.3: $?';' ignerr ($ignerr) should not exist
1818 call t2 1 'you get one arg
'
1819 echo t1.4: $?';' ignerr ($ignerr) should not exist
1820 ignerr call t2 '' 'you get one arg
'
1821 echo t1.5: $?';' ignerr ($ignerr) should not exist
1826 check 1 0 "${MBOX}" '1402489146 1682'
1834 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1835 vput addrcodec res e 1 <doog@def>
1836 echo $?/$^ERRNAME $res
1837 eval vput addrcodec res d $res
1838 echo $?/$^ERRNAME $res
1839 vput addrcodec res e 2 . <doog@def>
1840 echo $?/$^ERRNAME $res
1841 eval vput addrcodec res d $res
1842 echo $?/$^ERRNAME $res
1843 vput addrcodec res e 3 Sauer Dr. <doog@def>
1844 echo $?/$^ERRNAME $res
1845 eval vput addrcodec res d $res
1846 echo $?/$^ERRNAME $res
1847 vput addrcodec res e 3.50 Sauer (Ma) Dr. <doog@def>
1848 echo $?/$^ERRNAME $res
1849 eval vput addrcodec res d $res
1850 echo $?/$^ERRNAME $res
1851 vput addrcodec res e 3.51 Sauer (Ma) "Dr." <doog@def>
1852 echo $?/$^ERRNAME $res
1853 eval vput addrcodec res d $res
1854 echo $?/$^ERRNAME $res
1856 vput addrcodec res +e 4 Sauer (Ma) Dr. <doog@def>
1857 echo $?/$^ERRNAME $res
1858 eval vput addrcodec res d $res
1859 echo $?/$^ERRNAME $res
1860 vput addrcodec res +e 5 Sauer (Ma) Braten Dr. <doog@def>
1861 echo $?/$^ERRNAME $res
1862 eval vput addrcodec res d $res
1863 echo $?/$^ERRNAME $res
1864 vput addrcodec res +e 6 Sauer (Ma) Braten Dr. (Heu) <doog@def>
1865 echo $?/$^ERRNAME $res
1866 eval vput addrcodec res d $res
1867 echo $?/$^ERRNAME $res
1868 vput addrcodec res +e 7 Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu)
1869 echo $?/$^ERRNAME $res
1870 eval vput addrcodec res d $res
1871 echo $?/$^ERRNAME $res
1872 vput addrcodec res +e 8 \
1873 Dr. Sauer (Ma) Braten Dr. (Heu) <doog@def> (bu) Boom. Boom
1874 echo $?/$^ERRNAME $res
1875 eval vput addrcodec res d $res
1876 echo $?/$^ERRNAME $res
1877 vput addrcodec res +e 9 Dr.Sauer(Ma)Braten Dr. (Heu) <doog@def>
1878 echo $?/$^ERRNAME $res
1879 eval vput addrcodec res d $res
1880 echo $?/$^ERRNAME $res
1881 vput addrcodec res +e 10 (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 11 (Ma)Braten Dr"." (Heu) <doog@def>
1886 echo $?/$^ERRNAME $res
1887 eval vput addrcodec res d $res
1888 echo $?/$^ERRNAME $res
1889 vput addrcodec res +e 12 Dr. Sauer (Ma) Braten Dr. (u) <doog@def>
1890 echo $?/$^ERRNAME $res
1891 eval vput addrcodec res d $res
1892 echo $?/$^ERRNAME $res
1893 vput addrcodec res +e 13(Ma)Braten Dr. (Heu) <doog@def>
1894 echo $?/$^ERRNAME $res
1895 eval vput addrcodec res d $res
1896 echo $?/$^ERRNAME $res
1897 vput addrcodec res +e 14 Hey, Du <doog@def> Wie() findet Dr. das? ()
1898 echo $?/$^ERRNAME $res
1899 eval vput addrcodec res d $res
1900 echo $?/$^ERRNAME $res
1901 vput addrcodec res +e 15 \
1902 Hey, Du <doog@def> Wie() findet "" Dr. "" das? ()
1903 echo $?/$^ERRNAME $res
1904 eval vput addrcodec res d $res
1905 echo $?/$^ERRNAME $res
1906 vput addrcodec res +e 16 \
1907 "Hey," "Du" <doog@def> "Wie()" findet "" Dr. "" das? ()
1908 echo $?/$^ERRNAME $res
1909 eval vput addrcodec res d $res
1910 echo $?/$^ERRNAME $res
1911 vput addrcodec res +e 17 \
1912 "Hey" Du <doog@def> "Wie() findet " " Dr. """ das? ()
1913 echo $?/$^ERRNAME $res
1914 eval vput addrcodec res d $res
1915 echo $?/$^ERRNAME $res
1916 vput addrcodec res +e 18 \
1917 <doog@def> "Hey" Du "Wie() findet " " Dr. """ das? ()
1918 echo $?/$^ERRNAME $res
1919 eval vput addrcodec res d $res
1920 echo $?/$^ERRNAME $res
1921 vput addrcodec res +e 19 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1922 echo $?/$^ERRNAME $res
1923 eval vput addrcodec res d $res
1924 echo $?/$^ERRNAME $res
1926 vput addrcodec res ++e 20 Hey\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1927 echo $?/$^ERRNAME $res
1928 vput addrcodec res ++e 21 Hey\,\"" <doog@def> "Wie()" findet \" Dr. \" das?
1929 echo $?/$^ERRNAME $res
1930 eval vput addrcodec res d $res
1931 echo $?/$^ERRNAME $res
1933 vput addrcodec res +++e 22 Hey\\,\" <doog@def> "Wie()" findet \" Dr. \" das?
1934 echo $?/$^ERRNAME $res
1935 eval vput addrcodec res d $res
1936 echo $?/$^ERRNAME $res
1938 vput addrcodec res s \
1939 "23 Hey\\,\\\" \"Wie" () "\" findet \\\" Dr. \\\" das?" <doog@def>
1940 echo $?/$^ERRNAME $res
1942 # Fix for [f3852f88]
1943 vput addrcodec res ++e <from2@exam.ple> 100 (comment) "Quot(e)d"
1944 echo $?/$^ERRNAME $res
1945 eval vput addrcodec res d $res
1946 echo $?/$^ERRNAME $res
1947 vput addrcodec res e <from2@exam.ple> 100 (comment) "Quot(e)d"
1948 echo $?/$^ERRNAME $res
1949 eval vput addrcodec res d $res
1950 echo $?/$^ERRNAME $res
1953 check 1 0 "${MBOX}" '1047317989 2612'
1955 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
1957 mlsubscribe isa2@list
1959 vput addrcodec res skin Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1960 echo $?/$^ERRNAME $res
1961 vput addrcodec res skinlist Hey\\,\" <isa0@list> "Wie()" find \" Dr. \" das?
1962 echo $?/$^ERRNAME $res
1963 vput addrcodec res skin Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1964 echo $?/$^ERRNAME $res
1965 vput addrcodec res skinlist Hey\\,\" <isa1@list> "Wie()" find \" Dr. \" das?
1966 echo $?/$^ERRNAME $res
1967 vput addrcodec res skin Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1968 echo $?/$^ERRNAME $res
1969 vput addrcodec res skinlist Hey\\,\" <isa2@list> "Wie()" find \" Dr. \" das?
1970 echo $?/$^ERRNAME $res
1973 check 2 0 "${MBOX}" '1391779299 104'
1975 if have_feat idna; then
1976 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} ${ADDARG_UNI} > "${MBOX}" 2>&1
1977 vput addrcodec res e (heu) <du@blödiän> "stroh" du
1978 echo $?/$^ERRNAME $res
1979 eval vput addrcodec res d $res
1980 echo $?/$^ERRNAME $res
1981 vput addrcodec res e <du@blödiän> du
1982 echo $?/$^ERRNAME $res
1983 eval vput addrcodec res d $res
1984 echo $?/$^ERRNAME $res
1985 vput addrcodec res e du <du@blödiän>
1986 echo $?/$^ERRNAME $res
1987 eval vput addrcodec res d $res
1988 echo $?/$^ERRNAME $res
1989 vput addrcodec res e <du@blödiän>
1990 echo $?/$^ERRNAME $res
1991 eval vput addrcodec res d $res
1992 echo $?/$^ERRNAME $res
1993 vput addrcodec res e du@blödiän
1994 echo $?/$^ERRNAME $res
1995 eval vput addrcodec res d $res
1996 echo $?/$^ERRNAME $res
1999 check idna 0 "${MBOX}" '498775983 326'
2001 printf 'addrcodec-idna
: unsupported
, skipped
\n'
2010 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>>${ERR}
2012 vput vexpr res
= 9223372036854775807
2013 echo $?
/$^ERRNAME
$res
2014 vput vexpr res
= 9223372036854775808
2015 echo $?
/$^ERRNAME
$res
2016 vput vexpr res
= u9223372036854775808
2017 echo $?
/$^ERRNAME
$res
2018 vput vexpr res @
= 9223372036854775808
2019 echo $?
/$^ERRNAME
$res
2020 vput vexpr res
= -9223372036854775808
2021 echo $?
/$^ERRNAME
$res
2022 vput vexpr res
= -9223372036854775809
2023 echo $?
/$^ERRNAME
$res
2024 vput vexpr res @
= -9223372036854775809
2025 echo $?
/$^ERRNAME
$res
2026 vput vexpr res
= U9223372036854775809
2027 echo $?
/$^ERRNAME
$res
2030 0b0111111111111111111111111111111111111111111111111111111111111111
2031 echo $?
/$^ERRNAME
$res
2033 S0b1000000000000000000000000000000000000000000000000000000000000000
2034 echo $?
/$^ERRNAME
$res
2036 S0b1000000000000000000000000000000000000000000000000000000000000000
2037 echo $?
/$^ERRNAME
$res
2039 U0b1000000000000000000000000000000000000000000000000000000000000000
2040 echo $?
/$^ERRNAME
$res
2042 0b1000000000000000000000000000000000000000000000000000000000000000
2043 echo $?
/$^ERRNAME
$res
2045 0b1000000000000000000000000000000000000000000000000000000000000000
2046 echo $?
/$^ERRNAME
$res
2048 -0b1000000000000000000000000000000000000000000000000000000000000000
2049 echo $?
/$^ERRNAME
$res
2051 S0b1000000000000000000000000000000000000000000000000000000000000001
2052 echo $?
/$^ERRNAME
$res
2054 S0b1000000000000000000000000000000000000000000000000000000000000001
2055 echo $?
/$^ERRNAME
$res
2057 -0b1000000000000000000000000000000000000000000000000000000000000001
2058 echo $?
/$^ERRNAME
$res
2060 U0b1000000000000000000000000000000000000000000000000000000000000001
2061 echo $?
/$^ERRNAME
$res
2063 vput vexpr res
= 0777777777777777777777
2064 echo $?
/$^ERRNAME
$res
2065 vput vexpr res
= S01000000000000000000000
2066 echo $?
/$^ERRNAME
$res
2067 vput vexpr res @
= S01000000000000000000000
2068 echo $?
/$^ERRNAME
$res
2069 vput vexpr res
= U01000000000000000000000
2070 echo $?
/$^ERRNAME
$res
2071 vput vexpr res
= 01000000000000000000000
2072 echo $?
/$^ERRNAME
$res
2073 vput vexpr res @
= 01000000000000000000000
2074 echo $?
/$^ERRNAME
$res
2075 vput vexpr res
= -01000000000000000000000
2076 echo $?
/$^ERRNAME
$res
2077 vput vexpr res
= S01000000000000000000001
2078 echo $?
/$^ERRNAME
$res
2079 vput vexpr res @
= S01000000000000000000001
2080 echo $?
/$^ERRNAME
$res
2081 vput vexpr res @
= -01000000000000000000001
2082 echo $?
/$^ERRNAME
$res
2083 vput vexpr res
= U01000000000000000000001
2084 echo $?
/$^ERRNAME
$res
2086 vput vexpr res
= 0x7FFFFFFFFFFFFFFF
2087 echo $?
/$^ERRNAME
$res
2088 vput vexpr res
= S0x8000000000000000
2089 echo $?
/$^ERRNAME
$res
2090 vput vexpr res @
= S0x8000000000000000
2091 echo $?
/$^ERRNAME
$res
2092 vput vexpr res
= U0x8000000000000000
2093 echo $?
/$^ERRNAME
$res
2094 vput vexpr res
= 0x8000000000000000
2095 echo $?
/$^ERRNAME
$res
2096 vput vexpr res @
= 0x8000000000000000
2097 echo $?
/$^ERRNAME
$res
2098 vput vexpr res
= -0x8000000000000000
2099 echo $?
/$^ERRNAME
$res
2100 vput vexpr res
= S0x8000000000000001
2101 echo $?
/$^ERRNAME
$res
2102 vput vexpr res @
= S0x8000000000000001
2103 echo $?
/$^ERRNAME
$res
2104 vput vexpr res @
= -0x8000000000000001
2105 echo $?
/$^ERRNAME
$res
2106 vput vexpr res
= u0x8000000000000001
2107 echo $?
/$^ERRNAME
$res
2110 echo $?
/$^ERRNAME
$res
2112 echo $?
/$^ERRNAME
$res
2114 echo $?
/$^ERRNAME
$res
2116 vput vexpr res
+ 0 0
2117 echo $?
/$^ERRNAME
$res
2118 vput vexpr res
+ 0 1
2119 echo $?
/$^ERRNAME
$res
2120 vput vexpr res
+ 1 1
2121 echo $?
/$^ERRNAME
$res
2123 vput vexpr res
+ 9223372036854775807 0
2124 echo $?
/$^ERRNAME
$res
2125 vput vexpr res
+ 9223372036854775807 1
2126 echo $?
/$^ERRNAME
$res
2127 vput vexpr res @
+ 9223372036854775807 1
2128 echo $?
/$^ERRNAME
$res
2129 vput vexpr res
+ 0 9223372036854775807
2130 echo $?
/$^ERRNAME
$res
2131 vput vexpr res
+ 1 9223372036854775807
2132 echo $?
/$^ERRNAME
$res
2133 vput vexpr res @
+ 1 9223372036854775807
2134 echo $?
/$^ERRNAME
$res
2136 vput vexpr res
+ -9223372036854775808 0
2137 echo $?
/$^ERRNAME
$res
2138 vput vexpr res
+ -9223372036854775808 -1
2139 echo $?
/$^ERRNAME
$res
2140 vput vexpr res @
+ -9223372036854775808 -1
2141 echo $?
/$^ERRNAME
$res
2142 vput vexpr res
+ 0 -9223372036854775808
2143 echo $?
/$^ERRNAME
$res
2144 vput vexpr res
+ -1 -9223372036854775808
2145 echo $?
/$^ERRNAME
$res
2146 vput vexpr res @
+ -1 -9223372036854775808
2147 echo $?
/$^ERRNAME
$res
2149 vput vexpr res
- 0 0
2150 echo $?
/$^ERRNAME
$res
2151 vput vexpr res
- 0 1
2152 echo $?
/$^ERRNAME
$res
2153 vput vexpr res
- 1 1
2154 echo $?
/$^ERRNAME
$res
2156 vput vexpr res
- 9223372036854775807 0
2157 echo $?
/$^ERRNAME
$res
2158 vput vexpr res
- 9223372036854775807 -1
2159 echo $?
/$^ERRNAME
$res
2160 vput vexpr res @
- 9223372036854775807 -1
2161 echo $?
/$^ERRNAME
$res
2162 vput vexpr res
- 0 9223372036854775807
2163 echo $?
/$^ERRNAME
$res
2164 vput vexpr res
- -1 9223372036854775807
2165 echo $?
/$^ERRNAME
$res
2166 vput vexpr res
- -2 9223372036854775807
2167 echo $?
/$^ERRNAME
$res
2168 vput vexpr res @
- -2 9223372036854775807
2169 echo $?
/$^ERRNAME
$res
2171 vput vexpr res
- -9223372036854775808 +0
2172 echo $?
/$^ERRNAME
$res
2173 vput vexpr res
- -9223372036854775808 +1
2174 echo $?
/$^ERRNAME
$res
2175 vput vexpr res @
- -9223372036854775808 +1
2176 echo $?
/$^ERRNAME
$res
2177 vput vexpr res
- 0 -9223372036854775808
2178 echo $?
/$^ERRNAME
$res
2179 vput vexpr res
- +1 -9223372036854775808
2180 echo $?
/$^ERRNAME
$res
2181 vput vexpr res @
- +1 -9223372036854775808
2182 echo $?
/$^ERRNAME
$res
2184 vput vexpr res
+ -13 -2
2185 echo $?
/$^ERRNAME
$res
2186 vput vexpr res
- 0 0
2187 echo $?
/$^ERRNAME
$res
2188 vput vexpr res
- 0 1
2189 echo $?
/$^ERRNAME
$res
2190 vput vexpr res
- 1 1
2191 echo $?
/$^ERRNAME
$res
2192 vput vexpr res
- -13 -2
2193 echo $?
/$^ERRNAME
$res
2195 vput vexpr res
* 0 0
2196 echo $?
/$^ERRNAME
$res
2197 vput vexpr res
* 0 1
2198 echo $?
/$^ERRNAME
$res
2199 vput vexpr res
* 1 1
2200 echo $?
/$^ERRNAME
$res
2201 vput vexpr res
* -13 -2
2202 echo $?
/$^ERRNAME
$res
2204 vput vexpr res
/ 0 0
2205 echo $?
/$^ERRNAME
$res
2206 vput vexpr res
/ 0 1
2207 echo $?
/$^ERRNAME
$res
2208 vput vexpr res
/ 1 1
2209 echo $?
/$^ERRNAME
$res
2210 vput vexpr res
/ -13 -2
2211 echo $?
/$^ERRNAME
$res
2213 vput vexpr res
% 0 0
2214 echo $?
/$^ERRNAME
$res
2215 vput vexpr res
% 0 1
2216 echo $?
/$^ERRNAME
$res
2217 vput vexpr res
% 1 1
2218 echo $?
/$^ERRNAME
$res
2219 vput vexpr res
% -13 -2
2220 echo $?
/$^ERRNAME
$res
2223 check numeric
0 "${MBOX}" '960821755 1962'
2225 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2226 vput vexpr res find 'bananarama' 'nana'
2227 echo $?/$^ERRNAME :$res:
2228 vput vexpr res find 'bananarama' 'bana'
2229 echo $?/$^ERRNAME :$res:
2230 vput vexpr res find 'bananarama' 'Bana'
2231 echo $?/$^ERRNAME :$res:
2232 vput vexpr res find 'bananarama' 'rama'
2233 echo $?/$^ERRNAME :$res:
2235 vput vexpr res ifind 'bananarama' 'nana'
2236 echo $?/$^ERRNAME :$res:
2237 vput vexpr res ifind 'bananarama' 'bana'
2238 echo $?/$^ERRNAME :$res:
2239 vput vexpr res ifind 'bananarama' 'Bana'
2240 echo $?/$^ERRNAME :$res:
2241 vput vexpr res ifind 'bananarama' 'rama'
2242 echo $?/$^ERRNAME :$res:
2244 vput vexpr res substring 'bananarama' 1
2245 echo $?/$^ERRNAME :$res:
2246 vput vexpr res substring 'bananarama' 3
2247 echo $?/$^ERRNAME :$res:
2248 vput vexpr res substring 'bananarama' 5
2249 echo $?/$^ERRNAME :$res:
2250 vput vexpr res substring 'bananarama' 7
2251 echo $?/$^ERRNAME :$res:
2252 vput vexpr res substring 'bananarama' 9
2253 echo $?/$^ERRNAME :$res:
2254 vput vexpr res substring 'bananarama' 10
2255 echo $?/$^ERRNAME :$res:
2256 vput vexpr res substring 'bananarama' 1 3
2257 echo $?/$^ERRNAME :$res:
2258 vput vexpr res substring 'bananarama' 3 3
2259 echo $?/$^ERRNAME :$res:
2260 vput vexpr res substring 'bananarama' 5 3
2261 echo $?/$^ERRNAME :$res:
2262 vput vexpr res substring 'bananarama' 7 3
2263 echo $?/$^ERRNAME :$res:
2264 vput vexpr res substring 'bananarama' 9 3
2265 echo $?/$^ERRNAME :$res:
2266 vput vexpr res substring 'bananarama' 10 3
2267 echo $?/$^ERRNAME :$res:
2269 vput vexpr res substring 'bananarama' -1
2270 echo $?/$^ERRNAME :$res:
2271 vput vexpr res substring 'bananarama' -3
2272 echo $?/$^ERRNAME :$res:
2273 vput vexpr res substring 'bananarama' -5
2274 echo $?/$^ERRNAME :$res:
2275 vput vexpr res substring 'bananarama' -7
2276 echo $?/$^ERRNAME :$res:
2277 vput vexpr res substring 'bananarama' -9
2278 echo $?/$^ERRNAME :$res:
2279 vput vexpr res substring 'bananarama' -10
2280 echo $?/$^ERRNAME :$res:
2281 vput vexpr res substring 'bananarama' 1 -3
2282 echo $?/$^ERRNAME :$res:
2283 vput vexpr res substring 'bananarama' 3 -3
2284 echo $?/$^ERRNAME :$res:
2285 vput vexpr res substring 'bananarama' 5 -3
2286 echo $?/$^ERRNAME :$res:
2287 vput vexpr res substring 'bananarama' 7 -3
2288 echo $?/$^ERRNAME :$res:
2289 vput vexpr res substring 'bananarama' 9 -3
2290 echo $?/$^ERRNAME :$res:
2291 vput vexpr res substring 'bananarama' 10 -3
2292 echo $?/$^ERRNAME :$res:
2294 vput vexpr res trim 'Cocoon Cocoon'
2295 echo $?/$^ERRNAME :$res:
2296 vput vexpr res trim ' Cocoon Cocoon '
2297 echo $?/$^ERRNAME :$res:
2298 vput vexpr res trim-front 'Cocoon Cocoon'
2299 echo $?/$^ERRNAME :$res:
2300 vput vexpr res trim-front ' Cocoon Cocoon '
2301 echo $?/$^ERRNAME :$res:
2302 vput vexpr res trim-end 'Cocoon Cocoon'
2303 echo $?/$^ERRNAME :$res:
2304 vput vexpr res trim-end ' Cocoon Cocoon '
2305 echo $?/$^ERRNAME :$res:
2308 check string 0 "${MBOX}" '3182004322 601'
2310 if have_feat regex; then
2311 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2312 vput vexpr res regex
'bananarama' 'nana'
2313 echo $?
/$^ERRNAME
:$res:
2314 vput vexpr res regex
'bananarama' 'bana'
2315 echo $?
/$^ERRNAME
:$res:
2316 vput vexpr res regex
'bananarama' 'Bana'
2317 echo $?
/$^ERRNAME
:$res:
2318 vput vexpr res regex
'bananarama' 'rama'
2319 echo $?
/$^ERRNAME
:$res:
2321 vput vexpr res iregex
'bananarama' 'nana'
2322 echo $?
/$^ERRNAME
:$res:
2323 vput vexpr res iregex
'bananarama' 'bana'
2324 echo $?
/$^ERRNAME
:$res:
2325 vput vexpr res iregex
'bananarama' 'Bana'
2326 echo $?
/$^ERRNAME
:$res:
2327 vput vexpr res iregex
'bananarama' 'rama'
2328 echo $?
/$^ERRNAME
:$res:
2330 vput vexpr res regex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2331 echo $?
/$^ERRNAME
:$res:
2332 vput vexpr res regex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2333 echo $?
/$^ERRNAME
:$res:
2334 vput vexpr res regex
'bananarama' 'Bana(.+)' '\$1\$0'
2335 echo $?
/$^ERRNAME
:$res:
2336 vput vexpr res regex
'bananarama' '(.+)rama' '\$1\$0'
2337 echo $?
/$^ERRNAME
:$res:
2339 vput vexpr res iregex
'bananarama' '(.*)nana(.*)' '\${1}a\${0}u{\$2}'
2340 echo $?
/$^ERRNAME
:$res:
2341 vput vexpr res iregex
'bananarama' '(.*)bana(.*)' '\${1}a\${0}u\$2'
2342 echo $?
/$^ERRNAME
:$res:
2343 vput vexpr res iregex
'bananarama' 'Bana(.+)' '\$1\$0'
2344 echo $?
/$^ERRNAME
:$res:
2345 vput vexpr res iregex
'bananarama' '(.+)rama' '\$1\$0'
2346 echo $?
/$^ERRNAME
:$res:
2350 check regex
0 "${MBOX}" '3270360157 311'
2352 printf 'vexpr-regex: unsupported, skipped\n'
2361 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2366 vput vexpr j '&' $i 7
2372 vput vexpr j '&' $i 7
2378 echo ! The end for $1
2382 # Transport $?/$! up the call chain
2388 wysh set i=$? j=$! k=$^ERRNAME
2392 echo ! The end for $1
2393 return $i $^ERR-BUSY
2397 # Up and down it goes
2404 vput vexpr k - $1 $2
2408 echo "# <$i/$j> .. "
2412 eval echon
"<\$1=\$i/\$^ERRNAME-$j "
2415 echo ! The end
for $1=$i/$2
2419 return $i $^ERR-BUSY
2425 call w1
0; echo ?
=$?
!=$
!; echo -----;
2426 call w2
0; echo ?
=$?
!=$^ERRNAME
; echo -----;
2427 call w3
0 1; echo ?
=$?
!=$^ERRNAME
; echo -----;
2430 check
1 0 "${MBOX}" '1572045517 5922'
2438 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Snomemdebug > "${MBOX}" 2>&1
2443 vput vexpr j '&' $i 7
2449 echo ! The end for $1/$2
2451 return $i $^ERR-BUSY
2462 echo ?=$? !=$^ERRNAME
2465 echo ?=$? !=$^ERRNAME
2467 echo ?=$? !=$^ERRNAME
2470 check 1 0 "${MBOX}" '2401702082 23801'
2474 if have_feat uistrings; then
2475 ${cat} <<- '__EOT' > "${BODY}"
2480 vput vexpr j '&' $i 7
2486 echo ! The end for $1
2489 echo would be err with errexit
2498 echo zwei, ?=$? !=$!
2499 localopts yes; set errexit
2501 echo drei, ?=$? !=$^ERRNAME
2503 echo vier, ?=$? !=$^ERRNAME, this is an error
2506 echo outer 1, ?=$? !=$^ERRNAME
2508 echo outer 2, ?=$? !=$^ERRNAME, could be error if xxxign non-empty
2510 echo outer 3, ?=$? !=$^ERRNAME
2511 echo this is definitely an error
2514 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign ignerr' \
2515 -Snomemdebug > "${MBOX}" 2>&1
2516 check
2 0 "${MBOX}" '3900716531 4200'
2518 < "${BODY}" ${MAILX} ${ARGS} -X'commandalias xxxign " "' \
2519 -Snomemdebug > "${MBOX}" 2>&1
2520 check 3 1 "${MBOX}" '1006776201 2799'
2522 echo 'xcall-2: unsupported, skipped'
2523 echo 'xcall-3: unsupported, skipped'
2532 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2533 vpospar
set hey
, "'you ", world
!
2534 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2535 vput vpospar x quote
; echo x
<$x>
2536 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2537 vput vpospar y quote
;echo y
<$y>
2538 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2539 eval vpospar
set ${y};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2540 eval vpospar
set ${x};echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2543 echo infun2
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2544 vput vpospar z quote
;echo infun2
:z
<$z>
2548 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2549 vput vpospar y quote
;echo infun
:y
<$y>
2550 eval vpospar
set ${x};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2551 vpospar
clear;echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2553 echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2554 eval vpospar
set ${y};echo infun
:$?
/$^ERRNAME
/$#:$
*/"$@"/<$1><$2><$3><$4>
2557 call infun This
"in a" fun
2558 echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2559 vpospar
clear;echo $?
/$^ERRNAME
/$#: $
* / "$@" / <$1><$2><$3><$4>
2561 check
1 0 "${MBOX}" '155175639 866'
2564 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2566 echo ifs<$ifs> ifs-ws<$ifs-ws>
2567 vpospar set hey, "'you ", world!
2568 echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2569 vput vpospar x quote; echo x<$x>
2570 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2571 eval vpospar set ${x};echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2574 echo ifs<$ifs> ifs-ws<$ifs-ws>
2575 vpospar set hey, "'you
", world!
2576 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2578 vput vpospar x quote; echo x<$x>
2579 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2580 eval vpospar set ${x};\
2581 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@
" / <$1><$2><$3><$4>
2584 echo ifs<$ifs> ifs-ws<$ifs-ws>
2585 vpospar set hey, "'you ", world!
2586 unset ifs; echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2588 vput vpospar x quote; echo x<$x>
2589 vpospar clear;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2590 eval vpospar set ${x};\
2591 unset ifs;echo $?/$^ERRNAME/$#: $* / "$@" / <$1><$2><$3><$4>
2593 check ifs 0 "${MBOX}" '2015927702 706'
2600 TRAP_EXIT_ADDONS="./.t*"
2602 ${cat} > ./.t.sh <<- '___
'; ${cat} > ./.t.rc <<- '___
'
2605 printf " (1/$#: <$1>)"
2607 if [ $# -gt 0 ]; then
2621 printf yyy;yyy 'xxx' "b\$
'\t'u
' "
2622 printf xxx;xxx arg ,b u.
2623 printf xxx;xxx arg , .
2624 printf xxx;xxx arg ,ball.
2630 echon " (1/$#: <$1>)"
2645 echon yyy;call yyy '\call xxx' "b\$
'\t'u
' "
2646 echon xxx;call xxx arg ,b u.
2647 echon xxx;call xxx arg , .
2648 echon xxx;call xxx arg ,ball.
2651 ${MAILX} ${ARGS} -X'source ./.t.rc' -Xx > "${MBOX}" 2>&1
2652 check 1 0 "${MBOX}" '41566293 164'
2654 #${SHELL} ./.t.sh > ./.tshout 2>&1
2655 #check disproof-1 0 ./.tshout '41566293 164'
2662 TRAP_EXIT_ADDONS="./.t*"
2664 ${cat} <<- '__EOT
' > .tin
2665 hey1, "'you
", world!
2666 hey2, "'you ", bugs bunny!
2671 ${cat} <<- '__EOT
' |\
2672 ${MAILX} ${ARGS} -X'readctl create ./.tin' > "${MBOX}" 2>&1
2674 echo $?/$^ERRNAME / <$a><$b><$c>
2676 echo $?/$^ERRNAME / <$a><$b><$c>
2678 echo $?/$^ERRNAME / <$a><$b><$c>
2680 echo $?/$^ERRNAME / <$a><$b><$c>
2681 unset a b c;read a b c
2682 echo $?/$^ERRNAME / <$a><$b><$c>
2683 readctl remove ./.tin;echo readctl remove:$?/$^ERRNAME
2685 check 1 0 "${MBOX}" '1527910147 173'
2687 ${cat} <<- '__EOT
' > .tin2
2688 hey2.0,:"'you
",:world!:mars.:
2689 hey2.1,:"'you ",:world!
2690 hey2.2,:"'you
",:bugs bunny!
2696 ${cat} <<- '__EOT' |\
2697 6< .tin2 ${MAILX} ${ARGS} -X 'readctl create 6' > "${MBOX}" 2>&1
2700 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2702 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2704 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2706 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2708 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2710 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2711 unset a b c
;read a b c
2712 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2714 echo $?
/$^ERRNAME
/ <$a><$b><$c>
2715 readctl remove
6;echo readctl remove
:$?
/$^ERRNAME
2717 check ifs
0 "${MBOX}" '890153490 298'
2719 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} > "${MBOX}" 2>&1
2721 readall d; echo $?/$^ERRNAME / <$d>
2722 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2723 readctl create .tin2
2724 readall d; echo $?/$^ERRNAME / <$d>
2725 wysh set d;readall d;echo $?/$^ERRNAME / <$d>
2726 readctl remove .tin;echo $?/$^ERRNAME;\
2727 readctl remove .tin2;echo $?/$^ERRNAME
2728 echo '### now with empty lines'
2729 ! printf 'one line\n\ntwo line\n\n' > ./.temptynl
2730 readctl create .temptynl;echo $?/$^ERRNAME
2731 readall d; echo "$?
/$^ERRNAME
/ <$d>"
2732 readctl remove .temptynl;echo $?/$^ERRNAME
2734 check readall 0 "${MBOX}" '4113506527 405'
2743 TRAP_EXIT_ADDONS=".
/.t
*"
2747 while [ ${i} -lt 113 ]; do
2748 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2749 "${MBOX}" "${i}" "${i}"
2752 ) | ${MAILX} ${ARGS} > .tall 2>&1
2753 check 1 0 "${MBOX}" '1785801373 13336'
2754 check 1-outerr - ./.tall '4294967295 0' # empty file
2756 printf 'File "%s
"\ncopy * "%s
"\nFile "%s
"\nfrom*' "${MBOX}" .tmbox1 .tmbox1 |
2757 ${MAILX} ${ARGS} -Sshowlast > .tall 2>&1
2758 check 2 0 .tall '3075634057 9103'
2760 printf 'File "%s
"\ncopy * "file://%s
"\nFile "file://%s
"\nfrom*' \
2761 "${MBOX}" .tmbox2 .tmbox2 | ${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2762 check
3 0 .tall
'1902668747 9110'
2764 # copy only the odd (but the first), move the even
2766 printf 'File "file://%s"\ncopy ' .tmbox2
2768 while [ ${i} -lt 113 ]; do
2772 printf 'file://%s\nFile "file://%s"\nfrom*' .tmbox3 .tmbox3
2773 ) |
${MAILX} ${ARGS} -Sshowlast > .tall
2>&1
2774 check
4 0 .tmbox3
'2554734733 6666'
2775 check
5 - .tall
'3168324241 4573'
2778 printf 'file "file://%s"\nmove ' .tmbox2
2780 while [ ${i} -lt 113 ]; do
2784 printf 'file://%s\nFile "file://%s"\nfrom*\nFile "file://%s"\nfrom*' \
2785 .tmbox3 .tmbox3 .tmbox2
2786 ) |
${MAILX} ${ARGS} -Sshowlast > .tall 2>>${ERR}
2787 check
6 0 .tmbox3
'1429216753 13336'
2788 if have_feat uistrings
; then
2789 ${sed} 2d
< .tall
> .tallx
2793 check
7 - .tallx
'3604509039 13645'
2795 # Invalid MBOXes (after [f4db93b3])
2797 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2798 check 8 0 .tinvmbox '2848412822 118'
2799 check 9 - ./.tall '461280182 33'
2801 echo ' ' > .tinvmbox
2802 printf 'copy 1 ./.tinvmbox' | ${MAILX} ${ARGS} -Rf "${MBOX}" > .tall
2>&1
2803 check
10 0 .tinvmbox
'624770486 120'
2804 check
11 - .
/.tall
'461280182 33'
2806 { echo; echo; } > .tinvmbox
# (not invalid)
2807 printf 'copy 1 ./.tinvmbox' |
${MAILX} ${ARGS} -Rf "${MBOX}" > .tall 2>&1
2808 check 12 0 .tinvmbox '1485640875 119'
2809 check 13 - ./.tall '461280182 33'
2811 # *mbox-rfc4155*, plus
2812 ${cat} <<-_EOT > ./.tinv1
2815 From MAILER-DAEMON-1 Wed Oct 2 01:50:07 1996
2816 Date: Wed, 02 Oct 1996 01:50:07 +0000
2818 Subject: Bad bad message 1
2820 From me to you, blinde Kuh!
2822 From MAILER-DAEMON-2 Wed Oct 2 01:50:07 1996
2823 Date: Wed, 02 Oct 1996 01:50:07 +0000
2825 Subject: Bad bad message 2
2827 From me to you, blindes Kalb!
2829 ${cp} ./.tinv1 ./.tinv2
2833 \\localopts yes; \\wysh set mbox-rfc4155;\\wysh File "${1}";\\
2834 \\eval copy * "${2}"
2836 call mboxfix ./.tinv1 ./.tok' | ${MAILX} ${ARGS} > .tall 2>&1
2838 ${cat} ./.tinv1 ./.tok >> .tall
2839 check 14 - ./.tall '739301109 616'
2842 'wysh file ./.tinv1 # ^From not repaired, but missing trailing NL is
2843 wysh File ./.tok # Just move away to nowhere
2845 wysh file ./.tinv2 # Fully repaired
2846 File ./.tok' | ${MAILX} ${ARGS} >>${ERR} 2>&1
2848 check 15-1 - ./.tinv1 '3178048820 332'
2849 check 15-2 - ./.tinv2 '4151504442 314'
2856 if have_feat maildir; then :; else
2857 echo 'maildir: unsupported, skipped'
2861 TRAP_EXIT_ADDONS=".
/.t
*"
2865 while [ ${i} -lt 112 ]; do
2866 printf 'm file://%s\n~s Subject %s\nHello %s!\n~.\n' \
2867 "${MBOX}" "${i}" "${i}"
2870 ) | ${MAILX} ${ARGS}
2871 check 1 0 "${MBOX}" '2366902811 13332'
2877 ' "${MBOX}" .tmdir1 .tmdir1 |
2878 ${MAILX} ${ARGS} -Snewfolders=maildir -Sshowlast > .tlst
2879 check 2 0 .tlst '1713783045 9103'
2882 copy * "maildir
://%s
"
2885 ' "${MBOX}" .tmdir2 .tmdir2 |
2886 ${MAILX} ${ARGS} -Sshowlast > .tlst
2887 check 3 0 .tlst '1240307893 9113'
2889 printf 'File "maildir
://%s
"
2893 ' .tmdir2 .tmbox1 .tmbox1 |
2894 ${MAILX} ${ARGS} -Sshowlast > .tlst
2895 check 4 0 .tmbox1 '4096198846 12772'
2896 check 5 - .tlst '817337448 9110'
2898 # only the odd (even)
2900 printf 'File "maildir
://%s
"
2903 while [ ${i} -lt 112 ]; do
2905 [ ${j} -eq 1 ] && printf '%s ' "${i}"
2912 ) | ${MAILX} ${ARGS} -Sshowlast > .tlst
2913 check 6 0 .tmbox2 '4228337024 6386'
2914 check 7 - .tlst '884389294 4573'
2917 printf 'file "maildir
://%s
"
2920 while [ ${i} -lt 112 ]; do
2922 [ ${j} -eq 0 ] && [ ${i} -ne 0 ] && printf '%s ' "${i}"
2930 ' .tmbox2 .tmbox2 .tmdir2
2931 ) |
${MAILX} ${ARGS} -Sshowlast > .tlst
2932 check
8 0 .tmbox2
'978751761 12656'
2933 ${sed} 2d
< .tlst
> .tlstx
2934 check
9 - .tlstx
'2391942957 13645'
2940 # MIME and RFC basics {{{
2941 t_mime_if_not_ascii
() {
2942 t_prolog mime_if_not_ascii
2944 </dev
/null
${MAILX} ${ARGS} -s Subject "${MBOX}" >> "${MBOX}" 2>&1
2945 check 1 0 "${MBOX}" '3647956381 106'
2947 </dev/null ${MAILX} ${ARGS} -Scharset-7bit=not-ascii -s Subject "${MBOX}" \
2949 check
2 0 "${MBOX}" '3964303752 274'
2954 t_xxxheads_rfc2047
() {
2955 t_prolog xxxheads_rfc2047
2956 TRAP_EXIT_ADDONS
="./.t*"
2958 t_xmta
'GentianaLutea Mon Dec 04 17:15:29 2017'
2960 echo |
${MAILX} ${ARGS} ${ADDARG_UNI} \
2961 -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̲' \
2963 check
1 0 "${MBOX}" '3422562347 371'
2965 # Single word (overlong line split -- bad standard! Requires injection of
2966 # artificial data!! But can be prevented by using RFC 2047 encoding)
2968 i
=`${awk} 'BEGIN{for(i=0; i<92; ++i) printf "0123456789_"}'`
2969 echo |
${MAILX} ${ARGS} -s "${i}" "${MBOX}"
2970 check 2 0 "${MBOX}" '3317256266 1714'
2972 # Combination of encoded words, space and tabs of varying sort
2974 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
2975 -s "1Abrä Kaspas1
2Abra Katä b_kaspas2 \
2976 3Abrä Kaspas3
4Abrä Kaspas4
5Abrä Kaspas5 \
2977 6Abra Kaspas6
7Abrä Kaspas7
8Abra Kaspas8 \
2978 9Abra Kaspastäb4-3
10Abra Kaspas1 _
11Abra Katäb1 \
2979 12Abra Kadabrä
1 After Tab after Täb this is NUTS
" \
2981 check 3 0 "${MBOX}" '786672837 587'
2983 # Overlong multibyte sequence that must be forcefully split
2984 # todo This works even before v15.0, but only by accident
2986 echo | ${MAILX} ${ARGS} ${ADDARG_UNI} \
2987 -s "✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2988 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄\
2989 ✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄✄
" \
2991 check 4 0 "${MBOX}" '2889557767 655'
2995 echo | ${MAILX} ${ARGS} \
2996 -s "1-1 B2 B3 B4 B5 B6 B\
2997 1-2 B2 B3 B4 B5 B6 B\
2998 1-3 B2 B3 B4 B5 B6 B\
2999 1-4 B2 B3 B4 B5 B6 B\
3000 1-5 B2 B3 B4 B5 B6 B\
3001 1-6 B2 B3 B4 B5 B6
" \
3003 check 5 0 "${MBOX}" '3135161683 293'
3005 # Leading and trailing WS
3007 echo | ${MAILX} ${ARGS} \
3008 -s " 2-1 B2 B3 B4 B5 B6 B\
3009 1-2 B2 B3 B4 B5 B6 B\
3010 1-3 B2 B3 B4 B5 B6 B\
3011 1-4 B2 B3 B4 B5 B6
" \
3013 check 6 0 "${MBOX}" '3221845405 232'
3015 # RFC 2047 in an address field! (Missing test caused v14.9.6!)
3017 echo "Dat Früchtchen riecht häußlich
" |
3018 ${MAILX} ${ARGS} ${ADDARG_UNI} -Sfullnames -Smta=./.tmta.sh \
3020 'Schnödes "Früchtchen
" <do@du> (Hä!)'
3021 check 7 0 "${MBOX}" '800505986 368'
3023 # RFC 2047 in an address field, and iconv involved
3024 if have_feat iconv; then
3026 ${cat} > ./.trebox <<_EOT
3027 From zaza@exam.ple Fri Mar 2 21:31:56 2018
3028 Date: Fri, 2 Mar 2018 20:31:45 +0000
3029 From: z=?iso-8859-1?Q?=E1?=za <zaza@exam.ple>
3030 To: dude <dude@exam.ple>
3031 Subject: houston(...)
3032 Message-ID: <abra@1>
3034 Content-Type: text/plain; charset=iso-8859-1
3035 Content-Disposition: inline
3036 Content-Transfer-Encoding: 8bit
3039 echo reply | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3040 -Sfullnames -Sreply-in-same-charset \
3041 -Smta=./.tmta.sh -Rf ./.trebox
3042 check 8 0 "${MBOX}" '2914485741 280'
3044 echo 'xxxheads_rfc2047-8: iconv unsupported, skipped'
3050 t_iconv_mbyte_base64() { # TODO uses sed(1) and special *headline*!!
3051 t_prolog iconv_mbyte_base64
3052 TRAP_EXIT_ADDONS=".
/.t
*"
3054 if [ -n "${UTF8_LOCALE}" ] && have_feat iconv; then
3055 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1 ||
3056 (</dev/null iconv -f ascii -t euc-jp) >/dev/null 2>&1; then
3059 echo 'iconv_mbyte_base64: unsupported, skipped'
3063 echo 'iconv_mbyte_base64: unsupported, skipped'
3067 t_xmta 'DroseriaRotundifolia Thu Aug 03 17:26:25 2017'
3069 if (</dev/null iconv -f ascii -t iso-2022-jp) >/dev/null 2>&1; then
3070 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3072 -Sescape=! -Smime-encoding=base64 2>./.terr
3073 set ttycharset=utf-8 sendcharsets=iso-2022-jp
3075 !s Japanese from UTF-8 to ISO-2022-JP
3076 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3078 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3081 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3083 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの1種をシジュウカラと呼ぶ。
3086 set ttycharset=iso-2022-jp charset-7bit=iso-2022-jp sendcharsets=utf-8
3088 !s Japanese from ISO-2022-JP to UTF-8, eh, no, also ISO-2022-JP
3089 \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
3091 \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
3094 \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
3096 \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
3099 # May not presume iconv output as long as roundtrip possible [489a7122]
3101 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3102 < "${MBOX}" > .
/.tcksum
3103 check
1 - .
/.tcksum
'2694609714 520'
3104 check
2 - .
/.terr
'4294967295 0'
3106 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3107 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3108 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3109 -Rf "${MBOX}" >.
/.tlog
2>&1
3110 check
3 0 .
/.twrite
'1259742080 686'
3111 #check 4 - ./.tlog '3214068822 2123'
3112 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3113 check
4 - .
/.txlog
'3659773472 2035'
3115 echo 'iconv_mbyte_base64: ISO-2022-JP unsupported, skipping 1-4'
3118 if (</dev
/null
iconv -f ascii
-t euc-jp
) >/dev
/null
2>&1; then
3119 rm -f "${MBOX}" .
/.twrite
3120 ${cat} <<-'_EOT' | LC_ALL=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3122 -Sescape=! -Smime-encoding=base64
2>.
/.terr
3123 set ttycharset
=utf-8 sendcharsets
=euc-jp
3125 !s Japanese from UTF-8 to EUC-JP
3126 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3128 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3131 カンムリガラ(学名Parus cristatus)は、スズメ目シジュウカラ科に分類される鳥類の一種。
3133 シジュウカラ科(シジュウカラか、学名 Paridae)は、鳥類スズメ目の科である。シジュウカラ(四十雀)と総称されるが、狭義にはこの
1種をシジュウカラと呼ぶ。
3136 set ttycharset
=EUC-JP sendcharsets
=utf-8
3138 !s Japanese from EUC-JP to UTF-8
3139 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3141 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3144 ¥«¥ó¥à¥ê¥¬¥é¡Ê³Ø̾Parus cristatus¡Ë¤Ï¡¢¥¹¥º¥áÌÜ¥·¥¸¥å¥¦¥«¥é²Ê¤ËʬÎव¤ì¤ëÄ»Îà¤Î°ì¼ï¡£
3146 ¥·¥¸¥å¥¦¥«¥é²Ê¡Ê¥·¥¸¥å¥¦¥«¥é¤«¡¢³Ø̾ Paridae¡Ë¤Ï¡¢Ä»Îॹ¥º¥áÌܤβʤǤ¢¤ë¡£¥·¥¸¥å¥¦¥«¥é¡Ê»Í½½¿ý¡Ë¤ÈÁí¾Î¤µ¤ì¤ë¤¬¡¢¶¹µÁ¤Ë¤Ï¤³¤Î
1¼ï¤ò¥·¥¸¥å¥¦¥«¥é¤È¸Æ¤Ö¡£
3150 ${awk} 'BEGIN{h=1}/^$/{++h;next}{if(h % 2 == 1)print}' \
3151 < "${MBOX}" > .
/.tcksum
3152 check
5 - .
/.tcksum
'2870183985 473'
3153 check
6 - .
/.terr
'4294967295 0'
3155 printf 'eval f 1; eval write ./.twrite; eval type 1; eval type 2\n' |
3156 LC_ALL
=${UTF8_LOCALE} ${MAILX} ${ARGS} \
3157 -S headline
="%>%a%m %-18f %-16d %i%-s" \
3158 -Rf "${MBOX}" >.
/.tlog
2>&1
3159 check
7 0 .
/.twrite
'1259742080 686'
3160 #check 8 - ./.tlog '2506063395 2075'
3161 ${sed} -e '/^\[-- M/d' < .
/.tlog
> .
/.txlog
3162 check
8 - .
/.txlog
'2528199891 1988'
3164 echo 'iconv_mbyte_base64: EUC-JP unsupported, skipping 5-8'
3170 t_iconv_mainbody
() {
3171 t_prolog iconv_mainbody
3172 TRAP_EXIT_ADDONS
="./.t*"
3174 if [ -n "${UTF8_LOCALE}" ] && have_feat
iconv; then
3177 echo 'iconv_mainbody: unsupported, skipped'
3181 t_xmta
'HamamelisVirginiana Fri Oct 20 16:23:21 2017'
3183 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3184 -S charset-7bit
=us-ascii
-S charset-8bit
=utf-8 \
3185 -s '–' over-the@rain.bow
2>.
/.terr
3186 check
1 0 "${MBOX}" '3634015017 251'
3187 check
2 - .
/.terr
'4294967295 0'
3189 printf '–' |
${MAILX} ${ARGS} ${ADDARG_UNI} -Smta=.
/.tmta.sh \
3190 -S charset-7bit
=us-ascii
-S charset-8bit
=us-ascii \
3191 -s '–' over-the@rain.bow
2>.
/.terr
3193 check
3 - "${MBOX}" '3634015017 251'
3194 if have_feat uistrings
; then
3195 if have_feat docstrings
; then # xxx should not be like that
3196 check
4 - .
/.terr
'2579894983 148'
3198 check
4 - .
/.terr
'271380835 121'
3201 echo 'iconv_mainbody-4: unsupported, skipped'
3204 # The different iconv(3) implementations use different replacement sequence
3205 # types (character-wise, byte-wise, and the character(s) used differ)
3206 i
="${MAILX_ICONV_MODE}"
3207 if [ -n "${i}" ]; then
3208 printf 'p\nx\n' |
${MAILX} ${ARGS} -Rf "${MBOX}" >./.tout 2>./.terr
3210 check_ex0 5-1-estat ${j}
3211 check 5-1 - ./.terr '4294967295 0'
3212 if [ ${i} -eq 13 ]; then
3213 check 5-2 - ./.tout '189327996 283'
3214 elif [ ${i} -eq 12 ]; then
3215 check 5-3 - ./.tout '1959197095 283'
3216 elif [ ${i} -eq 3 ]; then
3217 check 5-4 - ./.tout '3196380198 279'
3219 check 5-5 - ./.tout '3760313827 279'
3222 echo 'iconv_mainbody-5: unsupported, skipped'
3228 t_binary_mainbody() {
3229 t_prolog binary_mainbody
3230 TRAP_EXIT_ADDONS=".
/.t
*"
3232 printf 'abra\0\nka\r\ndabra' |
3233 ${MAILX} ${ARGS} ${ADDARG_UNI} -s 'binary with carriage-return!' \
3235 check 1 0 "${MBOX}" '1629827 239'
3236 check 2 - ./.terr '4294967295 0'
3238 printf 'p\necho\necho writing now\nwrite ./.twrite\n' |
3239 ${MAILX} ${ARGS} -Rf \
3240 -Spipe-application/octet-stream="@
* ${cat} > .
/.tcat
" \
3241 "${MBOX}" >./.tall 2>&1
3242 check 3 0 ./.tall '733582513 319'
3243 check 4 - ./.tcat '3817108933 15'
3244 check 5 - ./.twrite '3817108933 15'
3249 t_C_opt_customhdr() {
3250 t_prolog C_opt_customhdr
3251 TRAP_EXIT_ADDONS=".
/.t
*"
3253 t_xmta 'CimicifugaRacemosa Mon Dec 25 21:33:40 2017'
3256 ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3257 -C 'C-One : Custom One Body' \
3258 -C 'C-Two:CustomTwoBody' \
3259 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3260 this-goes@nowhere >./.tall 2>&1
3262 ${cat} ./.tall >> "${MBOX}"
3263 check 1 0 "${MBOX}" '2400078426 195'
3266 printf 'm this-goes@nowhere\nbody\n!.
3268 m this-goes2@nowhere\nbody2\n!.
3269 set customhdr=%ccustom1 : custom1 body%c
3270 m this-goes2@nowhere\nbody2\n!.
3271 set customhdr=%ccustom1 : custom1\\, body , custom2: custom2 body%c
3272 m this-goes3@nowhere\nbody3\n!.
3274 ${MAILX} ${ARGS} -Smta=./.tmta.sh -Sescape=! \
3275 -C 'C-One : Custom One Body' \
3276 -C 'C-Two:CustomTwoBody' \
3277 -S customhdr='chdr1: chdr1 body, chdr2:chdr2 body' \
3280 ${cat} ./.tall >> "${MBOX}"
3281 check 2 0 "${MBOX}" '3546878678 752'
3287 # Operational basics with easy tests {{{
3290 TRAP_EXIT_ADDONS=".
/.t
*"
3292 t_xmta 'Hippocastanum Mon Jun 19 15:07:07 2017'
3294 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=./.tmta.sh > ./.tall 2>&1
3296 alias a1 ex2@a1.ple "EX3
<ex3@a1.ple
>"
3298 alias a2 ex1@a2.ple ex2@a2.ple ex3@a2.ple ex4@a2.ple
3300 alias a4 a5 ex1@a4.ple
3302 alias a6 a7 ex1@a6.ple
3316 check 1 0 "${MBOX}" '2496925843 272'
3317 check 2 - .tall '3548953204 152'
3319 # TODO t_alias: n_ALIAS_MAXEXP is compile-time constant,
3320 # TODO need to somehow provide its contents to the test, then test
3327 TRAP_EXIT_ADDONS=".
/.t
*"
3329 t_xmta 'Alchemilla Wed Apr 25 15:12:13 2017'
3331 printf 'm m1@e.t\nL1\nHy1\n~.\nm m2@e.t\nL2\nHy2\n~@ %s\n~.\n' \
3332 "${SRCDIR}snailmail.jpg" | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
3333 check
1 0 "${MBOX}" '1594682963 13520'
3335 if (echo |
gzip -c) >/dev
/null
2>&1; then
3337 printf 'File "%s"\ncopy 1 ./.t.mbox.gz\ncopy 2 ./.t.mbox.gz' \
3338 "${MBOX}" | ${MAILX} ${ARGS} \
3339 -X'filetype gz gzip\ -dc gzip\ -c'
3340 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3341 ${MAILX} ${ARGS} -X'filetype gz gzip\ -dc gzip\ -c'
3343 check 2 - ".
/.t.mbox
" '1594682963 13520'
3344 check 3 - ".
/.t.out
" '2392348396 102'
3346 echo 'filetype-2: unsupported, skipped'
3347 echo 'filetype-3: unsupported, skipped'
3352 printf 'File "%s
"\ncopy 1 ./.t.mbox.gz
3358 -X'filetype gz gzip\ -dc gzip\ -c' \
3359 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" \
3360 "echo eins
;echo zwei
;echo und mit
${sed} bist Du dabei
;${cat}"'
3361 printf 'File ./.t.mbox.gz\ncopy * ./.t.mbox\n' |
3363 -X'filetype gz gzip\ -dc gzip\ -c' \
3364 -X'filetype mbox.gz "${sed} 1,3d|
${cat}" kill\ 0'
3366 check 4 - ".
/.t.mbox
" '2886541147 27060'
3367 check 5 - ".
/.t.out
" '852335377 172'
3372 t_record_a_resend() {
3373 t_prolog record_a_resend
3374 TRAP_EXIT_ADDONS=".
/.t.record .
/.t.resent
"
3378 m %s\n~s Subject 1.\nHello.\n~.
3379 set record-files add-file-recipients
3380 m %s\n~s Subject 2.\nHello.\n~.
3382 resend 2 ./.t.resent
3383 Resend 1 ./.t.resent
3385 resend 2 ./.t.resent
3386 Resend 1 ./.t.resent
3387 ' ./.t.record "${MBOX}" "${MBOX}" "${MBOX}" |
3390 check 1 0 "${MBOX}" '2632690399 252'
3391 check 2 - .t.record '3337485450 456'
3392 check 3 - .t.resent '1560890069 640'
3399 TRAP_EXIT_ADDONS=".
/.tmta.sh .
/.t.mbox
"
3401 t_xmta 'Alchemilla Wed Apr 07 17:03:33 2017' ./.t.mbox
3404 ${MAILX} ${ARGS} -ef ./.t.mbox
3405 echo ${?} > "${MBOX}"
3407 printf 'm me@exam.ple\nLine 1.\nHello.\n~.\n' |
3408 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3409 printf 'm you@exam.ple\nLine 1.\nBye.\n~.\n' |
3410 ${MAILX} ${ARGS} -Smta=./.tmta.sh
3412 ${MAILX} ${ARGS} -ef ./.t.mbox 2>> "${MBOX}"
3413 echo ${?} >> "${MBOX}"
3414 ${MAILX} ${ARGS} -efL @t@me ./.t.mbox 2>> "${MBOX}"
3415 echo ${?} >> "${MBOX}"
3416 ${MAILX} ${ARGS} -efL @t@you ./.t.mbox 2>> "${MBOX}"
3417 echo ${?} >> "${MBOX}"
3418 ${MAILX} ${ARGS} -efL '@>@Line 1' ./.t.mbox 2>> "${MBOX}"
3419 echo ${?} >> "${MBOX}"
3420 ${MAILX} ${ARGS} -efL '@>@Hello.' ./.t.mbox 2>> "${MBOX}"
3421 echo ${?} >> "${MBOX}"
3422 ${MAILX} ${ARGS} -efL '@>@Bye.' ./.t.mbox 2>> "${MBOX}"
3423 echo ${?} >> "${MBOX}"
3424 ${MAILX} ${ARGS} -efL '@>@Good bye.' ./.t.mbox 2>> "${MBOX}"
3425 echo ${?} >> "${MBOX}"
3427 ${MAILX} ${ARGS} -fH ./.t.mbox >> "${MBOX}" 2>&1
3428 echo ${?} >> "${MBOX}"
3429 ${MAILX} ${ARGS} -fL @t@me ./.t.mbox >> "${MBOX}" 2>&1
3430 echo ${?} >> "${MBOX}"
3431 ${MAILX} ${ARGS} -fL @t@you ./.t.mbox >> "${MBOX}" 2>&1
3432 echo ${?} >> "${MBOX}"
3433 ${MAILX} ${ARGS} -fL '@>@Line 1' ./.t.mbox >> "${MBOX}" 2>&1
3434 echo ${?} >> "${MBOX}"
3435 ${MAILX} ${ARGS} -fL '@>@Hello.' ./.t.mbox >> "${MBOX}" 2>&1
3436 echo ${?} >> "${MBOX}"
3437 ${MAILX} ${ARGS} -fL '@>@Bye.' ./.t.mbox >> "${MBOX}" 2>&1
3438 echo ${?} >> "${MBOX}"
3439 ${MAILX} ${ARGS} -fL '@>@Good bye.' ./.t.mbox >> "${MBOX}" 2>>${ERR}
3440 echo ${?} >> "${MBOX}"
3442 check
1 - "${MBOX}" '1708955574 678'
3446 printf 'm me1@exam.ple\n~s subject cab\nLine 1.\n~.\n' |
3447 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3448 -r '' -X 'wysh set from=pony1@$LOGNAME'
3449 printf 'm me2@exam.ple\n~s subject bac\nLine 12.\n~.\n' |
3450 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3451 -r '' -X 'wysh set from=pony2@$LOGNAME'
3452 printf 'm me3@exam.ple\n~s subject abc\nLine 123.\n~.\n' |
3453 ${MAILX} ${ARGS} -Smta=.
/.tmta.sh \
3454 -r '' -X 'wysh set from=pony3@$LOGNAME'
3456 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3457 echo fh-test size; set autosort=size showname showto
3458 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3459 check
2-1 0 "${MBOX}" '512787278 418'
3461 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3462 echo fh-test subject; set autosort=subject showname showto
3463 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3464 check
2-2 0 "${MBOX}" '3606067531 421'
3466 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3467 echo fh-test from; set autosort=from showto
3468 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3469 check
2-3 0 "${MBOX}" '2506148572 418'
3471 ${MAILX} ${ARGS} -S folder-hook
=fh-test
-X 'define fh-test {
3472 echo fh-test to; set autosort=to showto
3473 }' -fH .
/.t.mbox
> "${MBOX}" 2>&1
3474 check
2-4 0 "${MBOX}" '1221542854 416'
3480 # Simple, if we need more here, place in a later vim fold!
3481 t_prolog q_t_etc_opts
3482 TRAP_EXIT_ADDONS
="./.t*"
3484 # Three tests for MIME encoding and (a bit) content classification.
3485 # At the same time testing -q FILE, < FILE and -t FILE
3486 t__put_body
> .
/.tin
3488 < .
/.tin
${MAILX} ${ARGS} ${ADDARG_UNI} \
3489 -a .
/.tin
-s "`t__put_subject`" "${MBOX}"
3490 check
1 0 "${MBOX}" '1088822685 6642'
3493 < /dev
/null
${MAILX} ${ARGS} ${ADDARG_UNI} \
3494 -a .
/.tin
-s "`t__put_subject`" -q .
/.tin
"${MBOX}"
3495 check
2 0 "${MBOX}" '1088822685 6642'
3498 ( echo "To: ${MBOX}" && echo "Subject: `t__put_subject`" && echo &&
3500 ) |
${MAILX} ${ARGS} ${ADDARG_UNI} -Snodot -a .
/.tin
-t
3501 check
3 0 "${MBOX}" '1088822685 6642'
3503 # Check comments in the header
3505 ${cat} <<-_EOT | ${MAILX} ${ARGS} -Snodot -t "${MBOX}"
3508 # Noch ein Kommentar
3510 # Nachgestelltes Kommentar
3514 check 4 0 "${MBOX}" '4161555890 124'
3519 t_message_injections() {
3520 # Simple, if we need more here, place in a later vim fold!
3521 t_prolog message_injections
3522 TRAP_EXIT_ADDONS=".
/.t
*"
3524 t_xmta 'Echinacea Tue Jun 20 15:54:02 2017'
3526 echo mysig > ./.tmysig
3528 echo some-body | ${MAILX} ${ARGS} -Smta=./.tmta.sh \
3529 -Smessage-inject-head=head-inject \
3530 -Smessage-inject-tail=tail-inject \
3531 -Ssignature=./.tmysig \
3532 ex@am.ple > ./.tall 2>&1
3533 check 1 0 "${MBOX}" '2434746382 134'
3534 check 2 - .tall '4294967295 0' # empty file
3537 ${cat} <<-_EOT > ./.template
3541 Subject: This subject is
3543 Body, body, body me.
3545 < ./.template ${MAILX} ${ARGS} -t -Smta=./.tmta.sh \
3546 -Smessage-inject-head=head-inject \
3547 -Smessage-inject-tail=tail-inject \
3548 -Ssignature=./.tmysig \
3550 check 3 0 "${MBOX}" '3114203412 198'
3551 check 4 - .tall '4294967295 0' # empty file
3557 # Relatively Simple, if we need more here, place in a later vim fold!
3558 t_prolog attachments
3559 TRAP_EXIT_ADDONS=".
/.t
*"
3561 t_xmta 'Cannabis Sun Feb 18 02:02:46 2018'
3563 ${cat} <<-_EOT > ./.tx
3564 From steffen Sun Feb 18 02:48:40 2018
3565 Date: Sun, 18 Feb 2018 02:48:40 +0100
3568 User-Agent: s-nail v14.9.7
3571 From steffen Sun Feb 18 02:48:42 2018
3572 Date: Sun, 18 Feb 2018 02:48:42 +0100
3575 User-Agent: s-nail v14.9.7
3580 printf 'att2-1\natt2-2\natt2-4\n' > ./'.t 2'
3581 printf 'att3-1\natt3-2\natt3-4\n' > ./.t3
3582 printf 'att4-1\natt4-2\natt4-4\n' > './.t 4'
3585 '!@ ./.t3 ".
/.t
4" ""
3593 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh \
3594 -a ./.t1 -a './.t 2' \
3595 -s attachment-test \
3596 ex@am.ple > ./.tall 2>&1
3597 check 1 0 "${MBOX}" '4107062253 634'
3598 if have_feat uistrings; then
3599 check 2 - .tall '1928331872 720'
3601 echo 'attachments-2: unsupported, skipped'
3607 !s This the subject is
3608 !@ ./.t3 "#2" "./.t 4" "#1" ""
3618 !@ .
/.t3
"#2" "./.t 4" "#1" ""
3626 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3635 !@ .
/.t3
"" "#2" "" "./.t 4" "" "#1" ""
3649 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3651 check 3 0 "${MBOX}" '798122412 2285'
3652 if have_feat uistrings; then
3653 check 4 - .tall '2526106274 1910'
3655 echo 'attachments-4
: unsupported
, skipped
'
3684 | ${MAILX} ${ARGS} -Sescape=! -Smta=./.tmta.sh -Rf ./.tx \
3686 check 5 0 "${MBOX}" '2165311808 2276'
3687 if have_feat uistrings; then
3688 check 6 - .tall '3662598562 509'
3690 echo 'attachments-6
: unsupported
, skipped
'
3697 # (after attachments)
3699 TRAP_EXIT_ADDONS="./.t*"
3702 mkdir ./.ttt || exit 1
3706 : > 'diet\ is \curd.txt
'
3707 : > 'diet
"is" curd.txt
'
3709 : > 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
3710 : > höde__tröge__müde__dätte__hätte__vuelle__guelle__aese__aesse__sauerliche__kräuter__österliche__grüße__mäh.txt
3711 : > hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt
3712 : > ✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt
3714 echo bla | ${MAILX} ${ARGS} ${ADDARG_UNI} \
3715 -a "./.ttt/ma'ger.txt
" -a ".
/.ttt
/mä
'ger.txt" \
3716 -a '.
/.ttt
/diet\ is \curd.txt
' -a '.
/.ttt
/diet
"is" curd.txt
' \
3717 -a ./.ttt/höde-tröge.txt \
3718 -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 \
3719 -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 \
3720 -a ./.ttt/hööööööööööööööööö_nöööööööööööööööööööööö_düüüüüüüüüüüüüüüüüüü_bäääääääääääääääääääääääh.txt \
3721 -a ./.ttt/✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆✆.txt \
3723 check 1 0 "${MBOX}" '3720896054 3088'
3725 # `resend' test, reusing
$MBOX
3726 printf "Resend ./.t2\nx\n" |
${MAILX} ${ARGS} -Rf "${MBOX}"
3727 check 2 0 ./.t2 '3720896054 3088'
3729 printf "resend .
/.t3
\nx
\n" | ${MAILX} ${ARGS} -Rf "${MBOX}"
3730 check
3 0 .
/.t3
'3979736592 3133'
3735 t_mime_types_load_control
() {
3736 t_prolog mime_types_load_control
3737 if have_feat uistrings
; then :; else
3738 echo 'mime_types_load_control: unsupported, skipped'
3741 TRAP_EXIT_ADDONS
="./.t*"
3743 ${cat} <<-_EOT > ./.tmts1
3744 @ application/mathml+xml mathml
3746 ${cat} <<-_EOT > ./.tmts2
3747 @ x-conference/x-cooltalk ice
3749 @ application/aga-aga aga
3752 ${cat} <<-_EOT > ./.tmts1.mathml
3753 <head>nonsense ML</head>
3755 ${cat} <<-_EOT > ./.tmts2.ice
3758 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.doom
3759 printf 'of which the c\x01rack is coming soon' > .
/.tmtsx.aga
3773 ' "${MBOX}" "${MBOX}" |
3775 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts2 \
3778 ${cat} "${MBOX}" >> .
/.tout
3779 check
1 - .
/.tout
'2716124839 2441'
3781 echo type |
${MAILX} ${ARGS} -R \
3782 -Smimetypes-load-control=f
=.
/.tmts1
,f
=.
/.tmts3 \
3783 -f "${MBOX}" >> .
/.tout
2>&1
3784 check
2 0 .
/.tout
'2093030907 3634'
3790 # Around state machine, after basics {{{
3793 TRAP_EXIT_ADDONS
="./.t*"
3795 t_xmta
'Valeriana Sat Jul 08 15:54:03 2017'
3797 ${cat} <<- '__EOT' | ${MAILX} ${ARGS} -Smta=.
/.tmta.sh
> .
/.tall
2>&1
3801 alternates a1@b1 a2@b2 a3@b3
3806 echo $?
/$^ERRNAME
<$rv>
3811 echo $?
/$^ERRNAME
<$rv>
3814 echo $?
/$^ERRNAME
<$rv>
3817 echo $?
/$^ERRNAME
<$rv>
3821 alternates a1@b1 a2@b2 a3@b3
3824 echo $?
/$^ERRNAME
<$rv>
3827 echo $?
/$^ERRNAME
<$rv>
3830 echo $?
/$^ERRNAME
<$rv>
3833 alternates a1@b1 a2@b2 a3@b3
3836 echo $?
/$^ERRNAME
<$rv>
3839 echo $?
/$^ERRNAME
<$rv>
3842 echo $?
/$^ERRNAME
<$rv>
3846 alternates a1@b1 a2@b2 a3@b3
3849 echo $?
/$^ERRNAME
<$rv>
3853 alternates a1@b1 a1@c1 a1@d1 a2@b2 a3@b3 a3@c3 a3@d3
3855 ~s all alternates
, only a1@b1 remains
3857 ~b a3@b3 a3@c3 a3@d3
3866 alternates a1@b1 a1@c1 a2@b2 a3@b3
3868 ~s a1@b1 a1@d1
, and a3@c3 a3@d3 remain
3870 ~b a3@b3 a3@c3 a3@d3
3877 alternates a1@b1 a2@b2 a3
; set allnet
3879 ~s all alternates via allnet
, only a1@b1 remains
3881 ~b a3@b3 a3@c3 a3@d3
3892 echo $?
/$^ERRNAME
<$rv>
3896 echo $?
/$^ERRNAME
<$rv>
3900 echo $?
/$^ERRNAME
<$rv>
3904 echo $?
/$^ERRNAME
<$rv>
3908 echo $?
/$^ERRNAME
<$rv>
3912 alternates a1@b1 a2@b2
3915 echo $?
/$^ERRNAME
<$rv>
3916 alternates a3@b3 a4@b4
3919 echo $?
/$^ERRNAME
<$rv>
3922 check
1 0 "${MBOX}" '142184864 515'
3923 if have_feat uistrings
; then
3924 check
2 - .tall
'1878598364 505'
3926 echo 'alternates-2: unsupported, skipped'
3929 # Automatic alternates, also from command line (freezing etc.)
3931 ${cat} <<- __EOT > ./.tin
3932 From trouble-report@desy Wed Jun 6 20:19:28 2018
3933 Date: Wed, 06 Jun 2018 19:58:02 +0200
3934 From: a@b.org, b@b.org, c@c.org
3937 Cc: a@b.org, c@c.org
3939 Message-ID: <20180606175802.dw-cn%a@b.org>
3949 a@b.org b@b.org c@c.org
3954 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3955 -S from
=a@b.org
,b@b.org
,c@c.org
-S sender
=a@b.org \
3956 -Rf .
/.tin
> .
/.tall
2>&1
3957 check
3 0 "${MBOX}" '287250471 256'
3958 check
4 - .tall
'4294967295 0'
3962 set from=a@b.org,b@b.org,c@c.org sender=a@b.org
3966 a@b.org b@b.org c@c.org
3971 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Sescape=! \
3972 -Rf .
/.tin
> .
/.tall
2>&1
3973 check
5 0 "${MBOX}" '2618762028 512'
3974 check
6 - .tall
'4294967295 0'
3976 # And more, with/out -r
3977 # TODO -r should be the Sender:, which should automatically propagate to
3978 # TODO From: if possible and/or necessary. It should be possible to
3979 # TODO suppres -r stuff from From: and Sender:, but fallback to special -r
3980 # TODO arg as appropriate.
3981 # TODO For now we are a bit messy
3984 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3985 -c a@b.example
,b@b.example
,c@c.example \
3986 -S from
=a@b.example
,b@b.example
,c@c.example \
3987 -S sender
=a@b.example \
3988 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
3989 check
7 0 "${MBOX}" '3510981487 192'
3990 check
8 - .tout
'2052716617 201'
3991 check
9 - .tall
'4294967295 0'
3993 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
3994 -c a@b.example
,b@b.example
,c@c.example \
3995 -S from
=a@b.example
,b@b.example
,c@c.example \
3996 -r a@b.example b@b.example .
/.tout
>.
/.tall
2>&1
3997 check
10 0 "${MBOX}" '2282326606 364'
3998 check
11 - .tout
'3213404599 382'
3999 check
12 - .tall
'4294967295 0'
4001 </dev
/null
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-s '-Sfrom + -r ++ test' \
4002 -c a@b.example
,b@b.example
,c@c.example \
4003 -S from
=a@b.example
,b@b.example
,c@c.example \
4004 -S sender
=a@b.example \
4005 b@b.example
>.
/.tall
2>&1
4006 check
13 0 "${MBOX}" '1460017970 582'
4007 check
14 - .tall
'4294967295 0'
4012 t_quote_a_cmd_escapes
() {
4013 t_prolog quote_a_cmd_escapes
4014 TRAP_EXIT_ADDONS
="./.t*"
4018 echo 'included file' > .
/.ttxt
4020 ${cat} <<-_EOT > ./.tmbox
4021 From neverneverland Sun Jul 23 13:46:25 2017
4022 Subject: Bugstop: five miles out 1
4023 Reply-To: mister originator1 <mr1@originator>
4024 From: mister originator1 <mr1@originator>
4025 To: bugstop-commit@five.miles.out
4027 In-reply-to: <20170719111113.bkcMz%laber1@backe.eu>
4028 Date: Wed, 19 Jul 2017 09:22:57 -0400
4029 Message-Id: <20170719132257.766AF781267-1@originator>
4032 That's appalling, I.
4034 From neverneverland Sun Jul 23 13:47:25 2017
4035 Subject: Bugstop: five miles out 2
4036 Reply-To: mister originator2 <mr2@originator>
4037 From: mister originator2 <mr2@originator>
4038 To: bugstop-commit@five.miles.out
4040 In-reply-to: <20170719111113.bkcMz%laber2@backe.eu>
4041 Date: Wed, 19 Jul 2017 09:23:57 -0400
4042 Message-Id: <20170719132257.766AF781267-2@originator>
4045 That's appalling, II.
4047 From neverneverland Sun Jul 23 13:48:25 2017
4048 Subject: Bugstop: five miles out 3
4049 Reply-To: mister originator3 <mr3@originator>
4050 From: mister originator3 <mr3@originator>
4051 To: bugstop-commit@five.miles.out
4053 In-reply-to: <20170719111113.bkcMz%laber3@backe.eu>
4054 Date: Wed, 19 Jul 2017 09:24:57 -0400
4055 Message-Id: <20170719132257.766AF781267-3@originator>
4058 That's appalling, III.
4063 set indentprefix=" |"
4070 headerpick type retain cc date from message-id reply-to subject to
4074 set quote=allheaders
4077 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4078 -Sescape=! -Sindentprefix=' >' \
4079 .
/.tmbox
>.
/.tall
2>&1
4081 ${cat} .
/.tall
>> "${MBOX}"
4082 check
1 0 "${MBOX}" '2181726970 2023'
4084 # ~@ is tested with other attachment stuff, ~^ is in compose_hooks
4087 set Sign=SignVar sign=signvar DEAD=./.ttxt
4088 headerpick type retain Subject
4090 !!1 Not escaped. And shell test last, right before !..
4091 !: echo 2 only echoed via colon
4092 !_ echo 3 only echoed via underscore
4094 !<! echo 5 shell echo included
4095 !| echo 6 pipecmd-pre; cat; echo 6 pipecmd-post
4096 7 and 8 are ~A and ~a:
4099 !b 9 added ~b cc <ex1@am.ple>
4100 !c 10 added ~c c <ex2@am.ple>
4107 14: ~f (headerpick: subject)
4111 16, 17: ~I Sign, ~i Sign
4132 set quote-inject-head quote-inject-tail indentprefix
4133 !:wysh set quote-inject-head=%%a quote-inject-tail=--%%r
4137 !:unset quote quote-inject-head quote-inject-tail
4142 24: ~s this new subject
4143 !s 24 did new ~s ubject
4144 !t 25 added ~t o <ex3@am.ple>
4149 and i ~w rite this out to ./.tmsg
4151 !:wysh set x=$escape;set escape=~
4152 ~!echo shell command output
4153 ~:wysh set escape=$x
4155 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Rf \
4156 -Sescape=! -Sindentprefix=' |' \
4157 .
/.tmbox
>.
/.tall
2>&1
4159 ${cat} .
/.tall
>> "${MBOX}"
4160 check
2 - "${MBOX}" '2613898218 4090'
4161 check
3 - .
/.tmsg
'2771314896 3186'
4166 t_compose_edits
() { # XXX very rudimentary
4167 t_prolog compose_edits
4168 TRAP_EXIT_ADDONS
="./.t*"
4170 ${cat} <<-_EOT > ./.ted.sh
4172 ${cat} <<-__EOT > \${1}
4185 # > All these are in-a-row!
4187 printf 'mail ./.tout\n~s This subject is\nThis body is\n~.' |
4188 ${MAILX} ${ARGS} -Seditheaders >.
/.tall
2>&1
4189 check
1 0 .
/.tout
'3993703854 127'
4190 check
2 - .
/.tall
'4294967295 0'
4192 ${mv} .
/.tall .
/.tout
4193 printf 'mail ./.tout\n~s This subject is\nThis body is\n~e\n~.' |
4194 ${MAILX} ${ARGS} -Seditheaders -SEDITOR=.
/.ted.sh
>.
/.tall
2>&1
4195 check
3 0 .
/.tout1
'285981670 116'
4196 check
4 - .
/.tout2
'285981670 116'
4197 check
5 - .
/.tout3
'285981670 116'
4198 check
6 - .
/.tout
'4294967295 0'
4199 check
7 - .
/.tall
'4294967295 0'
4200 ${rm} .
/.tout1 .
/.tout2 .
/.tout3
4202 # t_compose_hooks will test ~^ at edge
4203 ${mv} .
/.tout .
/.tout1
4204 ${mv} .
/.tall .
/.tout2
4206 mail ./.tout\n!s This subject is\nThis body is
4211 !^header insert fcc ./.tout
4212 !^header insert fcc .tout1
4213 !^header insert fcc ./.tout2
4216 !^header remove-at fcc 2
4217 !^header remove-at fcc 2
4221 !^header insert fcc ./.tout
4225 ' |
${MAILX} ${ARGS} -Sescape=! >.
/.tall
2>&1
4226 check
8 0 .
/.tout
'3993703854 127'
4227 check
9 - .
/.tout1
'4294967295 0'
4228 check
10 - .
/.tout2
'4294967295 0'
4229 check
11 - .
/.tall
'4280910245 300'
4231 # < No longer in-a-row
4233 ${cat} <<-_EOT | ${MAILX} ${ARGS} -t >.
/.tall
2>&1
4235 Subject
: Fcc via
-t test
4239 check
12 0 .
/.ttout
'1289478830 122'
4240 check
13 - .
/.tall
'4294967295 0'
4246 # Heavy use of/rely on state machine (behaviour) and basics {{{
4247 t_compose_hooks
() { # {{{ TODO monster
4248 t_prolog compose_hooks
4249 if have_feat uistrings
; then :; else
4250 echo 'compose_hooks: unsupported, skipped'
4253 TRAP_EXIT_ADDONS
="./.t*"
4255 t_xmta
'PrimulaVeris Wed Apr 10 22:59:00 2017'
4257 (echo line one
&&echo line two
&&echo line three
) > .
/.treadctl
4258 (echo echo four
&&echo echo five
&&echo echo six
) > .
/.tattach
4260 ${cat} <<'__EOT__' > ./.trc
4262 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4265 vput vexpr es substr "$1" 0 1
4270 define read_mline_res {
4271 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4272 echo $len/$es/$^ERRNAME: $hl
4273 if [ $es -ne $^ERR-NONE ]
4274 xcall bail read_mline_res
4276 \xcall read_mline_res
4281 echo "~^header list"; read hl; echo $hl;\
4282 call xerr "$hl" "in_addr ($xh) 0-1"
4284 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
4285 read es; echo $es; call xerr "$es" "ins_addr $xh 1-1"
4286 echo "~^header insert $xh <${xh}2@exam.ple>";\
4287 read es; echo $es; call xerr "$es" "ins_addr $xh 1-2"
4288 echo "~^header insert $xh ${xh}3@exam.ple";\
4289 read es; echo $es; call xerr "$es" "ins_addr $xh 1-3"
4290 echo "~^header list $xh"; read hl; echo $hl;\
4291 call xerr "$hl" "ins_addr $xh 1-4"
4292 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 1-5"
4295 if [ "$t_remove" == "" ]
4299 echo "~^header remove $xh"; read es; call xerr $es "ins_addr $xh 2-1"
4300 echo "~^header remove $xh"; read es; vput vexpr es substr $es 0 3
4302 xcall bail "ins_addr $xh 2-2"
4304 echo "~^header list $xh"; read es; vput vexpr es substr $es 0 3
4306 xcall bail "ins_addr $xh 2-3"
4308 echo "~^header show $xh"; read es; vput vexpr es substr $es 0 3
4310 xcall bail "ins_addr $xh 2-4"
4314 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
4315 read es; echo $es; call xerr "$es" "ins_addr $xh 3-1"
4316 echo "~^header insert $xh <${xh}2@exam.ple>";\
4317 read es; echo $es; call xerr "$es" "ins_addr $xh 3-2"
4318 echo "~^header insert $xh ${xh}3@exam.ple";\
4319 read es; echo $es; call xerr "$es" "ins_addr $xh 3-3"
4320 echo "~^header list $xh"; read hl; echo $hl;\
4321 call xerr "$hl" "ins_addr $xh 3-4"
4322 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 3-5"
4325 echo "~^header remove-at $xh 1"; read es;\
4326 call xerr $es "ins_addr $xh 3-6"
4327 echo "~^header remove-at $xh 1"; read es;\
4328 call xerr $es "ins_addr $xh 3-7"
4329 echo "~^header remove-at $xh 1"; read es;\
4330 call xerr $es "ins_addr $xh 3-8"
4331 echo "~^header remove-at $xh 1"; read es;\
4332 vput vexpr es substr $es 0 3
4334 xcall bail "ins_addr $xh 3-9"
4336 echo "~^header remove-at $xh T"; read es;\
4337 vput vexpr es substr $es 0 3
4339 xcall bail "ins_addr $xh 3-10"
4341 echo "~^header list $xh"; read es;\
4342 vput vexpr es substr $es 0 3
4344 xcall bail "ins_addr $xh 3-11"
4346 echo "~^header show $xh"; read es;\
4347 vput vexpr es substr $es 0 3
4349 xcall bail "ins_addr $xh 3-12"
4353 echo "~^header insert $xh diet <$xh@exam.ple> spliced";\
4354 read es; echo $es; call xerr "$es" "ins_addr $xh 4-1"
4355 echo "~^header insert $xh <${xh}2@exam.ple> (comment) \"Quot(e)d\"";\
4356 read es; echo $es; call xerr "$es" "ins_addr $xh 4-2"
4357 echo "~^header insert $xh ${xh}3@exam.ple";\
4358 read es; echo $es; call xerr "$es" "ins_addr $xh 4-3"
4359 echo "~^header list $xh"; read hl; echo $hl;\
4360 call xerr "$hl" "header list $xh 3-4"
4361 echo "~^header show $xh"; read es; call xerr $es "ins_addr $xh 4-5"
4364 echo "~^header remove-at $xh 3"; read es;\
4365 call xerr $es "ins_addr $xh 4-6"
4366 echo "~^header remove-at $xh 2"; read es;\
4367 call xerr $es "ins_addr $xh 4-7"
4368 echo "~^header remove-at $xh 1"; read es;\
4369 call xerr $es "ins_addr $xh 4-8"
4370 echo "~^header remove-at $xh 1"; read es;\
4371 vput vexpr es substr $es 0 3
4373 xcall bail "ins_addr $xh 4-9"
4375 echo "~^header remove-at $xh T"; read es;\
4376 vput vexpr es substr $es 0 3
4378 xcall bail "ins_addr $xh 4-10"
4380 echo "~^header list $xh"; read es;\
4381 vput vexpr es substr $es 0 3
4383 xcall bail "ins_addr $xh 4-11"
4385 echo "~^header show $xh"; read es;\
4386 vput vexpr es substr $es 0 3
4388 xcall bail "ins_addr $xh 4-12"
4392 wysh set xh=$1 mult=$2
4393 echo "~^header list"; read hl; echo $hl;\
4394 call xerr "$hl" "ins_ref ($xh) 0-1"
4396 echo "~^header insert $xh <$xh@exam.ple>";\
4397 read es; echo $es; call xerr "$es" "ins_ref $xh 1-1"
4399 echo "~^header insert $xh <${xh}2@exam.ple>";\
4400 read es; echo $es; call xerr "$es" "ins_ref $xh 1-2"
4401 echo "~^header insert $xh ${xh}3@exam.ple";\
4402 read es; echo $es; call xerr "$es" "ins_ref $xh 1-3"
4404 echo "~^header insert $xh <${xh}2@exam.ple>"; read es;\
4405 vput vexpr es substr $es 0 3
4407 xcall bail "ins_ref $xh 1-4"
4411 echo "~^header list $xh"; read hl; echo $hl;\
4412 call xerr "$hl" "ins_ref $xh 1-5"
4413 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 1-6"
4416 if [ "$t_remove" == "" ]
4420 echo "~^header remove $xh"; read es;\
4421 call xerr $es "ins_ref $xh 2-1"
4422 echo "~^header remove $xh"; read es;\
4423 vput vexpr es substr $es 0 3
4425 xcall bail "ins_ref $xh 2-2"
4427 echo "~^header list $xh"; read es;\
4428 vput vexpr es substr $es 0 3
4430 xcall bail "$es ins_ref $xh 2-3"
4432 echo "~^header show $xh"; read es;\
4433 vput vexpr es substr $es 0 3
4435 xcall bail "ins_ref $xh 2-4"
4439 echo "~^header insert $xh <$xh@exam.ple>";\
4440 read es; echo $es; call xerr "$es" "ins_ref $xh 3-1"
4442 echo "~^header insert $xh <${xh}2@exam.ple>";\
4443 read es; echo $es; call xerr "$es" "ins_ref $xh 3-2"
4444 echo "~^header insert $xh ${xh}3@exam.ple";\
4445 read es; echo $es; call xerr "$es" "ins_ref $xh 3-3"
4447 echo "~^header list $xh";\
4448 read hl; echo $hl; call xerr "$hl" "ins_ref $xh 3-4"
4449 echo "~^header show $xh";\
4450 read es; call xerr $es "ins_ref $xh 3-5"
4453 echo "~^header remove-at $xh 1"; read es;\
4454 call xerr $es "ins_ref $xh 3-6"
4455 if [ $mult -ne 0 ] && [ $xh != subject ]
4456 echo "~^header remove-at $xh 1"; read es;\
4457 call xerr $es "ins_ref $xh 3-7"
4458 echo "~^header remove-at $xh 1"; read es;\
4459 call xerr $es "ins_ref $xh 3-8"
4461 echo "~^header remove-at $xh 1"; read es;\
4462 vput vexpr es substr $es 0 3
4464 xcall bail "ins_ref $xh 3-9"
4466 echo "~^header remove-at $xh T"; read es;\
4467 vput vexpr es substr $es 0 3
4469 xcall bail "ins_ref $xh 3-10"
4471 echo "~^header show $xh"; read es;\
4472 vput vexpr es substr $es 0 3
4474 xcall bail "ins_ref $xh 3-11"
4478 echo "~^header insert $xh <$xh@exam.ple> ";\
4479 read es; echo $es; call xerr "$es" "ins_ref $xh 4-1"
4481 echo "~^header insert $xh <${xh}2@exam.ple> ";\
4482 read es; echo $es; call xerr "$es" "ins_ref $xh 4-2"
4483 echo "~^header insert $xh ${xh}3@exam.ple";\
4484 read es; echo $es; call xerr "$es" "ins_ref $xh 4-3"
4486 echo "~^header list $xh"; read hl; echo $hl;\
4487 call xerr "$hl" "ins_ref $xh 4-4"
4488 echo "~^header show $xh"; read es; call xerr $es "ins_ref $xh 4-5"
4491 if [ $mult -ne 0 ] && [ $xh != subject ]
4492 echo "~^header remove-at $xh 3"; read es;\
4493 call xerr $es "ins_ref $xh 4-6"
4494 echo "~^header remove-at $xh 2"; read es;\
4495 call xerr $es "ins_ref $xh 4-7"
4497 echo "~^header remove-at $xh 1"; read es;\
4498 call xerr $es "ins_ref $xh 4-8"
4499 echo "~^header remove-at $xh 1"; read es;\
4500 vput vexpr es substr $es 0 3
4502 xcall bail "ins_ref $xh 4-9"
4504 echo "~^header remove-at $xh T"; read es;\
4505 vput vexpr es substr $es 0 3
4507 xcall bail "ins_ref $xh 4-10"
4509 echo "~^header show $xh"; read es;\
4510 vput vexpr es substr $es 0 3
4512 xcall bail "ins_ref $xh 4-11"
4517 # In collect.c order
4519 call ins_ref sender 0 # Not a "ref", but works
4523 call ins_addr reply-To
4524 call ins_addr mail-Followup-to
4525 call ins_ref messAge-id 0
4526 call ins_ref rEfErEncEs 1
4527 call ins_ref in-Reply-to 1
4528 call ins_ref subject 1 # Not a "ref", but works (with tweaks)
4529 call ins_addr freeForm1
4530 call ins_addr freeform2
4532 echo "~^header show MAILX-Command"; read es; call xerr $es "t_header 1000"
4534 echo "~^header show MAILX-raw-TO"; read es; call xerr $es "t_header 1001"
4542 echo "~^attachment";\
4543 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4545 xcall bail "attach 0-1"
4548 echo "~^attach attribute ./.treadctl";\
4549 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4551 xcall bail "attach 0-2"
4553 echo "~^attachment attribute-at 1";\
4554 read hl; echo $hl; vput vexpr es substr "$hl" 0 3
4556 xcall bail "attach 0-3"
4559 echo "~^attachment insert ./.treadctl=ascii";\
4560 read hl; echo $hl; call xerr "$hl" "attach 1-1"
4561 echo "~^attachment list";\
4562 read es; echo $es;call xerr "$es" "attach 1-2"
4564 echo "~^attachment attribute ./.treadctl";\
4565 read es; echo $es;call xerr "$es" "attach 1-3"
4567 echo "~^attachment attribute .treadctl";\
4568 read es; echo $es;call xerr "$es" "attach 1-4"
4570 echo "~^attachment attribute-at 1";\
4571 read es; echo $es;call xerr "$es" "attach 1-5"
4574 echo "~^attachment attribute-set ./.treadctl filename rctl";\
4575 read es; echo $es;call xerr "$es" "attach 1-6"
4576 echo "~^attachment attribute-set .treadctl content-description Au";\
4577 read es; echo $es;call xerr "$es" "attach 1-7"
4578 echo "~^attachment attribute-set-at 1 content-id <10.du@ich>";\
4579 read es; echo $es;call xerr "$es" "attach 1-8"
4581 echo "~^attachment attribute ./.treadctl";\
4582 read es; echo $es;call xerr "$es" "attach 1-9"
4584 echo "~^attachment attribute .treadctl";\
4585 read es; echo $es;call xerr "$es" "attach 1-10"
4587 echo "~^attachment attribute rctl";\
4588 read es; echo $es;call xerr "$es" "attach 1-11"
4590 echo "~^attachment attribute-at 1";\
4591 read es; echo $es;call xerr "$es" "attach 1-12"
4595 echo "~^attachment insert ./.tattach=latin1";\
4596 read hl; echo $hl; call xerr "$hl" "attach 2-1"
4597 echo "~^attachment list";\
4598 read es; echo $es;call xerr "$es" "attach 2-2"
4600 echo "~^attachment attribute ./.tattach";\
4601 read es; echo $es;call xerr "$es" "attach 2-3"
4603 echo "~^attachment attribute .tattach";\
4604 read es; echo $es;call xerr "$es" "attach 2-4"
4606 echo "~^attachment attribute-at 2";\
4607 read es; echo $es;call xerr "$es" "attach 2-5"
4610 echo "~^attachment attribute-set ./.tattach filename tat";\
4611 read es; echo $es;call xerr "$es" "attach 2-6"
4613 "~^attachment attribute-set .tattach content-description Au2";\
4614 read es; echo $es;call xerr "$es" "attach 2-7"
4615 echo "~^attachment attribute-set-at 2 content-id <20.du@wir>";\
4616 read es; echo $es;call xerr "$es" "attach 2-8"
4618 "~^attachment attribute-set-at 2 content-type application/x-sh";\
4619 read es; echo $es;call xerr "$es" "attach 2-9"
4621 echo "~^attachment attribute ./.tattach";\
4622 read es; echo $es;call xerr "$es" "attach 2-10"
4624 echo "~^attachment attribute .tattach";\
4625 read es; echo $es;call xerr "$es" "attach 2-11"
4627 echo "~^attachment attribute tat";\
4628 read es; echo $es;call xerr "$es" "attach 2-12"
4630 echo "~^attachment attribute-at 2";\
4631 read es; echo $es;call xerr "$es" "attach 2-13"
4635 if [ "$t_remove" == "" ]
4639 echo "~^attachment remove ./.treadctl"; read es;\
4640 call xerr $es "attach 3-1"
4641 echo "~^attachment remove ./.tattach"; read es;\
4642 call xerr $es "attach 3-2"
4643 echo "~^ attachment remove ./.treadctl"; read es;\
4644 vput vexpr es substr $es 0 3
4646 xcall bail "attach 3-3"
4648 echo "~^ attachment remove ./.tattach"; read es;\
4649 vput vexpr es substr $es 0 3
4651 xcall bail "attach 3-4"
4653 echo "~^attachment list"; read es;\
4654 vput vexpr es substr $es 0 3
4656 xcall bail "attach 3-5"
4660 echo "~^attachment insert ./.tattach=latin1";\
4661 read hl; echo $hl; call xerr "$hl" "attach 4-1"
4662 echo "~^attachment insert ./.tattach=latin1";\
4663 read hl; echo $hl; call xerr "$hl" "attach 4-2"
4664 echo "~^attachment list";\
4665 read es; echo $es;call xerr "$es" "attach 4-3"
4667 echo "~^ attachment remove .tattach"; read es;\
4668 vput vexpr es substr $es 0 3
4670 xcall bail "attach 4-4 $es"
4672 echo "~^attachment remove-at T"; read es;\
4673 vput vexpr es substr $es 0 3
4675 xcall bail "attach 4-5"
4677 echo "~^attachment remove ./.tattach"; read es;\
4678 call xerr $es "attach 4-6"
4679 echo "~^attachment remove ./.tattach"; read es;\
4680 call xerr $es "attach 4-7"
4681 echo "~^ attachment remove ./.tattach"; read es;\
4682 vput vexpr es substr $es 0 3
4684 xcall bail "attach 4-8 $es"
4686 echo "~^attachment list"; read es;\
4687 vput vexpr es substr $es 0 3
4689 xcall bail "attach 4-9"
4693 echo "~^attachment insert ./.tattach=latin1";\
4694 read hl; echo $hl; call xerr "$hl" "attach 5-1"
4695 echo "~^attachment insert ./.tattach=latin1";\
4696 read hl; echo $hl; call xerr "$hl" "attach 5-2"
4697 echo "~^attachment insert ./.tattach=latin1";\
4698 read hl; echo $hl; call xerr "$hl" "attach 5-3"
4699 echo "~^attachment list";\
4700 read es; echo $es;call xerr "$es" "attach 5-4"
4703 echo "~^attachment remove-at 3"; read es;\
4704 call xerr $es "attach 5-5"
4705 echo "~^attachment remove-at 3"; read es;\
4706 vput vexpr es substr $es 0 3
4708 xcall bail "attach 5-6"
4710 echo "~^attachment remove-at 2"; read es;\
4711 call xerr $es "attach 5-7"
4712 echo "~^attachment remove-at 2"; read es;\
4713 vput vexpr es substr $es 0 3
4715 xcall bail "attach 5-8"
4717 echo "~^attachment remove-at 1"; read es;\
4718 call xerr $es "attach 5-9"
4719 echo "~^attachment remove-at 1"; read es;\
4720 vput vexpr es substr $es 0 3
4722 xcall bail "attach 5-10"
4725 echo "~^attachment list"; read es;\
4726 vput vexpr es substr $es 0 3
4728 xcall bail "attach 5-11"
4732 echo "~^attachment insert ./.tattach=latin1";\
4733 read hl; echo $hl; call xerr "$hl" "attach 6-1"
4734 echo "~^attachment insert ./.tattach=latin1";\
4735 read hl; echo $hl; call xerr "$hl" "attach 6-2"
4736 echo "~^attachment insert ./.tattach=latin1";\
4737 read hl; echo $hl; call xerr "$hl" "attach 6-3"
4738 echo "~^attachment list";\
4739 read es; echo $es;call xerr "$es" "attach 6-4"
4742 echo "~^attachment remove-at 1"; read es;\
4743 call xerr $es "attach 6-5"
4744 echo "~^attachment remove-at 1"; read es;\
4745 call xerr $es "attach 6-6"
4746 echo "~^attachment remove-at 1"; read es;\
4747 call xerr $es "attach 6-7"
4748 echo "~^attachment remove-at 1"; read es;\
4749 vput vexpr es substr $es 0 3
4751 xcall bail "attach 6-8"
4754 echo "~^attachment list"; read es;\
4755 vput vexpr es substr $es 0 3
4757 xcall bail "attach 6-9"
4769 echo on-compose-enter, mailx-command<$mailx-command>
4770 alternates alter1@exam.ple alter2@exam.ple
4772 set autocc='alter1@exam.ple alter2@exam.ple'
4773 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4774 echo mailx-subject<$mailx-subject>
4775 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4776 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4777 mailx-raw-bcc<$mailx-raw-bcc>
4778 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4779 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4782 echo on-compose-leave, mailx-command<$mailx-command>
4784 eval alternates $al alter3@exam.ple alter4@exam.ple
4786 set autobcc='alter3@exam.ple alter4@exam.ple'
4787 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4788 echo mailx-subject<$mailx-subject>
4789 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4790 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4791 mailx-raw-bcc<$mailx-raw-bcc>
4792 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4793 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4796 echo on-compose-cleanup, mailx-command<$mailx-command>
4799 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4800 echo mailx-subject<$mailx-subject>
4801 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4802 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4803 mailx-raw-bcc<$mailx-raw-bcc>
4804 echo mailx-orig-from<$mailx-orig-from> mailx-orig-to<$mailx-orig-to> \
4805 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
4807 wysh set on-compose-splice=t_ocs \
4808 on-compose-enter=t_oce on-compose-leave=t_ocl \
4809 on-compose-cleanup=t_occ
4812 printf 'm this-goes@nowhere\nbody\n!.\n' |
4813 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4814 -X'source ./.trc' -Smta=.
/.tmta.sh \
4816 ${cat} .
/.tall
>> "${MBOX}"
4817 check
1 0 "${MBOX}" '2481823179 10101'
4820 printf 'm this-goes@nowhere\nbody\n!.\n' |
4821 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
4822 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh \
4824 ${cat} .
/.tall
>> "${MBOX}"
4825 check
2 0 "${MBOX}" '3654000499 12535'
4829 # Some state machine stress, shell compose hook, localopts for hook, etc.
4830 # readctl in child. ~r as HERE document
4832 printf 'm ex@am.ple\nbody\n!.
4833 echon ${mailx-command}${mailx-subject}
4834 echon ${mailx-from}${mailx-sender}
4835 echon ${mailx-to}${mailx-cc}${mailx-bcc}
4836 echon ${mailx-raw-to}${mailx-raw-cc}${mailx-raw-bcc}
4837 echon ${mailx-orig-from}${mailx-orig-to}${mailx-orig-gcc}${mailx-orig-bcc}
4838 var t_oce t_ocs t_ocs_sh t_ocl t_occ autocc
4839 ' |
${MAILX} ${ARGS} -Snomemdebug -Sescape=! \
4843 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
4846 vput vexpr es substr "$1" 0 1
4851 define read_mline_res {
4852 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
4853 echo $len/$es/$^ERRNAME: $hl
4854 if [ $es -ne $^ERR-NONE ]
4855 xcall bail read_mline_res
4857 \xcall read_mline_res
4861 vput vexpr i + 1 "$2"
4863 vput vexpr j % $i 10
4870 eval \\$j _work $1 $i
4873 vput vexpr i + $i "$1"
4877 wysh set line; read line;wysh set es=$? en=$^ERRNAME ;\
4878 echo read:$es/$en: $line
4879 if [ "${es}" -ne -1 ]
4882 readctl remove $cwd/.treadctl; echo readctl remove:$?/$^ERRNAME
4887 echo "~^header list"; read hl; echo $hl;\
4888 vput vexpr es substr "$hl" 0 1
4890 xcall bail "header list"
4893 call _work 1; echo $?
4894 echo "~^header insert cc splicy diet <splice@exam.ple> spliced";\
4895 read es; echo $es; vput vexpr es substr "$es" 0 1
4897 xcall bail "be diet"
4899 echo "~^header insert cc <splice2@exam.ple>";\
4900 read es; echo $es; vput vexpr es substr "$es" 0 1
4902 xcall bail "be diet2"
4905 call _work 2; echo $?
4906 echo "~^header insert bcc juicy juice <juice@exam.ple> spliced";\
4907 read es; echo $es;vput vexpr es substr "$es" 0 1
4909 xcall bail "be juicy"
4911 echo "~^header insert bcc juice2@exam.ple";\
4912 read es; echo $es;vput vexpr es substr "$es" 0 1
4914 xcall bail "be juicy2"
4916 echo "~^header insert bcc juice3 <juice3@exam.ple>";\
4917 read es; echo $es;vput vexpr es substr "$es" 0 1
4919 xcall bail "be juicy3"
4921 echo "~^header insert bcc juice4@exam.ple";\
4922 read es; echo $es;vput vexpr es substr "$es" 0 1
4924 xcall bail "be juicy4"
4927 echo "~^header remove-at bcc 3";\
4928 read es; echo $es;vput vexpr es substr "$es" 0 1
4930 xcall bail "remove juicy5"
4932 echo "~^header remove-at bcc 2";\
4933 read es; echo $es;vput vexpr es substr "$es" 0 1
4935 xcall bail "remove juicy6"
4937 echo "~^header remove-at bcc 3";\
4938 read es; echo $es;vput vexpr es substr "$es" 0 3
4940 xcall bail "failed to remove-at"
4942 # Add duplicates which ought to be removed!
4943 echo "~^header insert bcc juice4@exam.ple";\
4944 read es; echo $es;vput vexpr es substr "$es" 0 1
4946 xcall bail "be juicy4-1"
4948 echo "~^header insert bcc juice4@exam.ple";\
4949 read es; echo $es;vput vexpr es substr "$es" 0 1
4951 xcall bail "be juicy4-2"
4953 echo "~^header insert bcc juice4@exam.ple";\
4954 read es; echo $es;vput vexpr es substr "$es" 0 1
4956 xcall bail "be juicy4-3"
4961 call _work 3; echo $?
4963 vput ! i echo just knock if you can hear me;\
4965 while [ $i -lt 24 ]; do printf "%s " $i; i=`expr $i + 1`; done;\
4967 echon shell-cmd says $?/$^ERRNAME: $i
4968 echo "~x will not become interpreted, we are reading until __EOT"
4970 read r_status; echo "~~r status output: $r_status"
4971 echo "~:echo $? $! $^ERRNAME"
4973 echo "~~r status from parent: $r_status"
4976 call _work 4; echo $?
4977 vput cwd cwd;echo cwd:$?
4978 readctl create $cwd/.treadctl ;echo readctl:$?/$^ERRNAME;\
4982 call _work 5; echo $?
4983 echo "~^header show MAILX-Command"; read es;\
4984 call xerr $es "t_header 1000"; call read_mline_res
4985 echo "~^header show MAILX-raw-TO"; read es;\
4986 call xerr $es "t_header 1001"; xcall read_mline_res
4988 echoerr IT IS WRONG IF YOU SEE THIS
4991 echo on-compose-enter, mailx-command<$mailx-command>
4992 set t_oce autobcc=oce@exam.ple
4993 alternates alter1@exam.ple alter2@exam.ple
4995 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
4996 echo mailx-subject<$mailx-subject>
4997 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
4998 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
4999 mailx-raw-bcc<$mailx-raw-bcc>
5000 echo mailx-orig-from<$mailx-orig-from> \
5001 mailx-orig-to<$mailx-orig-to> \
5002 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5005 echo on-compose-leave, mailx-command<$mailx-command>
5006 set t_ocl autocc=ocl@exam.ple
5008 alternates alter3@exam.ple alter4@exam.ple
5010 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5011 echo mailx-subject<$mailx-subject>
5012 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5013 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5014 mailx-raw-bcc<$mailx-raw-bcc>
5015 echo mailx-orig-from<$mailx-orig-from> \
5016 mailx-orig-to<$mailx-orig-to> \
5017 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5020 echo on-compose-cleanup, mailx-command<$mailx-command>
5021 set t_occ autocc=occ@exam.ple
5024 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5025 echo mailx-subject<$mailx-subject>
5026 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5027 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5028 mailx-raw-bcc<$mailx-raw-bcc>
5029 echo mailx-orig-from<$mailx-orig-from> \
5030 mailx-orig-to<$mailx-orig-to> \
5031 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5033 wysh set on-compose-splice=t_ocs \
5034 on-compose-splice-shell="read ver;echo t_ocs-shell;\
5035 echo \"~t shell@exam.ple\"; echo \"~:set t_ocs_sh\"" \
5036 on-compose-enter=t_oce on-compose-leave=t_ocl \
5037 on-compose-cleanup=t_occ
5040 ${cat} .
/.tnotes
>> "${MBOX}"
5041 check
3 - "${MBOX}" '679526364 2431'
5043 # Reply, forward, resend, Resend
5051 set from="du <f2@z>" stealthmua=noagent
5055 ' |
${MAILX} ${ARGS} -Smta=.
/.tmta.sh
-Snomemdebug -Sescape=!
5058 echo start: $? $! $^ERRNAME
5060 echo File: $? $! $^ERRNAME;echo;echo
5062 this is content of reply 1
5064 echo reply 1: $? $! $^ERRNAME;echo;echo
5066 this is content of Reply 1 2
5068 echo Reply 1 2: $? $! $^ERRNAME;echo;echo
5069 forward 1 fwdex@am.ple
5070 this is content of forward 1
5072 echo forward 1: $? $! $^ERRNAME;echo;echo
5073 wysh set forward-inject-head=$'"'"'-- \\
5074 forward (%%a)(%%d)(%%f)(%%i)(%%n)(%%r) --\\n'"'"'
5075 wysh set forward-inject-tail=$'"'"'-- \\
5076 end of forward (%%i) --\\n'"'"'
5077 forward 2 fwdex@am.ple
5078 this is content of forward 2
5080 echo forward 2: $? $! $^ERRNAME;echo;echo
5082 forward 2 fwdex2@am.ple
5083 this is content of forward 2, 2nd, with showname set
5085 echo forward 2, 2nd: $? $! $^ERRNAME;echo;echo
5086 resend 1 2 resendex@am.ple
5087 echo resend 1 2: $? $! $^ERRNAME;echo;echo
5088 Resend 1 2 Resendex@am.ple
5089 echo Resend 1 2: $? $! $^ERRNAME;echo;echo
5091 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sfullnames \
5095 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
5098 vput vexpr es substr "$1" 0 1
5103 define read_mline_res {
5104 read hl; wysh set len=$? es=$! en=$^ERRNAME;\
5105 echo mline_res:$len/$es/$^ERRNAME: $hl
5106 if [ $es -ne $^ERR-NONE ]
5107 xcall bail read_mline_res
5109 \xcall read_mline_res
5113 echo "~^header show $1"; read es;\
5114 call xerr $es "work_hl $1"; echo $1; call read_mline_res
5122 echo t_ocs version $ver
5123 echo "~^header list"; read hl; echo $hl;\
5124 echoerr the header list is $hl;\
5125 call xerr "$hl" "header list"
5126 eval vpospar set $hl
5129 echoerr IT IS WRONG IF YOU SEE THIS
5132 echo on-XY-enter, mailx-command<$mailx-command>
5133 set t_oce autobcc=oce@exam.ple
5134 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5135 echo mailx-subject<$mailx-subject>
5136 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5137 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5138 mailx-raw-bcc<$mailx-raw-bcc>
5139 echo mailx-orig-from<$mailx-orig-from> \
5140 mailx-orig-to<$mailx-orig-to> \
5141 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5144 echo on-XY-leave, mailx-command<$mailx-command>
5145 set t_ocl autocc=ocl@exam.ple
5146 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5147 echo mailx-subject<$mailx-subject>
5148 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5149 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5150 mailx-raw-bcc<$mailx-raw-bcc>
5151 echo mailx-orig-from<$mailx-orig-from> \
5152 mailx-orig-to<$mailx-orig-to> \
5153 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5156 echo on-XY-cleanup, mailx-command<$mailx-command>
5157 set t_occ autocc=occ@exam.ple
5158 echo mailx-from<$mailx-from> mailx-sender<$mailx-sender>
5159 echo mailx-subject<$mailx-subject>
5160 echo mailx-to<$mailx-to> mailx-cc<$mailx-cc> mailx-bcc<$mailx-bcc>
5161 echo mailx-raw-to<$mailx-raw-to> mailx-raw-cc<$mailx-raw-cc> \
5162 mailx-raw-bcc<$mailx-raw-bcc>
5163 echo mailx-orig-from<$mailx-orig-from> \
5164 mailx-orig-to<$mailx-orig-to> \
5165 mailx-orig-cc<$mailx-orig-cc> mailx-orig-bcc<$mailx-orig-bcc>
5167 wysh set on-compose-splice=t_ocs \
5168 on-compose-enter=t_oce on-compose-leave=t_ocl \
5169 on-compose-cleanup=t_occ \
5170 on-resend-enter=t_oce on-resend-cleanup=t_occ
5173 ${cat} .
/.tnotes
>> "${MBOX}"
5174 check
4 - "${MBOX}" '2151712038 11184'
5179 t_mass_recipients
() {
5180 t_prolog mass_recipients
5181 TRAP_EXIT_ADDONS
="./.t*"
5183 t_xmta
'Eucalyptus Sat Jul 08 21:14:57 2017'
5185 ${cat} <<'__EOT__' > ./.trc
5187 echoerr "Failed: $1. Bailing out"; echo "~x"; xit
5190 wysh set nr=$1 hn=$2
5191 echo "~$hn $hn$nr@$hn"; echo '~:echo $?'; read es
5193 xcall bail "ins_addr $hn 1-$nr"
5195 vput vexpr nr + $nr 1
5196 if [ "$nr" -le "$maximum" ]
5197 xcall ins_addr $nr $hn
5201 wysh set nr=$1 hn=$2
5202 alternates $hn$nr@$hn
5203 vput vexpr nr + $nr 2
5204 if [ "$nr" -le "$maximum" ]
5205 xcall bld_alter $nr $hn
5215 if [ "$t_remove" != '' ]
5220 set on-compose-splice=t_ocs on-compose-leave=t_ocl
5223 printf 'm this-goes@nowhere\nbody\n!.\n' |
5224 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5225 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
5228 ${cat} .
/.tall
>> "${MBOX}"
5229 check
1 - "${MBOX}" '2912243346 51526'
5232 printf 'm this-goes@nowhere\nbody\n!.\n' |
5233 ${MAILX} ${ARGS} -Snomemdebug -Sescape=! -Sstealthmua=noagent \
5234 -St_remove=1 -X'source ./.trc' -Smta=.
/.tmta.sh
-Smaximum=2001 \
5237 ${cat} .
/.tall
>> "${MBOX}"
5238 check
2 - "${MBOX}" '4097804632 34394'
5243 t_lreply_futh_rth_etc
() {
5244 t_prolog lreply_futh_rth_etc
5245 TRAP_EXIT_ADDONS
="./.t*"
5247 t_xmta
'HumulusLupulus Thu Jul 27 14:41:20 2017'
5249 ${cat} <<-_EOT > ./.tmbox
5250 From neverneverland Sun Jul 23 13:46:25 2017
5251 Subject: Bugstop: five miles out 1
5252 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5253 From: mister originator <mr@originator>
5254 To: bugstop-commit@five.miles.out, laber@backe.eu
5256 Mail-Followup-To: bugstop@five.miles.out, laber@backe.eu, is@a.list
5257 In-reply-to: <20170719111113.bkcMz%laber@backe.eu>
5258 Date: Wed, 19 Jul 2017 09:22:57 -0400
5259 Message-Id: <20170719132257.766AF781267@originator>
5262 > |Sorry, I think I misunderstand something. I would think that
5266 From neverneverland Fri Jul 7 22:39:11 2017
5267 Subject: Bugstop: five miles out 2
5268 Reply-To: mister originator2<mr2@originator>,bugstop@five.miles.out,is@a.list
5269 Content-Transfer-Encoding: 7bit
5270 From: mister originator <mr@originator>
5271 To: bugstop-commit@five.miles.out
5273 Message-ID: <149945963975.28888.6950788126957753723.reportbug@five.miles.out>
5274 Date: Fri, 07 Jul 2017 16:33:59 -0400
5277 capable of changing back.
5279 From neverneverland Fri Jul 7 22:42:00 2017
5280 Subject: Bugstop: five miles out 3
5281 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5282 Content-Transfer-Encoding: 7bit
5283 From: mister originator <mr@originator>
5284 To: bugstop-commit@five.miles.out
5286 Message-ID: <149945963975.28888.6950788126957753746.reportbug@five.miles.out>
5287 Date: Fri, 07 Jul 2017 16:33:59 -0400
5288 List-Post: <mailto:bugstop@five.miles.out>
5291 are you ready, boots?
5293 From neverneverland Sat Aug 19 23:15:00 2017
5294 Subject: Bugstop: five miles out 4
5295 Reply-To: mister originator2 <mr2@originator>, bugstop@five.miles.out
5296 Content-Transfer-Encoding: 7bit
5297 From: mister originator <mr@originator>
5298 To: bugstop@five.miles.out
5300 Message-ID: <149945963975.28888.6950788126qtewrqwer.reportbug@five.miles.out>
5301 Date: Fri, 07 Jul 2017 16:33:59 -0400
5302 List-Post: <mailto:bugstop@five.miles.out>
5305 are you ready, boots?
5310 ${cat} <<-'_EOT' | ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh \
5311 -Rf .
/.tmbox
>> "${MBOX}" 2>&1
5313 wysh
set m
="This is text of \"reply ${1}."
5324 echo -----After reply $1.1 - $1.3: $?/$^ERRNAME
5327 wysh set m="This is text of
\"Reply
${1}.
"
5333 echo -----After Reply
$1.
$2: $?
/$^ERRNAME
5342 wysh
set m
="This is text of \"Lreply ${1}." on-compose-splice
=_Lh n
=$2
5346 # We need two indirections for this test: one for the case that Lreply
5347 # fails because of missing recipients: we need to read EOF next, thus
5348 # place this in _Ls last; and second for the succeeding cases EOF is
5349 # not what these should read, so go over the backside and splice it in!
5351 echo -----After Lreply
$1.
$2: $?
/$^ERRNAME
5354 localopts call-fixate
yes
5356 call R
$1 1; call R
$1 2; call R
$1 3; call R
$1 4
5357 call L
$1 1; call L
$1 2; call L
$1 3
5360 echo;echo '===== CHANGING === '"$*"' =====';echo
5364 set from
=laber@backe.eu
5367 call tweak
set reply-to-honour
5369 call tweak
set followup-to
5371 call tweak
set followup-to-honour
5373 call tweak mlist bugstop@five.miles.out
5375 call tweak mlsubscribe bugstop@five.miles.out
5377 call tweak
set recipients-in-cc
5379 # While here, test that *fullnames* works (also here)
5382 This message should have
*fullnames
* in the header.
5387 if have_feat uistrings
; then
5388 check
1 - "${MBOX}" '1530821219 29859'
5390 echo 'lreply_futh_rth_etc-1: content test unsupported, skipped'
5395 ${cat} <<-_EOT > ./.tmbox
5396 From tom@i-i.example Thu Oct 26 03:15:55 2017
5397 Date: Wed, 25 Oct 2017 21:15:46 -0400
5398 From: tom <tom@i-i.example>
5399 To: Steffen Nurpmeso <steffen@sdaoden.eu>
5400 Cc: tom <tom@i-i.example>
5401 Subject: Re: xxxx yyyyyyyy configure does not really like a missing zzzzz
5402 Message-ID: <20171026011546.GA11643@i-i.example>
5403 Reply-To: tom@i-i.example
5404 References: <20171025214601.T2pNd%steffen@sdaoden.eu>
5405 In-Reply-To: <20171025214601.T2pNd%steffen@sdaoden.eu>
5408 The report's useful :-)
5411 # Let us test In-Reply-To: removal starts a new thread..
5412 # This needs adjustment of *stealthmua*
5413 argadd
='-Sstealthmua=noagent -Shostname'
5416 printf 'reply 1\nthread\n!.\n' |
5417 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5418 ${argadd} -Rf .
/.tmbox
> .tall
2>&1
5419 check
2 0 "${MBOX}" '3321764338 429'
5420 check
3 - .tall
'4294967295 0'
5422 printf 'reply 1\nnew <- thread!\n!||%s -e "%s"\n!.\n' \
5423 "${sed}" '/^In-Reply-To:/d' |
5424 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5425 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5426 check
4 0 "${MBOX}" '1682552516 763'
5427 check
5 - .tall
'4294967295 0'
5429 printf 'reply 2\nold <- new <- thread!\n!.\n' |
5430 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5431 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5432 check
6 0 "${MBOX}" '2900984135 1219'
5433 check
7 - .tall
'4294967295 0'
5435 printf 'reply 3\nnew <- old <- new <- thread!\n!|| %s -e "%s"\n!.\n' \
5436 "${sed}" '/^In-Reply-To:/d' |
5437 ${MAILX} ${ARGS} -Sescape=! -Smta=.
/.tmta.sh
-Sreply-to-honour \
5438 ${argadd} -Rf "${MBOX}" > .tall
2>&1
5439 check
8 0 "${MBOX}" '794031200 1567'
5440 check
9 - .tall
'4294967295 0'
5448 have_feat smime ||
{
5449 echo 's_mime: unsupported, skipped'
5454 TRAP_EXIT_ADDONS
="./.t.conf ./.tkey.pem ./.tcert.pem ./.tpair.pem"
5455 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.VERIFY ./.DECRYPT ./.ENCRYPT"
5456 TRAP_EXIT_ADDONS
="${TRAP_EXIT_ADDONS} ./.tmta.sh"
5458 ${cat} <<-_EOT > ./.t.conf
5461 default_keyfile = keyfile.pem
5462 distinguished_name = req_distinguished_name
5463 attributes = req_attributes
5467 [ req_distinguished_name ]
5474 emailAddress = test@localhost
5479 openssl req
-x509 -nodes -days 3650 -config .
/.t.conf \
5480 -newkey rsa
:1024 -keyout .
/.tkey.pem
-out .
/.tcert.pem
>>${ERR} 2>&1
5482 ${cat} .
/.tkey.pem .
/.tcert.pem
> .
/.tpair.pem
5485 echo bla |
${MAILX} ${ARGS} \
5486 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5487 -Ssmime-sign-digest=sha1 \
5488 -s 'S/MIME test' .
/.VERIFY
5492 /^Content-Description: /{ skip = 2; print; next }
5493 /^$/{ if(skip) --skip }
5496 < .
/.VERIFY
> "${MBOX}"
5497 check
1 - "${MBOX}" '335634014 644'
5499 printf 'verify\nx\n' |
5500 ${MAILX} ${ARGS} -Ssmime-ca-file=.
/.tcert.pem
-Serrexit \
5501 -R -f .
/.VERIFY
>>${ERR} 2>&1
5504 openssl smime
-verify -CAfile .
/.tcert.pem
-in .
/.VERIFY
>>${ERR} 2>&1
5507 # (signing +) encryption / decryption
5508 t_xmta
'Euphrasia Thu Apr 27 17:56:23 2017' .
/.ENCRYPT
5513 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5514 -Ssmime-sign-digest=sha1 \
5515 -Ssmime-sign -Ssmime-sign-cert=.
/.tpair.pem
-Sfrom=test@localhost \
5516 -s 'S/MIME test' recei@ver.com
5518 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5519 check
4 - "${MBOX}" '1937410597 327'
5521 printf 'decrypt ./.DECRYPT\nfi ./.DECRYPT\nverify\nx\n' |
5524 -Ssmime-ca-file=.
/.tcert.pem \
5525 -Ssmime-sign-cert=.
/.tpair.pem \
5526 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5530 /^Content-Description: /{ skip = 2; print; next }
5531 /^$/{ if(skip) --skip }
5534 < .
/.DECRYPT
> "${MBOX}"
5535 check
5 - "${MBOX}" '1019076159 931'
5537 (openssl smime
-decrypt -inkey .
/.tkey.pem
-in .
/.ENCRYPT |
5538 openssl smime
-verify -CAfile .
/.tcert.pem
) >>${ERR} 2>&1
5542 echo bla |
${MAILX} ${ARGS} \
5544 -Ssmime-force-encryption -Ssmime-encrypt-recei@ver.com
=.
/.tpair.pem \
5545 -Sfrom=test@localhost \
5546 -s 'S/MIME test' recei@ver.com
5548 ${sed} -e '/^$/,$d' < .
/.ENCRYPT
> "${MBOX}"
5549 check
7 - "${MBOX}" '1937410597 327'
5552 printf 'decrypt ./.DECRYPT\nx\n' |
${MAILX} ${ARGS} \
5554 -Ssmime-sign-cert=.
/.tpair.pem \
5555 -Serrexit -R -f .
/.ENCRYPT
>>${ERR} 2>&1
5556 check
8 0 "./.DECRYPT" '2624716890 422'
5558 openssl smime
-decrypt -inkey .
/.tkey.pem \
5559 -in .
/.ENCRYPT
>>${ERR} 2>&1
5566 # xxx Note: t_z() was the first test (series) written. Today many
5567 # xxx aspects are (better) covered by other tests above, some are not.
5568 # xxx At some future date and time, convert the last remains not covered
5569 # xxx elsewhere to a real t_* test and drop it
5573 # Test for [260e19d] (Juergen Daubert)
5574 echo body |
${MAILX} ${ARGS} "${MBOX}"
5575 check 4 0 "${MBOX}" '2948857341 94'
5577 # "Test
for" [d6f316a] (Gavin Troy)
5579 printf "m
${MBOX}\n~s subject1
\nEmail body
\n~.
\nfi
${MBOX}\np
\nx
\n" |
5580 ${MAILX} ${ARGS} ${ADDARG_UNI} -Spipe-text/plain="@* ${cat}" > "${BODY}"
5581 check
6 0 "${MBOX}" '3942990636 118'
5582 check
6-1 - "${BODY}" '3951695530 170'
5584 # "Test for" [c299c45] (Peter Hofmann) TODO shouldn't end up QP-encoded?
5587 for(i = 0; i < 10000; ++i)
5589 #printf "\xF0\x90\x87\x90"
5590 }' |
${MAILX} ${ARGS} ${ADDARG_UNI} -s TestSubject "${MBOX}"
5591 check 7 0 "${MBOX}" '1707496413 61812'
5597 # MIME encoding (QP) stress message subject
5598 printf 'Äbrä Kä?dä=brö Fü?di=bus? '\
5599 'adadaddsssssssddddddddddddddddddddd'\
5600 'ddddddddddddddddddddddddddddddddddd'\
5601 'ddddddddddddddddddddddddddddddddddd'\
5602 'dddddddddddddddddddd Hallelulja? Od'\
5603 'er?? eeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5604 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'\
5605 'eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee f'\
5606 'fffffffffffffffffffffffffffffffffff'\
5607 'fffffffffffffffffffff ggggggggggggg'\
5608 'ggggggggggggggggggggggggggggggggggg'\
5609 'ggggggggggggggggggggggggggggggggggg'\
5610 'ggggggggggggggggggggggggggggggggggg'\
5615 # MIME encoding (QP) stress message body
5617 'Ich bin eine DÖS-Datäi mit sehr langen Zeilen und auch '\
5618 'sonst bin ich ganz schön am Schleudern, da kannste denke '\
5619 "wasde willst
, gelle
, gelle
, gelle
, gelle
, gelle.
\r\n"\
5620 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
\r\n"\
5621 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1\r\n"\
5622 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12\r\n"\
5623 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123\r\n"\
5624 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234\r\n"\
5625 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345\r\n"\
5626 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456\r\n"\
5627 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
1234567\r\n"\
5628 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
12345678\r\n"\
5629 "Ich bin eine DÖS-Datäi mit langen Zeilen und auch sonst
123456789\r\n"\
5630 "Unn ausserdem habe ich trailing SP
/HT
/SP
/HT whitespace
\r\n"\
5631 "Unn ausserdem habe ich trailing HT
/SP
/HT
/SP whitespace
\r\n"\
5632 "auf den zeilen vorher.
\r\n"\
5633 "From am Zeilenbeginn und From der Mitte gibt es auch.
\r\n"\
5635 "Die letzte Zeile war nur ein Punkt.
\r\n"\
5637 "Das waren deren zwei.
\r\n"\
5639 "Die letzte Zeile war ein Leerschritt.
\n"\
5640 "=VIER
= EQUAL SIGNS
=ON A LINE
=\r\n"\
5643 "Die letzte Zeile war nur ein Punkt
, mit Unix Zeilenende.
\n"\
5645 "Das waren deren zwei. ditto.
\n"\
5647 "Unn ausseerdem habe ich trailing SP
/HT
/SP
/HT whitespace
\n"\
5648 "Unn ausseerdem habe ich trailing HT
/SP
/HT
/SP whitespace
\n"\
5649 "auf den zeilen vorher.
\n"\
5651 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
\n"\
5652 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.1"\
5654 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5656 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5658 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5660 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5662 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende
.12"\
5664 "QP am Zeilenende über soft-nl hinweg
\n"\
5665 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5667 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5669 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5671 "Ich bin eine ziemlich lange
, steile
, scharfe Zeile mit Unix Zeilenende.
"\
5673 "=VIER
= EQUAL SIGNS
=ON A LINE
=\n"\
5675 "Die letzte Zeile war ein Leerschritt.
\n"\
5680 # Test all configs TODO doesn't cover all *combinations*, stupid!
5684 ALWAYS = "OPT_AUTOCC
=1 OPT_AMALGAMATION
=1"
5685 NOTME["OPT_ALWAYS_UNICODE_LOCALE
"] = 1
5686 NOTME["OPT_CROSS_BUILD
"] = 1
5687 NOTME["OPT_AUTOCC
"] = 1
5688 NOTME["OPT_AMALGAMATION
"] = 1
5689 NOTME["OPT_DEBUG
"] = 1
5690 NOTME["OPT_DEVEL
"] = 1
5691 NOTME["OPT_ASAN_ADDRESS
"] = 1
5692 NOTME["OPT_ASAN_MEMORY
"] = 1
5693 NOTME["OPT_FORCED_STACKPROT
"] = 1
5694 NOTME["OPT_NOMEMDBG
"] = 1
5695 NOTME["OPT_NYD2
"] = 1
5700 MULCHOICE["OPT_IDNA
"] = "VAL_IDNA
"
5701 MULVALS["VAL_IDNA
"] = 1
5703 #VALKEYS[0] = "VAL_RANDOM
"
5704 VALVALS["VAL_RANDOM
"] = 1
5707 /^[[:space:]]*OPT_/{
5708 sub(/^[[:space:]]*/, "")
5709 # This bails for UnixWare 7.1.4 awk(1), but preceeding = with \
5710 # does not seem to be a compliant escape for =
5712 $1 = substr($1, 1, index($1, "=") - 1)
5714 OPTVALS[OPTNO++] = $1
5717 /^[[:space:]]*VAL_/{
5718 sub(/^[[:space:]]*/, "")
5719 val = substr($0, index($0, "=") + 1)
5721 val = substr(val, 2)
5722 val = substr(val, 1, length(val) - 1)
5724 $1 = substr($1, 1, index($1, "=") - 1)
5727 else if(VALVALS[$1]){
5728 VALKEYS[VALNO++] = $1
5733 function onepass(addons){
5734 a_onepass__worker(addons, "1", "0")
5735 a_onepass__worker(addons, "0", "1")
5737 function a_onepass__worker(addons, b0, b1){
5738 # Doing this completely sequentially and not doing make distclean in
5739 # between runs should effectively result in lesser compilations.
5740 # It is completely dumb nonetheless... TODO
5741 for(ono = 0; ono < OPTNO; ++ono){
5743 for(i = 0; i < ono; ++i){
5744 myconf = myconf " " OPTVALS[i] "=" b0 " "
5746 j = MULCHOICE[OPTVALS[i]]
5751 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5755 for(i = ono; i < OPTNO; ++i){
5756 myconf = myconf " " OPTVALS[i] "=" b1 " "
5758 j = MULCHOICE[OPTVALS[i]]
5763 myconf = myconf " " MULCHOICE[OPTVALS[i]] "=any
"
5769 myconf = VALKEYS[i] "=any
" myconf
5771 myconf = myconf " " ALWAYS " " addons
5776 i = split(MULVALS[mula], ia)
5780 print mula "=\"" j "\" " myconf
5786 # We cannot test NULL because of missing UI strings, which will end
5787 # up with different checksums
5788 print "CONFIG
=NULLI OPT_AUTOCC
=1"
5790 j = split(VALVALS[VALKEYS[i]], ia)
5794 print VALKEYS[i] "=\"" k "\" CONFIG
=NULLI OPT_AUTOCC
=1"
5797 print "CONFIG
=MINIMAL OPT_AUTOCC
=1"
5798 print "CONFIG
=NETSEND OPT_AUTOCC
=1"
5799 print "CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5801 j = split(VALVALS[VALKEYS[i]], ia)
5805 print VALKEYS[i] "=\"" k "\" CONFIG
=MAXIMAL OPT_AUTOCC
=1"
5808 print "CONFIG
=DEVEL OPT_AUTOCC
=1"
5809 print "CONFIG
=ODEVEL OPT_AUTOCC
=1"
5811 onepass("OPT_DEBUG
=1")
5814 ' | while read c; do
5815 [ -f mk-config.h ] && ${cp} mk-config.h .ccac.h
5816 printf "\n\n##########\n$c\n"
5817 printf "\n\n##########\n$c\n" >&2
5818 ${SHELL} -c "cd .. && ${MAKE} ${c} config
"
5819 if [ -f .ccac.h ] && ${cmp} mk-config.h .ccac.h; then
5820 printf 'Skipping after config, nothing changed\n'
5821 printf 'Skipping after config, nothing changed\n' >&2
5824 ${SHELL} -c "cd ..
/ && ${MAKE} build
test"
5827 cd .. && ${MAKE} distclean
5830 [ -n "${ERR}" ] && echo > ${ERR}
5831 if [ -z "${CHECK_ONLY}${MAE_TEST}" ]; then
5833 elif [ -z "${MAE_TEST}" ] || [ ${#} -eq 0 ]; then
5834 # if have_feat devel; then
5835 # ARGS="${ARGS} -Smemdebug"
5841 while [ ${#} -gt 0 ]; do
5847 [ ${ESTAT} -eq 0 ] && echo Ok || echo >&2 'Errors occurred'