]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Use is_attachment where useful
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Nov 2018 13:28:57 +0000 (13:28 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Thu, 22 Nov 2018 13:28:57 +0000 (13:28 +0000)
lualib/lua_fuzzy.lua
lualib/lua_meta.lua
src/plugins/lua/antivirus.lua

index bd601c038e79fde8637d9d49927e4e286e1c996a..325a8ff6c6fdf922e4c0eda7cc283838ad615a5d 100644 (file)
@@ -300,7 +300,7 @@ exports.check_mime_part = function(task, part, rule_id)
     return true,false
   end
 
-  if part:get_filename() then
+  if part:is_attachment() then
     return mime_types_check(task, part, rule)
   end
 
index f2b008dd4094eeb3608e0c0a612d1f8fa4846354..316c71d3d0c073f9a91eb5ad679a67b3af65a568 100644 (file)
@@ -103,7 +103,7 @@ local function meta_nparts_function(task)
 
   if parts then
     for _,p in ipairs(parts) do
-      if p:get_filename() then
+      if p:is_attachment() then
         nattachments = nattachments + 1
       end
       totalparts = totalparts + 1
index 875bd53e6ad1dc3fdf7e6be6e071036d74fab8ed..2aa1f034486a6d4d203f88087075db85467c362b 100644 (file)
@@ -1073,7 +1073,7 @@ local function add_antivirus_rule(sym, opts)
       local filter_func = function(p)
         return (rule.scan_image_mime and p:is_image())
             or (rule.scan_text_mime and p:is_text())
-            or (p:get_filename())
+            or (p:is_attachment())
       end
 
       fun.each(function(p)