Re: [exim] domains in condition

Etusivu
Poista viesti
Vastaa
Lähettäjä: Tony Finch
Päiväys:  
Vastaanottaja: Marilyn Davis
Kopio: exim-users
Aihe: Re: [exim] domains in condition
On Tue, 4 Jan 2005, Marilyn Davis wrote:
>
> Parsing the $received_protocol gives all the info needed for a
> delivery of this sort, so a lookup isn't necessary -- but getting to
> the right router without a lookup is.


The problem with your router as written is that the router preconditions
have a fixed order - see section 3.11 of the spec. I recommend that people
use this order when writing their routers, i.e. start with the router's
driver, then any preconditions in the order they are tested, then the rest
of the options.
http://www.exim.org/exim-html-4.40/doc/html/spec_3.html#SECT3.11

What you can do as an alternative is make use of the fact that the domains
precondition is expanded, so instead of what you wrote (in the order of
testing and reformatted for clarity):

  domains = ! +local_domains
  condition = ${if and{{ eq{$received_protocol}{local} } \
                       { eq{INBOUND_EMAIL}{no} } \
                       { !def:sender_address }} \
                   {yes} {no} }


you can write:

  domains = ${if and{{ eq{$received_protocol}{local} } \
                     { eq{INBOUND_EMAIL}{no} } \
                     { !def:sender_address }} \
                 {!+local_domains} {} }


Tony.
--
<fanf@???> <dot@???> http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}