[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Openldap version (proxy cache) - results

Ok, I have found a way to trick exim into coping with both attributes in its resultset (see below). Next question: Is it possible to let the proxy-cache cache 'negative' answers.

Example: I do a query on a user, but he does not exists in de ldap. I want to proxy-ldap to cache these anwers as well. Any luck this is a setting in the configuration? Currently I only get "QUERY NOT ANSWERABLE", "QUERY NOT CACHEABLE" :(

--- These are the query's I would like to be able to cache ---

1. Checks if an email adress is valid in the directory

driver = redirect
domains = +relay_check_domains
data = ${extract {mail}{${lookup ldap {ldap:///o=Domain,c=nl?mail,mailUserStatus?sub?mail=${quote_ldap:$local_part@$domain}}}}}

2. Checks if the box is enabled, gives a different error message if it's blocked....

driver = redirect
domains = +relay_check_domains
condition = ${extract {mail}{${lookup ldap {ldap:///o=Domain,c=nl?mail,mailUserStatus?sub?(&(mail=${quote_ldap:$local_part@$domain})(mailUserStatus=inactive))}{$value}fail}}}
data = :fail: Mailbox inactive

In an ideal situation, the seconds query should be able to use the result from the first query if the user does exist. So I tried
--- data = ${extract {mail}{${lookup ldap {ldap:///o=Domain,c=nl?mail,mailUserStatus?sub?(&(mail=${quote_ldap:$local_part@$domain})(mailUserStatus=*))}}}}
--- in the first router, but that doesn't work either :( . ( not cacheable )


----- Original Message ----- From: "Christiaan den Besten" <chris@scorpion.nl>
To: <ando@sys-net.it>
Cc: <openldap-software@OpenLDAP.org>
Sent: Tuesday, March 01, 2005 12:36 AM
Subject: Re: Openldap version (proxy cache) - results

Kinda figured that out myself :)

pcache.c: In function `proxy_cache_response':
pcache.c:1260: error: `slap_freeself_cb' undeclared (first use in this function)
pcache.c:1260: error: (Each undeclared identifier is reported only once
pcache.c:1260: error: for each function it appears in.)

Let's see if I can get a workaround in exim working so it will understand the first (incorrect) response from the proxy-server ... :(


----- Original Message ----- From: "Pierangelo Masarati" <ando@sys-net.it>
To: "Christiaan den Besten" <chris@scorpion.nl>
Cc: <openldap-software@openldap.org>
Sent: Tuesday, March 01, 2005 12:24 AM
Subject: Re: Openldap version (proxy cache) - results

I confirm the fix is in 2.3 but not in 2.2 (essentially, I guess, because
it was not the result of an ITS but rather of some development in the
area). If you can live with a patched build, get the diff between 1.31
and 1.32 of servers/slapd/overlays/pcache.c from the CVS, otherwise I
suggest you file an ITS.

Please disregard. The reason this is not in 2.2 is the fix needs more
than that patch; it uses some infrastructure that allows callbacks to free
themselves as soon as they're no longer required, so, even if you succeed
in compiling the patched code (and you'd need to change it quite a bit)
you'd end up with a leaking cache. I'm afraid you'll likely need to live
with the extra attr every time a query is being cached.


Pierangelo Masarati

SysNet - via Dossi,8 27100 Pavia Tel: +390382573859 Fax: +390382476497