summaryrefslogtreecommitdiffstats
path: root/lualib
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2020-05-30 21:24:34 +0100
committerGitHub <noreply@github.com>2020-05-30 21:24:34 +0100
commit3537be9a3796d9519247ba32985d802ca70d5100 (patch)
tree0657a9562e981240e69cbd7fb8c6ee60d2af2e48 /lualib
parentcdb11674cfe59c0bb6d73f45ce71fc3801b58df2 (diff)
parentdb18212e766e805410ce2003f8d7229c5934ce7e (diff)
downloadrspamd-3537be9a3796d9519247ba32985d802ca70d5100.tar.gz
rspamd-3537be9a3796d9519247ba32985d802ca70d5100.zip
Merge pull request #3385 from HeinleinSupport/lua_scanner/parts_match
[Minor] lua_scanners - fix detected parts_match
Diffstat (limited to 'lualib')
-rw-r--r--lualib/lua_scanners/common.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/lualib/lua_scanners/common.lua b/lualib/lua_scanners/common.lua
index a162828fb..67952923d 100644
--- a/lualib/lua_scanners/common.lua
+++ b/lualib/lua_scanners/common.lua
@@ -399,7 +399,10 @@ local function check_parts_match(task, rule)
-- check detected content type (libmagic) regex matching
if detected_ext then
local magic = lua_magic_types[detected_ext] or {}
- if match_filter(task, magic.ct, rule.mime_parts_filter_regex) then
+ if match_filter(task, rule, detected_ext, rule.mime_parts_filter_ext, 'ext') then
+ lua_util.debugm(rule.name, task, '%s: detected extension matched: |%s|', rule.log_prefix, detected_ext)
+ return true
+ elseif magic.ct and match_filter(task, rule, magic.ct, rule.mime_parts_filter_regex, 'regex') then
lua_util.debugm(rule.name, task, '%s: regex detected libmagic content-type: %s',
rule.log_prefix, magic.ct)
return true