Re: [exim] Help with using a numerical variable in a MIME AC…

Top Page
Delete this message
Reply to this message
Author: paul.mcilfatrick
Date:  
To: exim-users
Subject: Re: [exim] Help with using a numerical variable in a MIME ACL
> > I have tried the following in a MIME ACL but the $1
> numerical variable
> > does contain anything:
> >
> > # Discard e-mail with graphic file attachment.
> >         discard condition       =       ${if match
> > {${lc:$mime_filename}} {[.] *(gif|jpg|jpeg|png|bmp)\$}}
> >                 !sender_domains =       +ok_domains
> >                 logwrite        =       External e-mail from
> > '$sender_address' with invalid attached file type ($1) 
> '$mime_filename'
> > - discard!

> >
> >
> > Searched the current on-line documentation and the Wiki but
> can't find
> > an example for what I am after.
> >
> > Not sure if I want to do is possible.
>
> The value of $1 is not preserved outside an individual string
> expansion.
> However, there is no reason why you can't repeat the regex in
> an ${sg expansion to pick out the file type - though as it is
> in $mime_filename already I'm not sure why you want to log it twice.


Philip, thanks for your quick reply.

Was numerical variables not being available outside an individual string
expansion a design decision in Exim as in Perl I am used to have
numerical variables available for later use?

Have you ever been asked to modify this in Exim so that these variables
continue to exist after a string expansion?


Thanks


Paul McIlfatrick