summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-22 13:28:57 +0000
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-11-22 13:28:57 +0000
commitce36e23c2e07c55137ac3fb86e3f63981ddb8460 (patch)
tree645c868919795a893748cdacf376ec3cba8999d7
parent229cde8387f8aecf5d21ef3a1fcf40ba8c53a156 (diff)
downloadrspamd-ce36e23c2e07c55137ac3fb86e3f63981ddb8460.tar.gz
rspamd-ce36e23c2e07c55137ac3fb86e3f63981ddb8460.zip
[Minor] Use is_attachment where useful
-rw-r--r--lualib/lua_fuzzy.lua2
-rw-r--r--lualib/lua_meta.lua2
-rw-r--r--src/plugins/lua/antivirus.lua2
3 files changed, 3 insertions, 3 deletions
diff --git a/lualib/lua_fuzzy.lua b/lualib/lua_fuzzy.lua
index bd601c038..325a8ff6c 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 f2b008dd4..316c71d3d 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 875bd53e6..2aa1f0344 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)