Re: [exim] Lack of demime support in latest verstion + more.

Top Page
Delete this message
Reply to this message
Author: Chris Siebenmann
Date:  
To: kamil kapturkiewicz
CC: exim-users, cks
Subject: Re: [exim] Lack of demime support in latest verstion + more.
> Hi,
> I recently upgraded Exim to 4.88 and had to comment out part of configuration (demime):
>
> acl_check_data:
>
> ##  deny  message       = $found_extension files are not accepted here  
> ##        demime                = com:exe:vbs:bat:pif:reg:scr

>
> ##  deny  message       = Serious MIME defect detected ($demime_reason).
> ##      demime          = *
> ##      condition       = ${if >{$demime_errorlevel}{2}{1}{0}}


The modern replacement for demime conditions is checks in a MIME ACL,
which is run once against each MIME part in the message (including the
top level message itself). In general the reference for this is in
chapter 44, 'Content scanning at ACL time', in the 'Scanning MIME
parts' section:

    http://www.exim.org/exim-html-current/doc/html/spec_html/ch-content_scanning_at_acl_time.html


You may be able to find canned versions of what you'll need here
somewhere online. Otherwise you're going to need to code things
from scratch using 'condition = ' and Exim's string processing
features.

To check the nominal MIME extension, you will need a deny stanza
with a condition that checks against $mime_filename to see if it
has a relevant extension. Extracting the extension for an error
message is a bit intricate. Possibly the easiest overall approach
is to use ${sg} to extract the extension into an ACL variable, which
you can then reuse in both the 'condition = ' check and the message
itself.

I'm not sure what $demime_errorlevel is set for. If it's set because
an encoded MIME part fails to decode properly, probably the equivalent
is a deny stanza that attempts to decode the MIME part with 'decode
= default' or perhaps 'decode = /dev/null' (I don't know if that
works). If this fails, I believe that $mime_decoded_filename will be
unset and you can then act conditionally on that. (However, I suggest
testing this with deliberately broken encoded MIME parts.)

    - cks