diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-17 10:16:50 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-04-17 10:26:02 +0100 |
commit | 9941fa51938c08c353eb48b2dfcdcc9e45271934 (patch) | |
tree | 3223cfc5e8f566eff8cf5ff68d410622bb5f6a98 /src/plugins/lua | |
parent | c0bcfaff59f0442c63ca6530fdabfb684edef1d3 (diff) | |
download | rspamd-9941fa51938c08c353eb48b2dfcdcc9e45271934.tar.gz rspamd-9941fa51938c08c353eb48b2dfcdcc9e45271934.zip |
[Minor] Rbl: Add whitelisting indication to the symbol's options
Diffstat (limited to 'src/plugins/lua')
-rw-r--r-- | src/plugins/lua/rbl.lua | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/plugins/lua/rbl.lua b/src/plugins/lua/rbl.lua index 026432404..09ac69c94 100644 --- a/src/plugins/lua/rbl.lua +++ b/src/plugins/lua/rbl.lua @@ -296,12 +296,17 @@ local function gen_rbl_callback(rule) -- Maybe whitelisted by some other rbl rule if whitelist then - local wl_what = whitelist[req_str] - if wl_what then + local wl = whitelist[req_str] + if wl then lua_util.debugm(N, task, - 'whitelisted %s on %s by %s rbl rule (%s checked)', - req_str, wl_what, what) - return wl_what == what + 'whitelisted %s on %s by %s (%s) rbl rule (%s checked)', + req_str, wl.type, wl.symbol, what) + if wl.type == what then + -- Add symbol option (0.0 / 0.0 is used to denounce NAN that prevents score modification) + task:adjust_result(wl.symbol, 0.0 / 0.0, rule.symbol) + + return true + end end end @@ -1191,7 +1196,10 @@ local function rbl_callback_white(task) lua_util.debugm(N, task,'found whitelist from %s: %s(%s)', w, elt, what) if elt and what then - whitelisted_elements[elt] = what + whitelisted_elements[elt] = { + type = what, + symbol = w, + } end end end |