summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-09-26 14:31:47 +0200
committerCarsten Rosenberg <c.rosenberg@heinlein-support.de>2018-09-26 14:31:47 +0200
commitbb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6 (patch)
tree6062ed81f9f542fa22c5f48b2e0f369338a2fba1 /src
parent39a49396e3572f48ba566912888a163fc750fff6 (diff)
downloadrspamd-bb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6.tar.gz
rspamd-bb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6.zip
[Minor] Antivirus - configureable mime_part scanning
Diffstat (limited to 'src')
-rw-r--r--src/plugins/lua/antivirus.lua10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/lua/antivirus.lua b/src/plugins/lua/antivirus.lua
index 976e521f4..047035fc1 100644
--- a/src/plugins/lua/antivirus.lua
+++ b/src/plugins/lua/antivirus.lua
@@ -871,11 +871,17 @@ local function add_antivirus_rule(sym, opts)
end
return function(task)
- if rule.attachments_only then
+ if rule.scan_mime_parts then
local parts = task:get_parts() or {}
for _,p in ipairs(parts) do
- if not p:is_image() and not p:is_text() and not p:is_multipart() then
+ if (
+ (p:is_image() and rule.scan_image_mime)
+ or (p:is_text() and rule.scan_text_mime)
+ or (p:is_multipart() and rule.scan_text_mime)
+ or (not p:is_image() and not p:is_text() and not p:is_multipart())
+ ) then
+
local content = p:get_content()
if content and #content > 0 then