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