diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-10 12:04:15 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2017-05-10 12:04:15 +0100 |
commit | 37a04a9e42001f376f69d2920315194f3098a0c4 (patch) | |
tree | 5c383185523dd5e7f79bd5504d9d9f53925f70e6 /src/plugins/lua/dmarc.lua | |
parent | aaa96909f731c4493cfc707b59fdd4c67f0afcac (diff) | |
download | rspamd-37a04a9e42001f376f69d2920315194f3098a0c4.tar.gz rspamd-37a04a9e42001f376f69d2920315194f3098a0c4.zip |
[Fix] Do not check DMARC if SPF or DKIM were not checked
Issue: #1629
Diffstat (limited to 'src/plugins/lua/dmarc.lua')
-rw-r--r-- | src/plugins/lua/dmarc.lua | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua index e3cc09bf0..f7a95c5af 100644 --- a/src/plugins/lua/dmarc.lua +++ b/src/plugins/lua/dmarc.lua @@ -255,6 +255,12 @@ local function dmarc_callback(task) local dmarc_domain, efromdom, spf_domain local ip_addr = task:get_ip() local dkim_results = {} + local dmarc_checks = task:get_mempool():get_variable('dmarc_checks', 'int') or 0 + + if dmarc_checks ~= 2 then + rspamd_logger.infox(task, "skip DMARC checks as either SPF or DKIM were not checked"); + return + end if ((not check_authed and task:get_user()) or (not check_local and ip_addr and ip_addr:is_local())) then |