From: Vsevolod Stakhov Date: Mon, 26 Nov 2018 17:28:37 +0000 (+0000) Subject: [Fix] Use tld when looking for DKIM domains X-Git-Tag: 1.8.3~44 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9f44a6f359770bb7c273df4b52e5a62af3845a2;p=thirdparty%2Frspamd.git [Fix] Use tld when looking for DKIM domains Issue: #2646 --- diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index 56201f7dc6..374771c9b7 100644 --- a/src/plugins/lua/reputation.lua +++ b/src/plugins/lua/reputation.lua @@ -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 diff --git a/src/plugins/lua/whitelist.lua b/src/plugins/lua/whitelist.lua index 1c8612386f..b9dce612bf 100644 --- a/src/plugins/lua/whitelist.lua +++ b/src/plugins/lua/whitelist.lua @@ -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)