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