From: Vsevolod Stakhov Date: Thu, 16 Jul 2020 15:14:22 +0000 (+0100) Subject: [Minor] Do not autodetect html parts as text parts X-Git-Tag: 2.6~234 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f722832e3aba64438a7ca132a56db00bb182e2f6;p=rspamd.git [Minor] Do not autodetect html parts as text parts --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 82c2fa4bd..8c63cce72 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -393,6 +393,7 @@ exports.text_part_heuristic = function(part, log_obj, _) end local content = part:get_content() + local mtype,msubtype = part:get_type() local clen = #content local is_text @@ -433,6 +434,10 @@ exports.text_part_heuristic = function(part, log_obj, _) end end + if mtype == 'text' and (msubtype == 'html' or msubtype == 'htm') then + return 'html',21 + end + return 'txt',40 end end