Author Topic: Searching through LDAP RC 1.1.3  (Read 3403 times)

Offline malvivent7

  • Jr. Member
  • **
  • Posts: 18
Searching through LDAP RC 1.1.3
« on: November 04, 2015, 02:49:10 AM »
Hi to all and sorry if this problem was discussed elsewhere, but... anyway this is my question:
i have RC version 1.1.3 with ldap search enabled against my Lotus Domino addressbook. All semm function correctly but when i search composite names like "Michele De Marco" i can't find anithing.
Debugging on Lotus Notes console i found that RC's queries divide "De" into mail attribute and "Marco" into cn attribute and for this reason nothing come back from query.
Someone could bring me in the right direction to resolve this problem?
Thanks in advance for your help.

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Searching through LDAP RC 1.1.3
« Reply #1 on: November 04, 2015, 03:38:39 AM »
Do you search in Addressbook search or autocompletion? Did you try advanced search? Enable ldap_debug in Roundcube and provide precise ldap "query" for the search request.

Offline malvivent7

  • Jr. Member
  • **
  • Posts: 18
Re: Searching through LDAP RC 1.1.3
« Reply #2 on: November 04, 2015, 04:18:14 AM »
Thanks Alec for your quick response, here is my ldap debug output
//
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Connect [192.168.119.11:389]
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Search base dn: [ou=UTENTI,dc=teofe,dc=it] scope with filter [(&(sAMAccountType=805306368)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))]
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Using function ldap_search on scope sub ($ns_function is ldap_search)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: (Without VLV) Setting a filter of (&(sAMAccountType=805306368)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Executing search with return attributes: array (
  0 => 'dn',
)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> S: 0 record(s) found
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Connect [192.168.119.23:389]
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Search base dn: [] scope with filter [(&(objectclass=top)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))]
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Using function ldap_search on scope sub ($ns_function is ldap_search)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: (Without VLV) Setting a filter of (&(objectclass=top)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Executing search with return attributes: array (
  0 => 'dn',
)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> S: 2 record(s) found
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Search base dn: [] scope with filter [(&(objectclass=top)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))]
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Using function ldap_search on scope sub ($ns_function is ldap_search)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: (Without VLV) Setting a filter of (&(objectclass=top)(&(|(mail=*de*)(givenname=*de*))(|(mail=*marco*)(givenname=*marco*))))
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> Executing search with return attributes: array (
  0 => 'cn',
  1 => 'mail',
  2 => 'sn',
  3 => 'givenname',
  4 => 'objectClass',
)
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> S: 2 record(s) found
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Close
[04-Nov-2015 10:10:03 +0100]: <4vm6rfun> C: Close
[04-Nov-2015 10:10:08 +0100]: <4vm6rfun> C: Connect [192.168.119.23:389]
[04-Nov-2015 10:10:08 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 10:10:08 +0100]: <4vm6rfun> C: Read [dn: CN=Marco De Simone,O=CGILER] [(objectclass=*)]
[04-Nov-2015 10:10:09 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 10:10:09 +0100]: <4vm6rfun> C: Close
//

i search this on Addressbook

same search on AutoCompletion this is output
//
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> S: 7 record(s) found
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> C: Connect [192.168.119.23:389]
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> C: Search base dn: [] scope with filter [(&(objectclass=top)(|(cn=*mic*)(givenname=*mic*)(sn=*mic*)(mail=*mic*)))]
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> Using function ldap_search on scope sub ($ns_function is ldap_search)
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> C: (Without VLV) Setting a filter of (&(objectclass=top)(|(cn=*mic*)(givenname=*mic*)(sn=*mic*)(mail=*mic*)))
[04-Nov-2015 10:12:25 +0100]: <4vm6rfun> Executing search with return attributes: array (
  0 => 'cn',
  1 => 'mail',
  2 => 'sn',
  3 => 'givenname',
  4 => 'objectClass',
//

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Searching through LDAP RC 1.1.3
« Reply #3 on: November 04, 2015, 05:38:24 AM »
So, I don't see the described probelm. Search requests look good. The search for "de marco" returns two records here. As you see it searches in givenname (not cn) and mail. For autocompletion it uses different set of attributes, but I see the search string was different.

Offline malvivent7

  • Jr. Member
  • **
  • Posts: 18
Re: Searching through LDAP RC 1.1.3
« Reply #4 on: November 04, 2015, 06:46:55 AM »
Hi Alec, here is another output of a LDAP search for name "Michele de rose"
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> C: Connect [192.168.119.11:389]
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> S: OK
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> C: Search base dn: [ou=UTENTI,dc=teofe,dc=it] scope with filter [(&(sAMAccountType=805306368)(&(|(mail=*de*)(givenname=*de*))(|(mail=*rose*)(givenname=*rose*))))]
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> Using function ldap_search on scope sub ($ns_function is ldap_search)
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> C: (Without VLV) Setting a filter of (&(sAMAccountType=805306368)(&(|(mail=*de*)(givenname=*de*))(|(mail=*rose*)(givenname=*rose*))))
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> Executing search with return attributes: array (
  0 => 'dn',
)
[04-Nov-2015 12:38:15 +0100]: <4vm6rfun> S: 0 record(s) found

if i make same search with ldapsearch from commandline like this

ldapsearch -x -h 192.168.xxx.xx cn="*de rose*"

and the resulting output is this
# extended LDIF
#
# LDAPv3
# base <> (default) with scope subtree
# filter: cn=*de rose*
# requesting: ALL
#

# Michele De Rose, CGILER
dn: CN=Michele De Rose,O=CGILER
cn: Michele De Rose
mail: michele_derose@xx.xxxx.xx
displayname: Michele De Rose/CGILER
objectclass: dominoPerson
givenname: Michele
sn: De Rose
uid: mderose
maildomain: CGILER

# numResponses: 2
# numEntries: 1

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Searching through LDAP RC 1.1.3
« Reply #5 on: November 04, 2015, 07:45:04 AM »
Change your search criteria (attributes). The result is correct. Givenname nor mail contain "de" and "rose".

Offline malvivent7

  • Jr. Member
  • **
  • Posts: 18
Re: Searching through LDAP RC 1.1.3
« Reply #6 on: November 04, 2015, 09:49:13 AM »
Thanks Alec for your response, but i'm not sure that changing attributes could resolve the issue because if i search (like the figure attached to this post) search "de rose" (also including all fields) nothing is returned...
but if i search "michele" correct record is returned. Could be possible that composite names for some reason it's not correctly interpreted?
This is my snippet of LDAP config
//
  'RegionaleLDAP' =>
  array (
    'name' => 'LDAPAddressBookRegionale',
    'hosts' =>
    array (
      0 => '192.168.xxx.xx',
    ),
    'port' => 389,
    'use_tls' => false,
    'user_specific' => false,
    'writable' => false,
    'searchonly' => true,
    'ldap_version' => 3,
    'search_fields' =>
    array (
      0 => 'mail',
      1 => 'cn',
    ),
    'name_field' => 'cn',
    'email_field' => 'mail',
    'surname_field' => 'sn',
    'firstname_field' => 'givenname',
    'sort' => 'cn',
    'scope' => 'sub',
    'filter' => '(objectclass=dominoPerson)',
    'fuzzy_search' => true,
    'vlv'          => true,        // Enable Virtual List View to more efficiently fetch paginated data (if server supports it)
    'vlv_search'   => true,        // Use Virtual List View functions for autocompletion searches (if server supports it)
  ),
);
//