diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-15 12:57:50 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2022-01-15 12:57:50 +0000 |
commit | b9368887523031fcad0524cee98af04181a59f3c (patch) | |
tree | 70396f9b828598d6690b381091a5fc546cd673ff /src/plugins/lua/rbl.lua | |
parent | 0213518a5fa2d027e42cdc9f5603148397ec56a2 (diff) | |
download | rspamd-b9368887523031fcad0524cee98af04181a59f3c.tar.gz rspamd-b9368887523031fcad0524cee98af04181a59f3c.zip |
[Minor] Improve logic to select a random monitored mode for RBLs
Diffstat (limited to 'src/plugins/lua/rbl.lua')
-rw-r--r-- | src/plugins/lua/rbl.lua | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index e901e1a2f..22305aa1f 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -47,21 +47,26 @@ local known_selectors = {} -- map from selector string to selector id local url_flag_bits = rspamd_url.flags local function get_monitored(rbl) + local function is_random_monitored() + return (rbl.dkim + or rbl.urls + or rbl.emails + or rbl.no_ip + or rbl.rdns + or rbl.helo) + end + local default_monitored = '1.0.0.127' local ret = { rcode = 'nxdomain', prefix = default_monitored, - random = false, + random = is_random_monitored(), } if rbl.monitored_address then ret.prefix = rbl.monitored_address end - if rbl.dkim or rbl.urls or rbl.emails then - ret.random = true - end - lua_util.debugm(N, rspamd_config, 'added monitored address: %s (%s random)', ret.prefix, ret.random) |