commit f22fd35: [Minor] Lua_magic: Do not treat by default non-text part as text

Vsevolod Stakhov vsevolod at highsecure.ru
Fri Nov 20 11:28:06 UTC 2020


Author: Vsevolod Stakhov
Date: 2020-11-20 11:23:04 +0000
URL: https://github.com/rspamd/rspamd/commit/f22fd35fc8650db2db4a75400184130ec2beae49

[Minor] Lua_magic: Do not treat by default non-text part as text

---
 lualib/lua_magic/heuristics.lua | 5 +++++
 1 file changed, 5 insertions(+)

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


More information about the Commits mailing list