]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Doc] Update multimap documentation
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 20 May 2016 08:16:49 +0000 (11:16 +0300)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 20 May 2016 08:16:49 +0000 (11:16 +0300)
doc/markdown/modules/multimap.md

index 290df9e49f2702ea56ea6c9d5e94b06909bae438..cede3bc948eee106d68a6b5b1822a13f995805e8 100644 (file)
@@ -22,6 +22,7 @@ Multimap module allows to build rules based on the dynamic maps content. Rspamd
 map types in this module:
 
 * `hash map` - a list of domains or `user@domain`
+* `regexp map` - a list of regular expressions
 * `ip map` - an effective radix trie of `ip/mask` values (supports both IPv4 and IPv6 addresses)
 * `cdb` - constant database format (files only)
 
@@ -36,6 +37,8 @@ The module itself contains a set of rules in form:
 
        symbol { type = type; map = uri; [optional params] }
 
+### Map types
+
 Type attribute means what is matched with this map. The following types are supported:
 
 * `ip` - matches source IP of message (radix map)
@@ -52,7 +55,7 @@ Maps can also be specified as [CDB](http://www.corpit.ru/mjt/tinycdb.html) datab
 
        map = "cdb:///path/to/file.cdb";
 
-Here is an example configuration of multimap module:
+### Pre-filter maps
 
 To enable pre-filter support, you should specify `action` parameter which can take the
 following values:
@@ -73,13 +76,28 @@ multimap {
 }
 ~~~
 
+### Regexp maps
+
+
 All maps but `ip` and `dnsbl` support `regexp` mode. In this mode, all keys in maps are treated as regular expressions, for example:
 
        /example\d+\.com/i
        /other\d+\.com/i test
+       # Comments are still enabled
 
 For performance considerations, use only expressions supported by [hyperscan](http://01org.github.io/hyperscan/dev-reference/compilation.html#pattern-support) as this engine provides blazing performance at no additional cost. Currently, there is no way to distinguish what particular regexp was matched in case if multiple regexp were matched.
 
+To enable regexp mode, you should set `regexp` option to `true`:
+
+~~~ucl
+sender_from_whitelist_user {
+  type = "from";
+  map = "file:///tmp/from.map";
+  symbol = "SENDER_FROM_WHITELIST";
+  regexp = true;
+}
+~~~
+
 ### Map filters
 
 It is also possible to apply a filtering expression before checking value against some map. This is mainly useful