Re: [exim] multiple condition statements

Top Page
Delete this message
Reply to this message
Author: Devine, Steven (sd)
Date:  
To: Phil Pennock
CC: exim-users@exim.org
Subject: Re: [exim] multiple condition statements
Phil
Thank you for this:
  condition = ${if and{\
    {bool{${lookup mysql {MYSQL_EXPIRED}{1}}}}\
    {bool{${lookup mysql {MYSQL_VACATION_YES}{$value}}}}\
    }}


It works great and buy's me time to catch my breath.
I'm going to put upgrading this to a newer version on my To-Do list.
Thanks again for the quick response. This is a great list!


Steve Devine
Collaborative Systems & Support
Information Technology Services
Michigan State University

________________________________________
From: Phil Pennock [pdp@???]
Sent: Wednesday, September 05, 2012 8:58 PM
To: Devine, Steven (sd)
Cc: exim-users@???
Subject: Re: [exim] multiple condition statements

On 2012-09-06 at 00:11 +0000, Devine, Steven (sd) wrote:
> So this is odd on one system that is running Exim 4.75
> I have this in the routers section:

[ multiple condition rules ]
> This works fine.
>
> On another system running Exim 4.72


> Is this due to the version difference?
> Any ideas? I am rtfm'ing but no joy so far.


Yes, it was a feature addition; there should be a file "NewStuff"
distributed with Exim, which lists new features as they come in.

Version 4.73, item 9:
9. Routers now support multiple "condition" tests,

I've no idea why I ended that with a trailing comma, perhaps I meant to
write more at the time.

Note that version 4.74 had some security fixes, so unless your 4.72
install has backported those fixes, you should seriously consider
upgrading. I'm biased, but I suggest 4.80, to be up-to-date. :)
As always, review README.UPDATING before doing so, in case there are any
backwards-incompatible changes which will bite you. We try to avoid
them, but sometimes don't have much choice (security).

Note that this multiple-condition feature builds on item 8 added in
version 4.73, and behind the scenes is really just building a chained:

${if and{{bool_lax{previous_chained_conditions}}{bool_lax{text_of_new_condition}}}}

Without the bool_lax{} expansion condition, you may need to rephrase the
new condition a little, as you need to make it come to a true condition,
rather than new text.

> condition = ${lookup mysql {MYSQL_EXPIRED}{1}}
> condition = ${lookup mysql {MYSQL_VACATION_YES}{$value}}


So handling this depends upon what MYSQL_VACATION_YES will return. If
it will be the string which the bool{} expansion condition accepts as
yes, then this is a bit easier.

  condition = ${if and{\
    {bool{${lookup mysql {MYSQL_EXPIRED}{1}}}}\
    {bool{${lookup mysql {MYSQL_VACATION_YES}{$value}}}}\
    }}


But note that bool{} does not accept everything which "condition ="
does, while bool_lax{} accepts exactly the same things.

I'm glad to see that multiple-condition feature making life simpler and
being used. :)

Regards,
-Phil