aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-17 15:09:18 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-09-17 15:09:18 +0100
commit98c4b0460a1b67c2792a44e8e6ad6a8eedb1e347 (patch)
treefa2e39ed00260c4ae3ad928d5dff4c13bbb274ce /src
parent0582b6ef8c449f03e2fad49f92a84d8e3e05d707 (diff)
downloadrspamd-98c4b0460a1b67c2792a44e8e6ad6a8eedb1e347.tar.gz
rspamd-98c4b0460a1b67c2792a44e8e6ad6a8eedb1e347.zip
Improve dkim domains validation for DMARC
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/dmarc.lua16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/plugins/lua/dmarc.lua b/src/plugins/lua/dmarc.lua
index 8ef702c8b..25c540cf8 100644
--- a/src/plugins/lua/dmarc.lua
+++ b/src/plugins/lua/dmarc.lua
@@ -226,14 +226,16 @@ local function dmarc_callback(task)
end
end
local das = task:get_symbol(symbols['dkim_allow_symbol'])
- if das and das[1] and das[1]['options'] and das[1]['options'][0] then
- if from[1]['domain'] == das[1]['options'][0] then
- dkim_ok = true
- elseif not strict_dkim then
- if string.sub(das[1]['options'][0],
- -string.len('.' .. lookup_domain))
- == '.' .. lookup_domain then
+ if das and das[1] and das[1]['options'] then
+ for i,dkim_domain in ipairs(das[1]['options']) do
+ if from[1]['domain'] == dkim_domain then
dkim_ok = true
+ elseif not strict_dkim then
+ if string.sub(dkim_domain,
+ -string.len('.' .. lookup_domain))
+ == '.' .. lookup_domain then
+ dkim_ok = true
+ end
end
end
end