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

トップ ページ
このメッセージを削除
このメッセージに返信
著者: Philip Hazel
日付:  
To: paul.mcilfatrick
CC: exim-users
題目: Re: [exim] Help with using a numerical variable in a MIME ACL
On Tue, 16 Jan 2007, paul.mcilfatrick@??? wrote:

> 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 Hazel            University of Cambridge Computing Service
Get the Exim 4 book:    http://www.uit.co.uk/exim-book