Re: [Exim] condition = and mysql lookup

Startseite
Nachricht löschen
Nachricht beantworten
Autor: jmab
Datum:  
To: Odhiambo Washington
CC: exim-users
Betreff: Re: [Exim] condition = and mysql lookup
Well,
the problem is it doesn't work.
the sql query works fine with a {no}{yes} and the
header check works fine with {yes}{no} separately.


On Tue, Jul 27, 2004 at 07:52:44PM +0300, Odhiambo Washington typed:
:: * jmab@??? <jmab@???> [20040727 18:59]: wrote:
:: > hello i am using exim4.41  and i meet the following problem
:: > when defining a condition:
:: >
:: > condition = ${if and { \
:: >                         {eq {'1'} \
:: >                                 {${lookup mysql{SELECT loc_on_vacation \
:: >                                 FROM t_localmail \
:: >                         WHERE loc_alias='${local_part}@${domain}' \
:: >                         AND loc_is_active=1} {$value}fail}} } \
:: >                 {!match {$h_subject:} {ADV} } \
:: >                 } {no}{yes}}
:: >
:: > what I want is the condition to succeed if the lookup succeeds ans
:: > the "Subject" header doesn't match "ADV".
:: >
:: > 1)
:: > It seems that for the mysql lookup I have to invert the "{yes}{no}"
:: > to "{no}{yes}", this is strange as the documentation says that
:: > the 1st element is for the true case of the condition.
:: >
:: > 2)
:: > As I have to play "{no}{yes}" for the mysql lookup to work fine,
:: > I can't use the second condition in the right way.
:: >
:: > could someone give some light on this?
::
:: Let me try..
::
::
:: VACATION = mysql;SELECT loc_on_vacation FROM t_localmail WHERE loc_alias='${local_part}@${domain}' AND loc_is_active=1
::
:: condition = ${ if and { \
::                       {eq {'1'} {VACATION}} \
::                       {!match {$h_subject:} {ADV}} \
::                       } \
::                       {yes}{no}}
::
::
::
:: So if the VACATION query returned 1 and the subject did not contain ADV,
:: then the condition succeeds (yes) else it fails {no}...
::
:: I believe the placement of {yes}{no} depends on if this, then this, else
:: that ;)
::
::
::
::
::
:: -Wash
::
:: http://www.netmeister.org/news/learn2quote.html
::
:: --
:: +======================================================================+
::     |\      _,,,---,,_     | Odhiambo Washington    <wash@???>
:: Zzz /,`.-'`'    -.  ;-;;,_ | Wananchi Online Ltd.   www.wananchi.com
::    |,4-  ) )-,_. ,\ (  `'-'| Tel: +254 20 313985-9  +254 20 313922
::   '---''(_/--'  `-'\_)     | GSM: +254 722 743223   +254 733 744121
:: +======================================================================+
:: "I'd love to go out with you, but I did my own thing and now I've got
:: to undo it."


--