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

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Angel Marin
Dátum:  
Címzett: exim-users
Tárgy: Re: [exim] Help with using a numerical variable in a MIME ACL
paul.mcilfatrick@??? escribió:
> # Discard e-mail with graphic file attachment.
>         discard condition       =       ${if match
> {${lc:$mime_filename}} {[.] *(gif|jpg|jpeg|png|bmp)\$}}
>                 set acl_m2      =       $1
>                 !sender_domains =       +ok_domains
>                 logwrite        =       External e-mail from
> '$sender_address' with invalid attached file type ($acl_m2)
> '$mime_filename' - discard!


How about:

discard set acl_m2 = ${if match {${lc:$mime_filename} {[.]
*(gif|jpg|jpeg|png|bmp)\$}{$1}{--}}
        condition       = <test using $acl_m2 value>
        ...


From the documentation Philip quoted:

> documentation paragraph that is part of the ${if description:
>     At the start of an if expansion the values of the numeric variable
>     substitutions $1 etc. are remembered. Obeying a match condition that
>     succeeds causes them to be reset to the substrings of that condition
>     and they will have these values during the expansion of the success
>     string.


Regards,
--
Angel Marin
http://anmar.eu.org/