Re: [exim] acl_check_content doesn't get applied to all mail…

Top Page
Delete this message
Reply to this message
Author: Lena
Date:  
To: exim-users
Subject: Re: [exim] acl_check_content doesn't get applied to all mails
> From: Sch??rjann, Tobias

> the acl only works sometimes. In the rejectlog I can see a few mails that
> got rejected with the message: "This message contains an unwanted file
> extension (zip)", so the acl works, but most of the Mails are not rejected
> although they contain zip files.


Insert into the beggining of Exim config:

check_rfc2047_length = false

> From: Heiko Schlittermann


> maybe you should move to acl_smtp_mime, instead of using the
> obsoleted demime extension.


The path /usr/local/etc/unzip is for FreeBSD:

acl_smtp_mime = acl_check_mime
begin acl
acl_check_mime:
  deny message = Windows-executable attachments forbidden
       condition = ${if def:sender_host_address}
       !authenticated = *
       log_message = forbidden attachment: filename=$mime_filename, \
                     content-type=$mime_content_type, recipients=$recipients
       condition = ${if or{\
                           {match{$mime_content_type}{(?i)executable}}\
                           {match{$mime_filename}{\N(?i)\.(exe|com|vbs|bat|pif\
    |scr|hta|js|cmd|chm|cpl|jsp|reg|vbe|lnk|dll|sys|btm|dat|msi|prf|vb)$\N}}\
                          }}


  deny message = A .zip attachment contains a Windows-executable file - \
                 blocked because we are afraid of new viruses \
                 not recognized [yet] by antiviruses.
       condition = ${if match{$mime_filename}{\N(?i)\.zip$\N}}
       condition = ${if def:sender_host_address}
       !authenticated = *
       decode = default
       log_message = forbidden binary in attachment: filename=$mime_filename, \
                     recipients=$recipients
       condition = ${if match{${run{/usr/local/bin/unzip -l \
                                    $mime_decoded_filename}}}\
                             {\N(?i)\n .+\.(zip|exe|com|vbs|bat|pif|scr|hta\
           |js|cmd|chm|cpl|jsp|reg|vbe|lnk|dll|sys|btm|dat|msi|prf|vb)\n\N}}


accept