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

Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Peter Bowyer
Ημερομηνία:  
Προς: exim-users
Αντικείμενο: Re: [Exim] lookup mysql and {yes}{no}
jmab@??? said:
> 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.


It *is* working, but it doesn't do what you think it does.

The ${lookup is a string expansion with a test inside. It doesn't return
what the SQL statement returns (I presume you're expecting it to return
'1' - it won't).

You can make it do this a bit like this:

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


A review of the docs at
http://www.exim.org/exim-html-4.40/doc/html/spec_11.html#IX824
will reveal more.

Peter