From: Vsevolod Stakhov Date: Fri, 20 Nov 2020 11:23:04 +0000 (+0000) Subject: [Minor] Lua_magic: Do not treat by default non-text part as text X-Git-Tag: 2.7~129 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f22fd35fc8650db2db4a75400184130ec2beae49;p=rspamd.git [Minor] Lua_magic: Do not treat by default non-text part as text --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 02bc2b4a2..a0efdf50f 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -446,6 +446,11 @@ exports.text_part_heuristic = function(part, log_obj, _) return 'html',21 end + if mtype ~= 'text' then + -- Do not treat non text patterns as text + return nil + end + return 'txt',40 end end