From: Vsevolod Stakhov Date: Sat, 21 Jan 2023 15:30:13 +0000 (+0000) Subject: [Fix] Restore `strict_domains` support X-Git-Tag: 3.5~81 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0134f546db46ba873de1d342f3111df1507edf6a;p=thirdparty%2Frspamd.git [Fix] Restore `strict_domains` support --- diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua index d3ad835741..628d6efa71 100644 --- a/src/plugins/lua/phishing.lua +++ b/src/plugins/lua/phishing.lua @@ -35,6 +35,7 @@ local generic_service_name = 'generic service' local domains = nil local phishing_exceptions_maps = {} local anchor_exceptions_maps = {} +local strict_domains_maps = {} local generic_service_map = nil local openphish_map = 'https://www.openphish.com/feed.txt' local phishtank_suffix = 'phishtank.rspamd.com' @@ -304,15 +305,16 @@ local function phishing_cb(task) if not sweight then sweight = weight end if #map > 0 then for _,rule in ipairs(map) do - local found,_ = is_url_in_map(rule.map, furl) + local found,dn = is_url_in_map(rule.map, furl) if found then - task:insert_result(rule.symbol, sweight, ptld .. '->' .. tld) + task:insert_result(rule.symbol, sweight, string.format("%s->%s:%s", ptld, tld, dn)) return true end end end end + found_in_map(strict_domains_maps, purl, 1.0) if not found_in_map(anchor_exceptions_maps) then if not found_in_map(phishing_exceptions_maps, purl, 1.0) then if domains then @@ -566,4 +568,5 @@ if opts then end phishing_map('phishing_exceptions', phishing_exceptions_maps, id) phishing_map('exceptions', anchor_exceptions_maps, id) + phishing_map('strict_domains', strict_domains_maps, id) end