Re: [Exim] How to write a condition??

Página Principal
Apagar esta mensagem
Responder a esta mensagem
Autor: Andreas Metzler
Data:  
Para: exim-users
Assunto: Re: [Exim] How to write a condition??
On Tue, Jan 20, 2004 at 11:50:48AM +0200, Alexander Prohorenko wrote:
[...]
> condition = ${if eq{$h_X-SPAM-Flag:}{YES} {yes}{no}}
> ...


> And I need it to test also if "$local_part@$domain" does not exist in
> the "/usr/local/exim/etc/spamtrustedusers" file.


> I have tried the following:


> condition = ${if and {{ !${lookup{$local_part@$domain}lsearch{/usr/local/exim/etc/spamtrustedusers}} } {eq{$h_X-SPAM-Flag:}{YES}}} {yes}{no}}

[...]

"if ${lookup ..." does not work, "if" expects a condition, i.e. something
like
{eq ${lookup{x}lsearch{file}{}}
(result of lookup is empty string).

Untested:
condition = ${if and {\
       {eq ${lookup{$local_part@$domain}\
         lsearch{/usr/local/exim/etc/spamtrustedusers}}{}}\
       {eq {$h_X-SPAM-Flag:}{YES}}\
     } {yes}{no}}


BTW breaking lines using '\' imho increases readability a lot.
           cu andreas
--
"See, I told you they'd listen to Reason," [SPOILER] Svfurlr fnlf,
fuhggvat qbja gur juveyvat tha.
Neal Stephenson in "Snow Crash"