[turba] ActiveSync -> LDAP - addressbook cannot be created because CN is missing
Michael J Rubinsky
mrubinsk at horde.org
Sun Oct 22 04:26:56 UTC 2017
Quoting Jan Schneider <jan at horde.org>:
> Zitat von Michael J Rubinsky <mrubinsk at horde.org>:
>
>> Quoting Jan Schneider <jan at horde.org>:
>>
>>> Zitat von Oliver <oliverafg at gmx.de>:
>>>
>>>> Hello,
>>>>
>>>> I am using a few LDAP addressbooks, a few global read only books and
>>>> one personal addressbook.
>>>>
>>>> The synchronisation from LDAP to ActiveSync devices works fine.
>>>> A new entry from the webfrontend to LDAP and the clients works fine.
>>>>
>>>> If I try to add a new entry on my cell phone, it isn't created in the
>>>> LDAP backend, because of a missing cn field.
>>>>
>>>> I use the evolution schema
>>>>
>>>> My relevant part of backends.local.php:
>>>>
>>>> $_ldap_uid = $GLOBALS['registry']->getAuth('bare');
>>>> $_ldap_basedn = 'dc=kobosix,dc=lan';
>>>> $cfgSources['personal_ldap'] = array(
>>>> 'disabled' => false,
>>>> 'title' => _($_ldap_uid . " addressbook rw"),
>>>> 'type' => 'ldap',
>>>> 'params' => array(
>>>> 'server' => 'MYLDAPSERVER',
>>>> 'tls' => false,
>>>> 'root' => 'ou=' . $_ldap_uid . ',ou=Personal,ou=addressbook,' .
>>>> $_ldap_basedn,
>>>> 'bind_dn' => 'uid=' . $_ldap_uid . ',ou=User,ou=People,' . $_
>>>> ldap_basedn,
>>>> 'bind_password' => $GLOBALS['registry']-> getAuthCredential('
>>>> password'),
>>>> 'dn' => array('uid'),
>>>> 'objectclass' => array('top',
>>>> 'person',
>>>> // 'turbaContact',
>>>> 'inetOrgPerson',
>>>> // 'calEntry',
>>>> 'organizationalPerson',
>>>> 'evolutionPerson'),
>>>> 'scope' => 'one',
>>>> 'charset' => 'utf-8',
>>>> 'version' => 3
>>>> ),
>>>> 'map' => array(
>>>> '__key' => 'dn',
>>>> '__uid' => 'uid',
>>>> // From horde.schema:
>>>> // '__type' => 'turbaType',
>>>> // '__members' => 'turbaMembers',
>>>> 'name' => 'cn',https://bugs.horde.org/ticket/14678
>>>> 'lastname' => 'sn',
>>>> 'firstname' => 'givenname',
>>>> 'namePrefix' => 'title',
>>>> 'title' => 'businessRole',
>>>>
>>>> 'photo' => 'jpegphoto',
>>>> 'birthday' => 'birthdate',
>>>> 'anniversary' => 'anniversary',
>>>> 'spouse' => 'spouseName',
>>>> // 'children' => 'children', // still missing
>>>> 'company' => 'o',
>>>> 'department' => 'ou',
>>>> 'businessCategory' => 'businesscategory',
>>>> 'emails' => 'mail',
>>>> 'workPhone' => 'telephonenumber',
>>>> 'fax' => 'facsimiletelephonenumber',
>>>> 'companyPhone' => 'companyPhone',
>>>> 'homePhone' => 'homephone',
>>>> 'cellPhone' => 'mobile',
>>>> 'carPhone' => 'carphone',
>>>> 'pager' => 'pager',
>>>> 'radioPhone' => 'radio',
>>>> 'assistant' => 'assistantName',
>>>> 'assistPhone' => 'assistantPhone',
>>>> 'manager' => 'managerName',
>>>> '__tags' => 'categories',
>>>> 'workAddress' => 'postaladdress',
>>>> 'workStreet' => 'street',
>>>> 'workPostalCode' => 'postalcode',
>>>> 'workCity' => 'l',
>>>> 'workProvince' => 'st',
>>>> // 'workCountryFree' => 'c', // no LDAP backend yet
>>>> 'homeAddress' => 'homepostaladdress',
>>>> 'otherAddress' => 'otherPostalAddress',
>>>> 'notes' => 'note',
>>>> 'office' => 'roomNumber',
>>>> 'nickname' => 'displayName',
>>>> 'website' => 'labeledURI',
>>>> 'pgpPublicKey' => 'userCertificate',
>>>> 'smimePublicKey' => 'userSMIMECertificate',
>>>> 'freebusyUrl' => 'freebusyuri',
>>>> // no LDAP backend field yet
>>>> // 'imaddress1' => 'imAddress', //no LDAP backend yet
>>>> // 'yomifirstname' => 'yomiFirstname' // no LDAP backend yet
>>>> // 'yomilastname' => 'yomiLastname' // no LDAP backend yet
>>>> // NO LDAP and horde backend yet but ActiveSync field
>>>> // 'yomicompanyname' => 'yomiCompanyName'
>>>> ),
>>>> 'search' => array(
>>>> 'name',
>>>> 'emails',
>>>> 'businessCategory',
>>>> 'title',
>>>> 'homePhone',
>>>> 'workPhone',
>>>> 'cellPhone',
>>>> 'carPhone',
>>>> 'homeAddress'
>>>> ),
>>>> 'strict' => array(
>>>> 'dn', 'uid'
>>>> ),
>>>> 'approximate' => array(
>>>> 'cn',
>>>> ),
>>>> 'export' => true,
>>>> 'browse' => true,
>>>> );
>>>>
>>>>
>>>> In my Driver.php "name" maps to "fileas"
>>>>
>>>> The error in the activesync log is the following:
>>>>
>>>> [55906][2017-10-15T13:45:47+02:00] I: Motojj
>>>> [55906][2017-10-15T13:45:47+02:00] ERR: Failed to add an object:
>>>> [65] "Object class violation"
>>>> DN: uid=20171015134547.zapb17bqWwoWnbh_kwmbHEZ at ...,
>>>> ou=oliver,ou=Personal,ou=addressbook,dc=kobosix,dc=lan
>>>> (attributes: [a:7:s:2:"sn";s:6:"Tester";s:9:"givenname"; s:6
>>>> :"Motojj";s:6:"mobile";s:13:"+491222266644";
>>>> s:4:"note";s:1:"";s:4:"mail";s:2:",,";s:3:"uid";
>>>> s:53:"20171015134547.zapb17bqWwoWnbh_kwmbHEZ at ...";
>>>> s:11:"objectclass";a:5:{i:0;s:3:"top";i:1;s:6:"person";i:2;s:13
>>>> :"inetOrgPerson";i:3;s:20:"organizationalPerson";i:4;s:15:"evolutionPer
>>>> son";}}])
>>>>
>>>>
>>>> LDAP-Server complains about the missing CN field and indeed, there is
>>>> no CN field.
>>>>
>>>> At the moment I have no idea...
>>>>
>>>> Thanks and regards
>>>> Oliver
>>>
>>> From Turba's perspective, the 'name' attribute is required and
>>> should always be set. I'd say it's Turba_Driver::fromASContact()'s
>>> responsibility to set this attribute, if it hasn't been provided
>>> by the AS message.
>>> Please file a bug report.
>>
>> Yes, it looks like currently the turba 'name' attribute is obtained
>> from the ActiveSync 'fileas' property. I guess this will have to be
>> built dynamically, but I'm wondering what the best format for
>> building it is. None of the *name properties from ActiveSync are
>> guaranteed to be populated...
>
> We do support contacts without names, but limited.
>
> Thus a best guess should be sufficient. Use fileas, if available,
> and fall back to what the backend provides as a composite name field
> format, if any, and eventually use [firstname ]lastname.
Fixed in master & FW_52
--
mike
The Horde Project
http://www.horde.org
https://www.facebook.com/hordeproject
https://www.twitter.com/hordeproject
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-keys
Size: 9272 bytes
Desc: PGP Public Key
URL: <https://lists.horde.org/archives/turba/attachments/20171022/90095ffb/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 821 bytes
Desc: PGP Digital Signature
URL: <https://lists.horde.org/archives/turba/attachments/20171022/90095ffb/attachment-0001.bin>
More information about the turba
mailing list