Re: [exim] Block extensions

Startseite
Nachricht löschen
Nachricht beantworten
Autor: W B Hacker
Datum:  
To: exim users
Betreff: Re: [exim] Block extensions
Daniele Gallarato wrote:
>    Thanks Eduardo.
>    This is my configuration:
>      deny message = Questo messaggio contiene attachment non consentiti:
>    (.$found_extension)
>      demime =
>    m3u:acm:avb:bat:bin:chm:cmd:com:dll:exe:gms:hta:inf:lnk:mht:ocx:pif:wa
>    v
>    How can I modify it?
>    Daniele
>    Eduardo M KALINOWSKI wrote:

>
> Daniele Gallarato escreveu:
>
>
> Hello all.
> I've this problem.
> I've configured exim to block mails whose contain wav attachment.
> But I've a voice mail server that send messages with this type of file,
> and I want to configure an exception to permit this.
> Is it possible to obtain this?
> Using some type of acl? With ip address would be great.
>
>
>
>
> It certainly is possible. How are you blocking the .wav attachments?
> Providing the configuration snippet responsible for that would help.
>
> I'd guess you need something like
>     !hosts = ip.of.whitelisted.server
> in the ACL that blocks the attachments.

>
>
>


First, split into two acl clauses so as to not lose the other protections.

A) Remove the /wav extension in your original:


====

deny
      message = Questo messaggio contiene attachment non consentiti \
    (.$found_extension)
       demime =  m3u:acm:avb:bat:bin:chm:cmd:. . . .  (all EXCEPT .wav)


====

B) Add a new acl clause ONLY looking ONLY for .wav:

====
deny
      message = Questo messaggio contiene attachment non consentiti \
    (.$found_extension)
      !hosts = { a hostlist of those permitted}
==
and/or
==
      !condition = {an lsearch of a flat file of those permitted}
      demime = .wav


====

CAVEATS:

A 'hostlist', unless it is itself a lookup, needs editing WITHIN the
~/exim/comnfigure file AND a 'restart' to accomodate changes.

An lsearch (or similar search) of an external DB or falt file of IP or
hostnames requires neither ~/configure editing nor restart.
Any changes made to it will automagically be effective at the next
incoming message.

Specifics for how to match on IP, hostname or other are well covered in
the docs and archives, not reproduced above.

HTH,

Bill Hacker