[horde] ActiveSync GAL setup help - search returns no contacts

James B. MacLean macleajb at ednet.ns.ca
Sun Feb 10 20:27:31 UTC 2013


On 2013-02-07 2:06 AM, Michael J Rubinsky wrote:
>
> Quoting "James B. MacLean" <macleajb at ednet.ns.ca>:
>
>> So, no, I do not know if the LDAP server is being queried from the 
>> GAL function properly and I would like to trace that back, but, alas, 
>> my php skills for traversing where 
>> this->_registry->contacts->search() goes is beyond my skill :(.
>> Would you mind pointing out where that function is that is being 
>> called and I will keep digging in to it.
>
> This calls Turba_Api::search() (so, it's in turba/lib/Api.php). The 
> actual logic for the search that is called from Turba_Api::search() is 
> in a combination of Turba_Driver::search() (so, in 
> turba/lib/Driver.php) and Turba_Driver_Ldap::_search() (in 
> turba/lib/Driver/Ldap.php).
>
Ok, getting somewhere now. When you search within Horde in the "Global 
Address Book" the filter is :

(|(givenname=Maclean, james)(sn=Maclean, james)(|(displayname=*Maclean, 
james*)(mail=*Maclean, james*)))

Which ties in well with the use of 'strict' settings in 
turba/config/backends.local.php . When I do a search in ActiveSync, it 
looks like :

(&(givenname=Maclean)(sn=Maclean)(|(displayname=*Maclean*)(mail=*Maclean*)))

which will never match for me. The AND appears to be coming from :

horde/turba/lib/Driver.php

in

public function makeSearch

inside this if around line 460:

if (count($strict_search) && count($search)) {

changing that AND to OR gets things moving.

The next problem was that searching across more than 300000 records on a 
389 Directory Server against an attribute that is note indexed, and 
having a return limit of less than all those records was giving :

11 Administrative limit exceeded

So, I indexed all the fields used in the search and the Global Address 
Book is now working in ActiveSync.

Thanks for the help tracking down the functions to dig in to.

JES


More information about the horde mailing list