]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Lua_magic: Do not treat by default non-text part as text
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 20 Nov 2020 11:23:04 +0000 (11:23 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 20 Nov 2020 11:24:17 +0000 (11:24 +0000)
lualib/lua_magic/heuristics.lua

index 02bc2b4a28131f648b44ea0785912dff98db5d30..a0efdf50ff8d2873ecca210ad3f5b63097d033f3 100644 (file)
@@ -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