Re: [Exim] ACL to ALLOW only mentioned attachments type and …

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Bruce Richardson
Dátum:  
Címzett: exim-users
Tárgy: Re: [Exim] ACL to ALLOW only mentioned attachments type and block *
On Fri, Mar 26, 2004 at 12:49:45PM +0000, Bruce Richardson wrote:
> On Fri, Mar 26, 2004 at 12:26:25PM +0000, Tim Jackson wrote:
> > Hi Dilip, on Fri, 26 Mar 2004 17:56:57 +0530 you wrote:
> >
> > > Can i write a ACL which allows only specified attachments type and
> > > BLOCKS all *
> >
> > I'm wildly guessing here, as I haven't tried to see if this actually works
> > with the way Exiscan hooks into the ACLs, but how about:
> >
> > deny message = Bad attachment
> >      !demime = txt

> >
> > if you only wanted to allow attachments with a "txt" extension?
>
> Would that reject messages with no attachment?
>
> How about this:
>
> deny message = Bad attachment
>      demime = *
>      condition = ${if eqi {$found_extension}{txt} {no}{yes}}


Hmm. I don't have good things to report on this. If the condition is
'demime = *', then $found_extension is not filled. You have to specify
an explicit list of extensions before $found_extension will be used and
then it will only show the first found extension no matter how many
attachments. So I think you have to do something like this:

warn set acl_m0 = text_only
     demime = txt
warn set acl_mo = mixed
     demime = *
     !demime = txt
deny message = Bad attachment
     demime = *
     condition = ${if eq {$acl_m0}{text_only} {no}{yes}}


But I haven't had time to test this.


--
Bruce

I am now a little wary of bananas.