diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-16 16:14:22 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-07-16 16:14:22 +0100 |
commit | f722832e3aba64438a7ca132a56db00bb182e2f6 (patch) | |
tree | 031ec0996a57300fe40ffe4a78563fa77044a1f5 /lualib/lua_magic | |
parent | 4fb77a80c94a7600c45d06a05d1410de7e50de65 (diff) | |
download | rspamd-f722832e3aba64438a7ca132a56db00bb182e2f6.tar.gz rspamd-f722832e3aba64438a7ca132a56db00bb182e2f6.zip |
[Minor] Do not autodetect html parts as text parts
Diffstat (limited to 'lualib/lua_magic')
-rw-r--r-- | lualib/lua_magic/heuristics.lua | 5 |
1 files changed, 5 insertions, 0 deletions
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 |