Re: [exim] Condition in router

Páxina inicial
Borrar esta mensaxe
Responder a esta mensaxe
Autor: Dave Evans
Data:  
Para: exim-users
Asunto: Re: [exim] Condition in router
On Mon, Mar 03, 2008 at 07:55:23PM +0100, Pawel Rutkowski wrote:
> if he found user@domain in file /etc/exim/direct/$domain and all these:
> ...
> expression is true then the email is accepted in that router.


OK, well in that case your main choices are:

- embed the "if" inside the "lookup", a bit like this:

  condition = ${lookup{$local_part@$domain}lsearch{/etc/exim/direct/$domain}\
    {${if and{ ... add conditions here ... }} \
    {no} \
  }


(i.e. if the lookup succeeds, try the "if", otherwise the answer is "no")

- or, add the lookup as another condition:

>      {!def:h_X-Spam-Flag:} \
>      {!eq {$received_protocol}{spam-scanned}} \
>      {!eq {$received_protocol}{local}} \
>      {exists{/etc/exim/spam/$domain/user_prefs}} \

       {!eq {} {${lookup ...}}}


(i.e. an extra "and" condition which verifies that the lookup expands to
non-empty)

- or, add the lookup as part of the "true" expansion of the "if":

  condition = ${if and { ... } \
      {${lookup ...}  {yes}{no}}\
  }


(i.e. try all the "if", and if those tests are true then try the lookup)

I suspect the second option will be the most readable.

--
Dave Evans
http://djce.org.uk/
http://djce.org.uk/pgpkey