aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2016-08-22 14:58:52 +0100
committerGitHub <noreply@github.com>2016-08-22 14:58:52 +0100
commit6fde333aeee50108222673b16e28d81a09efe943 (patch)
tree621d07c2c9339fccf7d05b0a65ac31b5d651e255 /src/plugins
parent9066b5c14f885ba476cf3411a4ad1244102ef940 (diff)
parent5ba76f25279b71085eb9b633384f293cc98bf5db (diff)
downloadrspamd-6fde333aeee50108222673b16e28d81a09efe943.tar.gz
rspamd-6fde333aeee50108222673b16e28d81a09efe943.zip
Merge pull request #882 from fatalbanana/dmarc
[Fix] DMARC: Fix alignment checking for subdomains
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/lua/dmarc.lua10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 74f395cf8..d9961956f 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -213,9 +213,8 @@ local function dmarc_callback(task)
if rspamd_util.strequal_caseless(efrom[1]['domain'], from[1]['domain']) then
spf_ok = true
elseif not strict_spf then
- if rspamd_util.strequal_caseless(
- string.sub(efrom[1]['domain'], -string.len('.' .. lookup_domain)),
- '.' .. lookup_domain) then
+ local spf_tld = rspamd_util.get_tld(efrom[1]['domain'])
+ if rspamd_util.strequal_caseless(spf_tld, dmarc_domain) then
spf_ok = true
end
end
@@ -227,9 +226,8 @@ local function dmarc_callback(task)
if rspamd_util.strequal_caseless(from[1]['domain'], dkim_domain) then
dkim_ok = true
elseif not strict_dkim then
- if rspamd_util.strequal_caseless(
- string.sub(dkim_domain, -string.len('.' .. lookup_domain)),
- '.' .. lookup_domain) then
+ local dkim_tld = rspamd_util.get_tld(dkim_domain)
+ if rspamd_util.strequal_caseless(dkim_tld, dmarc_domain) then
dkim_ok = true
end
end