Debian Codegraph @

test/functional/configs/merged-override.conf

raw
1 antivirus {
2 clam {
3 attachments_only = false;
4 symbol = "CLAM_VIRUS";
5 type = "clamav";
6 servers = "127.0.0.1:{= env.PORT_CLAM =}";
7 }
8 fprot {
9 attachments_only = false;
10 symbol = "FPROT_VIRUS";
11 type = "fprot";
12 servers = "127.0.0.1:{= env.PORT_FPROT =}";
13 patterns {
14 FPROT_EICAR = "^EICAR_Test_File$";
15 }
16 }
17 fprot_duplicate {
18 prefix = "fp_dupe";
19 attachments_only = false;
20 symbol = "FPROT2_VIRUS_DUPLICATE_DEFAULT";
21 type = "fprot";
22 servers = "127.0.0.1:{= env.PORT_FPROT2_DUPLICATE =}";
23 patterns = [
24 {FPROT2_VIRUS_DUPLICATE_PATTERN = "^E"},
25 {FPROT2_VIRUS_DUPLICATE_NOPE1 = "^EI",
26 FPROT2_VIRUS_DUPLICATE_NOPE2 = "^EIC",
27 FPROT2_VIRUS_DUPLICATE_NOPE3 = "^EICA",
28 FPROT2_VIRUS_DUPLICATE_NOPE4 = "^EICAR",
29 FPROT2_VIRUS_DUPLICATE_NOPE5 = "^EICAR_"}
30 ];
31 }
32 avast {
33 attachments_only = false;
34 symbol = "AVAST_VIRUS";
35 type = "avast";
36 servers = "127.0.0.1:{= env.PORT_AVAST =}";
37 }
38 }
39
40 multimap {
41 WORDTEST4981 {
42 type = "content";
43 filter = "text";
44 map = "regexp_multi;{= env.TESTDIR =}/configs/maps/words.list";
45 score = 1.0;
46 }
47 DNSBL_MAP {
48 type = "dnsbl";
49 map = "rspamd.com";
50 }
51 IP_MAP {
52 type = "ip";
53 map = "{= env.TESTDIR =}/configs/maps/ip.list";
54 }
55 FROM_MAP {
56 type = "from";
57 filter = "email:domain";
58 map = "{= env.TESTDIR =}/configs/maps/domains.list";
59 }
60 FREEMAIL_CC {
61 type = "header";
62 header = "Cc";
63 filter = "email:domain";
64 map = "{= env.TESTDIR =}/configs/maps/domains.list.2";
65 score = 1.0;
66 }
67 REGEXP_MAP {
68 type = "from";
69 filter = "email:addr";
70 regexp = true;
71 map = "{= env.TESTDIR =}/configs/maps/regexp.list";
72 }
73 DEPS_MAP {
74 type = "from";
75 filter = "email:addr";
76 regexp = true;
77 map = "{= env.TESTDIR =}/configs/maps/regexp.list";
78 require_symbols = "(R_SPF_ALLOW|R_SPF_DNSFAIL) & REGEXP_MAP & !FROM_MAP";
79 }
80 RCPT_DOMAIN {
81 type = "rcpt";
82 filter = "email:domain";
83 map = "{= env.TESTDIR =}/configs/maps/domains.list";
84 }
85 RCPT_USER {
86 type = "rcpt";
87 filter = "email:user";
88 map = "{= env.TESTDIR =}/configs/maps/users.list";
89 }
90 RCPT_MAP {
91 type = "rcpt";
92 filter = "email:addr";
93 symbols = ["SYM1", "2000POINTS"];
94 map = "{= env.TESTDIR =}/configs/maps/multiple.list";
95 score = 1.0;
96 }
97 RCPT_MAP_NOMULTISYM {
98 type = "rcpt";
99 filter = "email:addr";
100 disable_multisymbol = true;
101 map = "{= env.TESTDIR =}/configs/maps/multiple.list";
102 score = 1.0;
103 }
104 HEADER_MAP {
105 type = "header";
106 header = "To";
107 filter = "email:name";
108 map = "{= env.TESTDIR =}/configs/maps/utf.list";
109 regexp = true;
110 }
111 HOSTNAME_MAP {
112 type = "hostname";
113 map = "{= env.TESTDIR =}/configs/maps/domains.list";
114 }
115 HOSTNAME_TOP_MAP {
116 type = "hostname";
117 filter = "top";
118 map = "{= env.TESTDIR =}/configs/maps/top.list";
119 }
120 CDB_HOSTNAME {
121 type = "hostname";
122 map = "cdb://{= env.TESTDIR =}/configs/maps/domains.cdb";
123 }
124 REDIS_HOSTNAME {
125 type = "hostname";
126 map = "redis://hostname";
127 }
128 REDIS_HOSTNAME_EXPANSION {
129 type = "hostname";
130 map = "redis://${ip}.${principal_recipient_domain}";
131 }
132 REDIS_IPADDR {
133 type = "ip";
134 map = "redis://ipaddr";
135 }
136 REDIS_FROMADDR {
137 type = "from";
138 filter = "email:addr";
139 map = "redis://emailaddr";
140 }
141 REDIS_URL_TLD {
142 type = "url";
143 map = "redis://hostname";
144 filter = "tld";
145 }
146 REDIS_URL_RE_FULL {
147 type = "url";
148 map = "redis://fullurlre";
149 filter = "full:regexp:/(html)$/";
150 }
151 REDIS_URL_FULL {
152 type = "url";
153 map = "redis://fullurl";
154 filter = "full";
155 }
156 REDIS_URL_PHISHED {
157 type = "url";
158 map = "redis://phishedurl";
159 filter = "is_phished";
160 }
161 REDIS_URL_RE_TLD {
162 type = "url";
163 map = "redis://tldre";
164 filter = "tld:regexp:/(net)$/";
165 }
166 REDIS_URL_RE_PLAIN {
167 type = "url";
168 map = "redis://urlre";
169 filter = "regexp:/^(www)/";
170 }
171 REDIS_URL_NOFILTER {
172 type = "url";
173 map = "redis://urlnofilter";
174 }
175 REDIS_COUNTRY {
176 type = "country";
177 map = "redis://cc";
178 }
179 REDIS_ASN {
180 type = "asn";
181 map = "redis://asn";
182 }
183 REDIS_ASN_FILTERED {
184 type = "mempool";
185 variable = "asn";
186 map = "redis://asn";
187 filter = "regexp:/^([0-9]).*/";
188 }
189 RCVD_TEST_01 {
190 type = "received";
191 max_pos = 1;
192 map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
193 }
194 RCVD_TEST_02 {
195 type = "received";
196 min_pos = -1;
197 map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
198 }
199 RCVD_TEST_REDIS_01 {
200 type = "received";
201 map = "redis://RCVD_TEST";
202 }
203 RCVD_AUTHED_ONE {
204 type = "received";
205 map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
206 flags = ["authenticated"];
207 nflags = ["ssl"];
208 }
209 RCVD_AUTHED_TWO {
210 type = "received";
211 map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
212 flags = ["authenticated", "ssl"];
213 }
214 COMBINED_MAP_AND {
215 type = "combined";
216 rules {
217 ip = {
218 type = "radix";
219 map = "{= env.TESTDIR =}/configs/maps/ip.list";
220 selector = "ip";
221 }
222 from {
223 map = "{= env.TESTDIR =}/configs/maps/domains.list";
224 selector = "from:domain";
225 }
226 }
227 expression = "from & ip";
228 score = 10;
229 action = "no action"
230 }
231 COMBINED_MAP_OR {
232 type = "combined";
233 rules {
234 ip = {
235 type = "radix";
236 map = "{= env.TESTDIR =}/configs/maps/ip.list";
237 selector = "ip";
238 }
239 from {
240 map = "{= env.TESTDIR =}/configs/maps/domains.list";
241 selector = "from:domain";
242 }
243 }
244 expression = "from || ip"
245 }
246
247 EXTERNAL_MULTIMAP {
248 type = "hostname";
249 filter = "top";
250 map = {
251 external = true;
252 backend = "http://127.0.0.1:18080/map-query",
253 method = "query",
254 }
255 }
256
257 EXTERNAL_MULTIMAP_CDB {
258 type = "hostname";
259 map = {
260 external = true;
261 cdb = "{= env.TESTDIR =}/configs/maps/domains.cdb";
262 }
263 }
264
265 DYN_MULTIMAP {
266 type = "hostname";
267 map = "{= env.TESTDIR =}/configs/maps/dynamic_symbols.map";
268 dynamic_symbols = true;
269 regexp = true;
270 score = 1.0; # required as the default score is 0: see https://github.com/rspamd/rspamd/issues/5247 for context
271 }
272 }
273
274 rbl {
275 rbls {
276 fake {
277 from = true;
278 ipv4 = true;
279 ipv6 = true;
280 rbl = "fake.rbl";
281 symbol = "FAKE_RBL_UNKNOWN";
282 received = true;
283 symbols_prefixes = {
284 received = 'FAKE_RECEIVED_RBL',
285 from = 'FAKE_RBL',
286 }
287 unknown = true;
288 returncodes_matcher = "regexp";
289 returncodes = {
290 "CODE_2" = '^127\.0\.0\.2$';
291 "CODE_3" = '^127\.0\.0\.3$';
292 }
293 }
294 fake_whitelist {
295 from = true;
296 ipv4 = true;
297 ipv6 = true;
298 received = true;
299 is_whitelist = true;
300 rbl = "fake.wl";
301 symbol = "FAKE_WL_RBL_UNKNOWN";
302 unknown = true;
303 #returncodes_matcher = "luapattern";
304 returncodes = {
305 "FAKE_WL_RBL_CODE_2" = "127%.0%.0%.2";
306 "FAKE_WL_RBL_CODE_3" = "127%.0%.0%.3";
307 }
308 }
309 RSPAMD_EMAILBL {
310 rbl = "test8.uribl";
311 url_compose_map = "{= env.TESTDIR =}/configs/maps/url_compose_map_for_mails.list";
312 ignore_defaults = true;
313 emails = true;
314 emails_domainonly = true
315 returncodes_matcher = "radix";
316 returncodes = {
317 RSPAMD_EMAILBL = "127.0.0.2/32";
318 }
319 }
320 URIBL_NUMERIC {
321 checks = ["numeric_urls"];
322 rbl = "test9.uribl";
323 }
324 URIBL_NUMERIC_IMAGES {
325 checks = ["numeric_urls"];
326 images = true;
327 rbl = "test9.uribl";
328 }
329 UNKNOWN_URIBL_NUMERIC_CONTENT {
330 checks = ["numeric_urls"];
331 content_urls = true;
332 rbl = "test9.uribl";
333 returncodes_matcher = "glob";
334 returncodes = {
335 URIBL_NUMERIC_CONTENT = "*.*.*.*";
336 }
337 }
338 URIBL_NONNUMERIC_VANILLA {
339 checks = ["urls"];
340 rbl = "test10.uribl";
341 exclude_local = false;
342 no_ip = true;
343 }
344 URIBL_NONNUMERIC_EVERYTHING {
345 checks = ["urls", "content_urls", "images"];
346 rbl = "test10.uribl";
347 exclude_local = false;
348 no_ip = true;
349 }
350 URIBL_NUMERIC_EVERYTHING {
351 checks = ["numeric_urls"];
352 images = true;
353 content_urls = true;
354 rbl = "test9.uribl";
355 exclude_local = false;
356 }
357 URIBL_NOCONTENT {
358 rbl = "test9.uribl";
359 ignore_defaults = true;
360 urls = true;
361 }
362 URIBL_WITHCONTENT {
363 rbl = "test9.uribl";
364 ignore_defaults = true;
365 urls = true;
366 content_urls = true;
367 }
368 URIBL_CONTENTONLY {
369 rbl = "test9.uribl";
370 ignore_defaults = true;
371 content_urls = true;
372 no_ip = true;
373 }
374 RBL_SELECTOR_SINGLE {
375 rbl = "test9.uribl";
376 ignore_defaults = true;
377 selector = "helo()";
378 }
379 RBL_SELECTOR_MULTIPLE {
380 rbl = "test9.uribl";
381 ignore_defaults = true;
382 selector = {
383 sel_from = "from('smtp'):domain";
384 sel_helo = "helo()";
385 }
386 }
387 }
388 }
389
390 surbl {
391 "whitelist" = [
392 "rspamd-test.com"
393 ];
394 rules {
395 "RSPAMD_URIBL" {
396 suffix = "test.uribl";
397 check_dkim = true;
398 check_emails = true;
399 images = false;
400 process_script =<<EOD
401 function(url, suffix)
402 local cr = require "rspamd_cryptobox_hash"
403 local h = cr.create(url):base32():sub(1, 32)
404 return string.format("%s.%s", h, suffix)
405 end
406 EOD;
407 }
408 "DBL" {
409 suffix = "test2.uribl";
410 no_ip = true;
411 check_emails = true;
412 check_dkim = true;
413 ips = {
414 # spam domain
415 DBL_SPAM = "127.0.1.2";
416 # phish domain
417 DBL_PHISH = "127.0.1.4";
418 }
419 }
420 "URIBL_MULTI" {
421 suffix = "test3.uribl";
422 check_dkim = true;
423 check_emails = true;
424 bits {
425 URIBL_BLOCKED = 1;
426 URIBL_BLACK = 2;
427 URIBL_GREY = 4;
428 URIBL_RED = 8;
429 }
430 }
431 "SPAMHAUS_ZEN_URIBL" {
432 suffix = "test4.uribl";
433 resolve_ip = true;
434 check_emails = true;
435 ips {
436 URIBL_SBL = "127.0.0.2";
437 URIBL_SBL_CSS = "127.0.0.3";
438 URIBL_XBL = ["127.0.0.4", "127.0.0.5", "127.0.0.6", "127.0.0.7"];
439 URIBL_PBL = ["127.0.0.10", "127.0.0.11"];
440 URIBL_DROP = "127.0.0.9";
441 }
442 }
443 "RSPAMD_URIBL_IMAGES" {
444 suffix = "test.uribl";
445 check_dkim = true;
446 check_emails = false;
447 images = true;
448 process_script =<<EOD
449 function(url, suffix)
450 local cr = require "rspamd_cryptobox_hash"
451 local h = cr.create(url):base32():sub(1, 32)
452 return string.format("%s.%s", h, suffix)
453 end
454 EOD;
455 }
456 "BAD_SUBDOMAIN" {
457 suffix = "test7.uribl";
458 url_compose_map = "{= env.TESTDIR =}/configs/maps/url_compose_map.list";
459 check_dkim = true;
460 check_emails = false;
461 }
462 }
463 }
464
465 # URL suspect plugin for testing
466 url_suspect {
467 enabled = true;
468 checks {
469 tld {
470 # Map is required for suspicious TLD detection
471 suspicious_tlds_map = "file://{= env.TESTDIR =}/../../conf/maps.d/suspicious_tlds.inc";
472 }
473 }
474 }