[Exim] condition/string expansion question

Top Page
Delete this message
Reply to this message
Author: Jack Ziegler
Date:  
To: exim-users
Subject: [Exim] condition/string expansion question
Hello,

I have a router that checks whether a message has been flagged as spam
by SpamAssassin:

condition = "${if def:header_X-Spam-Flag:{1}{0}}"

This is working fine.

I'm trying to "and" this condition with a clause that implements an
"opt-in" to special handling for suspected spam, based on a flag in the
each user's LDAP entry:

condition = "${if and { {def:header_X-Spam-Flag:} \
{eq {${lookup ldap {user="cn=yyyyyyyy,o=sonoma,o=edu" pass=xxxxxx ldap:///\
ou=people,o=sonoma,o=edu?grayMailFlag?sub?(&(objectClass=mailUser)\
(uid=${quote_ldap:$local_part}))}}}{True}}} {1}{0}}"

I have tested the condition (i.e. the part within "") in "exim -be", and
it seems to work as expected: returns 1 if the grayMailFlag = "True"
for the uid that I substitute for $local_part; 0, otherwise. But the
statement above fails to compile with the error:

Exim configuration error in line xxx:
extra characters follow string value for condition

Thanks for any help you can provide.