Use custom variables for ACL args, up to nine. Add an arg-count variable.
[exim.git] / test / scripts / 0000-Basic / 0002
CommitLineData
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 7munge dnssec
59371ea7
PH
8
9exim -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
17exim_path: $exim_path
18primary_hostname: $primary_hostname
19primary_hostname: ${primary_hostname}
20qualify_domain: $qualify_domain
21bounce_return_size_limit: ${bounce_return_size_limit}
22spool_directory: $spool_directory
23unknown: ${unknown}
24h_subject: $h_subject:(should be empty)
25h_subject:$h_subject (should be empty)
26header in curlies: ${header_subject:} (should fail)
27
28# \$message_headers should be empty
29message_headers: >$message_headers<
30
31# Continuation
32x\
33y
34x\
35 y
36
37# Overlong names and overbig numbers
38
39+$aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
40+${aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa}
41+$11111111111111111111111111111111111
42+${11111111111111111111111111111111111}
43
29f89cad
PH
44# List operations
45
46filter: "${filter{a:b:c}{eq{1}{1}}}"
47filter: ${filter{a:b:c}{!eq{$item}{b}}}
48filter: ${filter{<' a'b'c}{!eq{$item}{b}}}
49filter: ${filter{<' ''a'b' ''c}{!eq{$item}{b}}}
50filter: "${filter{}{!eq{$item}{b}}}"
51
52map: "${map{}{$item}}"
53map: ${map{a:b:c}{$item}}
54map: ${map{a:b:c}{:$item:}}
55map: ${if eq{1}{0}{${map{a:b:c}{:$item:}}}{fail string}}
56map: ${map{:b:c}{[$item]}}
57
58reduce: "${reduce{}{+}{$value$item}}"
59reduce: ${reduce{a:b:c}{+}{$value$item}}
60reduce: ${reduce {<, 1,2,3}{0}{${eval:$value+$item}}}
61reduce: ${reduce {3:0:9:4:6}{0}{${if >{$item}{$value}{$item}{$value}}}}
62
a64a3dfa
JH
63listnamed: ${listnamed:dlist}
64listnamed: ${listnamed:+dlist}
65listnamed: ${listnamed:hlist}
66listnamed: ${listnamed:elist}
67listnamed: ${listnamed:flist}
68listnamed: ${listnamed:nolist}
69listnamed: ${listnamed_d:dlist}
70listnamed: ${listnamed_d:hlist}
71listnamed: ${listnamed_z:dlist}
72
73listcount: ${listcount:a:b:c}
74listcount: ${listcount:}
75listcount: ${listcount:<;a;b;c}
76listcount: ${listcount:${listnamed:dlist}}
042eb971 77
ec95d1a6
PH
78# Tests with iscntrl() and illegal separators
79
80map: ${map{<\n a\n\nb\nc}{'$item'}}
81
82reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}}
83reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}}
84reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}}
85reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}}
86
59371ea7
PH
87# Operators
88
723c72e6
JH
89acl: ${acl
90acl: ${acl}
91acl: ${acl {a_bad}}
92acl: ${acl {a_ret}}
93acl: ${acl {a_ret}{person@dom.ain}}
525239c1
JH
94acl: ${acl {a_ret}{firstarg}{secondarg}}
95acl: ${acl {a_ret}{arg with spaces}}
723c72e6
JH
96acl: ${acl {a_none}}
97acl: ${acl {a_none}{person@dom.ain}}
98acl: ${acl {a_deny}}
99acl: ${acl {a_deny}{person@dom.ain}}
100acl: ${reduce {1:2:3:4} {} {$value ${acl {a_ret}{$item}}}}
101
59371ea7
PH
102addrss: ${address:local-part@dom.ain}
103addrss: ${address:Exim Person <local-part@dom.ain> (that's me)}
104domain: ${domain:local-part@dom.ain}
105domain: ${domain:Exim Person <local-part@dom.ain> (that's me)}
29f89cad
PH
106
107addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz}
108addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)}
109addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\
110 xyz@abc}
111addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \
112 xyz@abc, nullgroupname:;, group: p@q, r@s; }
113addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>}
114
59371ea7
PH
115