From: Vsevolod Stakhov Date: Thu, 22 Apr 2021 13:13:28 +0000 (+0100) Subject: [Minor] Lua_magic: Really add an exclusion... X-Git-Tag: 3.0~467 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=12e030093062ff6fbbb31f601d2f690337a9941b;p=thirdparty%2Frspamd.git [Minor] Lua_magic: Really add an exclusion... --- diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua index 5863897bc4..aa8e9e8190 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