Re: [Exim] lookup mysql and {yes}{no}

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: jmab
Ημερομηνία:  
Προς: Peter Bowyer
Υ/ο: exim-users
Αντικείμενο: Re: [Exim] lookup mysql and {yes}{no}
actually, what i want to do is:
condition = ${if and { \
                        {eq {'1'} {MYCOND}} \
                        {!match {$h_subject:} {bozzo}} \
             {yes}{no} }



MYCOND = "${lookup mysql {SELECT id_f FROM ids \
              WHERE email='${local_part}@${domain}'} }"



So, the match condition works as expected, but MYCOND doesn't.
MYCOND works if i use a {no}{yes} - tested separately.

..

julien

On Wed, Jul 28, 2004 at 01:30:23PM -0000, Peter Bowyer typed:
:: jmab@??? said:
:: > hello,
:: > according to the docs :
:: > ${if <condition> {yes}{no} }
:: > will return 'yes' if the condition is true and 'no' if the condition
:: > fails.
:: >
:: > why does this work the opposite way when i do a mysql lookup:
:: > ${if <mysql lookup> {yes}{no} } ?
:: >
:: > I have to use:
:: > ${if <mysql lookup> {no}{yes} } so that when the SELECT query returns
:: > non-null if matches 'yes'.
::
:: You're getting conditions and lookups confused.
::
:: ${lookup mysql {<some sql>} {yes}{no}}
::
:: will return yes if the sql query succeeded (ie returned something) and no
:: if it didn't. That's probably all you need.
::
:: Peter
::
:: --
::
:: ## List details at http://www.exim.org/mailman/listinfo/exim-users Exim details at http://www.exim.org/ ##