diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-22 14:13:28 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-04-22 14:13:28 +0100 |
commit | 12e030093062ff6fbbb31f601d2f690337a9941b (patch) | |
tree | 5e487740f1dce0278d5ea5b3aafb1937bc9a0142 /lualib/lua_magic | |
parent | adefe59d6f1273d4b9613bf29f19bca954d6ad45 (diff) | |
download | rspamd-12e030093062ff6fbbb31f601d2f690337a9941b.tar.gz rspamd-12e030093062ff6fbbb31f601d2f690337a9941b.zip |
[Minor] Lua_magic: Really add an exclusion...
Diffstat (limited to 'lualib/lua_magic')
-rw-r--r-- | lualib/lua_magic/heuristics.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 5863897bc..aa8e9e819 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -403,7 +403,7 @@ exports.text_part_heuristic = function(part, log_obj, _) is_text = is_span_text(content) end - if is_text then + if is_text and mtype ~= 'message' then -- Try patterns local span_len = math.min(4096, clen) local start_span = content:span(1, span_len) @@ -420,14 +420,14 @@ exports.text_part_heuristic = function(part, log_obj, _) end end - if res.html and res.html >= 40 then + if res.html and res.html >= 40 then -- HTML has priority over something like js... return 'html', res.html end local ext, weight = process_top_detected(res) - if weight and weight >= 40 and mtype ~= 'message' then + if weight and weight >= 40 then return ext, weight end end |