diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-05 15:02:01 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-06-05 15:02:41 +0100 |
commit | ce57de5ff68c0425ddbbb5f792f36aca21d582a3 (patch) | |
tree | 15913fba3b0efe74ea91edca5b39aaf7821dda35 /src | |
parent | 2ba967dda3650992aaf2c57eb48a64ad0601b439 (diff) | |
download | rspamd-ce57de5ff68c0425ddbbb5f792f36aca21d582a3.tar.gz rspamd-ce57de5ff68c0425ddbbb5f792f36aca21d582a3.zip |
[Feature] Add `monitored_address` for rbls
Also disable monitoring for whitelists
Issue: #1662
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/rbl.lua | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 7d22c6fa8..5813d0ef1 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -33,6 +33,7 @@ local hash = require 'rspamd_cryptobox_hash' local rspamd_logger = require 'rspamd_logger' local rspamd_util = require 'rspamd_util' local fun = require 'fun' +local default_monitored = '1.0.0.127' local symbols = { dkim_allow_symbol = 'R_DKIM_ALLOW', @@ -516,7 +517,7 @@ for key,rbl in pairs(opts['rbls']) do if rbl['dkim'] then need_dkim = true end - if(rbl['is_whitelist']) then + if (rbl['is_whitelist']) then if type(rbl['whitelist_exception']) == 'string' then if (rbl['whitelist_exception'] ~= rbl['symbol']) then table.insert(white_symbols, rbl['symbol']) @@ -542,8 +543,14 @@ for key,rbl in pairs(opts['rbls']) do end end if rbl['rbl'] then - rbl.monitored = rspamd_config:register_monitored(rbl['rbl'], 'dns', - {rcode = 'nxdomain', prefix = '1.0.0.127'}) + if not rbl['disable_monitoring'] and not rbl['is_whitelist'] then + rbl.monitored = rspamd_config:register_monitored(rbl['rbl'], 'dns', + { + rcode = 'nxdomain', + prefix = rbl['monitored_address'] or default_monitored + }) + end + rbls[key] = rbl end end)() |