]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix some issues in URI_COUNT_ODD rule
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Jan 2022 20:25:52 +0000 (20:25 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 11 Jan 2022 20:25:52 +0000 (20:25 +0000)
Issue: #4037

rules/misc.lua

index 2e5f3880074446f594c1339d28bd3b91eb30308a..9c8cade710c389b76403902ac21adc8e6bdaa4e8 100644 (file)
@@ -338,10 +338,8 @@ rspamd_config.URI_COUNT_ODD = {
   callback = function (task)
     local ct = task:get_header('Content-Type')
     if (ct and ct:lower():find('^multipart/alternative')) then
-      local urls = task:get_urls() or {}
-      local nurls = fun.filter(function(url)
-        return not url:is_html_displayed()
-      end, urls):foldl(function(acc, val) return acc + val:get_count() end, 0)
+      local urls = task:get_urls_filtered(nil, {'subject', 'html_displayed', 'special'}) or {}
+      local nurls = fun.foldl(function(acc, val) return acc + val:get_count() end, 0)
 
       if nurls % 2 == 1 then
         return true, 1.0, tostring(nurls)