Re: [exim] Deny MIME attachments in the acl_smtp_mime ACL

Top Page
Delete this message
Reply to this message
Author: Sebastian Kayser
Date:  
To: exim-users
Subject: Re: [exim] Deny MIME attachments in the acl_smtp_mime ACL
* Magnus Holmgren <holmgren@???> wrote:
> On Wednesday 22 November 2006 13:05, paul.mcilfatrick@??? wrote:
> > I want to deny e-mail with certain MIME attachments and all the Exim
> > examples I have found use demime.
> >
> > If the demime condition is deprecated is it possible to do what I want
> > to do in the acl_smtp_mime ACL?
>
> The most common thing to do (probably), denying attached files with certain
> extensions, can be done thusly:
>
>   deny    condition = ${if match \
>                          {${lc:$mime_filename}} \
>                          {[.](bat|com|exe|pif|prf|scr|vbs|lnk|cpl)\$}}
>           message = Attached file '$mime_filename' has disallowed extension.


I am currently trying to block MIME attachments based on their filename.

    deny    set acl_m3 = ${lookup {$mime_filename} nwildlsearch \
                            {/etc/exim4/list-filenames-reject}}
            condition = ${if def:acl_m3}
            message = This message containes a blacklisted attachment filename
            log_message = DENY: reject_filename ($mime_filename)


    warn    log_message = DEBUG: acl_check_mime done for \"$mime_filename\" \
                            (lookup = $acl_m3)
            condition = ${if def:mime_filename}


Content of /etc/exim4/list-filenames-reject (without leading spaces):

    ^Update-.+-x86\.zip


For an attachment named Update-abc-x86.zip the debug message is written
to the log but the deny condition isn't met.

Warning: DEBUG: acl_check_mime done for "Update-abc-x86.zip" (lookup = )

What am i missing?

Sebastian