diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-10-02 12:46:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-02 12:46:56 +0100 |
commit | 0b7bbd9a1df25d3cf93173dc0f853d1863930ae8 (patch) | |
tree | 746b364bda5238cb5bba4e48807054d56fb87376 | |
parent | c03f12c4c9918a8545d6053cc40786b152b4c44e (diff) | |
parent | df19a35754532f7530eb3da53dddfdafff3214e9 (diff) | |
download | rspamd-0b7bbd9a1df25d3cf93173dc0f853d1863930ae8.tar.gz rspamd-0b7bbd9a1df25d3cf93173dc0f853d1863930ae8.zip |
Merge pull request #2557 from HeinleinSupport/master
[Fix] ip_score - respect check_authed and check_local settings
-rw-r--r-- | src/plugins/lua/ip_score.lua | 11 |
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 |