Hello list:
When I try to import the following vCard with RC 0.8.1, I get the following two (different) results:
BEGIN:VCARD VERSION:3.0 N:Last;First;;; FN:First Last EMAIL;type=INTERNET;type=WORK:first.last.work@example.com EMAIL;type=INTERNET:first.last@example.com TEL;type=MOBILE:1234 URL:http://acme.com ADR:;;Park Av 100;NY;;12345; ORG:Org END:VCARD
LDAP resulting record (incorrect, misses 2 values, see below): First Last Org Email: first.last.work@example.com Phone: Mobile: 1234 Address: Other : Park Av 100 12345 NY
SQL resulting record (correct): First Last Org Email: Work: first.last.work@example.com Email: Other: first.last@example.com Phone: Mobile: 1234 Address: Other : Park Av 100 12345 NY Website: Other: http://acme.com
So LDAP imports name, organisation, first email, (mobile) phone, and address correctly.
RC also loses/misses the second email address (forget about the classification for now, just to import the address would be great!), and also misses the website URL. My LDAP settings look as follows in main.inc.php:
$rcmail_config['ldap_public'] = array ( 'private' => array ( 'name' => 'Private', 'hosts' => array ( 0 => 'ldap.host', ), 'port' => 389, 'ldap_version' => 3, 'user_specific' => true, 'base_dn' => 'cn=%fu,ou=private', 'bind_dn' => 'cn=%fu,ou=private', 'bind_pass' => '%p', 'filter' => '(objectClass=inetOrgPerson)', 'writable' => true, 'LDAP_Object_Classes' => array ( 0 => 'top', 1 => 'person', 2 => 'inetOrgPerson', 3 => 'organizationalPerson', 4 => 'evolutionPerson', ), 'LDAP_rdn' => 'cn', 'required_fields' => array('cn', 'givenName', 'sn', 'mail' ), 'fieldmap' => array ( 'prefix' => 'title', 'name' => 'cn', 'surname' => 'sn', 'firstname' => 'givenName', 'middlename' => 'initials', 'suffix' => 'telex', 'nickname' => 'tty', 'email' => 'mail:*', 'im' => 'categories:*', 'phone:mobile' => 'mobile', 'phone:home' => 'homePhone', 'phone:work' => 'telephoneNumber', 'phone:homefax' => 'homeFacsimileTelephoneNumber', 'phone:workfax' => 'facsimileTelephoneNumber', 'phone:pager' => 'pager', 'phone:assistant' => 'assistantPhone', 'phone:car' => 'carPhone', 'phone:company' => 'companyPhone', 'phone:radio' => 'radio', 'photo' => 'jpegPhoto', 'website' => 'labeledURI', 'street:work' => 'street:*', 'zipcode:work' => 'postalCode', 'locality:work' => 'l', 'region:work' => 'st', 'country:work' => 'mailer', 'street:home' => 'registeredAddress:*', 'zipcode:home' => 'postOfficeBox', 'locality:home' => 'homePostalAddress', 'region:home' => 'roomNumber', 'country:home' => 'postalAddress', 'street:other' => 'carLicense:*', 'zipcode:other' => 'description', 'locality:other' => 'otherPostalAddress', 'region:other' => 'preferredLanguage', 'country:other' => 'physicalDeliveryOfficeName', 'organization' => 'o', 'notes' => 'note', 'assistant' => 'assistantName', 'department' => 'ou', 'jobtitle' => 'businessRole', 'manager' => 'managerName', 'anniversary' => 'anniversary', 'birthday' => 'birthDate', 'spouse' => 'spouseName', ), 'search_fields' => array ( 0 => 'mail', 1 => 'cn', 2 => 'sn', 3 => 'givenName', ), 'sort' => 'cn', 'scope' => 'sub', 'fuzzy_search' => true, 'vlv' => false, 'numsub_filter' => '(objectClass=organizationalUnit)', 'sizelimit' => '0', 'timelimit' => '0', 'groups' => array ( 'base_dn' => '', 'filter' => '(objectClass=groupOfNames)', 'object_classes' => array ( 0 => 'top', 1 => 'groupOfNames', ), 'member_attr' => 'member', 'name_attr' => 'cn', ), ), );
I should also note that on existing or newly created contacts in LDAP, the values of those fields (URL, multiple phone numbers without additional lables (work, home, other)) just works fine.
I am pretty certain that this has to do something with the import module/routine. What are the distinctions between SQL and LDAP import? They clearly exist, because the "private" and "work" labels make it form vCard into SQL, but are specifically dropped for LDAP because LDAP currently does not support them.
Thank you in advance for any pointers, Achim
Hello again:
Some more questions about the logic behind the import:
At the moment, if a name already exists in the exact same constellation (first name = first name of the contact to be imported, same for last name), then it appears that the new contact is not imported, even though the other fields (such as email) are different.
I think that it is a very reasonable assumption that most (if not the majority) of uses have their contact in the following form;
Contact 1: Joe Bloe, joe@acme.com Contact 2: Joe Bloe, joe@home.org
With the (artificial) restriction that I can observe in the import algorithm, the email address from contact 2 (joe@home.org) is lost. Why should we not just import everything, without any comparisons, restrictions etc?
Best regards, Achim
Hello again, some more observations on the LDAP importing functionality:
'required_fields' => array('cn', 'givenName', 'sn', 'mail' ),
spliting heuristic)
'required_fields' => array("cn", "sn"),
for givenName required!)
without warning!)
field: ("FN:NOex@mple.com, EMAIL;TYPE=INTERNET;TYPE=OTHER:ex@mple.com" works "FN:ex@mple.com, EMAIL;TYPE=INTERNET;TYPE=OTHER:ex@mple.com" does not work
I would like to use the lowest common denominator for 'required_fields' (e.g. ("cn", "sn")), but it appears that with that setting, for some reason, email addresses do not get imported, although they exist and are perfectly imported with 'required_fields' => array('cn', 'sn', 'mail' ).
May I propose that the importing function
"required_fields" list
name may exist. Store both contacts (with the same name), and let the user worry about or consolidate the data, but don't just skip it while importing.
case above, FN=EMAIL or the case I outlined in an earlier email where the website URL field got dropped). PLEASE tell the user and do not hide behind "Successfully imported n contacts", because "successfully" usually means "without any problems", and not "some information may or may not have been lost during the process".
name splitting without having to add "givenName" to required_fields in order to be able to import also items with only word in FN?
Thanks for your consideration, time and patience, Achim