Commit | Line | Data |
---|---|---|
59371ea7 PH |
1 | # Common string expansions |
2 | # | |
3 | # This is the main string expansion test that tests those expansions that will | |
4 | # be present in the basic Exim binary which we require in order to run these | |
5 | # tests at all. Specialized expansion tests also exist for optional features | |
6 | # in other test scripts. | |
c9a55f6a | 7 | munge dnssec |
59371ea7 PH |
8 | |
9 | exim -be | |
10 | ||
11 | # These expansions can test variables in the configuration, but as there | |
12 | # is no message being processed, there is no message-related data. But | |
13 | # that of course gets tested in plenty of other places. | |
14 | ||
15 | # Some fixed variables | |
16 | ||
17 | exim_path: $exim_path | |
71224040 | 18 | exim_version: $exim_version |
98b8312f HSHR |
19 | config_dir: $config_dir |
20 | config_file: $config_file | |
59371ea7 PH |
21 | primary_hostname: $primary_hostname |
22 | primary_hostname: ${primary_hostname} | |
23 | qualify_domain: $qualify_domain | |
24 | bounce_return_size_limit: ${bounce_return_size_limit} | |
25 | spool_directory: $spool_directory | |
26 | unknown: ${unknown} | |
27 | h_subject: $h_subject:(should be empty) | |
28 | h_subject:$h_subject (should be empty) | |
29 | header in curlies: ${header_subject:} (should fail) | |
30 | ||
31 | # \$message_headers should be empty | |
32 | message_headers: >$message_headers< | |
33 | ||
34 | # Continuation | |
35 | x\ | |
36 | y | |
37 | x\ | |
38 | y | |
39 | ||
40 | # Overlong names and overbig numbers | |
41 | ||
42 | +$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
43 | +${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} | |
44 | +$11111111111111111111111111111111111 | |
45 | +${11111111111111111111111111111111111} | |
46 | ||
29f89cad PH |
47 | # List operations |
48 | ||
49 | filter: "${filter{a:b:c}{eq{1}{1}}}" | |
50 | filter: ${filter{a:b:c}{!eq{$item}{b}}} | |
51 | filter: ${filter{<' a'b'c}{!eq{$item}{b}}} | |
52 | filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}} | |
53 | filter: "${filter{}{!eq{$item}{b}}}" | |
54 | ||
55 | map: "${map{}{$item}}" | |
56 | map: ${map{a:b:c}{$item}} | |
57 | map: ${map{a:b:c}{:$item:}} | |
58 | map: ${if eq{1}{0}{${map{a:b:c}{:$item:}}}{fail string}} | |
59 | map: ${map{:b:c}{[$item]}} | |
60 | ||
61 | reduce: "${reduce{}{+}{$value$item}}" | |
62 | reduce: ${reduce{a:b:c}{+}{$value$item}} | |
63 | reduce: ${reduce {<, 1,2,3}{0}{${eval:$value+$item}}} | |
64 | reduce: ${reduce {3:0:9:4:6}{0}{${if >{$item}{$value}{$item}{$value}}}} | |
65 | ||
a64a3dfa JH |
66 | listnamed: ${listnamed:dlist} |
67 | listnamed: ${listnamed:+dlist} | |
68 | listnamed: ${listnamed:hlist} | |
69 | listnamed: ${listnamed:elist} | |
70 | listnamed: ${listnamed:flist} | |
71 | listnamed: ${listnamed:nolist} | |
72 | listnamed: ${listnamed_d:dlist} | |
73 | listnamed: ${listnamed_d:hlist} | |
74 | listnamed: ${listnamed_z:dlist} | |
75 | ||
76 | listcount: ${listcount:a:b:c} | |
77 | listcount: ${listcount:} | |
78 | listcount: ${listcount:<;a;b;c} | |
79 | listcount: ${listcount:${listnamed:dlist}} | |
042eb971 | 80 | |
aa26e137 JH |
81 | listextract: ${listextract{ 2}{a:b:c:d}} |
82 | listextract: ${listextract{-2}{<,a,b,c,d}{X${value}X}} | |
83 | listextract: ${listextract{ 5}{a:b:c:d}} | |
84 | listextract: ${listextract{-5}{a:b:c:d}} | |
85 | listextract: ${listextract{ 5}{a:b:c:d}{}{fail}} | |
86 | listextract: ${listextract{ 5}{a:b:c:d}{}fail} | |
87 | ||
ac4ef9bd JH |
88 | sort: ${sort{3:2:1:4}{<}{$item}} |
89 | sort: ${sort {<, 3,2,1,4}{>}{$item}} | |
90 | sort: ${sort{c:B:a:aa}{lti}{$item}} | |
91 | sort: ${sort{666 r99.ex.com:10 smtp.ex.com:100 r2.ex.com}{<}{${sg {$item}{([0-9]*).*\$}{\$1}}}} | |
92 | sort: ${sort{666,r99.ex.com:10,smtp.ex.com:100,r2.ex.com}{<}{${listextract{1}{<,$item}}}} | |
93 | sort: "${sort{}{<}{$item}}" | |
94 | ||
ec95d1a6 PH |
95 | # Tests with iscntrl() and illegal separators |
96 | ||
97 | map: ${map{<\n a\n\nb\nc}{'$item'}} | |
98 | ||
99 | reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}} | |
100 | reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}} | |
101 | reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}} | |
102 | reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}} | |
103 | ||
59371ea7 PH |
104 | # Operators |
105 | ||
723c72e6 JH |
106 | acl: ${acl |
107 | acl: ${acl} | |
bef3ea7f | 108 | acl: ${acl {a_nosuch}} |
723c72e6 JH |
109 | acl: ${acl {a_ret}} |
110 | acl: ${acl {a_ret}{person@dom.ain}} | |
525239c1 JH |
111 | acl: ${acl {a_ret}{firstarg}{secondarg}} |
112 | acl: ${acl {a_ret}{arg with spaces}} | |
723c72e6 JH |
113 | acl: ${acl {a_none}} |
114 | acl: ${acl {a_none}{person@dom.ain}} | |
115 | acl: ${acl {a_deny}} | |
116 | acl: ${acl {a_deny}{person@dom.ain}} | |
bef3ea7f JH |
117 | acl: ${acl {a_defer}} |
118 | acl: ${acl {a_sub}{top_arg_1}{top_arg_2}{top_arg_3}} | |
723c72e6 JH |
119 | acl: ${reduce {1:2:3:4} {} {$value ${acl {a_ret}{$item}}}} |
120 | ||
59371ea7 PH |
121 | addrss: ${address:local-part@dom.ain} |
122 | addrss: ${address:Exim Person <local-part@dom.ain> (that's me)} | |
123 | domain: ${domain:local-part@dom.ain} | |
124 | domain: ${domain:Exim Person <local-part@dom.ain> (that's me)} | |
29f89cad PH |
125 | |
126 | addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz} | |
127 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)} | |
128 | addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\ | |
129 | xyz@abc} | |
130 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \ | |
131 | xyz@abc, nullgroupname:;, group: p@q, r@s; } | |
132 | addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>} | |
133 | ||
59371ea7 PH |
134 |