Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: exim: users

multiple condition statements

 

 

exim users RSS feed   Index | Next | Previous | View Threaded


sd at msu

Sep 5, 2012, 5:11 PM

Post #1 of 4 (352 views)
Permalink
multiple condition statements

So this is odd on one system that is running Exim 4.75
I have this in the routers section:

vacation_expired_director:
driver = accept
condition = ${lookup mysql {MYSQL_EXPIRED}{1}}
condition = ${lookup mysql {MYSQL_VACATION_YES}{$value}}
transport = vacation_expired_autoreply

This works fine.

On another system running Exim 4.72

I have the exact same configuration in the Routers section and when I try
to start exim I get this error:

Initializing SMTP port (exim)2012-09-05 20:09:34 Exim configuration error in line 767 of /etc/exim/configure:
"condition" option set for the second time

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





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





--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


pdp at exim

Sep 5, 2012, 5:58 PM

Post #2 of 4 (341 views)
Permalink
Re: multiple condition statements [In reply to]

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

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


tlyons at ivenue

Sep 5, 2012, 6:19 PM

Post #3 of 4 (337 views)
Permalink
Re: multiple condition statements [In reply to]

On Wed, Sep 5, 2012 at 5:58 PM, Phil Pennock <pdp [at] exim> wrote:
> I'm glad to see that multiple-condition feature making life simpler and
> being used. :)

Oh yeah, I'm using the heck out of it. It simplified some of my
really ugly conditions. Thanks for that particular feature :-)

If I ever end up in your neck of the woods, we are going to (not
necessarily in this order and possibly at the same time)
1. Share a pitcher of good beer
2. Eat at a place that puts french fries, cheese steak, and a sweet
sauce on a salad

The rest is play it by ear, but those two are required. :-)

...Todd
--
The total budget at all receivers for solving senders' problems is $0.
If you want them to accept your mail and manage it the way you want,
send it the way the spec says to. --John Levine

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/


sd at msu

Sep 5, 2012, 6:47 PM

Post #4 of 4 (340 views)
Permalink
Re: multiple condition statements [In reply to]

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 [at] exim]
Sent: Wednesday, September 05, 2012 8:58 PM
To: Devine, Steven (sd)
Cc: exim-users [at] exim
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

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/

exim users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.