From: Andrew Lewis Date: Wed, 31 Aug 2016 06:34:14 +0000 (+0200) Subject: [Minor] Disable IP Score for authenticated users & local networks X-Git-Tag: 1.3.5~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6894ee82ad15569e92310d9765af0327f1219a4;p=thirdparty%2Frspamd.git [Minor] Disable IP Score for authenticated users & local networks --- diff --git a/src/plugins/lua/ip_score.lua b/src/plugins/lua/ip_score.lua index 677ed12a5c..1bb05446e1 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 @@ -278,6 +281,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