From: Carsten Rosenberg Date: Tue, 2 Oct 2018 09:05:32 +0000 (+0200) Subject: [Fix] ip_score - respect check_authed and check_local settings from config X-Git-Tag: 1.8.1~107^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=df19a35754532f7530eb3da53dddfdafff3214e9;p=rspamd.git [Fix] ip_score - respect check_authed and check_local settings from config --- 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