commit 0134f54: [Fix] Restore `strict_domains` support

Vsevolod Stakhov vsevolod at rspamd.com
Sat Jan 21 15:35:03 UTC 2023


Author: Vsevolod Stakhov
Date: 2023-01-21 15:30:13 +0000
URL: https://github.com/rspamd/rspamd/commit/0134f546db46ba873de1d342f3111df1507edf6a (HEAD -> master)

[Fix] Restore `strict_domains` support

---
 src/plugins/lua/phishing.lua | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
index d3ad83574..628d6efa7 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


More information about the Commits mailing list