Le Fri, 28 Aug 2009 10:00:31 +0100,
Dave Evans <exim-users-20081202@???> a écrit :
> On Thu, Aug 27, 2009 at 10:36:15AM +0200, Pascal Bourdais wrote:
> >
> > Hi list,
> >
> > I have a problem with this condition in a router.
> >
> > condition = and { \
> > { ${lookup ldap {ldap:///LDAP_BIND?mail?sub?(&LDAP_COND(departmentNumber=DOMAIN))}{true}{false}} } \
> > { ! def:h_X-From71:} } \
> > }
>
> Your condition will always end up starting with "and {", plus some other
> stuff, whereas what you need is something like "" or "0" or "no" or "false".
>
> See http://exim.org/exim-html-current/doc/html/spec_html/ch15.html#id560622
>
Thank you for your answer,
I had already make tests, the one which has the more respect with the
doc is
exim -bem /tmp/test.eml '${if
> and {
> { { ${lookup ldap {ldap:///ou=cer5372,dc=infagri,dc=laval?mail?sub?(&(employeeType=actif:1)(mail=pbourdais@???))}{true}{false} } } }
> { ! def:h_X-From71:}
> }
> {true}{false}
> }'
Failed: condition name expected, but found "{ ${lookup ldap " inside
"and{...}" condition
But the result is not what i expected.
Some tests :
exim -bem /tmp/test.eml '${lookup ldap {ldap:///ou=cer5372,dc=infagri,dc=laval?mail?sub?(&(employeeType=actif:1)(mail=pbourdais@???))}{true}{false}}'
Return-path taken from "Return-path:" header line
true
exim -bem /tmp/test.eml '${if ! def:h_X-From71:{true}{false}}'
Return-path taken from "Return-path:" header line
false
exim -bem /tmp/test.eml '${if ${lookup ldap {ldap:///ou=cer5372,dc=infagri,dc=laval?mail?sub?(&(employeeType=actif:1)(mail=pbourdais@???)}){true}{false}}{1}{0}'
Return-path taken from "Return-path:" header line
Failed: condition name expected, but found "${lookup ldap {l"
Lead me think thas one can't do a lookup in a ${if }, or am i wrong ?
and if so, how can i test employeetype=actif:1 ?
Pascal