From: Vsevolod Stakhov Date: Thu, 22 Nov 2018 13:28:57 +0000 (+0000) Subject: [Minor] Use is_attachment where useful X-Git-Tag: 1.8.3~75 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ce36e23c2e07c55137ac3fb86e3f63981ddb8460;p=thirdparty%2Frspamd.git [Minor] Use is_attachment where useful --- diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua index bd601c038e..325a8ff6c6 100644 --- a/lualib/lua_fuzzy.lua +++ b/lualib/lua_fuzzy.lua @@ -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 diff --git a/lualib/lua_meta.lua b/lualib/lua_meta.lua index f2b008dd40..316c71d3d0 100644 --- a/lualib/lua_meta.lua +++ b/lualib/lua_meta.lua @@ -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 diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua index 875bd53e6a..2aa1f03448 100644 --- a/src/plugins/lua/antivirus.lua +++ b/src/plugins/lua/antivirus.lua @@ -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)