Commit | Line | Data |
---|---|---|
afda344b PH |
1 | # Exim test configuration 0023 |
2 | ||
3 | LOG_SELECTOR= | |
4 | ||
5 | exim_path = EXIM_PATH | |
6 | host_lookup_order = bydns | |
7 | primary_hostname = myhost.test.ex | |
8 | rfc1413_query_timeout = 0s | |
9 | spool_directory = DIR/spool | |
10 | log_file_path = DIR/spool/log/%slog | |
11 | gecos_pattern = "" | |
12 | gecos_name = CALLER_NAME | |
13 | ||
14 | # ----- Main settings ----- | |
15 | ||
16 | addresslist ok_senders = ok@ok.ok | |
17 | ||
18 | domainlist local_domains = test.ex : *.test.ex | |
19 | domainlist relay_domains = relay.test.ex | |
20 | ||
21 | hostlist ok9_hosts = 9.9.9.9 | |
22 | ||
23 | LOG_SELECTOR | |
24 | ||
25 | qualify_domain = test.ex | |
26 | trusted_users = CALLER | |
27 | ||
28 | # Use first three components of address to select ACL | |
29 | acl_smtp_rcpt = acl_${sg{${tr{$sender_host_address}{.}{_}}}{^(.*)_.*\$}{\$1}} | |
30 | acl_smtp_data = data_acl | |
31 | ||
32 | # ----- ACLs ----- | |
33 | ||
34 | begin acl | |
35 | ||
36 | data_acl: | |
37 | warn condition = ${if def:h_x-rcpt-added:{yes}{no}} | |
38 | message = X-data-added: Header added at data time | |
39 | warn senders = rcpttest@test.ex | |
40 | message = X-data-rcpt-count: $rcpt_count\n\ | |
41 | X-data-rcpt-defer-count: $rcpt_defer_count\n\ | |
42 | X-data-rcpt-fail-count: $rcpt_fail_count | |
43 | warn message = X-message-body-size: $message_body_size | |
44 | accept | |
45 | ||
46 | acl_1_2_3: | |
47 | require domains = !nopass | |
48 | ||
49 | require message = $local_part@$domain shall not pass | |
50 | domains = !wontpass | |
51 | ||
52 | deny message = domain explicitly denied | |
53 | log_message = DOMAIN EXPLICITLY DENIED | |
c3611384 | 54 | continue = this value is not used |
afda344b PH |
55 | domains = deny.test.ex |
56 | ||
57 | accept domains = +local_domains | |
58 | endpass | |
59 | message = $domain gets refused | |
60 | domains = !refuse.test.ex | |
61 | ||
62 | # Double to check caching | |
63 | accept domains = +relay_domains | |
64 | accept domains = +relay_domains | |
65 | ||
66 | acl_5_6_7: | |
67 | accept domains = lsearch;DIR/aux-fixed/TESTNUM.doms | |
68 | local_parts = $domain_data | |
69 | ||
70 | acl_5_6_8: | |
71 | accept senders = user1@domain1 : domain2 : +ok_senders | |
72 | ||
73 | acl_5_6_11: | |
74 | accept condition = ${if match{$local_part}{^x}{yes}{no}} | |
75 | deny message = "local part of wrong type\n(quotes are literal) | |
76 | ||
77 | acl_5_6_12: | |
78 | accept hosts = 5.6.12.1 | |
79 | endpass | |
80 | message = failed nested acl | |
81 | acl = acl_5_6_12A | |
82 | accept | |
83 | ||
84 | acl_5_6_12A: | |
85 | accept domains = ok | |
86 | ||
87 | acl_5_6_13: | |
88 | accept acl = DIR/aux-fixed/TESTNUM.acl1 | |
89 | ||
90 | acl_8_8_8: | |
91 | accept acl = acl_8_8_8 | |
92 | ||
93 | acl_9_9_9: | |
94 | accept hosts = +ok9_hosts | |
95 | deny message = don't like this host | |
96 | hosts = 9.9.9.0/26 | |
97 | accept hosts = 9.9.9.0/24 | |
98 | ||
99 | acl_V4NET_0_0: | |
100 | require verify = reverse_host_lookup | |
101 | accept | |
102 | ||
103 | acl_V4NET_11_12: | |
104 | deny message = host in DNS list $dnslist_domain: $dnslist_text | |
105 | log_message = DNSLIST ($dnslist_domain: $dnslist_text) | |
106 | dnslists = rbl.test.ex | |
107 | accept | |
108 | ||
109 | acl_20_20_20: | |
110 | accept endpass | |
111 | message = sender verify failure | |
112 | verify = sender | |
113 | message = recipient verify failure | |
114 | verify = recipient | |
115 | ||
116 | acl_21_21_21: | |
117 | accept | |
118 | verify = sender | |
119 | verify = recipient | |
120 | ||
121 | acl_22_22_22: | |
122 | accept recipients = x@y | |
123 | ||
124 | acl_23_23_23: | |
125 | deny hosts = 23.23.23.0 | |
126 | message = sender must verify | |
127 | !verify = sender | |
128 | accept | |
129 | ||
130 | acl_24_24_24: | |
131 | warn message = X-Warn: sender didn't verify | |
132 | condition = yes | |
133 | ||
134 | acl_25_25_25: | |
135 | deny message = denying domains=x | |
136 | domains = x | |
137 | ||
138 | acl_26_26_26: | |
139 | deny senders = : | |
140 | message = bounce messages can have only one recipient | |
141 | condition = ${if > {$recipients_count}{0}{yes}{no}} | |
142 | accept | |
143 | ||
144 | # Force host list expansion failure | |
145 | acl_27_27_27: | |
146 | deny hosts = ${if eq {1}{0}{}fail} | |
147 | accept | |
148 | ||
149 | acl_28_28_28: | |
150 | accept sender_domains = : okdomain | |
151 | ||
152 | acl_29_29_29: | |
153 | deny dnslists = test.ex/$sender_address_domain | |
154 | accept | |
155 | ||
156 | acl_30_30_30: | |
157 | deny message = domain=$dnslist_domain\n\ | |
158 | value=$dnslist_value\n\ | |
93655c46 | 159 | matched=$dnslist_matched\n\ |
afda344b PH |
160 | text="$dnslist_text" |
161 | dnslists = test.ex=V4NET.0.0.1,127.0.0.2/$sender_address_domain | |
162 | accept | |
163 | ||
164 | # This one tests what happens when a lookup key gets too long | |
165 | acl_31_31_31: | |
166 | deny dnslists = test.ex/$sender_address_domain+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+extra+END | |
167 | accept | |
168 | ||
169 | # Settings of $domain and $local_part | |
170 | acl_32_32_32: | |
171 | warn message = Start: domain=$domain local_part=$local_part | |
172 | ||
173 | warn local_parts = userx-vs | |
174 | message = Vs: domain=$domain local_part=$local_part | |
175 | verify = sender | |
176 | ||
177 | warn message = Vr: domain=$domain local_part=$local_part | |
178 | verify = recipient | |
179 | ||
180 | accept | |
181 | ||
182 | acl_33_33_33: | |
183 | accept endpass | |
184 | message = sender verify failure | |
185 | verify = sender/no_details | |
186 | message = recipient verify failure | |
187 | verify = recipient | |
188 | ||
189 | # Incomplete DNS lookups | |
190 | acl_44_44_44: | |
191 | warn dnslists = test.again.dns | |
192 | warn dnslists = +include_unknown : test.again.dns | |
193 | warn dnslists = +exclude_unknown : test.again.dns | |
194 | warn dnslists = +defer_unknown : test.again.dns | |
195 | accept | |
196 | ||
197 | # Adding header at RCPT time and testing at DATA time | |
198 | acl_55_55_55: | |
199 | warn message = X-rcpt-added: An added header at RCPT time | |
200 | accept | |
201 | ||
202 | acl_56_56_56: | |
203 | warn message = X-Warn: $local_part | |
204 | condition = ${substr_5:$local_part} | |
205 | accept | |
206 | ||
207 | acl_56_56_57: | |
4e88a19f | 208 | accept message = accepted by condition |
afda344b PH |
209 | condition = ${substr_5:$local_part} |
210 | ||
211 | acl_56_56_58: | |
212 | warn message = xx: rcpt_count = $rcpt_count\n \ | |
213 | rcpt_defer_count = $rcpt_defer_count\n \ | |
214 | rcpt_fail_count = $rcpt_fail_count\n \ | |
215 | recipients_count = $recipients_count\n \ | |
216 | local_part = $local_part | |
217 | accept local_parts = ^ok | |
218 | ||
219 | acl_56_56_59: | |
220 | accept message = ACL message for verification failure\n \ | |
221 | Original was >$acl_verify_message< | |
222 | verify = recipient | |
223 | ||
0b26748a PH |
224 | acl_60_60_60: |
225 | accept !acl = DIR/aux-fixed/0023.acl2 | |
226 | ||
afda344b PH |
227 | |
228 | # ----- Transports ----- | |
229 | ||
230 | begin transports | |
231 | ||
232 | t1: | |
233 | driver = appendfile | |
234 | file = DIR/test-mail/$local_part | |
235 | user = CALLER | |
236 | ||
237 | t2: | |
238 | driver = appendfile | |
239 | file = DIR/test-mail/okbatch | |
240 | user = CALLER | |
241 | batch_max = 100 | |
242 | envelope_to_add | |
243 | ||
244 | # ----- Routers ----- | |
245 | ||
246 | begin routers | |
247 | ||
248 | r0: | |
249 | driver = accept | |
250 | local_parts = ^ok | |
251 | transport = t2 | |
252 | ||
253 | r1: | |
254 | driver = accept | |
255 | local_parts = ^userx : ^cond- | |
256 | transport = t1 | |
257 | ||
258 | r2: | |
259 | driver = redirect | |
260 | local_parts = fail | |
261 | allow_fail | |
262 | data = :fail: here is a fail message | |
263 | ||
264 | # ----- Retry ----- | |
265 | ||
266 | begin retry | |
267 | ||
268 | * * F,5d,5m | |
269 | ||
270 | # End |