Mailing List Archive

'boolean' LDAP query...
I've setup an LDAP query like that:

unseen = ${if eq{${lookup ldapm {user=LOCAL_AD_BIND_DN pass=LOCAL_AD_PASS ldap:///LOCAL_AD_ALIASES_DN?rfc822MailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:${local_part}}@${quote_ldap:${domain}}))}}}{}{no}{yes}}

query work (tested by hand; and if i set manually 'unseen = yes', it is
used by the subsequent router) but 'unseen' is every time 'no'.


Probably is because checking for empty result in an ldap query have soem
trouble.

How can i setup a query/condition that simply set 'yes' if the ldap query
return some output?


Thanks.

--
Please note that free software should be interpreted as free speach
while most seem to interprete it as free lunch.
(Hugo van der Kooij)



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: 'boolean' LDAP query... [ In reply to ]
On 07/12/2018 12:05, Marco Gaiarin via Exim-users wrote:
> unseen = ${if eq{${lookup ldapm {user=LOCAL_AD_BIND_DN pass=LOCAL_AD_PASS ldap:///LOCAL_AD_ALIASES_DN?rfc822MailMember?sub?(&(objectClass=nisMailAlias)(cn=${quote_ldap:${local_part}}@${quote_ldap:${domain}}))}}}{}{no}{yes}}
>
> query work (tested by hand; and if i set manually 'unseen = yes', it is
> used by the subsequent router) but 'unseen' is every time 'no'.
>
>
> Probably is because checking for empty result in an ldap query have soem
> trouble.

I think you need to find out what it's actually doing in the router
context. Try running with debug enabled, either by starting your
daemon with extra commandline options (it'll output to stderr) or
by patching an ACL "debug=" modifier at some convenient point
(it'll output to a file).
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: 'boolean' LDAP query... [ In reply to ]
Mandi! Jeremy Harris via Exim-users
In chel di` si favelave...

> I think you need to find out what it's actually doing in the router
> context. Try running with debug enabled, either by starting your
> daemon with extra commandline options (it'll output to stderr) or
> by patching an ACL "debug=" modifier at some convenient point
> (it'll output to a file).

'debug= at some convenient point'?! Can you explain a bit?

I'm testing with:

exim -d+deliver -v -bt

and i can see the query executed correctly... ahem...


Sorry to the list, i've simply used the wrong variables. Sorry...

--
Ragazzi, lavoriamo per il Signore:
la paga non ? un granch?, ma la pensione ? roba dell'altro Mondo!!!
(letta su una maglietta, da Stefy)



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: 'boolean' LDAP query... [ In reply to ]
On 10/12/2018 13:09, Marco Gaiarin via Exim-users wrote:
> 'debug= at some convenient point'?! Can you explain a bit?

Debugging can be turned on (and cancelled) by an ACL modifier.
This means you can make it conditional on all kinds of convenient
things, merely by doing a bit of programming. Read the documentation
on ACL.
--
Cheers,
Jeremy

--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/
Re: 'boolean' LDAP query... [ In reply to ]
Mandi! Jeremy Harris via Exim-users
In chel di` si favelave...

> Debugging can be turned on (and cancelled) by an ACL modifier.
> This means you can make it conditional on all kinds of convenient
> things, merely by doing a bit of programming. Read the documentation
> on ACL.

Cool! Thanks!

--
Raramente chi spara cazzate finisce subito le munizioni.
(Anonimo)



--
## List details at https://lists.exim.org/mailman/listinfo/exim-users
## Exim details at http://www.exim.org/
## Please use the Wiki with this list - http://wiki.exim.org/