Code tidying
[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
aa26e137
JH
78listextract: ${listextract{ 2}{a:b:c:d}}
79listextract: ${listextract{-2}{<,a,b,c,d}{X${value}X}}
80listextract: ${listextract{ 5}{a:b:c:d}}
81listextract: ${listextract{-5}{a:b:c:d}}
82listextract: ${listextract{ 5}{a:b:c:d}{}{fail}}
83listextract: ${listextract{ 5}{a:b:c:d}{}fail}
84
ac4ef9bd
JH
85sort: ${sort{3:2:1:4}{<}{$item}}
86sort: ${sort {<, 3,2,1,4}{>}{$item}}
87sort: ${sort{c:B:a:aa}{lti}{$item}}
88sort: ${sort{666 r99.ex.com:10 smtp.ex.com:100 r2.ex.com}{<}{${sg {$item}{([0-9]*).*\$}{\$1}}}}
89sort: ${sort{666,r99.ex.com:10,smtp.ex.com:100,r2.ex.com}{<}{${listextract{1}{<,$item}}}}
90sort: "${sort{}{<}{$item}}"
91
ec95d1a6
PH
92# Tests with iscntrl() and illegal separators
93
94map: ${map{<\n a\n\nb\nc}{'$item'}}
95
96reduce: ${reduce {<n 1\n2\n3}{0}{${eval:$value+$item}}}
97reduce: ${reduce {<\n 1\n2\n3}{0}{${eval:$value+$item}}}
98reduce: ${reduce { <\n 1\n 2 \n 3 }{0}{${eval:$value+$item}}}
99reduce: ${reduce {<\x7f 1\x7f2\177 3}{0}{${eval:$value+$item}}}
100
59371ea7
PH
101# Operators
102
723c72e6
JH
103acl: ${acl
104acl: ${acl}
bef3ea7f 105acl: ${acl {a_nosuch}}
723c72e6
JH
106acl: ${acl {a_ret}}
107acl: ${acl {a_ret}{person@dom.ain}}
525239c1
JH
108acl: ${acl {a_ret}{firstarg}{secondarg}}
109acl: ${acl {a_ret}{arg with spaces}}
723c72e6
JH
110acl: ${acl {a_none}}
111acl: ${acl {a_none}{person@dom.ain}}
112acl: ${acl {a_deny}}
113acl: ${acl {a_deny}{person@dom.ain}}
bef3ea7f
JH
114acl: ${acl {a_defer}}
115acl: ${acl {a_sub}{top_arg_1}{top_arg_2}{top_arg_3}}
723c72e6
JH
116acl: ${reduce {1:2:3:4} {} {$value ${acl {a_ret}{$item}}}}
117
59371ea7
PH
118addrss: ${address:local-part@dom.ain}
119addrss: ${address:Exim Person <local-part@dom.ain> (that's me)}
120domain: ${domain:local-part@dom.ain}
121domain: ${domain:Exim Person <local-part@dom.ain> (that's me)}
29f89cad
PH
122
123addresses: ${addresses:>' 'abc@xyz, 'pqr@xyz}
124addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me)}
125addresses: ${addresses:>+ Exim Person <local-part@dom.ain> (that's me),\
126 xyz@abc}
127addresses: ${addresses:Exim Person <local-part@dom.ain> (that's me), \
128 xyz@abc, nullgroupname:;, group: p@q, r@s; }
129addresses: ${addresses:local-part@dom.ain <local-part@dom.ain>}
130
59371ea7
PH
131