On Thu, 10 Feb 2005, Mark T. Valites wrote:
> I'm attempting to set up a router that will only accept email if the
> local_part exists as a uid in two different ldap directories, but I can't
> seem to get the syntax down quite right.
>
> My router currently looks like this:
>
> condition = "${if and {\
> ${lookup ldap {ldap:///ou=<ou>,o=<o>?uid?sub?(uid=$local_part)}}\
> ${lookup ldap {ldap://<2nd_ldap_server>/dc=<dc>,dc=<dc>,dc=<dc>?uid?sub?(uid=$local_part)}}\
> }\
> {true}{false}\
> }"
The arguments to and{} must be expansion conditions, and must be wrapped
in braces. In your code, ${lookup is not an expansion condition, and is
not wrapped in braces.
Remember that ${lookup has built in then/else functionality, so you can say:
condition = ${lookup ldap {ldap://<2nd_ldap_server>/dc=<dc>,dc=<dc>,dc=<dc>?uid?sub?(uid=$local_part)} \
{${lookup ldap {ldap:///ou=<ou>,o=<o>?uid?sub?(uid=$local_part)} \
{yes} {no} }} \
{no} }
Tony.
--
<fanf@???> <dot@???>
http://dotat.at/ ${sg{\N${sg{\
N\}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}\
\N}{([^N]*)(.)(.)(.*)}{\$1\$3\$2\$1\$3\n\$2\$3\$4\$3\n\$3\$2\$4}}