commit 0604bcc: [Minor] Filter urls for R_SUSPICIOUS_URL check

Vsevolod Stakhov vsevolod at highsecure.ru
Tue May 11 14:35:04 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-05-11 15:26:34 +0100
URL: https://github.com/rspamd/rspamd/commit/0604bcc851c3337fc32f535449dc3640a5486e07 (HEAD -> master)

[Minor] Filter urls for R_SUSPICIOUS_URL check
Suggested by: @citrin

---
 rules/misc.lua | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/rules/misc.lua b/rules/misc.lua
index b20f62bab..a7e77516d 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -126,12 +126,12 @@ rspamd_config:register_symbol({
 
 local obscured_id = rspamd_config:register_symbol{
   callback = function(task)
-    local urls = task:get_urls()
+    local susp_urls = task:get_urls_filtered({ 'obscured', 'zw_spaces'})
     local obs_flag = url_flags_tab.obscured
     local zw_flag = url_flags_tab.zw_spaces
 
-    if urls then
-      for _,u in ipairs(urls) do
+    if susp_urls then
+      for _,u in ipairs(susp_urls) do
         local fl = u:get_flags_num()
         if bit.band(fl, obs_flag) then
           task:insert_result('R_SUSPICIOUS_URL', 1.0, u:get_host())


More information about the Commits mailing list