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")
82 > # check operation when the condition modifies the 'value' variable
87 > map: ::a::: ::b::: ::c::
95 > # Check for extract corrupting reduce's
98 > listnamed: *.aa.bb : ^\Nxxx(.*)
99 > listnamed: *.aa.bb : ^\Nxxx(.*)
100 > listnamed: V4NET.11.12.13 : iplsearch;TESTSUITE/aux-fixed/0002.iplsearch
101 > listnamed: *.aa.bb : ^\Nxxx(.*) : ;;
102 > listnamed: a : b;c : *.aa.bb : ^\Nxxx(.*) : ;; : 2001::630::212::8::204::::b664
103 > Failed: "nolist" is not a named list
104 > listnamed: *.aa.bb : ^\Nxxx(.*)
105 > Failed: "hlist" is not a domain named list
106 > Failed: bad suffix on "list" operator
118 > Failed: "listextract" failed and "fail" requested
122 > listquote: ::a::b::c::d::
123 > listquote: ab::::cd
132 > sort: 10 smtp.ex.com:100 r2.ex.com:666 r99.ex.com
133 > sort: 10,smtp.ex.com:100,r2.ex.com:666,r99.ex.com
136 > # Tests with iscntrl() and illegal separators
143 > Failed: error in expression evaluation: expecting number or opening parenthesis (after processing "0+") inside "reduce" item
150 > Failed: Not enough arguments for 'acl' (min is 1)
151 > Failed: Not enough arguments for 'acl' (min is 1)
152 > Failed: ERROR from acl "a_nosuch"
154 > acl: (1) [person@dom.ain] []
155 > acl: (2) [firstarg] [secondarg]
156 > acl: (1) [arg with spaces] []
160 > acl: (1) [person@dom.ain] []
161 > Failed: DEFER from acl "a_defer"
162 > acl: (2) [new arg1] [top_arg_1]
163 > acl: (1) [1] [] (1) [2] [] (1) [3] [] (1) [4] []
165 > addrss: local-part@dom.ain
166 > addrss: local-part@dom.ain
167 > addrss: local-part@dom.ain
168 > addrss: local-part@dom.ain
169 > addrss: local-part@dom.ain
170 > addrss: local-part.dot-atom@dom.ain
171 > addrss: local-part@dom.ain
177 > addresses: ''abc@xyz' ''pqr@xyz
178 > addresses: local-part@dom.ain
179 > addresses: local-part@dom.ain+xyz@abc
180 > addresses: local-part@dom.ain:xyz@abc:p@q:r@s
182 > Failed: output separator missing in expanding ${addresses:>}
184 > escape: B7\267F2\362
185 > excape8bit: undisturbed text tab
186 newline tab\134backslash ~tilde\177DEL\200\201.
188 > expand: $primary_hostname myhost.test.ex
189 > hash: jmg monty fbWx
190 > hash: abcX abX aX X
195 > Failed: "1a2b3c4d5e6" contains an odd number of characters
196 > Failed: "1a2b3c4d5e6g" is not a hex string
197 > hex2b64:MPPJPkZDbetYunCBao7BJA==
198 > hex2b64:ztcfpyNSMb7Tg/rP3EHE3cwi7PE=
205 > Failed: argument for base32 operator is "0x1", which is not a decimal number
212 > Failed: argument for base32d operator is "ABC", which is not a base 32 number
214 > the base62 operator is actually a base36 operator in the Darwin and Cygwin
215 > environments. Write cunning tests that produce the same output in both cases,
216 > while doing a reasonable check.
221 > Failed: argument for base62 operator is "12345x", which is not a decimal number
222 > Failed: argument for base62d operator is "0003D7.", which is not a base 36/62 number
224 > hmac: dd97e3ba5d1a61b5006108f8c8252953
225 > hmac: 0210cf9d274b53f1550f657c378b29e8bfed1064
226 > md5: 77add1d5f41223d5582fca736a5cb335
227 > sha1: DA39A3EE5E6B4B0D3255BFEF95601890AFD80709
228 > sha1: A9993E364706816ABA3E25717850C26C9CD0D89D
229 > mask: 192.168.10.192/28
230 > mask: 192.168.10.206/32
231 > Failed: mask value too big in "192.168.10.206/33"
233 > Failed: missing mask value in "192.168.10.206"
234 > Failed: "a.b.c.d" is not an IP address
235 > mask: 2a00.0002.0003.0004.0004.0000.0000.0000/79
236 > mask: 2a00.0002.0003.0004.0005.0006.0007.0008/128
237 > Failed: mask value too big in "2a00:2:3:4:5:6:7:8/129"
238 > mask_n: 2a00:2:3:4:4::/79
239 > ipv6denorm: 0000:0000:0000:0000:0000:0000:0000:0001
240 > ipv6denorm: fe00:0000:0000:0000:0000:0000:0000:0001
241 > ipv6denorm: 0000:0000:0000:0000:0000:ffff:c0a8:0001
242 > ipv6denorm: fe80:0000:0000:0000:0000:0000:c0a8:0001
246 > ipv6norm: 2a00:eadf::1:0
247 > ipv6norm: 2a00:eadf:0:1::
249 > ipv6norm: 2a00:2:3:4:5:6:7:8trailing_text
251 > lc/uc: the quick BROWN FOX
252 > length: The quick abc
257 > quote: aZ09_.-Q "ab*cd" "abcd\"ef"
263 > quote_local_part: abcd
264 > quote_local_part: O'Reilly
265 > quote_local_part: "a space"
266 > quote_local_part: ".something"
267 > quote_local_part: "something."
268 > quote_local_part: joe.bloggs
269 > quote_local_part: a!b
270 > quote_local_part: "x@y"
271 > quote_local_part: ab*cd
272 > quote_local_part: "x:y"
273 > quote_local_part: "abcd\"ef"
274 > quote_local_part: ""
275 > rxquote:aZ09\_\,\-Q ab\*cd abcd\"ef
276 > 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
282 > str2b64:VGhlIHF1aWNrIGJyb3duIAogZm94
284 > base64: VGhlIHF1aWNrIGJyb3duIAogZm94
286 > base64d:The quick brown
295 > Failed: string "14" is not an Exim time interval in "time_eval" operator
296 > Failed: string "rhubarb" is not an Exim time interval in "time_eval" operator
299 > time_interval: 1w4d13h46m39s
300 > Failed: string "-1" is not a positive number in "time_interval" operator
301 > Failed: string "rhubarb" is not a positive number in "time_interval" operator
303 > # stat is a bit tricky, but some of the fields of the aux-var directory
304 > # should be the same on all systems
308 > Failed: stat(/a/non/existent/file) failed: No such file or directory
310 > # "Operators" that have expanded arguments
312 > hash: jmg monty fbWx
313 > hash: abcX abX aX X
315 > length: The quick abc
321 > Failed: Not enough arguments for 'hash' (min is 2)
322 > Failed: "nonnumber" is not a number (in "hash" expansion)
323 > Failed: Too many arguments for 'hash' (max is 3)
324 > Failed: "-2" is not a positive number (in "substr" expansion)
326 > # Skipped operators
336 > # Number suffixes in conditions
343 > # >32b should work, >64b not
349 > 1 > 4611686018427387904 n
350 > Failed: absolute value of integer "46116860184273879040" is too large (overflow)
380 > Failed: invalid integer "3z "
381 > Failed: integer expected but "a" found
382 > Failed: integer expected but "${substr_2_2:65535}" found
392 > Failed: unknown variable "post" after "def:"
395 > Failed: curly-bracket problem in conditional yes/no parsing: 'yes' part did not start with '{'
396 remaining string is ':{y}{n}}'
425 > isip: n ::1.2.3.256
433 > isip: y fe80::a00:20ff:fe86:a061
434 > isip4: n fe80::a00:20ff:fe86:a061
435 > isip6: y fe80::a00:20ff:fe86:a061
436 > isip: y fe80::1.2.3.4
444 > Failed: "if" failed and "fail" requested
446 > # check for empty capture group
455 > >x@zz.aa.bb< [zz] >x@zz.aa.bb<
457 > >x@xxxabc< [abc] >x@xxxabc<
462 > match_local_part:yes
463 > match_local_part:yes
475 > Failed: "somename" is not an IP address
484 > queue_running after or: y
485 > first_delivery after or: y
487 > # acl expansion condition
488 > acl if: Y:(0) [] []
489 > acl if: Y:(1) [argY] []
490 > acl if: N:(2) [argN] [arg2]
491 > Failed: DEFER from acl "a_defer"
493 > # Default values for both if strings
495 > ${if eq{1}{1}} >true<
498 > # Lookups: DIR is the testing directory. In this test we can only use the
499 > # lookups that are required in all cases.
519 > Failed: "lookup" failed and "fail" requested
522 > a.b.c.d: data for a.b.c.d
524 > *.p.q: data for *.p.q
525 > *.p.q: data for *.p.q
526 > *.p.q: data for *.p.q
527 > Failed: "lookup" failed and "fail" requested
533 > q4: "a:b" abc continued data (make sure not key)
541 > q4f: a:b "a:b" abc continued data (make sure not key)
542 > q5f: "quoted" "\"quoted\""
543 > q6f: white space "white space"
554 > a:b: lookup succeeded
560 > # Should give the same results as above because expansion does nothing
570 > a:b: lookup succeeded
572 > # Should fail because of no expansion
579 > # But these should succeed
584 > # Some tests of case-(in)dependence
586 > .MiXeD-CD: Data found for case-dependent MiXeD-CD
587 > .MixeD-CD: NOT FOUND
588 > .MiXeD-Ncd: Data found for case-independent MiXeD-nCD
589 > .MixeD-Ncd: Data found for case-independent MiXeD-nCD
591 > # IP address (CIDR) lookups
593 > 1.2.3.4: data for 1.2.3.4
595 > 1.2.3.5: data for *
596 > abcd::cdab: data for abcd::cdab
597 > 192.168.1.2: data for 192.168.0.0/16
598 > 192.168.5.6: data for 192.168.0.0/16
599 > abcd:abcd:: data for abcd:abcd::/32
600 > abcd:abcd:1:: data for abcd:abcd::/32
601 > abcd:abcd::3 data for abcd:abcd::/32
602 > 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
605 > # Nested Lookups - style 1
607 > The data for key1->key2
608 > Failed: "lookup" failed and "fail" requested
610 > # Nested Lookups - style 2
612 > The data for key1->key2
615 > # Other nesting tests
619 > both-in-1,both-in-2
620 > Failed: "lookup" failed and "fail" requested
622 > # Lookup quotes for standardly expected lookups
624 > lsearch !@#$%^&*()_-+=|\~`1234567890{[}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm
625 > Failed: unknown lookup type "xxx"
641 > Failed: "extract" failed and "fail" requested
642 > Failed: "extract" failed and "fail" requested
653 > Failed: first argument of "extract" must not be empty
654 > Failed: first argument of "extract" must not be empty
658 > Failed: missing '}' closing extract inside "map" item
663 > abcdea aaa xyz zbcdez
666 > abcdea abc z zzzdez
669 > "TrUe" true EXPECT: true
670 > "FALSE" false EXPECT: false
671 > " yes" true EXPECT: true
672 > " no" false EXPECT: false
673 > "yes " true EXPECT: true
674 > "-1" true EXPECT: true
675 > "0" false EXPECT: false
676 > "1" true EXPECT: true
677 > " 0 " false EXPECT: false
678 > " 1 " true EXPECT: true
679 > "1111111111111111111" true EXPECT: true
680 > "9" true EXPECT: true
681 > " " false EXPECT: false
682 > Failed: unrecognised boolean value "text"
683 > Failed: unrecognised boolean value "text"
684 > Failed: unrecognised boolean value "-text"
685 > Failed: unrecognised boolean value "text"
686 > Failed: unrecognised boolean value "text"
687 > "00" false EXPECT: false
688 > "!true" false EXPECT: false
689 > "!false" true EXPECT: true
691 > "TrUe" true EXPECT: true
692 > "FALSE" false EXPECT: false
693 > " yes" true EXPECT: true
694 > " no" false EXPECT: false
695 > "yes " true EXPECT: true
696 > "-1" true EXPECT: true
697 > "0" false EXPECT: false
698 > "1" true EXPECT: true
699 > " 0 " false EXPECT: false
700 > " 1 " true EXPECT: true
701 > "1111111111111111111" true EXPECT: true
702 > "9" true EXPECT: true
703 > " " false EXPECT: false
704 > "text" true EXPECT: true
705 > " text" true EXPECT: true
706 > "text " true EXPECT: true
707 > " text " true EXPECT: true
708 > "00" true EXPECT: true
709 > "!true" false EXPECT: false
710 > "!false" true EXPECT: true
715 > <:abcd:> =?iso-8859-8?Q?=3C=3Aabcd=3A=3E?=
716 > <:ab cd:> =?iso-8859-8?Q?=3C=3Aab_cd=3A=3E?=
717 > 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?=
718 > 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?=
724 > <:ab cd:> <:ab cd:>
725 > Long: here we go: a string that is going to be encoded: it will go over the 75-char limit
726 > 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
736 > ${sg{abcdefabcdef}{abc}{xyz}} =xyzdefxyzdef
737 > ${sg{ab:xy::z}{:}{::}} =ab::xy::::z
738 > ${sg{abcdefabcdef}{(..)[^c]}{>$1<}} =a><><><ef
739 > ${sg{abcdefabcdef}{(..)[^c]}{>\$1<}} =a>bc<>ef<>bc<ef
740 > ${sg{abcdefabcdef}{(..)[^c]}{>\N$1\N<}}=a>bc<>ef<>bc<ef
741 > ${sg{abbab}{a*}{+}} =++b+b++b+
745 > Failed: Not enough arguments for 'readfile' (min is 1)
753 > abcde - 12345 - - xyz -
754 > Failed: failed to open /non/exist/file: No such file or directory
756 > >abcde!12345!!xyz!<
758 > # Calling a command
789 > prvs=xxxxxxxxxx=userx@test.ex
790 > prvs=xxxxxxxxxx=userx@test.ex
791 > prvs=xxxxxxxxxx=userx@test.ex
795 > Failed: prvs third argument must be a single digit
796 > Failed: prvs third argument must be a single digit
797 > Failed: prvs third argument must be a single digit
799 > # Correct checks; can't put explicit addresses in the tests, because they
800 > # will change over time.
805 > >1< >userx@test.ex< >1<
826 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
827 > Failed: "${tod_log" is not a known operator (or a } is missing in a variable reference)
828 > Failed: missing } at end of string
829 > Failed: missing } at end of string
830 > Failed: hmac algorithm "xxx" is not recognised
831 > Failed: each subcondition inside an "and{...}" condition must be in its own {}
832 > Failed: unknown condition "xya" inside "and{...}" condition
833 > Failed: condition name expected, but found "${lookup{x}lsear" inside "and{...}" condition
834 > Failed: missing } at end of string - could be header name not terminated by colon
835 > Failed: curly-bracket problem in conditional yes/no parsing: did not close with '}'
836 remaining string is ''
837 > Failed: missing or misplaced { or } - could be header name not terminated by colon
838 > Failed: each subcondition inside an "or{...}" condition must be in its own {}
839 > Failed: missing } at end of condition inside "or" group
840 > Failed: unknown condition "yes" inside "or{...}" condition
841 > Failed: non-digit after underscore in "substr_1_"
842 > Failed: non-digit after underscore in "substr__3"
844 > # Iterations: forany and forall
856 > Failed: unknown condition "yes" inside "forany" condition
857 > Failed: missing } at end of condition inside "forany"
870 > outer=yes item='' (unset)
875 > # Error inside nest - check message is helpful
876 > Failed: missing } at end of condition inside "forall" inside "forany" condition
879 > # Miscellaneous (for bug fixes, etc)
883 > # Environment access
890 > "http://www.example.com/image/481989943"
903 > {"1":116, "2":943, "3":234}
904 > expect: {"1":116, "2":943, "3":234}
906 > {"1":116, "2":943, "3":234}
907 > expect: {"1":116, "2":943, "3":234}
920 > primary_hostname: myhost.test.ex
921 > sender_address: sndr@dom
923 > Failed: "if" failed and "fail" requested
927 > primary_hostname: myhost.test.ex
929 > Failed: "if" failed and "fail" requested
933 > -be Sender host name and address etc, all unset
934 > -oMa sender_host_address =
935 > sender_host_port = 0
936 > -oMaa sender_host_authenticated =
937 > -oMai authenticated_id = CALLER
938 > -oMas authenticated_sender = CALLER@myhost.test.ex
939 > -oMi interface_address =
940 > interface_port = -1
941 > -oMr received_protocol =
942 > -oMs sender_host_name =
943 > -oMt sender_ident = CALLER
945 > -be Sender host name and address etc, all set except host name.
946 > -oMa sender_host_address = V4NET.0.0.1
947 > sender_host_port = 1234
948 > -oMaa sender_host_authenticated = AAA
949 > -oMai authenticated_id = philip
950 > -oMas authenticated_sender = xx@yy.zz
951 > -oMi interface_address = 1.1.1.1
952 > interface_port = 99
953 > -oMr received_protocol = special
954 > -oMt sender_ident = me
956 > -be Sender host name explicitly set
957 > -oMa sender_host_address = V4NET.0.0.1
958 > sender_host_port = 1234
959 > -oMs sender_host_name = my.host.name
961 > be Sender host name lookup fails (V4NET.11.12.13 is not reverse registered)
962 > -oMs sender_host_name =
963 > host_lookup_failed = 1
965 > -be Sender host name and protocol set by Sendmail-compatible option
966 > -p received_protocol = special
967 > -p sender_host_name = host.name
969 > -be Sender host name and address etc, all set except host name
970 > -oMa sender_host_address = V4NET.0.0.1
971 > sender_host_port = 1234
972 > -oMaa sender_host_authenticated = AAA
973 > -oMai authenticated_id = philip
974 > -oMas authenticated_sender = xx@yy.zz
975 > -oMi interface_address = 1.1.1.1
976 > interface_port = 99
977 > -oMr received_protocol = special
978 > ----> No lookup yet: No
979 > -oMs sender_host_name = ten-1.test.ex
980 > -oMt sender_ident = me
983 **** SMTP testing session as if from host V4NET.0.0.1
984 **** but without any ident (RFC 1413) callback.
985 **** This is not for real!
987 550 Administrative prohibition
\r
989 **** SMTP testing session as if from host V4NET.0.0.2
990 **** but without any ident (RFC 1413) callback.
991 **** This is not for real!
993 550 Administrative prohibition
\r
995 **** SMTP testing session as if from host V4NET.0.0.0
996 **** but without any ident (RFC 1413) callback.
997 **** This is not for real!
999 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
1000 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
1003 354 Enter message, ending with "." on a line by itself
\r
1004 550 reply_address=<>
\r
1007 354 Enter message, ending with "." on a line by itself
\r
1008 550 reply_address=<a@b>
\r
1011 354 Enter message, ending with "." on a line by itself
\r
1012 550 reply_address=<c@d>
\r
1015 354 Enter message, ending with "." on a line by itself
\r
1016 550 reply_address=<>
\r
1019 354 Enter message, ending with "." on a line by itself
\r
1020 550 reply_address=<x@y>
\r
1021 221 myhost.test.ex closing connection
\r
1023 **** SMTP testing session as if from host V4NET.0.0.0
1024 **** but without any ident (RFC 1413) callback.
1025 **** This is not for real!
1027 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
1028 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
1031 354 Enter message, ending with "." on a line by itself
\r
1032 550 reply_address=<>
\r
1033 221 myhost.test.ex closing connection
\r
1035 **** SMTP testing session as if from host V4NET.0.0.0
1036 **** but without any ident (RFC 1413) callback.
1037 **** This is not for real!
1039 220 myhost.test.ex ESMTP Exim x.yz Tue, 2 Mar 1999 09:44:33 +0000
\r
1040 250 myhost.test.ex Hello test [V4NET.0.0.0]
\r
1043 354 Enter message, ending with "." on a line by itself
\r
1044 550 reply_address=<>
\r
1045 221 myhost.test.ex closing connection
\r
1052 > '${listextract {2} {<. my.target.host.name}}' => 'target'