[turba] ActiveSync -> LDAP - addressbook cannot be created because CN is missing

Jan Schneider jan at horde.org
Mon Oct 16 09:07:53 UTC 2017


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.

-- 
Jan Schneider
The Horde Project
https://www.horde.org/



More information about the turba mailing list