aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-04 16:50:48 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-06-04 16:50:48 +0100
commitb2c78d1b079e5880b908b27bebebb2a140ae2d4b (patch)
treed565f4e23599cb2a0bdadc1b9fb6736bbeafa663
parentae53944eec8b20ce389712de5d1cc10b5e6c35bf (diff)
downloadrspamd-b2c78d1b079e5880b908b27bebebb2a140ae2d4b.tar.gz
rspamd-b2c78d1b079e5880b908b27bebebb2a140ae2d4b.zip
[Fix] Fix matching patterns with no paths
-rw-r--r--src/plugins/lua/phishing.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/plugins/lua/phishing.lua b/src/plugins/lua/phishing.lua
index e76ffc79a..69aec219f 100644
--- a/src/plugins/lua/phishing.lua
+++ b/src/plugins/lua/phishing.lua
@@ -75,8 +75,12 @@ local function phishing_cb(task)
for _,d in ipairs(elt) do
if not d['path'] then
found_path = true
+ end
+
+ if query and d['query'] and query == d['query'] then
+ found_query = true
+ elseif not d['query'] then
found_query = true
- break
end
end
end
@@ -101,7 +105,10 @@ local function phishing_cb(task)
task:insert_result(phish_symbol, 1.0, args)
else
-- Host + path match
- task:insert_result(phish_symbol, 0.3, args)
+ if path then
+ task:insert_result(phish_symbol, 0.3, args)
+ end
+ -- No path, no symbol
end
else
if url:is_phished() then