summaryrefslogtreecommitdiffstats
path: root/src/plugins/lua
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-10-02 11:05:32 +0200
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-10-02 11:05:32 +0200
commitdf19a35754532f7530eb3da53dddfdafff3214e9 (patch)
treeb3777c072bc180696e5ebcd7ba205520a0f6852a /src/plugins/lua
parent647986d925162a8bd1ee18dde1b074e3edabb22d (diff)
downloadrspamd-df19a35754532f7530eb3da53dddfdafff3214e9.tar.gz
rspamd-df19a35754532f7530eb3da53dddfdafff3214e9.zip
[Fix] ip_score - respect check_authed and check_local settings from config
Diffstat (limited to 'src/plugins/lua')
-rw-r--r--src/plugins/lua/ip_score.lua11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua
index 7ada08413..47b000b8b 100644
--- a/src/plugins/lua/ip_score.lua
+++ b/src/plugins/lua/ip_score.lua
@@ -314,8 +314,12 @@ local ip_score_check = function(task)
return cmd, args
end
- if task:get_user() or (ip and ip:is_local()) then
- rspamd_logger.infox(task, "skip IP Score for local networks and authorized users")
+ if task:get_user() and not check_authed then
+ rspamd_logger.infox(task, "skip IP Score for authorized users")
+ return
+ end
+ if ip and ip:is_local() and not check_local then
+ rspamd_logger.infox(task, "skip IP Score for local networks")
return
end
if ip:is_valid() then
@@ -355,7 +359,7 @@ end
-- Configuration options
local configure_ip_score_module = function()
- local opts = rspamd_config:get_all_opt('options')
+ local opts = rspamd_config:get_all_opt(N)
if type(opts) == 'table' then
if type(opts['check_authed']) == 'boolean' then
check_authed = opts['check_authed']
@@ -364,7 +368,6 @@ local configure_ip_score_module = function()
check_local = opts['check_local']
end
end
- opts = rspamd_config:get_all_opt('ip_score')
if not opts then return end
for k,v in pairs(opts) do
options[k] = v