diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-03 11:51:03 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-12-03 11:51:03 +0000 |
commit | 2aaf02a82cf2eebcccbeb470ec0a8d2f1999815a (patch) | |
tree | e09bb8655fb50f4961d838772dcb49ee2c41bd76 | |
parent | a70b48eec52d09f6d2fa395b21d7b902db255600 (diff) | |
download | rspamd-2aaf02a82cf2eebcccbeb470ec0a8d2f1999815a.tar.gz rspamd-2aaf02a82cf2eebcccbeb470ec0a8d2f1999815a.zip |
[Minor] Lua_magic: Use larger span to look for text patterns
-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 a0efdf50f..d9a7702a4 100644 --- a/lualib/lua_magic/heuristics.lua +++ b/lualib/lua_magic/heuristics.lua @@ -408,7 +408,7 @@ exports.text_part_heuristic = function(part, log_obj, _) if is_text then -- Try patterns - local span_len = math.min(160, clen) + local span_len = math.min(4096, clen) local start_span = content:span(1, span_len) local matches = txt_trie:match(start_span) local res = {} @@ -418,8 +418,8 @@ exports.text_part_heuristic = function(part, log_obj, _) local ext,weight = txt_patterns_indexes[n][1], txt_patterns_indexes[n][2][2] if ext then res[ext] = (res[ext] or 0) + weight * #positions - lua_util.debugm(N, log_obj, "found txt pattern for %s: %s, total: %s", - ext, weight * #positions, res[ext]) + lua_util.debugm(N, log_obj, "found txt pattern for %s: %s, total: %s; %s/%s announced", + ext, weight * #positions, res[ext], mtype, msubtype) end end |