clamav {
# If set force this action if any virus is found (default unset: no action is forced)
# action = "reject";
- # if `true` only messages with non-image attachments will be checked (default true)
- attachments_only = true;
+ # message = '${SCANNER}: virus found: "${VIRUS}"';
+ # Scan mime_parts seperately - otherwise the complete mail will be transfered to AV Scanner
+ #scan_mime_parts = true;
+ # Scanning Text is suitable for some av scanner databases (e.g. Sanesecurity)
+ #scan_text_mime = false;
+ #scan_image_mime = false;
# If `max_size` is set, messages > n bytes in size are not scanned
#max_size = 20000000;
# symbol to add (add it to metric if you want non-zero weight)
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