]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Disable DMARC for local/authorized mail
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 21 Aug 2016 15:27:57 +0000 (16:27 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 21 Aug 2016 15:28:37 +0000 (16:28 +0100)
src/plugins/lua/dmarc.lua

index 3e72a4d30f375689bf866367a0792bd32c211ba7..c9444b23d80e45a742fee8b16431eb0ea3cbe776 100644 (file)
@@ -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