]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Use tld when looking for DKIM domains
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 26 Nov 2018 17:28:37 +0000 (17:28 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Mon, 26 Nov 2018 17:28:37 +0000 (17:28 +0000)
Issue: #2646

src/plugins/lua/reputation.lua
src/plugins/lua/whitelist.lua

index 56201f7dc6dbf42588370a6778a855926dcf3dc4..374771c9b751eccc7f1d837f7f309538803fbf70 100644 (file)
@@ -108,7 +108,8 @@ local function gen_dkim_queries(task, rule)
       local dom,res = lpeg.match(gr, opt)
 
       if dom and res then
-        ret[dom] = res
+        local tld = rspamd_util.get_tld(dom)
+        ret[tld] = res
       end
     end
   end
index 1c8612386fb27bcd8cd842e0c1b397142206a581..b9dce612bffbe44ae405dac61896a95afc10c393 100644 (file)
@@ -162,9 +162,11 @@ local function whitelist_cb(symbol, rule, task)
       if dkim_opts then
         fun.each(function(val)
             if val[2] == '+' then
-              find_domain(val[1], 'dkim_success')
+              local tld = rspamd_util.get_tld(val[1])
+              find_domain(tld, 'dkim_success')
             elseif val[2] == '-' then
-              find_domain(val[1], 'dkim_fail')
+              local tld = rspamd_util.get_tld(val[1])
+              find_domain(tld, 'dkim_fail')
             end
           end,
             fun.map(function(s)