[exim] MIME-ACL: Request for MIME checks

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: oliver egginger
Dátum:  
Címzett: exim-users
Tárgy: [exim] MIME-ACL: Request for MIME checks
Hello,

I found some useful MIME checks on the exim list (see the attached file mime_acl.cf),
but there are certainly more. If you do MIME checking with Exims new MIME-ACL,
please have a look at the attached file and post your increments or improvements
to the list.

regards
oliver




# $Id: mime_acl.cf 4493 2005-06-29 11:32:07Z oliver $

###############################
# MIME-ACL
###############################

# Decode MIME parts to disk. This will support virus scanners later.
warn decode = default

# warn log_message = DEBUG: [$mime_part_count] -> [$mime_filename] [$mime_content_type]

# File extension filtering.
deny   message  = This message contains a prohibited file extension (${extract{-1}{.}{${lc:$mime_filename}}})
   log_message     = BAD_ATTACHMENT (${extract{-1}{.}{${lc:$mime_filename}}})
   condition       = ${if match{${extract{-1}{.}{${lc:$mime_filename}}}}{\N^(BAD_ATTACHMENTS)$\N}{1}{0}}


# CLSID Attachment Blocking
deny condition = ${if match{$mime_filename}{\N\{[a-hA-H0-9-]{25,}\}\N}{1}{0}}
message = BAD_ATTACHMENT (CLSID)

# Refuse Empty (invalid) MIME Boundaries
deny condition = $mime_is_multipart
condition = ${if eq{$mime_boundary}{}{yes}{no}}
message = MIME_ERROR (Empty MIME Boundary)

# Too many MIME parts
deny
  condition   = ${if >{$mime_part_count}{256}{yes}{no}}
  message     = MIME_ERROR : Too many MIME parts (max 256)
  log_message = MIME_ERROR : Too many MIME parts: $mime_part_count


# Excessive line length
deny
  regex       = ^.{16382}
  message     = MIME_ERROR Line length in message or single header exceeds 16382.
  log_message = MIME_ERROR : Maximum line length exceeded


# Partial message
deny
  condition   = ${if eq {$mime_content_type}{message/partial}{yes}{no}}
  message     = MIME_ERROR : MIME type message/partial not allowed here
  log_message = MIME_ERROR : MIME type message/partial found


# Filename length too long (> 512 characters)
deny
  condition   = ${if >{${strlen:$mime_filename}}{512}{yes}{no}}
  message     = MIME_ERROR : Proposed filename exceeds 512 characters
  log_message = MIME_ERROR : Proposed filename too long


# MIME boundary length too long (> 1024)
deny
  condition   = ${if >{${strlen:$mime_boundary}}{1024}{yes}{no}}
  message     = MIME_ERROR : MIME boundary length exceed 1024 characters
  log_message = MIME_ERROR : (Boundary length too long)



accept