diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-04 15:22:28 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2016-05-04 15:22:28 +0100 |
commit | 4bdef6885b5ff5f86b52c074c9a9d453a68d6fc0 (patch) | |
tree | 367b2ac021a81ccd7dcee2372bbe158b878e3438 /src/plugins | |
parent | 798bd5e86f7941dd87884a4ea15c9a15179ac811 (diff) | |
download | rspamd-4bdef6885b5ff5f86b52c074c9a9d453a68d6fc0.tar.gz rspamd-4bdef6885b5ff5f86b52c074c9a9d453a68d6fc0.zip |
[Feature] Improve phishing plugin
- Ignore redirected URLs
- Fix levenshtein distance calculations
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/lua/phishing.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index fcb2e5f7d..ecf88679f 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 |