diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-22 21:34:18 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2015-06-22 21:34:18 +0100 |
commit | f2228a7422aa8f379efb4e20d117b2d1c2a65b56 (patch) | |
tree | 66f97493636c13027856670dfadb53939a0ea635 | |
parent | 1f94f578870842e958ccc8faf6f45579b8acddf1 (diff) | |
parent | 935c992ce705d3b978eb1e6defb9f3f64498a935 (diff) | |
download | rspamd-f2228a7422aa8f379efb4e20d117b2d1c2a65b56.tar.gz rspamd-f2228a7422aa8f379efb4e20d117b2d1c2a65b56.zip |
Merge pull request #300 from fatalbanana/master
Don't use RWL_MAILSPIKE_POSSIBLE or DNSWL_BLOCKED for whitelisting
-rw-r--r-- | conf/modules.conf | 2 | ||||
-rw-r--r-- | doc/markdown/modules/rbl.md | 5 | ||||
-rw-r--r-- | src/plugins/lua/rbl.lua | 17 |
3 files changed, 23 insertions, 1 deletions
diff --git a/conf/modules.conf b/conf/modules.conf index ad875ece3..6f4e12e2c 100644 --- a/conf/modules.conf +++ b/conf/modules.conf @@ -169,6 +169,7 @@ rbl { mailspike_wl { rbl = "wl.mailspike.net"; is_whitelist = true; + whitelist_exception = "RWL_MAILSPIKE_POSSIBLE"; returncodes { RWL_MAILSPIKE_POSSIBLE = "127.0.0.17"; RWL_MAILSPIKE_GOOD = "127.0.0.18"; @@ -226,6 +227,7 @@ rbl { rbl = "list.dnswl.org"; ipv6 = true; is_whitelist = true; + whitelist_exception = "DNSWL_BLOCKED"; returncodes { RCVD_IN_DNSWL_NONE = "127.0.%d+.0"; RCVD_IN_DNSWL_LOW = "127.0.%d+.1"; diff --git a/doc/markdown/modules/rbl.md b/doc/markdown/modules/rbl.md index 33c3a4c18..b5f797fd3 100644 --- a/doc/markdown/modules/rbl.md +++ b/doc/markdown/modules/rbl.md @@ -105,3 +105,8 @@ an_rbl { } ~~~ +The following extra settings are valid in the RBL subsection: + +- whitelist_exception + +(For whitelists) - Symbols named as parameters for this setting will not be used for neutralising blacklists (set this multiple times to add multiple exceptions). diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index cceb00449..c524c5bf1 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -355,7 +355,22 @@ for key,rbl in pairs(opts['rbls']) do if type(rspamd_config.get_api_version) ~= 'nil' then rspamd_config:register_virtual_symbol(s, 1, id) if(rbl['is_whitelist']) then - table.insert(white_symbols, s) + if type(rbl['whitelist_exception']) == 'string' then + if (rbl['whitelist_exception'] ~= s) then + table.insert(white_symbols, s) + end + elseif type(rbl['whitelist_exception']) == 'table' then + local foundException = false + for _, e in pairs(rbl['whitelist_exception']) do + if e == s then + foundException = true + break + end + end + if not foundException then + table.insert(white_symbols, s) + end + end else table.insert(black_symbols, s) end |