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 | |
0cd5fd23 | 26 | queue_name: $queue_name |
59371ea7 PH |
27 | unknown: ${unknown} |
28 | h_subject: $h_subject:(should be empty) | |
29 | h_subject:$h_subject (should be empty) | |
30 | header in curlies: ${header_subject:} (should fail) | |
31 | ||
32 | # \$message_headers should be empty | |
33 | message_headers: >$message_headers< | |
34 | ||
35 | # Continuation | |
36 | x\ | |
37 | y | |
38 | x\ | |
39 | y | |
40 | ||
41 | # Overlong names and overbig numbers | |
42 | ||
43 | +$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa | |
44 | +${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa} | |
45 | +$11111111111111111111111111111111111 | |
46 | +${11111111111111111111111111111111111} | |
47 | ||
29f89cad PH |
48 | # List operations |
49 | ||
50 | filter: "${filter{a:b:c}{eq{1}{1}}}" | |
51 | filter: ${filter{a:b:c}{!eq{$item}{b}}} | |
52 | filter: ${filter{<' a'b'c}{!eq{$item}{b}}} | |
53 | filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}} | |
54 | filter: "${filter{}{!eq{$item}{b}}}" | |
55 | ||
56 | map: "${map{}{$item}}" | |
57 | map: ${map{a:b:c}{$item}} | |
58 | map: ${map{a:b:c}{:$item:}} | |
59 | map: ${if eq{1}{0}{${map{a:b:c}{:$item:}}}{fail string}} | |
60 | map: ${map{:b:c}{[$item]}} | |
61 | ||
62 | reduce: "${reduce{}{+}{$value$item}}" | |
63 | reduce: ${reduce{a:b:c}{+}{$value$item}} | |
64 | reduce: ${reduce {<, 1,2,3}{0}{${eval:$value+$item}}} | |
65 | reduce: ${reduce {3:0:9:4:6}{0}{${if >{$item}{$value}{$item}{$value}}}} | |
1e0a93cf JH |
66 | # Check for extract corrupting reduce's $value |
67 | reduce: ${reduce {b}{a aaa}{${extract{1}{ }{$value}} , $item}} | |
29f89cad | 68 | |
a64a3dfa JH |
69 | listnamed: ${listnamed:dlist} |
70 | listnamed: ${listnamed:+dlist} | |
71 | listnamed: ${listnamed:hlist} | |
72 | listnamed: ${listnamed:elist} | |
73 | listnamed: ${listnamed:flist} | |
74 | listnamed: ${listnamed:nolist} | |
75 | listnamed: ${listnamed_d:dlist} | |
76 | listnamed: ${listnamed_d:hlist} | |
77 | listnamed: ${listnamed_z:dlist} | |
78 | ||
79 | listcount: ${listcount:a:b:c} | |
80 | listcount: ${listcount:} | |
81 | listcount: ${listcount:<;a;b;c} | |
82 | listcount: ${listcount:${listnamed:dlist}} | |
042eb971 | 83 | |
aa26e137 JH |
84 | listextract: ${listextract{ 2}{a:b:c:d}} |
85 | listextract: ${listextract{-2}{<,a,b,c,d}{X${value}X}} | |
86 | listextract: ${listextract{ 5}{a:b:c:d}} | |
87 | listextract: ${listextract{-5}{a:b:c:d}} | |
88 | listextract: ${listextract{ 5}{a:b:c:d}{}{fail}} | |
89 | listextract: ${listextract{ 5}{a:b:c:d}{}fail} | |
90 | ||
ac4ef9bd JH |
91 | sort: ${sort{3:2:1:4}{<}{$item}} |
92 | sort: ${sort {<, 3,2,1,4}{>}{$item}} | |
93 | sort: ${sort{c:B:a:aa}{lti}{$item}} | |
94 | sort: ${sort{666 r99.ex.com:10 smtp.ex.com:100 r2.ex.com}{<}{${sg {$item}{([0-9]*).*\$}{\$1}}}} | |
95 | sort: ${sort{666,r99.ex.com:10,smtp.ex.com:100,r2.ex.com}{<}{${listextract{1}{<,$item}}}} | |
96 | sort: "${sort{}{<}{$item}}" | |
97 | ||
ec95d1a6 PH |
98 | # Tests with iscntrl() and illegal separators |
99 | ||
100 | map: ${map{<\n a\n\nb\nc}{'$item'}} | |
101 | ||
102 | reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}} | |
103 | reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}} | |
104 | reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}} | |
105 | reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}} | |
106 | ||
59371ea7 PH |
107 | # Operators |
108 | ||
723c72e6 JH |
109 | acl: ${acl |
110 | acl: ${acl} | |
bef3ea7f | 111 | acl: ${acl {a_nosuch}} |
723c72e6 JH |
112 | acl: ${acl {a_ret}} |
113 | acl: ${acl {a_ret}{person@dom.ain}} | |
525239c1 JH |
114 | acl: ${acl {a_ret}{firstarg}{secondarg}} |
115 | acl: ${acl {a_ret}{arg with spaces}} | |
723c72e6 JH |
116 | acl: ${acl {a_none}} |
117 | acl: ${acl {a_none}{person@dom.ain}} | |
118 | acl: ${acl {a_deny}} | |
119 | acl: ${acl {a_deny}{person@dom.ain}} | |
bef3ea7f JH |
120 | acl: ${acl {a_defer}} |
121 | acl: ${acl {a_sub}{top_arg_1}{top_arg_2}{top_arg_3}} | |
723c72e6 JH |
122 | acl: ${reduce {1:2:3:4} {} {$value ${acl {a_ret}{$item}}}} |
123 | ||
59371ea7 PH |
124 | addrss: ${address:local-part@dom.ain} |
125 | addrss: ${address:Exim Person <local-part@dom.ain> (that's me)} | |
126 | domain: ${domain:local-part@dom.ain} | |
127 | domain: ${domain:Exim Person <local-part@dom.ain> (that's me)} | |
29f89cad PH |
128 | |
129 | addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz} | |
130 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)} | |
131 | addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\ | |
132 | xyz@abc} | |
133 | addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \ | |
134 | xyz@abc, nullgroupname:;, group: p@q, r@s; } | |
135 | addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>} | |
1b7cf216 | 136 | addresses: ${addresses:>} |
29f89cad | 137 | |
3367f8c2 JH |
138 |