]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Do not autodetect html parts as text parts
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 15:14:22 +0000 (16:14 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 16 Jul 2020 15:14:22 +0000 (16:14 +0100)
lualib/lua_magic/heuristics.lua

index 82c2fa4bdf8909039d3c40e72b28d2e8e231ff58..8c63cce72dafc0bbbc92e5325e65f4ca2d3e7ea6 100644 (file)
@@ -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