diff options
author | Carsten Rosenberg <c.rosenberg@heinlein-support.de> | 2018-09-26 14:31:47 +0200 |
---|---|---|
committer | Carsten Rosenberg <c.rosenberg@heinlein-support.de> | 2018-09-26 14:31:47 +0200 |
commit | bb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6 (patch) | |
tree | 6062ed81f9f542fa22c5f48b2e0f369338a2fba1 /src | |
parent | 39a49396e3572f48ba566912888a163fc750fff6 (diff) | |
download | rspamd-bb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6.tar.gz rspamd-bb58fb5440a4bc4dc02abbf7f61faa9bf01f17b6.zip |
[Minor] Antivirus - configureable mime_part scanning
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/lua/antivirus.lua | 10 |
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 |