diff options
author | Andrew Lewis <nerf@judo.za.org> | 2017-05-26 13:19:05 +0200 |
---|---|---|
committer | Andrew Lewis <nerf@judo.za.org> | 2017-05-26 13:19:05 +0200 |
commit | ff0d6e33c17a83211ccac3fe5ec9617617b388f4 (patch) | |
tree | 2b8b099f9cec554bfd26f87dfb0ccbd674fdca9a /src/plugins/lua/phishing.lua | |
parent | c68e1e42bc999665c65a0f7b7a6ef805a144d6bf (diff) | |
download | rspamd-ff0d6e33c17a83211ccac3fe5ec9617617b388f4.tar.gz rspamd-ff0d6e33c17a83211ccac3fe5ec9617617b388f4.zip |
[Fix] Phishing: strict_domains
Diffstat (limited to 'src/plugins/lua/phishing.lua')
-rw-r--r-- | src/plugins/lua/phishing.lua | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index 880b85b8f..cd2288067 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -182,12 +182,14 @@ local function phishing_cb(task) rspamd_logger.debugm(N, task, "distance: %1 -> %2: %3", tld, ptld, dist) end - local function found_in_map(map) + local function found_in_map(map, furl, sweight) + if not furl then furl = url end + if not sweight then sweight = weight end if #map > 0 then for _,rule in ipairs(map) do - for _,dn in ipairs({url:get_tld(), url:get_host()}) do + for _,dn in ipairs({furl:get_tld(), furl:get_host()}) do if rule['map']:get_key(dn) then - task:insert_result(rule['symbol'], weight, ptld .. '->' .. dn) + task:insert_result(rule['symbol'], sweight, ptld .. '->' .. dn) return true end end |