[Exim] condition in director

Top Page
Delete this message
Reply to this message
Author: o.cook
Date:  
To: exim-users
Subject: [Exim] condition in director
I'm trying to get a condition for a director to work as follows.

1) Do an SQL query.
2) If no rows are returned, don't run the director, or
If one or more rows is returned, run the director.

I'm using:

condition = ${if {lookup mysql {MYSQL_AUTORESP}{$value}} {yes}{no}}

where MYSQL_AUTORESP is:

SELECT id FROM autoresponder WHERE address="${local_part}@${domain}"

The error i'm getting is:

marley:/usr/exim# sendmail -bt
> ollie

LOG: 0 MAIN PANIC DIE
failed to expand condition"${if {lookup mysql {SELECT id FROM
autoresponder WHERE address="${local_part}@${domain}"}{$value}} {yes}{no}}"
for uservacation_director director: "lookup mysql {SELECT id FROM
autoresponder WHERE address="ollie@???"" is not a number

Would anyone be kind enough to point me in the correct direction. I had a
look at the specification, but couldn't work this one out myself...

Regards,

Ollie