[turba] Automatic Add of Recipient To Address Book Fails With ObjectClass violation or "Schema not initialized"
Jan Schneider
jan at horde.org
Mon Aug 31 21:23:42 UTC 2015
Zitat von Andy Dorman <AndyDorman at comehome.net>:
> We have been happily using LDAP for our address books for many
> years...at some point in the last year or two we lost the ability to
> automatically add new recipient addresses to our personal_ldap
> address book when sending an email.
>
> Our installation is the latest Debian package of Horde Groupware
> Webmail Edition 5.2.7 with Turba 4.2.7 and OpenLDAP 2.4.41.
>
> I am certain I have something misconfigured because I have not seen
> anything about this in the wiki or mailing lists, but I can not
> figure out what I have missed.
>
> The problem is the 'inetOrgPerson' object class requires the 'sn'
> (lastname) attribute, so with checkrequired = false, when Turba
> tries to automatically add a recipient address, it does not supply
> 'sn' and openLDAP throws an ObjectClass violation like this:
>
> Entry
> (uid=20150819142842.-fDOkvc4NwFWmfMpjyODUEw at mail.bulldogs.com,uid=andydorman at comehome.net,ou=addresses,o=antespam.com): object class 'inetOrgPerson' requires attribute
> 'sn'
>
> I tried setting checkrequired = true and checkrequired_string to
> some string (I have tried both ' ' and '-'), but when I do this I
> get a Horde LDAP error, "Schema not initialized", when adding a new
> address book entry BOTH manually or automatically.
>
> $cfgSources['personal_ldap']['params']['checkrequired'] = true;
> $cfgSources['personal_ldap']['params']['checkrequired_string'] = ' ';
>
> If we set 'checkrequired' = false, we can manually add an entry to
> an address book (because we have a value for 'sn'), but we are then
> back to the ObjectClass violation when Turba tries to automatically
> add a recipient without an 'sn'.
>
> I have looked at the git code and found where the "Schema not
> initialized" error is set on line 1329 of
> https://github.com/horde/horde/blob/master/framework/Ldap/lib/Horde/Ldap.php, but so far I have not been able to understand why new Horde_Ldap_Schema fails on the next line when checkrequired =
> true;
>
> So any idea about what I might be doing wrong? Turba works great
> except for not being able to automatically add a recipient when
> sending email (with checkrequired = false).
>
> Our complete turba/config/backends.local.php is below if that helps.
> ================
> $cfgSources['localsql']['disabled'] = true;
>
> /* First get the uid and set the base DN. */
> $_ldap_uid = strtolower($GLOBALS['registry']->getAuth());
> $_ldap_basedn = ',ou=addresses,o=antespam.com';
>
> // enable the personal_ldap address book
> $cfgSources['personal_ldap']['disabled'] = false;
>
> // talk to localhost and let the slapd updateref refer writes to the
> master...
> $cfgSources['personal_ldap']['params']['server'] = 'localhost';
> $cfgSources['personal_ldap']['params']['bind_dn'] = 'uid=' .
> $_ldap_uid . $_ldap_basedn;
> $cfgSources['personal_ldap']['params']['bind_password'] =
> $GLOBALS['registry']->getAuthCredential('password');
>
> // according to my research, these are the objectclasses needed to
> provide the fields below
> $cfgSources['personal_ldap']['params']['objectclass'] = array('top',
> 'person', 'inetOrgPerson', 'organizationalPerson');
>
> $cfgSources['personal_ldap']['params']['referrals'] = 1;
> $cfgSources['personal_ldap']['params']['tls'] = false;
> $cfgSources['personal_ldap']['params']['root'] = 'uid=' . $_ldap_uid
> . $_ldap_basedn;
> $cfgSources['personal_ldap']['params']['scope'] = 'sub';
>
> // check the object classes to make sure we have the required fields
> to add a contact
> $cfgSources['personal_ldap']['params']['checkrequired'] = false;
> $cfgSources['personal_ldap']['params']['checkrequired_string'] = ' ';
> $cfgSources['personal_ldap']['params']['checksyntax'] = false;
>
> // set up our own mapping cause the object_pgppublickey field caused
> LDAP to complain about "bad filter"
> $cfgSources['personal_ldap']['map'] = array(
> '__key' => 'dn',
> '__uid' => 'uid',
> 'name' => 'cn',
> 'email' => 'mail',
> 'firstname' => 'givenName',
> 'lastname' => 'sn',
> 'title' => 'title',
> 'company' => 'organizationName',
> 'businessCategory' => 'businessCategory',
> 'workAddress' => 'postalAddress',
> 'workPostalCode' => 'postalCode',
> 'workPhone' => 'telephoneNumber',
> 'fax' => 'facsimileTelephoneNumber',
> 'homeAddress' => 'homePostalAddress',
> 'homePhone' => 'homePhone',
> 'cellPhone' => 'mobile',
> 'notes' => 'description',
> 'office' => 'roomNumber',
> 'department' => 'ou',
> 'nickname' => 'displayName',
> 'website' => 'labeledURI'
> );
What happens if you add a contact from an open message?
--
Jan Schneider
The Horde Project
http://www.horde.org/
More information about the turba
mailing list