2 > # These expansions can test variables in the configuration, but as there
3 > # is no message being processed, there is no message-related data. But
4 > # that of course gets tested in plenty of other places.
6 > # Some fixed variables
8 > exim_path: TESTSUITE/eximdir/exim
10 > config_dir: TESTSUITE
11 > config_file: TESTSUITE/test-config
12 > primary_hostname: myhost.test.ex
13 > primary_hostname: myhost.test.ex
14 > qualify_domain: myhost.test.ex
15 > bounce_return_size_limit: 102400
16 > spool_directory: TESTSUITE/spool
18 > Failed: unknown variable in "${unknown}"
19 > h_subject: (should be empty)
20 > h_subject: (should be empty)
21 > Failed: unknown expansion operator "header_subject"
23 > # $message_headers should be empty
30 > # Overlong names and overbig numbers
32 > Failed: unknown variable name "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
33 > Failed: unknown variable in "${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}"
47 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "")
51 > Failed: error in expression evaluation: expecting closing parenthesis (after processing "-2 - (-3")
52 > Failed: error in expression evaluation: expecting operator (after processing "-2 - -3")
58 > Failed: error in expression evaluation: expecting operator (after processing "0")
61 > Failed: error in expression evaluation: expecting operator (after processing "0")
85 > map: ::a::: ::b::: ::c::
93 > # Check for extract corrupting reduce's
96 > listnamed: *.aa.bb : ^\Nxxx(.*)
97 > listnamed: *.aa.bb : ^\Nxxx(.*)
98 > listnamed: V4NET.11.12.13 : iplsearch;TESTSUITE/aux-fixed/0002.iplsearch
99 > listnamed: *.aa.bb : ^\Nxxx(.*) : ;;
100 > listnamed: a : b;c : *.aa.bb : ^\Nxxx(.*) : ;; : 2001::630::212::8::204::::b664
101 > Failed: "nolist" is not a named list
102 > listnamed: *.aa.bb : ^\Nxxx(.*)
103 > Failed: "hlist" is not a domain named list
104 > Failed: bad suffix on "list" operator
116 > Failed: "listextract" failed and "fail" requested
120 > listquote: ::a::b::c::d::
121 > listquote: ab::::cd
130 > sort: 10 smtp.ex.com:100 r2.ex.com:666 r99.ex.com
131 > sort: 10,smtp.ex.com:100,r2.ex.com:666,r99.ex.com
134 > # Tests with iscntrl() and illegal separators
141 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "0+") inside "reduce" item
148 > Failed: Not enough arguments for 'acl' (min is 1)
149 > Failed: Not enough arguments for 'acl' (min is 1)
150 > Failed: ERROR from acl "a_nosuch"
152 > acl: (1) [person@dom.ain] []
153 > acl: (2) [firstarg] [secondarg]
154 > acl: (1) [arg with spaces] []
158 > acl: (1) [person@dom.ain] []
159 > Failed: DEFER from acl "a_defer"
160 > acl: (2) [new arg1] [top_arg_1]
161 > acl: (1) [1] [] (1) [2] [] (1) [3] [] (1) [4] []
163 > addrss: local-part@dom.ain
164 > addrss: local-part@dom.ain
165 > addrss: local-part@dom.ain
166 > addrss: local-part@dom.ain
167 > addrss: local-part@dom.ain
168 > addrss: local-part.dot-atom@dom.ain
169 > addrss: local-part@dom.ain
175 > addresses: ''abc@xyz' ''pqr@xyz
176 > addresses: local-part@dom.ain
177 > addresses: local-part@dom.ain+xyz@abc
178 > addresses: local-part@dom.ain:xyz@abc:p@q:r@s
180 > Failed: output separator missing in expanding ${addresses:>}
182 > escape: B7\267F2\362
183 > excape8bit: undisturbed text tab
184 newline tab\134backslash ~tilde\177DEL\200\201.
186 > expand: $primary_hostname myhost.test.ex
187 > hash: jmg monty fbWx
188 > hash: abcX abX aX X
193 > Failed: "1a2b3c4d5e6" contains an odd number of characters
194 > Failed: "1a2b3c4d5e6g" is not a hex string
195 > hex2b64:MPPJPkZDbetYunCBao7BJA==
196 > hex2b64:ztcfpyNSMb7Tg/rP3EHE3cwi7PE=
203 > Failed: argument for base32 operator is "0x1", which is not a decimal number
210 > Failed: argument for base32d operator is "ABC", which is not a base 32 number
212 > the base62 operator is actually a base36 operator in the Darwin and Cygwin
213 > environments. Write cunning tests that produce the same output in both cases,
214 > while doing a reasonable check.
219 > Failed: argument for base62 operator is "12345x", which is not a decimal number
220 > Failed: argument for base62d operator is "0003D7.", which is not a base 36/62 number
222 > hmac: dd97e3ba5d1a61b5006108f8c8252953
223 > hmac: 0210cf9d274b53f1550f657c378b29e8bfed1064
224 > md5: 77add1d5f41223d5582fca736a5cb335
225 > sha1: DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
226 > sha1: A9993E364706816ABA3E25717850C26C9CD0D89D
227 > mask: 192.168.10.192/28
228 > mask: 192.168.10.206/32
229 > Failed: mask value too big in "192.168.10.206/33"
231 > Failed: missing mask value in "192.168.10.206"
232 > Failed: "a.b.c.d" is not an IP address
233 > mask: 2a00.0002.0003.0004.0004.0000.0000.0000/79
234 > mask_n: 2a00:2:3:4:4::/79
235 > ipv6denorm: 0000:0000:0000:0000:0000:0000:0000:0001
236 > ipv6denorm: fe00:0000:0000:0000:0000:0000:0000:0001
237 > ipv6denorm: 0000:0000:0000:0000:0000:ffff:c0a8:0001
238 > ipv6denorm: fe80:0000:0000:0000:0000:0000:c0a8:0001
242 > ipv6norm: 2a00:eadf::1:0
243 > ipv6norm: 2a00:eadf:0:1::
245 > ipv6norm: 2a00:2:3:4:5:6:7:8trailing_text
247 > lc/uc: the quick BROWN FOX
248 > length: The quick abc
253 > quote: aZ09_.-Q "ab*cd" "abcd\"ef"
259 > quote_local_part: abcd
260 > quote_local_part: O'Reilly
261 > quote_local_part: "a space"
262 > quote_local_part: ".something"
263 > quote_local_part: "something."
264 > quote_local_part: joe.bloggs
265 > quote_local_part: a!b
266 > quote_local_part: "x@y"
267 > quote_local_part: ab*cd
268 > quote_local_part: "x:y"
269 > quote_local_part: "abcd\"ef"
270 > quote_local_part: ""
271 > rxquote:aZ09\_\,\-Q ab\*cd abcd\"ef
272 > hexquote: \x01\x02\x03\x04\x05\x06\x07\x20\x08\x09\x0a\x0b\x0c\x0d\x0e\x0f\x20\x10\x11\x12\x13\x14\x15\x16\x17\x20\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f\x20\x20!"#$%&'\x20()*+,-./\x2001234567\x2089:;<=>?\x20@ABCDEFG\x20HIJKLMNO\x20PQRSTUVW\x20XYZ[\]^_\x20`abcdefg\x20hijklmno\x20pqrstuvw\x20xyz{|}~\x7f
278 > str2b64:VGhlIHF1aWNrIGJyb3duIAogZm94
280 > base64: VGhlIHF1aWNrIGJyb3duIAogZm94
282 > base64d:The quick brown
291 > Failed: string "14" is not an Exim time interval in "time_eval" operator
292 > Failed: string "rhubarb" is not an Exim time interval in "time_eval" operator
295 > time_interval: 1w4d13h46m39s
296 > Failed: string "-1" is not a positive number in "time_interval" operator
297 > Failed: string "rhubarb" is not a positive number in "time_interval" operator
299 > # stat is a bit tricky, but some of the fields of the aux-var directory
300 > # should be the same on all systems
304 > Failed: stat(/a/non/existent/file) failed: No such file or directory
306 > # "Operators" that have expanded arguments
308 > hash: jmg monty fbWx
309 > hash: abcX abX aX X
311 > length: The quick abc
317 > Failed: Not enough arguments for 'hash' (min is 2)
318 > Failed: "nonnumber" is not a number (in "hash" expansion)
319 > Failed: Too many arguments for 'hash' (max is 3)
320 > Failed: "-2" is not a positive number (in "substr" expansion)
322 > # Skipped operators
332 > # Number suffixes in conditions
339 > # >32b should work, >64b not
345 > 1 > 4611686018427387904 n
346 > Failed: absolute value of integer "46116860184273879040" is too large (overflow)
376 > Failed: invalid integer "3z "
377 > Failed: integer expected but "a" found
378 > Failed: integer expected but "${substr_2_2:65535}" found
388 > Failed: unknown variable "post" after "def:"
391 > Failed: curly-bracket problem in conditional yes/no parsing: 'yes' part did not start with '{'
392 remaining string is ':{y}{n}}'
421 > isip: n ::1.2.3.256
429 > isip: y fe80::a00:20ff:fe86:a061
430 > isip4: n fe80::a00:20ff:fe86:a061
431 > isip6: y fe80::a00:20ff:fe86:a061
432 > isip: y fe80::1.2.3.4
440 > Failed: "if" failed and "fail" requested
449 > >x@zz.aa.bb< [zz] >x@zz.aa.bb<
451 > >x@xxxabc< [abc] >x@xxxabc<
456 > match_local_part:yes
457 > match_local_part:yes
469 > Failed: "somename" is not an IP address
478 > queue_running after or: y
479 > first_delivery after or: y
481 > # acl expansion condition
482 > acl if: Y:(0) [] []
483 > acl if: Y:(1) [argY] []
484 > acl if: N:(2) [argN] [arg2]
485 > Failed: DEFER from acl "a_defer"
487 > # Default values for both if strings
489 > ${if eq{1}{1}} >true<
492 > # Lookups: DIR is the testing directory. In this test we can only use the
493 > # lookups that are required in all cases.
513 > Failed: "lookup" failed and "fail" requested
516 > a.b.c.d: data for a.b.c.d
518 > *.p.q: data for *.p.q
519 > *.p.q: data for *.p.q
520 > *.p.q: data for *.p.q
521 > Failed: "lookup" failed and "fail" requested
527 > q4: "a:b" abc continued data (make sure not key)
535 > q4f: a:b "a:b" abc continued data (make sure not key)
536 > q5f: "quoted" "\"quoted\""
537 > q6f: white space "white space"
548 > a:b: lookup succeeded
554 > # Should give the same results as above because expansion does nothing
564 > a:b: lookup succeeded
566 > # Should fail because of no expansion
573 > # But these should succeed
578 > # Some tests of case-(in)dependence
580 > .MiXeD-CD: Data found for case-dependent MiXeD-CD
581 > .MixeD-CD: NOT FOUND
582 > .MiXeD-Ncd: Data found for case-independent MiXeD-nCD
583 > .MixeD-Ncd: Data found for case-independent MiXeD-nCD
585 > # IP address (CIDR) lookups
587 > 1.2.3.4: data for 1.2.3.4
589 > 1.2.3.5: data for *
590 > abcd::cdab: data for abcd::cdab
591 > 192.168.1.2: data for 192.168.0.0/16
592 > 192.168.5.6: data for 192.168.0.0/16
593 > abcd:abcd:: data for abcd:abcd::/32
594 > abcd:abcd:1:: data for abcd:abcd::/32
595 > abcd:abcd::3 data for abcd:abcd::/32
596 > Failed: lookup of "rhubarb" gave DEFER: "rhubarb" is not a valid iplsearch key (an IP address, with optional CIDR mask, is wanted): in a host list, use net-iplsearch as the search type
599 > # Nested Lookups - style 1
601 > The data for key1->key2
602 > Failed: "lookup" failed and "fail" requested
604 > # Nested Lookups - style 2
606 > The data for key1->key2
609 > # Other nesting tests
613 > both-in-1,both-in-2
614 > Failed: "lookup" failed and "fail" requested
616 > # Lookup quotes for standardly expected lookups
618 > lsearch !@#$%^&*()_-+=|\~`1234567890{[}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm
619 > Failed: unknown lookup type "xxx"
635 > Failed: "extract" failed and "fail" requested
636 > Failed: "extract" failed and "fail" requested
647 > Failed: first argument of "extract" must not be empty
648 > Failed: first argument of "extract" must not be empty
652 > Failed: missing '}' closing extract inside "map" item
657 > abcdea aaa xyz zbcdez
660 > abcdea abc z zzzdez
663 > "TrUe" true EXPECT: true
664 > "FALSE" false EXPECT: false
665 > " yes" true EXPECT: true
666 > " no" false EXPECT: false
667 > "yes " true EXPECT: true
668 > "-1" true EXPECT: true
669 > "0" false EXPECT: false
670 > "1" true EXPECT: true
671 > " 0 " false EXPECT: false
672 > " 1 " true EXPECT: true
673 > "1111111111111111111" true EXPECT: true
674 > "9" true EXPECT: true
675 > " " false EXPECT: false
676 > Failed: unrecognised boolean value "text"
677 > Failed: unrecognised boolean value "text"
678 > Failed: unrecognised boolean value "-text"
679 > Failed: unrecognised boolean value "text"
680 > Failed: unrecognised boolean value "text"
681 > "00" false EXPECT: false
682 > "!true" false EXPECT: false
683 > "!false" true EXPECT: true
685 > "TrUe" true EXPECT: true
686 > "FALSE" false EXPECT: false
687 > " yes" true EXPECT: true
688 > " no" false EXPECT: false
689 > "yes " true EXPECT: true
690 > "-1" true EXPECT: true
691 > "0" false EXPECT: false
692 > "1" true EXPECT: true
693 > " 0 " false EXPECT: false
694 > " 1 " true EXPECT: true
695 > "1111111111111111111" true EXPECT: true
696 > "9" true EXPECT: true
697 > " " false EXPECT: false
698 > "text" true EXPECT: true
699 > " text" true EXPECT: true
700 > "text " true EXPECT: true
701 > " text " true EXPECT: true
702 > "00" true EXPECT: true
703 > "!true" false EXPECT: false
704 > "!false" true EXPECT: true
709 > <:abcd:> =?iso-8859-8?Q?=3C=3Aabcd=3A=3E?=
710 > <:ab cd:> =?iso-8859-8?Q?=3C=3Aab_cd=3A=3E?=
711 > long: =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_ov?= =?iso-8859-8?Q?er_the_75-char_limit?=
712 > long: =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_ov?= =?iso-8859-8?Q?er_the_75-char_limit_by_a_long_way=3B_in_fact_this_on?= =?iso-8859-8?Q?e_will_go_over_the_150_character_limit?=
718 > <:ab cd:> <:ab cd:>
719 > Long: here we go: a string that is going to be encoded: it will go over the 75-char limit
720 > Long: here we go: a string that is going to be encoded: it will go over the 75-char limit by a long way; in fact this one will go over the 150 character limit
730 > ${sg{abcdefabcdef}{abc}{xyz}} =xyzdefxyzdef
731 > ${sg{ab:xy::z}{:}{::}} =ab::xy::::z
732 > ${sg{abcdefabcdef}{(..)[^c]}{>$1<}} =a><><><ef
733 > ${sg{abcdefabcdef}{(..)[^c]}{>\$1<}} =a>bc<>ef<>bc<ef
734 > ${sg{abcdefabcdef}{(..)[^c]}{>\N$1\N<}}=a>bc<>ef<>bc<ef
735 > ${sg{abbab}{a*}{+}} =++b+b++b+
739 > Failed: Not enough arguments for 'readfile' (min is 1)
747 > abcde - 12345 - - xyz -
748 > Failed: failed to open /non/exist/file: No such file or directory
750 > >abcde!12345!!xyz!<
752 > # Calling a command
779 > prvs=xxxxxxxxxx=userx@test.ex
780 > prvs=xxxxxxxxxx=userx@test.ex
781 > prvs=xxxxxxxxxx=userx@test.ex
785 > Failed: prvs third argument must be a single digit
786 > Failed: prvs third argument must be a single digit
787 > Failed: prvs third argument must be a single digit
789 > # Correct checks; can't put explicit addresses in the tests, because they
790 > # will change over time.
795 > >1< >userx@test.ex< >1<
816 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
817 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
818 > Failed: missing } at end of string
819 > Failed: missing } at end of string
820 > Failed: hmac algorithm "xxx" is not recognised
821 > Failed: each subcondition inside an "and{...}" condition must be in its own {}
822 > Failed: unknown condition "xya" inside "and{...}" condition
823 > Failed: condition name expected, but found "${lookup{x}lsear" inside "and{...}" condition
824 > Failed: missing } at end of string - could be header name not terminated by colon
825 > Failed: curly-bracket problem in conditional yes/no parsing: did not close with '}'
826 remaining string is ''
827 > Failed: missing or misplaced { or } - could be header name not terminated by colon
828 > Failed: each subcondition inside an "or{...}" condition must be in its own {}
829 > Failed: missing } at end of condition inside "or" group
830 > Failed: unknown condition "yes" inside "or{...}" condition
831 > Failed: non-digit after underscore in "substr_1_"
832 > Failed: non-digit after underscore in "substr__3"
834 > # Iterations: forany and forall
846 > Failed: unknown condition "yes" inside "forany" condition
847 > Failed: missing } at end of condition inside "forany"
860 > outer=yes item='' (unset)
865 > # Error inside nest - check message is helpful
866 > Failed: missing } at end of condition inside "forall" inside "forany" condition
869 > # Miscellaneous (for bug fixes, etc)
873 > # Environment access
880 > "http://www.example.com/image/481989943"
893 > {"1":116, "2":943, "3":234}
894 > expect: {"1":116, "2":943, "3":234}
896 > {"1":116, "2":943, "3":234}
897 > expect: {"1":116, "2":943, "3":234}
910 > primary_hostname: myhost.test.ex
911 > sender_address: sndr@dom
913 > Failed: "if" failed and "fail" requested
917 > primary_hostname: myhost.test.ex
919 > Failed: "if" failed and "fail" requested
923 > -be Sender host name and address etc, all unset
924 > -oMa sender_host_address =
925 > sender_host_port = 0
926 > -oMaa sender_host_authenticated =
927 > -oMai authenticated_id = CALLER
928 > -oMas authenticated_sender = CALLER@myhost.test.ex
929 > -oMi interface_address =
930 > interface_port = -1
931 > -oMr received_protocol =
932 > -oMs sender_host_name =
933 > -oMt sender_ident = CALLER
935 > -be Sender host name and address etc, all set except host name.
936 > -oMa sender_host_address = V4NET.0.0.1
937 > sender_host_port = 1234
938 > -oMaa sender_host_authenticated = AAA
939 > -oMai authenticated_id = philip
940 > -oMas authenticated_sender = xx@yy.zz
941 > -oMi interface_address = 1.1.1.1
942 > interface_port = 99
943 > -oMr received_protocol = special
944 > -oMt sender_ident = me
946 > -be Sender host name explicitly set
947 > -oMa sender_host_address = V4NET.0.0.1
948 > sender_host_port = 1234
949 > -oMs sender_host_name = my.host.name
951 > be Sender host name lookup fails (V4NET.11.12.13 is not reverse registered)
952 > -oMs sender_host_name =
953 > host_lookup_failed = 1
955 > -be Sender host name and protocol set by Sendmail-compatible option
956 > -p received_protocol = special
957 > -p sender_host_name = host.name
959 > -be Sender host name and address etc, all set except host name
960 > -oMa sender_host_address = V4NET.0.0.1
961 > sender_host_port = 1234
962 > -oMaa sender_host_authenticated = AAA
963 > -oMai authenticated_id = philip
964 > -oMas authenticated_sender = xx@yy.zz
965 > -oMi interface_address = 1.1.1.1
966 > interface_port = 99
967 > -oMr received_protocol = special
968 > ----> No lookup yet: No
969 > -oMs sender_host_name = ten-1.test.ex
970 > -oMt sender_ident = me
973 **** SMTP testing session as if from host V4NET.0.0.1
974 **** but without any ident (RFC 1413) callback.
975 **** This is not for real!
977 550 Administrative prohibition
\r
979 **** SMTP testing session as if from host V4NET.0.0.2
980 **** but without any ident (RFC 1413) callback.
981 **** This is not for real!
983 550 Administrative prohibition
\r
985 **** SMTP testing session as if from host V4NET.0.0.0
986 **** but without any ident (RFC 1413) callback.
987 **** This is not for real!
989 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
990 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
993 354 Enter message, ending with "." on a line by itself
\r
994 550 reply_address=<>
\r
997 354 Enter message, ending with "." on a line by itself
\r
998 550 reply_address=<a@b>
\r
1001 354 Enter message, ending with "." on a line by itself
\r
1002 550 reply_address=<c@d>
\r
1005 354 Enter message, ending with "." on a line by itself
\r
1006 550 reply_address=<>
\r
1009 354 Enter message, ending with "." on a line by itself
\r
1010 550 reply_address=<x@y>
\r
1011 221 myhost.test.ex closing connection
\r
1013 **** SMTP testing session as if from host V4NET.0.0.0
1014 **** but without any ident (RFC 1413) callback.
1015 **** This is not for real!
1017 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
1018 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
1021 354 Enter message, ending with "." on a line by itself
\r
1022 550 reply_address=<>
\r
1023 221 myhost.test.ex closing connection
\r
1025 **** SMTP testing session as if from host V4NET.0.0.0
1026 **** but without any ident (RFC 1413) callback.
1027 **** This is not for real!
1029 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
1030 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
1033 354 Enter message, ending with "." on a line by itself
\r
1034 550 reply_address=<>
\r
1035 221 myhost.test.ex closing connection
\r
1042 > '${listextract {2} {<. my.target.host.name}}' => 'target'