diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-23 18:27:12 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-08-23 18:27:12 +0100 |
commit | 5192e59c59a07ecfe0182fe9ef02297a42bcf9ee (patch) | |
tree | bb3998b3984ee3e19ff5af730ec926caaa79f0c5 /src | |
parent | 9e0a0156e3c1a1ed80b2348be8705b37daa86134 (diff) | |
download | rspamd-5192e59c59a07ecfe0182fe9ef02297a42bcf9ee.tar.gz rspamd-5192e59c59a07ecfe0182fe9ef02297a42bcf9ee.zip |
[Feature] Use random monitored in rbl module
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/rbl.lua | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 7abe163b1..aacd2715c 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -42,16 +42,21 @@ local monitored_addresses = {} local function get_monitored(rbl) local default_monitored = '1.0.0.127' + local ret = { + rcode = 'nxdomain', + prefix = default_monitored, + random = false, + } if rbl.monitored_address then - return rbl.monitored_address + ret.prefix = rbl.monitored_address end if rbl.dkim or rbl.url or rbl.email then - default_monitored = 'facebook.com' -- should never be blacklisted + ret.random = true end - return default_monitored + return ret end local function validate_dns(lstr) @@ -708,14 +713,11 @@ local function add_rbl(key, rbl) table.insert(black_symbols, rbl.symbol) end -- Process monitored - if not rbl.disable_monitoring and not rbl.is_whitelist then + if not rbl.disable_monitoring then if not monitored_addresses[rbl.rbl] then monitored_addresses[rbl.rbl] = true rbl.monitored = rspamd_config:register_monitored(rbl.rbl, 'dns', - { - rcode = 'nxdomain', - prefix = get_monitored(rbl) - }) + get_monitored(rbl)) end end |