]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Improve dkim domains validation for DMARC
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Sep 2015 14:09:18 +0000 (15:09 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 17 Sep 2015 14:09:18 +0000 (15:09 +0100)
src/plugins/lua/dmarc.lua

index 8ef702c8b4e631fd24a93f08a934b4cc2156f796..25c540cf811b8041e42d9a1f6ef6bcc1dc37fa6e 100644 (file)
@@ -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