diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-12-15 15:20:19 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-12-15 15:20:19 +0000 |
commit | c20ae890aa62c5323c7dad718ef356e09b00e2a5 (patch) | |
tree | a77ae54892b78811406511b521aa8c13bdab5575 /lualib/lua_scanners | |
parent | fd222e43f32a87106612c3b5197a9d491256bfe4 (diff) | |
download | rspamd-c20ae890aa62c5323c7dad718ef356e09b00e2a5.tar.gz rspamd-c20ae890aa62c5323c7dad718ef356e09b00e2a5.zip |
[Minor] Antivirus: Improve parts selection
Diffstat (limited to 'lualib/lua_scanners')
-rw-r--r-- | lualib/lua_scanners/common.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua index a92d923d0..d052f4552 100644 --- a/lualib/lua_scanners/common.lua +++ b/lualib/lua_scanners/common.lua @@ -459,14 +459,15 @@ local function check_parts_match(task, rule) end if rule.scan_all_mime_parts ~= false then + local is_part_checkable = (p:is_attachment() and (not p:is_image() or rule.scan_image_mime)) if detected_ext then -- We know what to scan! local magic = lua_magic_types[detected_ext] or {} - if p:is_attachment() or magic.av_check ~= false then + if magic.av_check ~= false or is_part_checkable then return true end - elseif p:is_attachment() then + elseif is_part_checkable then -- Just rely on attachment property return true end |