aboutsummaryrefslogtreecommitdiffstats
path: root/test/functional/configs/multimap.conf
blob: c59c1ac57e9576e23f0d2a19769e61ab7d7d3676 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
.include(duplicate=append,priority=0) "{= env.TESTDIR =}/configs/plugins.conf"

asn {
}
spf {}
redis {
  servers = "{= env.REDIS_ADDR =}:{= env.REDIS_PORT =}";
  expand_keys = true;
}
multimap {
  DNSBL_MAP {
    type = "dnsbl";
    map = "rspamd.com";
  }
  IP_MAP {
    type = "ip";
    map = "{= env.TESTDIR =}/configs/maps/ip.list";
  }
  FROM_MAP {
    type = "from";
    filter = "email:domain";
    map = "{= env.TESTDIR =}/configs/maps/domains.list";
  }
  FREEMAIL_CC {
    type = "header";
    header = "Cc";
    filter = "email:domain";
    map = "{= env.TESTDIR =}/configs/maps/domains.list.2";
    score = 1.0;
  }
  REGEXP_MAP {
    type = "from";
    filter = "email:addr";
    regexp = true;
    map = "{= env.TESTDIR =}/configs/maps/regexp.list";
  }
  DEPS_MAP {
    type = "from";
    filter = "email:addr";
    regexp = true;
    map = "{= env.TESTDIR =}/configs/maps/regexp.list";
    require_symbols = "(R_SPF_ALLOW|R_SPF_DNSFAIL) & REGEXP_MAP & !FROM_MAP";
  }
  RCPT_DOMAIN {
    type = "rcpt";
    filter = "email:domain";
    map = "{= env.TESTDIR =}/configs/maps/domains.list";
  }
  RCPT_USER {
    type = "rcpt";
    filter = "email:user";
    map = "{= env.TESTDIR =}/configs/maps/users.list";
  }
  RCPT_MAP {
    type = "rcpt";
    filter = "email:addr";
    symbols = ["SYM1"];
    map = "{= env.TESTDIR =}/configs/maps/multiple.list";
    score = 1.0;
  }
  RCPT_MAP_NOMULTISYM {
    type = "rcpt";
    filter = "email:addr";
    disable_multisymbol = true;
    map = "{= env.TESTDIR =}/configs/maps/multiple.list";
    score = 1.0;
  }
  HEADER_MAP {
    type = "header";
    header = "To";
    filter = "email:name";
    map = "{= env.TESTDIR =}/configs/maps/utf.list";
    regexp = true;
  }
  HOSTNAME_MAP {
    type = "hostname";
    map = "{= env.TESTDIR =}/configs/maps/domains.list";
  }
  HOSTNAME_TOP_MAP {
    type = "hostname";
    filter = "top";
    map = "{= env.TESTDIR =}/configs/maps/top.list";
  }
  CDB_HOSTNAME {
    type = "hostname";
    map = "cdb://{= env.TESTDIR =}/configs/maps/domains.cdb";
  }
  REDIS_HOSTNAME {
    type = "hostname";
    map = "redis://hostname";
  }
  REDIS_HOSTNAME_EXPANSION {
    type = "hostname";
    map = "redis://${ip}.${principal_recipient_domain}";
  }
  REDIS_IPADDR {
    type = "ip";
    map = "redis://ipaddr";
  }
  REDIS_FROMADDR {
    type = "from";
    filter = "email:addr";
    map = "redis://emailaddr";
  }
  REDIS_URL_TLD {
    type = "url";
    map = "redis://hostname";
    filter = "tld";
  }
  REDIS_URL_RE_FULL {
    type = "url";
    map = "redis://fullurlre";
    filter = "full:regexp:/(html)$/";
  }
  REDIS_URL_FULL {
    type = "url";
    map = "redis://fullurl";
    filter = "full";
  }
  REDIS_URL_PHISHED {
    type = "url";
    map = "redis://phishedurl";
    filter = "is_phished";
  }
  REDIS_URL_RE_TLD {
    type = "url";
    map = "redis://tldre";
    filter = "tld:regexp:/(net)$/";
  }
  REDIS_URL_RE_PLAIN {
    type = "url";
    map = "redis://urlre";
    filter = "regexp:/^(www)/";
  }
  REDIS_URL_NOFILTER {
    type = "url";
    map = "redis://urlnofilter";
  }
  REDIS_COUNTRY {
    type = "country";
    map = "redis://cc";
  }
  REDIS_ASN {
    type = "asn";
    map = "redis://asn";
  }
  REDIS_ASN_FILTERED {
    type = "mempool";
    variable = "asn";
    map = "redis://asn";
    filter = "regexp:/^([0-9]).*/";
  }
  RCVD_TEST_01 {
    type = "received";
    max_pos = 1;
    map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
  }
  RCVD_TEST_02 {
    type = "received";
    min_pos = -1;
    map = "{= env.TESTDIR =}/configs/maps/rcvd.list";
  }
  RCVD_TEST_REDIS_01 {
    type = "received";
    map = "redis://RCVD_TEST";
  }
  RCVD_AUTHED_ONE {
    type = "received";
    map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
    flags = ["authenticated"];
    nflags = ["ssl"];
  }
  RCVD_AUTHED_TWO {
    type = "received";
    map = "{= env.TESTDIR =}/configs/maps/rcvd2.list";
    flags = ["authenticated", "ssl"];
  }
  COMBINED_MAP_AND {
    type = "combined";
    rules {
      ip = {
        type = "radix";
        map = "{= env.TESTDIR =}/configs/maps/ip.list";
        selector = "ip";
      }
      from {
        map = "{= env.TESTDIR =}/configs/maps/domains.list";
        selector = "from:domain";
      }
    }
    expression = "from & ip";
    score = 10;
    prefilter = true;
  }
  COMBINED_MAP_OR {
    type = "combined";
    rules {
      ip = {
        type = "radix";
        map = "{= env.TESTDIR =}/configs/maps/ip.list";
        selector = "ip";
      }
      from {
        map = "{= env.TESTDIR =}/configs/maps/domains.list";
        selector = "from:domain";
      }
    }
    expression = "from || ip"
  }
}

symbols {
  SYM1 = {
    score = 1.0,
  }
}