From: Vsevolod Stakhov Date: Sun, 21 Aug 2016 15:27:57 +0000 (+0100) Subject: [Fix] Disable DMARC for local/authorized mail X-Git-Tag: 1.3.4~15 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=accb853f83625bcb993113dc10938a197a551acd;p=rspamd.git [Fix] Disable DMARC for local/authorized mail --- 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