From: Vsevolod Stakhov Date: Wed, 4 May 2016 14:22:28 +0000 (+0100) Subject: [Feature] Improve phishing plugin X-Git-Tag: 1.3.0~552 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4bdef6885b5ff5f86b52c074c9a9d453a68d6fc0;p=thirdparty%2Frspamd.git [Feature] Improve phishing plugin - Ignore redirected URLs - Fix levenshtein distance calculations --- diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index fcb2e5f7d2..ecf88679fe 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -30,7 +30,7 @@ local function phishing_cb(task) if urls then for _,url in ipairs(urls) do - if url:is_phished() then + if url:is_phished() and not url:is_redirected() then local found = false local purl = url:get_phished() local tld = url:get_tld() @@ -41,7 +41,7 @@ local function phishing_cb(task) end local weight = 1.0 - local dist = util.levenshtein_distance(tld, ptld) + local dist = util.levenshtein_distance(tld, ptld, 2) dist = 2 * dist / (#tld + #ptld) if dist > 0.3 and dist <= 1.0 then