aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-30 18:36:46 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2015-04-30 18:36:46 +0100
commit4af6be3d79dcb5fed8f10196982eac4ac9e738ff (patch)
tree10fe441a10440eb57fa7270625a321a67fc6614e
parent9aa7f9490aaf2895f9a13fe3f621e2d0f1b86cdb (diff)
downloadrspamd-4af6be3d79dcb5fed8f10196982eac4ac9e738ff.tar.gz
rspamd-4af6be3d79dcb5fed8f10196982eac4ac9e738ff.zip
Remove ugly tld detection.
-rw-r--r--src/plugins/lua/phishing.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
index 21418f385..78d3b2099 100644
--- a/src/plugins/lua/phishing.lua
+++ b/src/plugins/lua/phishing.lua
@@ -41,7 +41,7 @@ function phishing_cb (task)
local found = false
local purl = url:get_phished()
if table.maxn(strict_domains) > 0 then
- local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$')
+ local tld = purl:get_tld()
if tld then
for _,rule in ipairs(strict_domains) do
if rule['map']:get_key(tld) then
@@ -53,7 +53,7 @@ function phishing_cb (task)
end
if not found then
if domains then
- local _,_,tld = string.find(purl:get_host(), '([a-zA-Z0-9%-]+%.[a-zA-Z0-9%-]+)$')
+ local tld = purl:get_tld()
if tld then
if domains:get_key(tld) then
task:insert_result(symbol, 1, purl:get_host())