From accb853f83625bcb993113dc10938a197a551acd Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Sun, 21 Aug 2016 16:27:57 +0100 Subject: [PATCH] [Fix] Disable DMARC for local/authorized mail --- src/plugins/lua/dmarc.lua | 5 +++++ 1 file changed, 5 insertions(+) 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 -- 2.39.5