]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Fix detection for some csv cases
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 13 Mar 2022 16:14:49 +0000 (16:14 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Sun, 13 Mar 2022 16:14:49 +0000 (16:14 +0000)
lualib/lua_magic/heuristics.lua

index 7eae38ffc7c4dbd6ea3711263ac3404ef9c9ef42..8f287acbf58d18e4f5e782b12d9c9793b7fa7ee6 100644 (file)
@@ -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()