From: Alexander Moisseev Date: Fri, 25 Jan 2019 07:14:52 +0000 (+0300) Subject: [Minor] mime_types: Do not treat numbers in brackets as double extension X-Git-Tag: 1.9.0~253^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=a089a38e5ca71881797683ccf0f8c00237e95573;p=rspamd.git [Minor] mime_types: Do not treat numbers in brackets as double extension Example: PDF417(3.2.4).msi --- diff --git a/src/plugins/lua/mime_types.lua b/src/plugins/lua/mime_types.lua index a7a859e53..6b7ddbdc9 100644 --- a/src/plugins/lua/mime_types.lua +++ b/src/plugins/lua/mime_types.lua @@ -854,7 +854,7 @@ local function check_mime_type(task) if #parts > 2 then -- We need to ensure that next-to-last extension is an extension, -- so we check for its length and if it is not a number or date - if #ext2 <= 4 and not string.match(ext2, '^%d+$') then + if #ext2 <= 4 and not string.match(ext2, '^%d+[%]%)]?$') then -- Use the greatest badness multiplier if not badness_mult or