Change names to "listnamed" and "listcount".
[exim.git] / test / scripts / 0000-Basic / 0002
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.
7 munge dnssec
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
18 primary_hostname: $primary_hostname
19 primary_hostname: ${primary_hostname}
20 qualify_domain: $qualify_domain
21 bounce_return_size_limit: ${bounce_return_size_limit}
22 spool_directory: $spool_directory
23 unknown: ${unknown}
24 h_subject: $h_subject:(should be empty)
25 h_subject:$h_subject (should be empty)
26 header in curlies: ${header_subject:} (should fail)
27
28 # \$message_headers should be empty
29 message_headers: >$message_headers<
30
31 # Continuation
32 x\
33 y
34 x\
35              y
36
37 # Overlong names and overbig numbers
38
39 +$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
40 +${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
41 +$11111111111111111111111111111111111
42 +${11111111111111111111111111111111111}
43
44 # List operations
45
46 filter: "${filter{a:b:c}{eq{1}{1}}}"
47 filter: ${filter{a:b:c}{!eq{$item}{b}}}
48 filter: ${filter{<' a'b'c}{!eq{$item}{b}}}
49 filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}}
50 filter: "${filter{}{!eq{$item}{b}}}"
51
52 map: "${map{}{$item}}"
53 map: ${map{a:b:c}{$item}}
54 map: ${map{a:b:c}{:$item:}}
55 map: ${if eq{1}{0}{${map{a:b:c}{:$item:}}}{fail string}}
56 map: ${map{:b:c}{[$item]}}
57
58 reduce: "${reduce{}{+}{$value$item}}"
59 reduce: ${reduce{a:b:c}{+}{$value$item}}
60 reduce: ${reduce {<, 1,2,3}{0}{${eval:$value+$item}}}
61 reduce: ${reduce {3:0:9:4:6}{0}{${if >{$item}{$value}{$item}{$value}}}}
62
63 listnamed: ${listnamed:dlist}
64 listnamed: ${listnamed:+dlist}
65 listnamed: ${listnamed:hlist}
66 listnamed: ${listnamed:elist}
67 listnamed: ${listnamed:flist}
68 listnamed: ${listnamed:nolist}
69 listnamed: ${listnamed_d:dlist}
70 listnamed: ${listnamed_d:hlist}
71 listnamed: ${listnamed_z:dlist}
72
73 listcount: ${listcount:a:b:c}
74 listcount: ${listcount:}
75 listcount: ${listcount:<;a;b;c}
76 listcount: ${listcount:${listnamed:dlist}}
77
78 # Tests with iscntrl() and illegal separators
79
80 map: ${map{<\n a\n\nb\nc}{'$item'}}
81
82 reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}}
83 reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}}
84 reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}}
85 reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}}
86
87 # Operators
88
89 addrss: ${address:local-part@dom.ain}
90 addrss: ${address:Exim Person <local-part@dom.ain> (that's me)}
91 domain: ${domain:local-part@dom.ain}
92 domain: ${domain:Exim Person <local-part@dom.ain> (that's me)}
93
94 addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz}
95 addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)}
96 addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\
97            xyz@abc}
98 addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \
99            xyz@abc, nullgroupname:;, group: p@q, r@s; }
100 addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>}
101
102 escape: ${escape:B7·F2ò}
103 eval:   ${eval:1+1}
104 eval:   ${eval:1+2*3}
105 eval:   ${eval:(1+2)*3}
106 eval:   ${eval:3/2*4}
107 eval:   ${eval:3*4/2}
108 eval:   ${eval:42}
109 eval:   ${eval:}
110 eval:   ${eval:-2}
111 eval:   ${eval:-2 - -3}
112 eval:   ${eval:-2 - (-3)}
113 eval:   ${eval:-2 - (-3}
114 eval:   ${eval:-2 - -3)}
115 eval:   ${eval:-2 --3}
116 eval:   ${eval:-2 -+3}
117 eval:   ${eval:-2 -+-3}
118 eval:   ${eval:(2*(1+1))/2 + 40K}
119 eval:   ${eval:077}
120 eval:   ${eval:08}
121 eval10: ${eval10:077}
122 eval10: ${eval10:08}
123 eval10: ${eval10:0x1234}
124 eval:   ${eval:2+42%5}
125 eval:   ${eval:0xc&5}
126 eval:   ${eval:0xc & 5 }
127 eval:   ${eval:0x0c|5}
128 eval:   ${eval:0xc^5}
129 eval:   ${eval:0xc>>1}
130 eval:   ${eval:0xc >> 2}
131 eval:   ${eval:0xc >> 4 }
132 eval:   ${eval:0xc<<1}
133 eval:   ${eval:~255&0x1234}
134 eval:   ${eval:~ 255&0x1234}
135 eval:   ${eval: -(~255&0x1234)}
136
137 expand: \$primary_hostname ${expand:\$primary_hostname}
138 hash:   ${hash_3:monty} ${hash_5:monty} ${hash_4_62:monty python}
139 hash:   ${hash_3:abc}X ${hash_3:ab}X ${hash_3:a}X ${hash_3:}X
140 hex2b64:${hex2b64:12345678}
141 hex2b64:${hex2b64:abcdef}
142 hex2b64:${hex2b64:ABCDEF}
143 hex2b64:${hex2b64:1a2b3c4d5e6f}
144 hex2b64:${hex2b64:1a2b3c4d5e6}
145 hex2b64:${hex2b64:1a2b3c4d5e6g}
146 hex2b64:${hex2b64:${md5:the quick brown fox}}
147 hex2b64:${hex2b64:${sha1:the quick brown fox}}
148
149 The base62 operator is actually a base36 operator in the Darwin and Cygwin
150 environments. Write cunning tests that produce the same output in both cases,
151 while doing a reasonable check.
152
153 base62:  ${if or {\
154                  {eq {${base62:12345}}{0003D7}}\
155                  {eq {${base62:12345}}{0009IX}}\
156                  }{OK}{NOT OK}}
157 base62d: ${if or {\
158                  {eq {${base62d:0003D7}}{12345}}\
159                  {eq {${base62d:0009IX}}{12345}}\
160                  }{OK}{NOT OK}}
161 base62d: ${if or {\
162                  {eq {${base62d:3D7}}{12345}}\
163                  {eq {${base62d:9IX}}{12345}}\
164                  }{OK}{NOT OK}}
165 base62 error: ${base62:12345x}
166 base62d error:${base62d:0003D7.}
167
168 hmac:   ${hmac{md5}{somesecret}{mail.example.com 2002-10-17 11:30:59}}
169 hmac:   ${hmac{sha1}{somesecret}{mail.example.com 2002-10-17 11:30:59}}
170 md5:    ${md5:the quick brown fox jumps over the lazy dog}
171 sha1:   ${sha1:}
172 sha1:   ${sha1:abc}
173 mask:   ${mask:192.168.10.206/28}
174 mask:   ${mask:192.168.10.206/32}
175 mask:   ${mask:192.168.10.206/33}
176 mask:   ${mask:192.168.10.206/0}
177 mask:   ${mask:192.168.10.206}
178 mask:   ${mask:a.b.c.d}
179 nhash:  ${nhash_24:monty} ${nhash_8_63:monty python}
180 lc/uc:  ${lc:The Quick} ${uc: Brown Fox}
181 length: ${length_10:The quick brown fox} ${l_10:abc}
182 lclpt:  ${local_part:local-part@dom.ain}
183 lclpt:  ${local_part:Exim Person <local-part@dom.ain> (that's me)}
184 quote:  ${quote:aZ09_.-Q} ${quote:ab*cd} ${quote:ab\cd"ef}
185 quote:  ${quote:nl(\n)}
186 quote:  ${quote:cr(\r)}
187 quote:  ${quote:tab(\t)}
188 quote:  ${quote:xff(\xff)}
189 quote:  Empty>${quote:}<
190 quote_local_part: ${quote_local_part:abcd}
191 quote_local_part: ${quote_local_part:O'Reilly}
192 quote_local_part: ${quote_local_part:a space}
193 quote_local_part: ${quote_local_part:.something}
194 quote_local_part: ${quote_local_part:something.}
195 quote_local_part: ${quote_local_part:joe.bloggs}
196 quote_local_part: ${quote_local_part:a!b}
197 quote_local_part: ${quote_local_part:x@y}
198 quote_local_part: ${quote_local_part:ab*cd}
199 quote_local_part: ${quote_local_part:x:y}
200 quote_local_part: ${quote_local_part:ab\cd"ef}
201 quote_local_part: ${quote_local_part:}
202 rxquote:${rxquote:aZ09_,-Q} ${rxquote:ab*cd} ${rxquote:ab\cd"ef}
203 substr: ${substr_3_2:rhubarb} ${s_-5_2:1234567} ${s_-5_2:12} ${s_-3_2:12}
204 substr: ${s_3:rhubarb} ${s_-2:rhubarb}
205 substr: ${s_1:}
206 substr: ${substr_10:abc}
207 str2b64:${str2b64:abcd}
208 str2b64:${str2b64:The quick brown \n fox}
209 strlen: ${strlen:}
210 strlen: ${strlen:a}
211 strlen: ${strlen:abcdefgh}
212 time_eval:     ${time_eval:10s}
213 time_eval:     ${time_eval:2h}
214 time_eval:     ${time_eval:1d5m}
215 time_eval:     ${time_eval:1w2d3h4m5s}
216 time_eval:     ${time_eval:14}
217 time_eval:     ${time_eval:rhubarb}
218 time_interval: ${time_interval:0}
219 time_interval: ${time_interval:44}
220 time_interval: ${time_interval:999999}
221 time_interval: ${time_interval:-1}
222 time_interval: ${time_interval:rhubarb}
223
224 # stat is a bit tricky, but some of the fields of the aux-var directory
225 # should be the same on all systems
226
227 stat:   ${extract{mode}{${stat:DIR/aux-var}}}
228 stat:   ${extract{smode}{${stat:DIR/aux-var}}}
229 stat:   ${stat:/a/non/existent/file}
230
231 # "Operators" that have expanded arguments
232
233 hash:   ${hash{3}{monty}} ${hash{5}{monty}} ${hash{4}{62}{monty python}}
234 hash:   ${hash{3}{abc}}X ${hash{3}{ab}}X ${hash{3}{a}}X ${hash{3}{}}X
235 nhash:  ${nhash{24}{monty}} ${nhash{8}{63}{monty python}}
236 length: ${length{10}{The quick brown fox}} ${length{10}{abc}}
237 substr: ${substr{3}{2}{rhubarb}} ${substr{-5}{2}{1234567}} ${substr{-5}{2}{12}} ${substr{-3}{2}{12}}
238 substr: ${substr{${if eq{1}{1}{-8}}}{${if eq{1}{0}{25}{1}}}{abcde}}
239
240 # Error forms
241
242 ${hash{one}}
243 ${hash{nonnumber}{abcd}}
244 ${hash{3}{2}{4}{abcd}}
245 ${substr{-3}{-2}{abcd}}
246
247 # Skipped operators
248
249 addrss: ${if eq {1}{2}{${address:invalid}}{NO}}
250 domain: ${if eq {1}{2}{${domain:invalid}}{NO}}
251 escape: ${if eq {1}{2}{${escape:invalid}}{NO}}
252 expand: ${if eq {1}{2}{\$primary_hostname ${expand:\$invalid}}{NO}}
253 hash:   ${if eq {1}{2}{${hash_3:invalid}}{NO}}
254 md5:    ${if eq {1}{2}{${md5:invalid}}{NO}}
255 mask:   ${if eq {1}{2}{${mask:invalid}}{NO}}
256
257 # Number suffixes in conditions
258 1k: ${if >{1}{1k}{n}{y}}
259 1K: ${if >{1}{1K}{n}{y}}
260 1M: ${if >{1}{1M}{n}{y}}
261 1G: ${if >{1}{1G}{n}{y}}
262
263 # Numeric overflow
264 # >32b should work, >64b not
265
266 4096M      ${if >{1}{4096M}{y}{n}}
267 4096000000 ${if >{1}{4096000000}{y}{n}}
268 4611686018427387904  ${if >{1}{4611686018427387904} {y}{n}}
269 46116860184273879040 ${if >{1}{46116860184273879040}{y}{n}}
270
271 # Conditions
272
273 2=2:    ${if ={2}{2}{y}{n}}
274 2==2:   ${if =={2}{2}{y}{n}}
275 3=2:    ${if ={3}{2}{y}{n}}
276 2==3:   ${if =={2}{3}{y}{n}}
277 !2=2:   ${if !={2}{2}{y}{n}}
278 !2==2:  ${if !=={2}{2}{y}{n}}
279 !3=2:   ${if !={3}{2}{y}{n}}
280 !2==3:  ${if !=={2}{3}{y}{n}}
281 2>3:    ${if >{2}{3}{y}{n}}
282 3>3:    ${if >{3}{3}{y}{n}}
283 4>3:    ${if >{4}{3}{y}{n}}
284 1>-1:   ${if >{1}{-1}{y}{n}}
285 2>=3:   ${if >={2}{3}{y}{n}}
286 3>=3:   ${if >={3}{3}{y}{n}}
287 4>=3:   ${if >={4}{3}{y}{n}}
288 2<3:    ${if <{2}{3}{y}{n}}
289 3<3:    ${if <{3}{3}{y}{n}}
290 4<3:    ${if <{4}{3}{y}{n}}
291 2<=3:   ${if <={2}{3}{y}{n}}
292 3<=3:   ${if <={3}{3}{y}{n}}
293 4<=3:   ${if <={4}{3}{y}{n}}
294 5<=3:   ${if <={ 5 } { 3 } {y}{n}}
295 -3<=1:  ${if <={-3}{1}{y}{n}}
296
297 5>3k:   ${if >{5 } {3k }{y}{n}}
298 5>3m:   ${if >{5 } {3m }{y}{n}}
299 5>3z:   ${if >{5 } {3z }{y}{n}}
300 5>a:    ${if >{ 5 } {a}{y}{n}}
301
302 >0:     ${if > {}{0}{y}{n}}
303 =:      ${if = {}{}{y}{n}}
304 -2<:    ${if < {-2}{}{y}{n}}
305 08>07:  ${if > {08}{07}{y}{n}}
306 011=11: ${if = {011}{11}{y}{n}}
307
308 def:y   ${if def:tod_log{y}{n}}
309 def:n   ${if def:host{y}{n}}
310 def:f   ${if def:post{y}{n}}
311 def:h_f ${if def:h_xxx {y}{n}}
312 def:h_f ${if def:h_xxx:{y}{n}}
313 def:d:  ${if def:tod_log:{y}{n}}
314
315 exists: ${if exists{/etc/passwd}{y}{n}}
316 exists: ${if exists{/doesnt}{y}{n}}
317
318 eq:     ${if eq{abc}{abc}{y}{n}}
319 eq:     ${if eq{abc}{xyz}{y}{n}}
320 !eq:    ${if !eq{abc}{abc}{y}{n}}
321 !eq:    ${if !eq{abc}{xyz}{y}{n}}
322
323 eqi:    ${if eqi{abc}{abc}{y}{n}}
324 eqi:    ${if eqi{abc}{ABC}{y}{n}}
325 eqi:    ${if eqi{abc}{xyz}{y}{n}}
326 !eqi:   ${if !eqi{abc}{abc}{y}{n}}
327 !eqi:   ${if !eqi{abc}{aBc}{y}{n}}
328 !eqi:   ${if !eqi{abc}{xyz}{y}{n}}
329
330 lt:     ${if lt{ABC}{abc}{y}{n}}
331 lti:    ${if lti{ABC}{abc}{y}{n}}
332 le:     ${if le{ABC}{abc}{y}{n}}
333 lei:    ${if lei{ABC}{abc}{y}{n}}
334 gt:     ${if gt{ABC}{abc}{y}{n}}
335 gti:    ${if gti{ABC}{abc}{y}{n}}
336 ge:     ${if ge{ABC}{abc}{y}{n}}
337 gei:    ${if gei{ABC}{abc}{y}{n}}
338
339 isip:   ${if isip {1.2.3.4}{y}{n}}  1.2.3.4
340 isip4:  ${if isip4{1.2.3.4}{y}{n}}  1.2.3.4
341 isip6:  ${if isip6{1.2.3.4}{y}{n}}  1.2.3.4
342 isip:   ${if isip {1:2:3:4}{y}{n}}  1:2:3:4
343 isip4:  ${if isip4{1:2:3:4}{y}{n}}  1:2:3:4
344 isip6:  ${if isip6{1:2:3:4}{y}{n}}  1:2:3:4
345 isip:   ${if isip {::1}{y}{n}}      ::1
346 isip4:  ${if isip4{::1}{y}{n}}      ::1
347 isip6:  ${if isip6{::1}{y}{n}}      ::1
348 isip:   ${if isip {fe80::a00:20ff:fe86:a061}{y}{n}}  fe80::a00:20ff:fe86:a061
349 isip4:  ${if isip4{fe80::a00:20ff:fe86:a061}{y}{n}}  fe80::a00:20ff:fe86:a061
350 isip6:  ${if isip6{fe80::a00:20ff:fe86:a061}{y}{n}}  fe80::a00:20ff:fe86:a061
351 isip:   ${if isip {rhubarb}{y}{n}}  rhubarb
352 isip4:  ${if isip4{rhubarb}{y}{n}}  rhubarb
353 isip6:  ${if isip6{rhubarb}{y}{n}}  rhubarb
354
355 match:  ${if match{abcd}{\N^([ab]+)(\w+)$\N}{$2$1}fail}
356 match:  ${if match{abcd}{^\N([ab]+)(\w+)$\N}{$2$1}fail}
357 match:  ${if match{abcd}{^([ab]+)(\\w+)\$}{$2$1}fail}
358 match:  ${if match{wxyz}{^([ab]+)(\\w+)\$}{$2$1}fail}
359 match:  ${if match{abcd}{^([ab]+)(\\w+)\$}{$2[${if match{xyz}{(.*)}{$1}fail}]$1}fail}
360
361 match_domain:    ${if match_domain{a.b.c}{x.y.z:a.b.c:p.q.r}{yes}{no}}
362 match_domain:    ${if match_domain{a.b.c}{x.y.z:p.q.r}{yes}{no}}
363 match_domain:    ${if match_domain{5.aa.bb}{+dlist}{yes}{no}}
364 match_domain:    ${if match_domain{xxxyz}{+dlist}{yes}{no}}
365 match_domain:    ${if match_domain{xyz}{+dlist}{yes}{no}}
366
367 ${if match{x@zz.aa.bb}{^(.*)} \
368   { \
369   >$1< \
370   ${if match_domain{${domain:$1}}{+dlist}{[$1]}} \
371   >$1< \
372   } \
373   { CAN'T HAPPEN}}
374
375 ${if match{x@xxxabc}{^(.*)} \
376   { \
377   >$1< \
378   ${if match_domain{${domain:$1}}{^\Nxxx(.*)\N}{[$1]}} \
379   >$1< \
380   } \
381   { CAN'T HAPPEN}}
382
383 match_address:   ${if match_address{x@y.z}{p@q:*@y.z}{yes}{no}}
384 match_address:   ${if match_address{x@y.z}{p@q:x@*.z}{yes}{no}}
385
386 match_local_part:${if match_local_part{jo}{jack:jill:jo:john}{yes}{no}}
387 match_local_part:${if match_local_part{jo}{\N^\w\N}{yes}{no}}
388
389 match_ip:        01 ${if match_ip{1.2.3.4}{4.5.6.7:1.2.3.4}}
390 match_ip:        02 ${if match_ip{1.2.3.4}{4.5.6.7:1.2.3.6}}
391 match_ip:        03 ${if match_ip{1.2.3.4}{4.5.6.7:1.2.3.6/24}}
392 match_ip:        04 ${if match_ip{1.2.3.4}{4.5.6.7:1.2.3.6:*}}
393 match_ip:        05 ${if match_ip{1.2.3.4}{4.5.6.7:1.2.3.6:name}}
394 match_ip:        06 ${if match_ip{1.2.3.4}{:4.5.6.7}}
395 match_ip:        07 ${if match_ip{}{:4.5.6.7}}
396 match_ip:        08 ${if match_ip{V4NET.11.12.13}{+hlist}}
397 match_ip:        09 ${if match_ip{V4NET.11.12.14}{+hlist}}
398 match_ip:        10 ${if match_ip{192.168.3.4}{+hlist}}
399 match_ip:        11 ${if match_ip{somename}{+hlist}}
400 match_ip:        12 ${if match_ip{1.2.3.4}{lsearch;DIR/aux-fixed/0002.matchip}}
401 match_ip:        13 ${if match_ip{1.2.3.4}{net-lsearch;DIR/aux-fixed/0002.matchip}}
402 match_ip:        14 ${if match_ip{5.6.7.8}{net24-lsearch;DIR/aux-fixed/0002.matchip}}
403 match_ip:        15 ${if match_ip{abcd::dcba}{net-iplsearch;DIR/aux-fixed/0002.matchip}}
404
405 queue_running:  ${if queue_running{y}{n}}
406 first_delivery: ${if first_delivery{y}{n}}
407
408 queue_running after or: ${if or{{eq {0}{0}}{queue_running}}{y}{n}}
409 first_delivery after or: ${if or{{eq {0}{0}}{first_delivery}}{y}{n}}
410
411 # Default values for both if strings
412
413 \${if eq{1}{1}}  >${if eq{1}{1}}<
414 \${if eq{1}{2}}  >${if eq{1}{2}}<
415
416 # Lookups: DIR is the testing directory. In this test we can only use the
417 # lookups that are required in all cases.
418
419 ${lookup{postmaster}lsearch{DIR/aux-fixed/0002.aliases}{$value}fail}
420
421 ${lookup{x@y}lsearch*@{DIR/aux-fixed/0002.starat}{$value}fail}
422 ${lookup{x@z}lsearch*{DIR/aux-fixed/0002.starat}{$value}fail}
423 ${lookup{x@z}lsearch*@{DIR/aux-fixed/0002.starat}{$value}fail}
424 ${lookup{x@w}lsearch*@{DIR/aux-fixed/0002.starat}{$value}fail}
425
426 ${lookup{a.b.c.d}partial-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
427 ${lookup{x.y.z}partial-lsearch{DIR/aux-fixed/0002.domains}{$value}{failed x.y.z}}
428 ${lookup{p.q}partial-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
429 ${lookup{o.p.q}partial-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
430 ${lookup{m.n.o.p.q}partial-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
431 ${lookup{x.y.z}partial1-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
432 ${lookup{x.y.z}partial0-lsearch{DIR/aux-fixed/0002.domains}{$value}fail}
433
434 q1:  ${lookup{abc}lsearch{DIR/aux-fixed/0002.quoted}}
435 q2:  ${lookup{xyz}lsearch{DIR/aux-fixed/0002.quoted}}
436 q3:  ${lookup{pqr}lsearch{DIR/aux-fixed/0002.quoted}}
437 q4:  ${lookup{a:b}lsearch{DIR/aux-fixed/0002.quoted}}
438 q5:  ${lookup{"quoted"}lsearch{DIR/aux-fixed/0002.quoted}}
439 q6:  ${lookup{white space}lsearch{DIR/aux-fixed/0002.quoted}}
440 q7:  ${lookup{b\\s}lsearch{DIR/aux-fixed/0002.quoted}}
441
442 abc:   ${lookup{abc}wildlsearch{DIR/aux-var/0002.wild}}
443 a.b.c: ${lookup{a.b.c}wildlsearch{DIR/aux-var/0002.wild}}
444 ab.c:  ${lookup{ab.c}wildlsearch{DIR/aux-var/0002.wild}}
445 xyz:   ${lookup{xyz}wildlsearch{DIR/aux-var/0002.wild}}
446 Xyz:   ${lookup{Xyz}wildlsearch{DIR/aux-var/0002.wild}}
447 Zyz:   ${lookup{Zyz}wildlsearch{DIR/aux-var/0002.wild}}
448 a b:   ${lookup{a b}wildlsearch{DIR/aux-var/0002.wild}}
449 a  b:  ${lookup{a  b}wildlsearch{DIR/aux-var/0002.wild}}
450 a:b:   ${lookup{a:b}wildlsearch{DIR/aux-var/0002.wild}}
451 a.b:   ${lookup{a.b}wildlsearch{DIR/aux-var/0002.wild}}
452 a..b:  ${lookup{a..b}wildlsearch{DIR/aux-var/0002.wild}}
453 a9b:   ${lookup{a9b}wildlsearch{DIR/aux-var/0002.wild}}
454 a99b:  ${lookup{a99b}wildlsearch{DIR/aux-var/0002.wild}}
455
456 # Should give the same results as above because expansion does nothing
457
458 abc:   ${lookup{abc}nwildlsearch{DIR/aux-var/0002.wild}}
459 a.b.c: ${lookup{a.b.c}nwildlsearch{DIR/aux-var/0002.wild}}
460 ab.c:  ${lookup{ab.c}nwildlsearch{DIR/aux-var/0002.wild}}
461 xyz:   ${lookup{xyz}nwildlsearch{DIR/aux-var/0002.wild}}
462 Xyz:   ${lookup{Xyz}nwildlsearch{DIR/aux-var/0002.wild}}
463 Zyz:   ${lookup{Zyz}nwildlsearch{DIR/aux-var/0002.wild}}
464 a b:   ${lookup{a b}nwildlsearch{DIR/aux-var/0002.wild}}
465 a  b:  ${lookup{a  b}nwildlsearch{DIR/aux-var/0002.wild}}
466 a:b:   ${lookup{a:b}nwildlsearch{DIR/aux-var/0002.wild}}
467
468 # Should fail because of no expansion
469
470 a.b:   ${lookup{a.b}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NO}}
471 a..b:  ${lookup{a..b}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NO}}
472 a9b:   ${lookup{a9b}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NO}}
473 a99b:  ${lookup{a99b}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NO}}
474
475 # But these should succeed
476
477 a\\:b:  ${lookup{a\\:b}nwildlsearch{DIR/aux-var/0002.wild}}
478 a\\:Xb: ${lookup{a\\:Xb}nwildlsearch{DIR/aux-var/0002.wild}}
479
480 # Some tests of case-(in)dependence
481
482 MiXeD-CD:  ${lookup{MiXeD-CD}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
483 MixeD-CD:  ${lookup{MixeD-CD}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
484 MiXeD-Ncd: ${lookup{MiXeD-Ncd}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
485 MixeD-Ncd: ${lookup{MixeD-Ncd}nwildlsearch{DIR/aux-var/0002.wild}{$value}{NOT FOUND}}
486
487 # IP address (CIDR) lookups
488
489 1.2.3.4:      ${lookup{1.2.3.4}iplsearch{DIR/aux-fixed/0002.iplsearch}}
490 1.2.3.5:      ${lookup{1.2.3.5}iplsearch{DIR/aux-fixed/0002.iplsearch}}
491 1.2.3.5:      ${lookup{1.2.3.5}iplsearch*{DIR/aux-fixed/0002.iplsearch}}
492 abcd::cdab:   ${lookup{abcd::cdab}iplsearch{DIR/aux-fixed/0002.iplsearch}}
493 192.168.1.2:  ${lookup{192.168.1.2}iplsearch{DIR/aux-fixed/0002.iplsearch}}
494 192.168.5.6:  ${lookup{192.168.5.6}iplsearch{DIR/aux-fixed/0002.iplsearch}}
495 abcd:abcd::   ${lookup{abcd:abcd::}iplsearch{DIR/aux-fixed/0002.iplsearch}}
496 abcd:abcd:1:: ${lookup{abcd:abcd:1::}iplsearch{DIR/aux-fixed/0002.iplsearch}}
497 abcd:abcd::3  ${lookup{abcd:abcd::3}iplsearch{DIR/aux-fixed/0002.iplsearch}}
498 rhubarb       ${lookup{rhubarb}iplsearch{DIR/aux-fixed/0002.iplsearch}}
499
500
501 # Nested Lookups - style 1
502
503 ${lookup{${lookup{key1}lsearch{DIR/aux-fixed/0002.rec}{$value}{key1f}}}lsearch{DIR/aux-fixed/0002.rec}{$value}fail}
504 ${lookup{${lookup{key3}lsearch{DIR/aux-fixed/0002.rec}{$value}{key1f}}}lsearch{DIR/aux-fixed/0002.rec}{$value}fail}
505
506 # Nested Lookups - style 2
507
508 ${lookup{key1}lsearch{DIR/aux-fixed/0002.rec}{${lookup{$value}lsearch{DIR/aux-fixed/0002.rec}{$value}{failed for $value}}}{failed for key1}}
509 ${lookup{key3}lsearch{DIR/aux-fixed/0002.rec}{${lookup{$value}lsearch{DIR/aux-fixed/0002.rec}{$value}{failed for $value}}}{failed for key1}}
510
511 # Other nesting tests
512
513 ${lookup{one}lsearch{DIR/aux-fixed/0002.alias1}{$value${lookup{one}lsearch{DIR/aux-fixed/0002.alias2}{,$value}}}{${lookup{one}lsearch{DIR/aux-fixed/0002.alias2}{$value}fail}}}
514 ${lookup{two}lsearch{DIR/aux-fixed/0002.alias1}{$value${lookup{two}lsearch{DIR/aux-fixed/0002.alias2}{,$value}}}{${lookup{two}lsearch{DIR/aux-fixed/0002.alias2}{$value}fail}}}
515 ${lookup{both}lsearch{DIR/aux-fixed/0002.alias1}{$value${lookup{both}lsearch{DIR/aux-fixed/0002.alias2}{,$value}}}{${lookup{both}lsearch{DIR/aux-fixed/0002.alias2}{$value}fail}}}
516 ${lookup{neither}lsearch{DIR/aux-fixed/0002.alias1}{$value${lookup{neither}lsearch{DIR/aux-fixed/0002.alias2}{,$value}}}{${lookup{neither}lsearch{DIR/aux-fixed/0002.alias2}{$value}fail}}}
517
518 # Lookup quotes for standardly expected lookups
519
520 lsearch ${quote_lsearch: !@#\$%^&*()_-+=|\\~`1234567890\{[\}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm}
521 xxx     ${quote_xxx: !@#\$%^&*()_-+=|\\~`1234567890\{[\}]qwertyuiop:;"'asdfghjkl<,>.?/zxcvbnm}
522
523 # Extract
524
525 ${extract{B}{A=1 B=2 C=3}}
526 ${extract{ B }{A=1 B=2 C=3}{$value}{NOT FOUND}}
527 ${extract{2}{:}{1:2:3}}
528 ${extract{ 2 }{:}{1:2:3}{$value}{NOT FOUND}}
529 Empty:<${extract{D}{A=1 B=2 C=3}}>
530 Empty:<${extract{4}{:}{1:2:3}}>
531 ${extract{C}{A=1 B=2 C=3}{<$value>}}
532 ${extract{3}{:}{1:2:3}{<$value>}}
533 Empty:<${extract{Z}{A=1 B=2 C=3}{<$value>}}>
534 Empty:<${extract{4}{:}{1:2:3}{<$value>}}>
535 ${extract{Z}{A=1 B=2 C=3}{<$value>}{no Z}}
536 ${extract{4}{:}{1:2:3}{<$value>}{no 4}}
537 ${extract{Z}{A=1 B=2 C=3}{<$value>}fail}
538 ${extract{4}{:}{1:2:3}{<$value>}fail}
539 ${extract{K4}{${sg{1=A 4=D 3=C}{(\\d+)=}{K\$1=}}}}
540 ${extract{0}{:}{a:b:c:d:e}{$value}{FAIL}}
541 ${extract{1}{:}{a:b:c:d:e}{$value}{FAIL}}
542 ${extract{-1}{:}{a:b:c:d:e}{$value}{FAIL}}
543 ${extract{-5}{:}{a:b:c:d:e}{$value}{FAIL}}
544 ${extract{-6}{:}{a:b:c:d:e}{$value}{FAIL}}
545 ${extract{-3}{:,}{a,,b::c}}
546 ${extract{2}{:,}{a,,b::c}}
547 ${extract{3}{:,}{a,,b::c}}
548 ${extract{a-b}{X = "one two" a-b "three four" 5=99}}
549 ${extract{}{X=3}}
550 ${extract{ }{X=3}}
551 ${extract{ 2 }{ }{a b c}}
552
553 # Translation
554
555 abcdea aaa xyz ${tr{abcdea}{aaa}{xyz}}
556 abcdea a   z   ${tr{abcdea}{a}{z}}
557 abcdea a       ${tr{abcdea}{a}{}}
558 abcdea abc z   ${tr{abcdea}{abc}{z}}
559
560 # Boolean
561 "TrUe"                ${if bool{TrUe}{true}{false}}      EXPECT: true
562 "FALSE"               ${if bool{FALSE}{true}{false}}     EXPECT: false
563 " yes"                ${if bool{ yes}{true}{false}}      EXPECT: true
564 " no"                 ${if bool{ no}{true}{false}}     EXPECT: false
565 "yes "                ${if bool{yes }{true}{false}}      EXPECT: true
566 "-1"                  ${if bool{-1}{true}{false}}     EXPECT: error
567 "0"                   ${if bool{0}{true}{false}}     EXPECT: false
568 "1"                   ${if bool{1}{true}{false}}      EXPECT: true
569 " 0 "                 ${if bool{ 0 }{true}{false}}     EXPECT: false
570 " 1 "                 ${if bool{ 1 }{true}{false}}      EXPECT: true
571 "1111111111111111111" ${if bool{1111111111111111111}{true}{false}}      EXPECT: true
572 "9"                   ${if bool{9}{true}{false}}      EXPECT: true
573 " "                   ${if bool{ }{true}{false}}     EXPECT: false
574 "text"                ${if bool{text}{true}{false}}     EXPECT: error
575 " text"               ${if bool{ text}{true}{false}}     EXPECT: error
576 "text "               ${if bool{text }{true}{false}}     EXPECT: error
577 " text "              ${if bool{ text }{true}{false}}     EXPECT: error
578 "00"                  ${if bool{00}{true}{false}}     EXPECT: false
579 "!true"               ${if !bool{true}{true}{false}}     EXPECT: false
580 "!false"              ${if !bool{false}{true}{false}}      EXPECT: true
581
582 "TrUe"                ${if bool_lax{TrUe}{true}{false}}      EXPECT: true
583 "FALSE"               ${if bool_lax{FALSE}{true}{false}}     EXPECT: false
584 " yes"                ${if bool_lax{ yes}{true}{false}}      EXPECT: true
585 " no"                 ${if bool_lax{ no}{true}{false}}     EXPECT: false
586 "yes "                ${if bool_lax{yes }{true}{false}}      EXPECT: true
587 "-1"                  ${if bool_lax{-1}{true}{false}}      EXPECT: true
588 "0"                   ${if bool_lax{0}{true}{false}}     EXPECT: false
589 "1"                   ${if bool_lax{1}{true}{false}}      EXPECT: true
590 " 0 "                 ${if bool_lax{ 0 }{true}{false}}     EXPECT: false
591 " 1 "                 ${if bool_lax{ 1 }{true}{false}}      EXPECT: true
592 "1111111111111111111" ${if bool_lax{1111111111111111111}{true}{false}}      EXPECT: true
593 "9"                   ${if bool_lax{9}{true}{false}}      EXPECT: true
594 " "                   ${if bool_lax{ }{true}{false}}     EXPECT: false
595 "text"                ${if bool_lax{text}{true}{false}}      EXPECT: true
596 " text"               ${if bool_lax{ text}{true}{false}}      EXPECT: true
597 "text "               ${if bool_lax{text }{true}{false}}      EXPECT: true
598 " text "              ${if bool_lax{ text }{true}{false}}      EXPECT: true
599 "00"                  ${if bool_lax{00}{true}{false}}      EXPECT: true
600 "!true"               ${if !bool_lax{true}{true}{false}}     EXPECT: false
601 "!false"              ${if !bool_lax{false}{true}{false}}      EXPECT: true
602
603 # RFC 2047
604
605 abcd      ${rfc2047:abcd}
606 <:abcd:>  ${rfc2047:<:abcd:>}
607 <:ab cd:> ${rfc2047:<:ab cd:>}
608 Long:     ${rfc2047: here we go: a string that is going to be encoded: it will go over the 75-char limit}
609 Long:     ${rfc2047: 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}
610
611 # RFC 2047 decode
612
613 ${rfc2047d:abcd      abcd}
614 ${rfc2047d:<:abcd:>  =?iso-8859-8?Q?=3C=3Aabcd=3A=3E?=}
615 ${rfc2047d:<:ab cd:> =?iso-8859-8?Q?=3C=3Aab_cd=3A=3E?=}
616 ${rfc2047d:Long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_i?= =?iso-8859-8?Q?t_will_go_over_the_75-char_limit?=}
617 ${rfc2047d:Long:     =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_i?= =?iso-8859-8?Q?t_will_go_over_the_75-char_limit_by_a_long_way=3B_in_fac?= =?iso-8859-8?Q?t_this_one_will_go_over_the_150_character_limit?=}
618
619 # UTF-8
620
621 abcd      ${from_utf8:abcd}
622 aÀÿd      ${from_utf8:aÃ\80ÿd}
623 toobig    ${from_utf8:aĀd}
624
625 # Substitution
626
627 \${sg{abcdefabcdef}{abc}{xyz}}          =${sg{abcdefabcdef}{abc}{xyz}}
628 \${sg{ab:xy::z}{:}{::}}                 =${sg{ab:xy::z}{:}{::}}
629 \${sg{abcdefabcdef}{(..)[^c]}{>\$1<}}    =${sg{abcdefabcdef}{(..)[^c]}{>$1<}}
630 \${sg{abcdefabcdef}{(..)[^c]}{>\\\$1<}}   =${sg{abcdefabcdef}{(..)[^c]}{>\$1<}}
631 \${sg{abcdefabcdef}{(..)[^c]}{>\\N\$1\\N<}}=${sg{abcdefabcdef}{(..)[^c]}{>\N$1\N<}}
632 \${sg{abbab}{a*}{+}}                    =${sg{abbab}{a*}{+}}
633
634 # File insertion
635
636 ${readfile}
637 ${readfile{DIR/aux-fixed/0002.readfile}}
638 ${readfile{DIR/aux-fixed/0002.readfile}{}}
639 ${readfile{DIR/aux-fixed/0002.readfile}{:}}
640 ${readfile{DIR/aux-fixed/0002.readfile}{ - }}
641 ${readfile{/non/exist/file}}
642 ${if exists{/non/exist/file}{${readfile{/non/exist/file}}}{non-exist}}
643 >${readfile{DIR/aux-fixed/0002.readfile}{!}}\
644     <
645
646 # Calling a command
647
648 ${run{DIR/aux-fixed/0002.runfile 0}}
649 RC=$runrc
650 ${run{DIR/aux-fixed/0002.runfile 0}{1}{2}}
651 RC=$runrc
652 ${run{DIR/aux-fixed/0002.runfile 0}{$value}{2}}
653 RC=$runrc
654 ${run{DIR/aux-fixed/0002.runfile 1}{$value}{2}}
655 RC=$runrc
656 ${run{DIR/aux-fixed/0002.runfile 1}{$value}{$value}}
657 RC=$runrc
658 ${run{DIR/test-nonexist}{Y}{N}}
659 RC=$runrc
660 >>${run{DIR/bin/iefbr14}}<<
661 RC=$runrc
662 ${if eq{1}{2}{${run{/non/exist}}}{1!=2}}
663 RC=$runrc
664
665 # PRVS
666
667 ${prvs{userx@test.ex}{secret}}
668 ${prvs{userx@test.ex}{secret}{1}}
669 ${prvs{userx@test.ex}{secret}{8}}
670
671 # Syntax errors
672
673 ${prvs{userx@test.ex}{secret}{12}}
674 ${prvs{userx@test.ex}{secret}{rhubarb}}
675 ${prvs{userx@test.ex}{secret}{}}
676
677 # Correct checks; can't put explicit addresses in the tests, because they
678 # will change over time.
679
680 ${prvscheck{${prvs{userx@test.ex}{secret}}}{secret}}
681 result=$prvscheck_result
682
683 ${prvscheck{${prvs{userx@test.ex}{secret}{1}}}{secret}\
684 {>$prvscheck_result< >$prvscheck_address< >$prvscheck_keynum<}}
685 result=$prvscheck_result
686
687 ${prvscheck{${prvs{userx@test.ex}{secret}{8}}}{secret}{}}
688 result=$prvscheck_result
689
690 # Incorrect secret
691
692 ${prvscheck{${prvs{userx@test.ex}{secret}}}{socrot}}
693 result=$prvscheck_result
694
695 ${prvscheck{${prvs{userx@test.ex}{secret}}}{socrot}{$prvscheck_keynum}}
696 result=$prvscheck_result
697
698 # Non-prvs address
699
700 >>${prvscheck{userx@test.ex}{secret}}<<
701 result=$prvscheck_result
702
703 # Syntax errors
704
705 ${tod_log
706 ${tod_log+6
707 ${expand:abcd
708 ${expand:abcd${tod_log}
709 ${hmac{xxx}{a}{b}}
710 ${if and {xyz}{a}{b}}
711 ${if and {{xya}}{a}{b}}
712 ${if and {{${lookup{x}lsearch{/a/b}}}}{a}{b}}
713 ${if eq {$h_xyz}{1}{y}{n}}
714 ${if eq {$h_xyz:}{1}{y}{n}
715 ${if def:h_xyz}{y}{n}}
716 ${if or {eq {}{}{yes}{no}}
717 ${if or {{eq {}{}{yes}{no}}
718 ${if or {{eq {}{}}{yes}{no}}
719 ${substr_1_:12345}
720 ${substr__3:12345}
721
722 # Iterations: forany and forall
723
724 ${if forany{a:b:c}{eq{$item}{a}}{yes}{no}}
725 ${if forany{a:b:c}{eq{$item}{b}}{yes}{no}}
726 ${if forany{a:b:c}{eq{$item}{c}}{yes}{no}}
727 ${if forany {a:b:c} {eq {$item} {z}} {yes} {no}}
728 ${if !forany{a:b:c}{eq{$item}{z}}{yes}{no}}
729 ${if !forany{a:b:c}{eq{$item}{a}}{yes}{no}}
730 ${if forany{}{eq{$item}{a}}{yes}{no}}
731 ${if !forany{}{eq{$item}{a}}{yes}{no}}
732 ${if forany{<, $primary_hostname,foo,bar}{eq{$item}{$primary_hostname}}{yes}{no}}
733
734 ${if forany{}{yes}{no}}
735 ${if forany{a:b:c}{gt{$item}{a}{yes}{no}}
736
737 ${if forall{a:b:c}{match{$item}{^[a-c]\$}}{yes}{no}}
738 ${if forall{q:b:c}{match{$item}{^[a-c]\$}}{yes}{no}}
739 ${if forall{a:b:z}{match{$item}{^[a-c]\$}}{yes}{no}}
740 ${if forall{}{match{$item}{^[a-c]\$}}{yes}{no}}
741
742 ${if !forall{a:b:c}{match{$item}{^[a-c]\$}}{yes}{no}}
743 ${if !forall{q:b:c}{match{$item}{^[a-c]\$}}{yes}{no}}
744 ${if !forall{a:b:z}{match{$item}{^[a-c]\$}}{yes}{no}}
745 ${if !forall{}{match{$item}{^[a-c]\$}}{yes}{no}}
746
747 # Expect yes
748 ${if forany{a:b:c}\
749   {\
750   eq\
751     {$item: ${if forall{x:y:z}{match{$item}{^[x-z]\$}}{true}{false}}}\
752     {$item: true}\
753   }\
754 {outer=yes}{outer=no}} item='$item' (unset)
755
756 # Expect no
757 ${if forany{a:b:c}\
758   {\
759   eq\
760     {$item: ${if !forall{x:y:z}{match{$item}{^[x-z]\$}}{true}{false}}}\
761     {$item: true}\
762   }\
763 {outer=yes}{outer=no}}
764
765 # Error inside nest - check message is helpful
766 ${if forany{a:b:c}\
767   {\
768   eq\
769     {$item: ${if forall{x:y:z}{match{$item}{^[x-z]\$}{true}{false}}}\
770     {$item: true}\
771   }\
772 {outer=yes}{outer=no}}
773
774
775 # Miscellaneous (for bug fixes, etc)
776
777 ${if ={1}{1} {true}{${if ={1}{1} {true}{${if ={1}{1}{true}fail}}}}}
778
779 ****
780 # Test "escape" with print_topbitchars
781 exim -be -DPTBC=print_topbitchars
782 escape: ${escape:B7·F2ò}
783 ****
784 # Checkout expansion debugging
785 exim -d-all+expand -be
786 primary_hostname: $primary_hostname
787 match:  ${if match{abcd}{\N^([ab]+)(\w+)$\N}{$2$1}fail}
788 match:  ${if match{wxyz}{\N^([ab]+)(\w+)$\N}{$2$1}fail}
789 ${if eq {1}{1}{yes}{${lookup{xx}lsearch{/non/exist}}}}
790 match_address:   ${if match_address{a.b.c}{a.b.c}{yes}{no}}
791 ****
792 # Sender host name and address etc, all unset
793 exim -be
794 -oMa  sender_host_address = $sender_host_address
795       sender_host_port = $sender_host_port
796 -oMaa sender_host_authenticated = $sender_host_authenticated
797 -oMai authenticated_id = $authenticated_id
798 -oMas authenticated_sender = $authenticated_sender
799 -oMi  interface_address = $interface_address
800       interface_port = $interface_port
801 -oMr  received_protocol = $received_protocol
802 -oMs  sender_host_name = $sender_host_name
803 -oMt  sender_ident = $sender_ident
804 ****
805 # Sender host name and address etc, all set except host name.
806 exim -d-all+expand -be -oMa V4NET.0.0.1.1234 -oMaa AAA -oMai philip -oMas xx@yy.zz -oMi 1.1.1.1.99 -oMr special -oMt me
807 -oMa  sender_host_address = $sender_host_address
808       sender_host_port = $sender_host_port
809 -oMaa sender_host_authenticated = $sender_host_authenticated
810 -oMai authenticated_id = $authenticated_id
811 -oMas authenticated_sender = $authenticated_sender
812 -oMi  interface_address = $interface_address
813       interface_port = $interface_port
814 -oMr  received_protocol = $received_protocol
815 -oMt  sender_ident = $sender_ident
816 ****
817 # Sender host name explicitly set
818 exim -be -oMa V4NET.0.0.1.1234 -oMs my.host.name
819 -oMa  sender_host_address = $sender_host_address
820       sender_host_port = $sender_host_port
821 -oMs  sender_host_name = $sender_host_name
822 ****
823 # Sender host name lookup fails (V4NET.11.12.13 is not reverse registered)
824 exim -be -oMa V4NET.11.12.13
825 -oMs  sender_host_name = $sender_host_name
826       host_lookup_failed = $host_lookup_failed
827 ****
828 # Sender host name and protocol set by Sendmail-compatible option
829 exim -be -pspecial:host.name
830 -p  received_protocol = $received_protocol
831 -p  sender_host_name = $sender_host_name
832 ****
833 # Sender host name and address etc, all set except host name,
834 # which should therefore be looked up from the address, but not if
835 # we are skipping. The debug output for this test will show when
836 # the lookup occurs.
837 exim -d-all+host_lookup+expand -be -oMa V4NET.0.0.1.1234 -oMaa AAA -oMai philip -oMas xx@yy.zz -oMi 1.1.1.1.99 -oMr special -oMt me
838 -oMa  sender_host_address = $sender_host_address
839       sender_host_port = $sender_host_port
840 -oMaa sender_host_authenticated = $sender_host_authenticated
841 -oMai authenticated_id = $authenticated_id
842 -oMas authenticated_sender = $authenticated_sender
843 -oMi  interface_address = $interface_address
844       interface_port = $interface_port
845 -oMr  received_protocol = $received_protocol
846 ----> No lookup yet: ${if eq{black}{white}{$sender_host_name}{No}}
847 -oMs  sender_host_name = $sender_host_name
848 -oMt  sender_ident = $sender_ident
849 ****
850 # Test no auto host name lookup for query-style lookups
851 exim -d -bh V4NET.0.0.1
852 ****
853 exim -d -bh V4NET.0.0.2
854 ****
855 # Test $reply_address
856 exim -bh V4NET.0.0.0
857 mail from:<>
858 rcpt to:<some@body>
859 data
860 .
861 mail from:<>
862 rcpt to:<some@body>
863 data
864 From: a@b
865 .
866 mail from:<>
867 rcpt to:<some@body>
868 data
869 From: a@b
870 Reply-to: c@d
871 .
872 mail from:<>
873 rcpt to:<some@body>
874 data
875 Reply-to:
876 .
877 mail from:<>
878 rcpt to:<some@body>
879 data
880 Reply-to:
881 From: x@y
882 .
883 quit
884 ****
885 # Check RFC 2047 decoding with (default) length check
886 exim -bh V4NET.0.0.0
887 mail from:<>
888 rcpt to:<some@body>
889 data
890 Subject: =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_over_the_75-char_limit_by_a_long_way=3B_in_fact_this_one_will_go_over_the_150_character_limit?=
891 .
892 quit
893 ****
894 # Check RFC 2047 decoding with length check disabled
895 exim -DLENCHECK=check_rfc2047_length=false -bh V4NET.0.0.0
896 mail from:<>
897 rcpt to:<some@body>
898 data
899 Subject: =?iso-8859-8?Q?_here_we_go=3A_a_string_that_is_going_to_be_encoded=3A_it_will_go_over_the_75-char_limit_by_a_long_way=3B_in_fact_this_one_will_go_over_the_150_character_limit?=
900 .
901 quit
902 ****
903 # Certain kind of error
904 exim -d -be
905 match_ip:        15 ${if match_ip{1.2.3.4}{1.2.3}}
906 match_ip:        16 ${if match_ip{1.2.3.4}{1.2.3.4/abc}}
907 ****