commit 4804292: [Minor] Fix detection for some csv cases

Vsevolod Stakhov vsevolod at highsecure.ru
Sun Mar 13 16:21:04 UTC 2022


Author: Vsevolod Stakhov
Date: 2022-03-13 16:14:49 +0000
URL: https://github.com/rspamd/rspamd/commit/4804292ed27b0c7339d31ad007cb64d1a3601da7 (HEAD -> master)

[Minor] Fix detection for some csv cases

---
 lualib/lua_magic/heuristics.lua | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lualib/lua_magic/heuristics.lua b/lualib/lua_magic/heuristics.lua
index 7eae38ffc..8f287acbf 100644
--- a/lualib/lua_magic/heuristics.lua
+++ b/lualib/lua_magic/heuristics.lua
@@ -529,6 +529,12 @@ exports.text_part_heuristic = function(part, log_obj, _)
         return 'html', 21
       end
 
+      if msubtype:lower() == 'csv' then
+        if validate_csv(part, content, log_obj) then
+          return 'csv', 40
+        end
+      end
+
       -- Extension stuff
       local function has_extension(file, ext)
         local ext_len = ext:len()


More information about the Commits mailing list