]> source.dussan.org Git - rspamd.git/commitdiff
Remove ugly tld detection.
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 30 Apr 2015 17:36:46 +0000 (18:36 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 30 Apr 2015 17:36:46 +0000 (18:36 +0100)
src/plugins/lua/phishing.lua

index 21418f385bd1199944cc2b99661274e79c17d38e..78d3b209906350b47c8adc35abbe57402b62e669 100644 (file)
@@ -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())