Fwd: [exim] detecting local IP in exim filter

Kezdőlap
Üzenet törlése
Válasz az üzenetre
Szerző: Chris Jensen
Dátum:  
Címzett: exim-users
Tárgy: Fwd: [exim] detecting local IP in exim filter
Thanks (sorry, forgot to reply all so it never went to the list)

---------- Forwarded message ----------
From: David S. Madole <david@???>
Date: Dec 1, 2005 3:29 PM
Subject: Re: [exim] detecting local IP in exim filter
To: Chris Jensen <cjensen@???>


Sorry, you need to quote the expansions since they contain a space.

Yes, you can use any expansions in filters. Any place a filter takes a
string argument, you can use expansion items in that string. Just be sure
to quote them if they contain spaces. Also, any quoted strings need to
have backslashes in them doubled.

David


----- Original Message -----
From: "Chris Jensen" <cjensen@???>
To: "David S. Madole" <david@???>
Sent: Wednesday, November 30, 2005 11:25 PM
Subject: Re: [exim] detecting local IP in exim filter


> match_address is an expansion conditional, it needs to be used inside
> of
> an *expansion* if statement, not a *filter* if statement.
>
> Do something like this instead:
>
> if ${if
> match_address{$sender_host_address}{$relay_from_hosts}{true}{false}} is
> true
>  then
>    add 1 to n1
> endif


I tried that, but using "exim -oMa 127.0.0.1 -bf filter"
I get
Filter error: unrecognized condition word
"match_address{$sender_host_address}{$relay_from_hosts}{true}{false}}"
near line 7 of filter file

> or you could just
>
> add ${if match_address{$sender_host_address}{$relay_from_hosts}{1}{0}}
> to n1


That gives
Filter error: "to" expected in "add" command near line 5 of filter file

> You need to remember that you are dealing basically with two different
> languages here, the string expansion language and the filter language.
> You can't arbitrarily mix and match, you need to keep each within its
> own
> context.


Yeah, I was aware of that, I was confused about the use of the ${if}
statements within filters. So if I understand correctly, I can use any
of the expansions as described in section 11 of the exim specification
in a filter?

I'm running Exim version 4.43, instaled using an RPM from
http://dag.wieers.com/

Chris