aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/plugins/lua/dmarc.lua5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 3e72a4d30..c9444b23d 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -55,7 +55,12 @@ end
local function dmarc_callback(task)
local from = task:get_from(2)
local dmarc_domain
+ local ip_addr = task:get_ip()
+ if task:get_user() or (ip_addr and ip_addr:is_local()) then
+ rspamd_logger.infox(task, "skip SPF checks for local networks and authorized users");
+ return
+ end
if from and from[1] and from[1]['domain'] and not from[2] then
dmarc_domain = rspamd_util.get_tld(from[1]['domain'])
else