diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 12:37:06 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-09-09 12:37:06 +0100 |
commit | 23814946671f0385b38650aa855f701a0bfcd003 (patch) | |
tree | 092c54263be1bd64b973fc803486b2a584d3b287 /lualib/lua_magic/init.lua | |
parent | 4219a66db3f633d102dfe38e5315f0f552b85262 (diff) | |
download | rspamd-23814946671f0385b38650aa855f701a0bfcd003.tar.gz rspamd-23814946671f0385b38650aa855f701a0bfcd003.zip |
[Project] Lua_magic: Some rework in detection
Diffstat (limited to 'lualib/lua_magic/init.lua')
-rw-r--r-- | lualib/lua_magic/init.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lualib/lua_magic/init.lua b/lualib/lua_magic/init.lua index 8b5064bfe..e9e0297e9 100644 --- a/lualib/lua_magic/init.lua +++ b/lualib/lua_magic/init.lua @@ -132,6 +132,8 @@ local function process_patterns(log_obj) end end +process_patterns(rspamd_config) + local function match_chunk(chunk, input, tlen, offset, trie, processed_tbl, log_obj, res) local matches = trie:match(chunk) @@ -253,7 +255,6 @@ end exports.detect = function(input, log_obj) if not log_obj then log_obj = rspamd_config end - process_patterns(log_obj) local res = {} @@ -319,7 +320,7 @@ exports.detect = function(input, log_obj) end exports.detect_mime_part = function(part, log_obj) - local ext,weight = heuristics.mime_part_heuristic(part) + local ext,weight = heuristics.mime_part_heuristic(part, log_obj) if ext and weight and weight > 20 then return ext,types[ext] |