Dear all,
I am setting up a proxy to cache queries against Active Directory, so our Postfix servers do not hammer the AD servers.
To do so I am using rwm and pcache with the following configuration:
overlay rwm rwm-normalize-mapped-attrs yes rwm-map attribute uid sAMAccountName rwm-map attribute mail proxyAddresses rwm-map attribute maildrop smtp rwm-map attribute mailbox imap rwm-map attribute domain msExchAcceptedDomainName rwm-map attribute *
tls ldaps tls_reqcert=never overlay pcache pcache bdb 10000 1 50 900 directory /var/lib/ldap/cache cachesize 10000
#index uid,mail,maildrop,mailbox eq index uid eq index mail eq
# cache configuration proxyCacheQueries 10000 pcacheAttrset 0 uid mail maildrop mailbox pcacheTemplate (uid=) 0 900 pcacheTemplate (mail=smtp:) 0 900
When running:
ldapsearch -x -LLL -E pr=200/noprompt -h 127.0.0.1 \ -D "CN=username,OU=users,DC=company,DC=com" \ -w "passsssworddddd" \ -b "OU=users,DC=company,DC=com" -s sub "(mail=smtp:me@company.com)" maildrop
It never gets cached.
query template of incoming query = (mail=) QUERY NOT ANSWERABLE QUERY NOT CACHEABLE
I have read the pcache manual many times, but I cannot find the reason. Perhaps you can find the problem.
Regards,
Xavier Garcia
On Mon, 17 Sep 2012, Xavier Garcia wrote:
I am setting up a proxy to cache queries against Active Directory, so our Postfix servers do not hammer the AD servers.
...
pcacheTemplate (mail=smtp:) 0 900
From the slapo-pcache(5) manpage:
A template is defined by a filter string and an index identifying a set of attributes. The template string for a query can be obtained by removing assertion values from the RFC 2254 representation of its search filter. A query belongs to a template if its template string and set of projected attributes correspond to a cacheable template. Exam- ples of template strings are (mail=), (|(sn=)(cn=)), (&(sn=)(given- Name=)).
So, "(mail=smtp:)" isn't a template. You need to use: pcacheTemplate (mail=) 0 900
instead.
openldap-technical@openldap.org