Theresa Arzadon-Labajo

Configuring and Troubleshooting Turba

Posted by Theresa Arzadon-Labajo (tarzadon) on Nov 18 2010
Tech Stuff >> Unix-Linux
LDAP addressbook  was not working in Horde.

In /var/log/messages, I saw this error:
[turba] Could not instantiate the localldap source: Bind failed: (-1) Can't contact LDAP server [pid 14188 on line 348 of "...../Turba.php"]

Our turba/config/sources.php looked like:
 $cfgSources['localldap'] = array(
     'title' => _("IAS Directory"),
     'type' => 'ldap',
     'params' => array(
         'server' => '',
         'port' => 389,
         'tls' => false,
         'root' => 'o=ias',
         'sizelimit' => 200,
         'dn' => array('employeeNumber'),
         'objectclass' => array('top',
         'scope' => 'sub',
         'charset' => 'utf-8',
         'checkrequired' => false,
         'checkrequired_string' => ' ',
         'checksyntax' => false,
         'version' => 3
     'map' => array(
         '__key' => 'dn',
         '__uid' => 'uid',

         'name' => 'cn',
         'firstname' => 'givenName',
         'lastname' => 'sn',
         'alias' => 'uid',
         'email' => 'mail',
         'photo' => 'photo',
         'homePhone' => 'homephone',
         'workPhone' => 'telephonenumber',
         'homeStreet' => 'mozillaHomeStreet',
         'homeCity' => 'mozillaHomeCity',
         'homeProvince' => 'mozillaHomeState',
         'homeCountry' => 'mozillaHomeCountryName',
         'workStreet' => 'street',
         'workCity' => 'l',
         'workProvince' => 'st',
         'workCountry' => 'c',
     'search' => array(
     'strict' => array(
     'export' => true,
     'browse' => true,

Permissions were not set in Horde so we added them:
Login to Horde as an administrator, then select the Administration/Permissions menu.

   1. Under All Permissions, add new permission Address Book (turba)
   2. Under Address Book (turba), add new permission Sources (sources)
   3. Under Sources (sources), add new permission IAS Directory (localldap)
   4. Edit the added permissions to grant all authenticated users the following rights:
          * Address Book (turba): Show, Read, Edit, Delete (This will provide access to turba via the menus.)
          * Sources (sources): Show, Read, Edit, Delete
          * IAS Directory (localldap): Show, Read (This will hide, in the several menus, all editing operations that would otherwise cause weird error messages.)

It still didn't show up in the Drop-Down box in Address Book.

I went to the /turba/test.php page in my browser to test if my server can talk to the LDAP machine:
I saw:
Net_LDAP: No
Net_LDAP is required when doing schema checks with LDAP address books.

PHP LDAP Support Test
server="" basedn="o=ias" filter="cn=Joe Smith"
bind anonymously
unable to bind anonymously to LDAP server

I installed Net_LDAP by running:
pear install Net_LDAP which told me that it was deprecated and to use Net_LDAP2. So, I ran:
pear install Net_LDAP2
service httpd restart

It still was not in the Drop-Down menu.

I changed Server to ldap:// and it worked:
server="ldap://" basedn="o=ias" filter="cn=Joe Smith"
bind anonymously
search returned 1 entries

I edited turba/config/sources.php and changed:
         'server' => '',
         'server' => 'ldap://',

Now, IAS Directory showed up in the Drop-Down menu, but Search returned no results.

I modified the map array so that it matched our LDAP schema:
         'employeeNumber' => 'employeeNumber',
         'homePhone' => 'homePhone',
         'dept' => 'ou',
         'workPhone' => 'telephoneNumber',
         'homeCity' => 'mozillaHomeLocalityName',

I also modified the search array and added some more attributes:

I modified sources.php and changed:
            'scope' => 'one',
            'scope' => 'sub',

Search now works!

I also wanted to turn on auto-complete in IMP when you type in the To: line.
I edited imp/config/prefs.php and added the Turba sources:
            'value' => "",
            'value' => "localldap\tlocalsql",

Auto-complete now works too!

Last changed: Feb 27 2020 at 4:12 PM