diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-08-31 11:07:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-31 11:07:03 +0100 |
commit | 8ac3eb0f4902e2935e4a1f170e8f66f740801978 (patch) | |
tree | 68237e2d79eae1d63033c3e623855a9a18c95feb | |
parent | dacfdb076ba21ef1c3be5c9d7bb87723f74d952b (diff) | |
parent | 28f24e3a1ae8daf344a0dd9f14bee638f5a5f3b2 (diff) | |
download | rspamd-8ac3eb0f4902e2935e4a1f170e8f66f740801978.tar.gz rspamd-8ac3eb0f4902e2935e4a1f170e8f66f740801978.zip |
Merge pull request #912 from fatalbanana/ipscore
[Minor] Disable IP Score for authenticated users & local networks
-rw-r--r-- | src/plugins/lua/ip_score.lua | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index a8687a1cd..6b6ac900a 100644 --- a/src/plugins/lua/ip_score.lua +++ b/src/plugins/lua/ip_score.lua @@ -110,8 +110,11 @@ local ip_score_set = function(task) end end - local action = task:get_metric_action(options['metric']) local ip = task:get_from_ip() + if task:get_user() or (ip and ip:is_local()) then + return + end + local action = task:get_metric_action(options['metric']) if not ip or not ip:is_valid() then return end @@ -274,6 +277,10 @@ local ip_score_check = function(task) end local ip = task:get_from_ip() + if task:get_user() or (ip and ip:is_local()) then + rspamd_logger.infox(task, "skip IP Score for local networks and authorized users") + return + end if ip:is_valid() then -- Check IP whitelist if whitelist then |