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