Browse Source

[Fix] Use tld when looking for DKIM domains

Issue: #2646
tags/1.8.3
Vsevolod Stakhov 5 years ago
parent
commit
c9f44a6f35
2 changed files with 6 additions and 3 deletions
  1. 2
    1
      src/plugins/lua/reputation.lua
  2. 4
    2
      src/plugins/lua/whitelist.lua

+ 2
- 1
src/plugins/lua/reputation.lua View 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

+ 4
- 2
src/plugins/lua/whitelist.lua View 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)

Loading…
Cancel
Save