Author Topic: ldap search in email field dont work  (Read 4049 times)

Offline tiodary

  • Newbie
  • *
  • Posts: 2
ldap search in email field dont work
« on: January 30, 2008, 10:39:10 AM »
Sorry for my bad english, i am from argentina and wanna to say that Rondcube rocks! but...
I set up an ldap server and when searching for names everything works fine in the address book, but if I'm searching for emails (or part of emails) in the compose window nothing will be found. I think the email-field is not searched, i check all the post with any possible solution in the forum with no results..:-(

any ideas?

thanks for your help

Tiodary

Offline guneza

  • Newbie
  • *
  • Posts: 1
Re: ldap search in email field dont work
« Reply #1 on: February 16, 2008, 06:09:48 PM »
Hello,

I'm experiencing the same problems, but I got it working by doing something I consider a nasty hack:

Code: [Select]
$rcmail_config['ldap_public']['zaera-holo'] = array(
 'name'      => 'zaera-holo.net',
 'hosts'     => array('localhost'),
 'port'      => 389,
 'base_dn'    => 'ou=addressbook,dc=zaera-holo,dc=net',
 'bind_dn'    => 'uid=roundcube,ou=users,dc=zaera-holo,dc=net',
 'bind_pass'   => 'blank',
 'ldap_version'  => 3,       // using LDAPv3
 'firstname_field'=> 'givenName',  // this field represents the contact's first name
 'surname_field' => 'sn',     // this field represents the contact's last name
 'name_field'   => 'cn',     // this field represents the contact's name
 'email_field'  => 'mail',    // this field represents the contact's e-mail
 'search_fields' => array('name_field', 'email_field'), // fields to search in
 'scope'     => 'sub',     // search mode: sub|base|list
 'filter'     => '(objectClass=inetOrgPerson)',   // used for basic listing (if not empty) and will be &'d with search queries. ex: (status=act)
 'fuzzy_search'  => 1);      // server allows wildcard search

The search field above now refers to a name in the PHP config array, and not in the LDAP tree. Somehow, this works although I do get the following warning from PHP:

Code: [Select]
Warning: ldap_search(): Search: Bad search filter in /var/www/intranet.zaera-holo.net_443/roundcubemail-0.1-rc2/program/include/rcube_ldap.inc on line 409
Does anyone have any tips here?

cheers,
gustavo :-\

Offline tiodary

  • Newbie
  • *
  • Posts: 2
Re: ldap search in email field dont work
« Reply #2 on: February 29, 2008, 12:39:00 PM »
guneza, thanks for your reply...but this "nasty hack" don´t work for me...
do you only change the code in main.inc.php, nothing in compose.inc?

thnks a lot!

tiodary