diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-26 17:28:37 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-11-26 17:28:37 +0000 |
commit | c9f44a6f359770bb7c273df4b52e5a62af3845a2 (patch) | |
tree | c628d3ab6f7c3a4b72f1c4378227b3c573d5aa95 /src | |
parent | 5e9cd04af5b9314defdf5bdc6b014b7cfefa896e (diff) | |
download | rspamd-c9f44a6f359770bb7c273df4b52e5a62af3845a2.tar.gz rspamd-c9f44a6f359770bb7c273df4b52e5a62af3845a2.zip |
[Fix] Use tld when looking for DKIM domains
Issue: #2646
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/reputation.lua | 3 | ||||
-rw-r--r-- | src/plugins/lua/whitelist.lua | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/plugins/lua/reputation.lua b/src/plugins/lua/reputation.lua index 56201f7dc..374771c9b 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 1c8612386..b9dce612b 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) |