diff options
author | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-03-08 15:06:13 +0300 |
---|---|---|
committer | Alexander Moisseev <moiseev@mezonplus.ru> | 2019-03-08 15:06:13 +0300 |
commit | 6bfb1182eb065aa72afbf364e80277896943452f (patch) | |
tree | 14eaf39dda0cbbfa669714c0da6bf96a2e9fffaa | |
parent | 73cf5c9693e93d5a48e0b1b3321539243bc10f10 (diff) | |
download | rspamd-6bfb1182eb065aa72afbf364e80277896943452f.tar.gz rspamd-6bfb1182eb065aa72afbf364e80277896943452f.zip |
[Minor] mime_types: Skip extensions matching
if extension of the file inside archive is not bad
-rw-r--r-- | src/plugins/lua/mime_types.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index 98acd463f..589f82515 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -1016,8 +1016,9 @@ local function check_mime_type(task) if ext2 then local enc_ext = gen_extension(fl[1].name) - if enc_ext and - not string.match(ext2, '^%d+$') + if enc_ext + and settings['bad_extensions'][enc_ext] + and not string.match(ext2, '^%d+$') and enc_ext ~= ext2 then task:insert_result(settings['symbol_double_extension'], 2.0, string.format("%s!=%s", ext2, enc_ext)) |