aboutsummaryrefslogtreecommitdiffstats
path: root/rules
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2022-01-11 20:25:52 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2022-01-11 20:25:52 +0000
commitc6f7b897d45cbe4a166334ca60d29b3b7391bd3a (patch)
tree19fd763d530ab0f8b06e80d9cb821a5283a563d2 /rules
parent420a261aa40ed55163fd638aa71561207574eea8 (diff)
downloadrspamd-c6f7b897d45cbe4a166334ca60d29b3b7391bd3a.tar.gz
rspamd-c6f7b897d45cbe4a166334ca60d29b3b7391bd3a.zip
[Minor] Fix some issues in URI_COUNT_ODD rule
Issue: #4037
Diffstat (limited to 'rules')
-rw-r--r--rules/misc.lua6
1 files changed, 2 insertions, 4 deletions
diff --git a/rules/misc.lua b/rules/misc.lua
index 2e5f38800..9c8cade71 100644
--- a/rules/misc.lua
+++ b/rules/misc.lua
@@ -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)