Auteur: Marcin Mirosław Datum: Aan: exim-users Onderwerp: Re: [exim] router condition, problem with "and"
W dniu 19.08.2010 09:06, Jonas Forsberg pisze: >
>
> Hello.
> I am fairly new to exim4, so please be patient with me.
>
> I'm
> trying to get a condition for a router to work as I expect, but I
> clearly have issues understanding the syntax.
>
> The condition consists of
> two parts:
>
> 1st a check in the Subject field after a string, that I have
> got to work.
>
> condition = ${lookup mysql{
> SELECT email FROM users
>
> WHERE email='${quote_mysql:$local_part}@${quote_mysql:$domain}'}
>
> {true}{false}}
>
> 2nd a check in a MySQL table, which I have been
> working.
>
> condition = ${if match
> {$h_subject:}{N^KalleKalas$N}{yes}{no}}
>
> but to combine those two into a
> "and rule" makes my head spin. What ever I do exim4 logs that it can not
> expand the condition.
Hello!
If you want to join this two condition with logical "and", it would be
looks in this way:
condition = ${if and{
{lookup mysql{SELECT 1 FROM users WHERE
email='${quote_mysql:$local_part}@${quote_mysql:$domain}'}}
{if match {$h_subject:}{N^KalleKalas$N}{yes}{no}}}
}
I can't test it, i'm not sure about sql query (mayby it shoud be write
in such way: {eq {1}{SELECT 1 FROM users WHERE
email='${quote_mysql:$local_part}@${quote_mysql:$domain}'}
)