Penguin
Diff: LDAPAddressBook
EditPageHistoryDiffInfoLikePages

Differences between version 4 and predecessor to the previous major change of LDAPAddressBook.

Other diffs: Previous Revision, Previous Author, or view the Annotated Edit History

Newer page: version 4 Last edited on Thursday, June 24, 2004 12:39:27 am by AristotlePagaltzis Revert
Older page: version 2 Last edited on Monday, October 27, 2003 4:01:09 pm by StuartYeates Revert
@@ -1,18 +1,79 @@
-Many common desktop email / groupware packages these days (XimianEvolution, MozillaMail, MicrosoftOutlook) have the ability to connect to a Remote [ LDAP] server to retrieve a list of contacts. This is a great way to have a single address book available at multiple locations.  
+!! Installing LDAP 
  
-! Setting up [OpenLDAP] for use as an AddressBook  
-This describes how to setup [OpenLDAP ] to use as a personal addressbook
+My project for the day was to get a [LDAP ] address book running, so I can get rid of pieces of paper with phone numbers. Eventually I'd like to be able to sync my cellphone against it (easy, cos the software for the phone can take a CSV and I'm sure I could write a connector if I wanted), and I want to be able to read it from MicrosoftOutlook/OutlookExpress and XimianEvolution, and write to it with at least Evolution (pref. everything, but you can't always get what you want .)  
  
-There is not a lot involved in setting up [OpenLDAP ] to use as a personal addressbook , you basically  
-* Install [OpenLDAP ] (refer to [LDAPNotes])  
-* Configure your installation, set the base DN, rootdn , rootpw etc.  
-* Configure your mail client to access your LDAP tree
+These notes may be slightly [Debian ] specific , [YMMV ], etc. 
  
-I store all my contacts under the ou=People subtree, so the DN for my addressbook looks like  
- ou=People,dc= ldap,dc=my,dc=domain,dc=here  
+There is also an article about [Building an Address Book with OpenLDAP | http://www.onlamp.com/pub/a/onlamp/2003/03/27/ ldap_ab.html] on [ONLamp | http://www.onlamp.com/].  
  
-* Use the person !ObjectClass for your contacts, seems to work as a basic start
+! 1 . Install slapd  
  
-! Notes about Ximian Evolution 
+ [[root@jane]: ~# apt-get install slapd ldap-utils  
+ The following extra packages will be installed:  
+ libgtk1.2 libgtk1.2-common libiodbc2  
+  
+Why does my server need [GTK], you say? Well, on Debian [Woody], OpenLDAP requires [ODBC], ODBC requires ODBC-setup and ODBC-setup requires libgtk. Or something similar. (Fixed in testing - see [LDAPNotes].)  
+  
+When you install the server, use your hostname for the LDAP root DN - my hostname is ellusions.tla so my DN becomes dc=ellusions,dc=tla.  
+  
+ ! 2. Get your existing contacts  
+  
+By far the easiest way I found to get contacts out of Outlook and into LDIF was using MozillaMail as an intermediate step. Export whatever fields you need to a [CSV], fire up Mozilla and it's address book, import the file, line up the fields (be careful here!) and then you have all your data in Mozilla's address book. From the Tools menu, click Export, to LDIF - done.  
+  
+I also found a [Perl script that converts CSV to LDIF|http://ranger.dnsalias.com/mandrake/muo/connect/cldap4.html] but then you'll have to manually align the fields.  
+  
+! 3. Create an OU ([OrganisationalUnit]) for your contacts  
+  
+Create a file called 'ou.ldif' that contains something like this (edit for your DN)  
+  
+ dn: ou=Contacts, dc=ellusions, dc=tla  
+ objectClass: top  
+ objectClass: organizationalUnit  
+ ou: Contacts  
+  
+Then import it with  
+  
+ # ldapadd -W -x -D "cn=admin,dc=ellusions,dc=tla" -f ou.ldif  
+ Enter LDAP Password: xxxxxxxx  
+ adding new entry "ou=Contacts, dc=ellusions, dc=tla"  
+  
+Done!  
+  
+! 4. Modify the output from the export to fit your DN  
+  
+You need to run a substitution or two over your file. Create a [Perl] script:  
+  
+ #!/usr/bin/perl -pi  
+ s/mail=.*/ou=Contacts,dc=ellusions,dc=tla/;  
+ s/modifytimestamp.*\n//;  
+ s/objectclass: mozillaAbPersonObsolete.*\n//;  
+  
+eg as __fix-ldif__ and run it (don't forget to __chmod a+x__):  
+  
+ # ./fix-ldif contacts.ldif  
+  
+The first substitution takes mail=(emailaddr) (Mozilla's DN) and replaces it with your own. The second removes the modify time, which a standard ldap add can't set.  
+  
+Then remove any givenName and sn blocks and use this:  
+  
+ # perl -pi -e '$_ .= "givenName: $1\n" . "sn: $2\n" if /^cn: \s+ (\w+) \s+ (.*)//x' contacts.ldif  
+  
+''If this works (it should), it should be added to the script above.'' --AristotlePagaltzis  
+  
+Now import them in much the same way:  
+  
+! 5. Connect Evolution to your address book  
+  
+In the Tools menu, click Settings. Select Directory Server and Add a new connection. Follow the wizard, adding the name of your server, binding by DN (use cn=admin,dc=ellusions,dc=tla at this point).  
+  
+When you save this, you will see an entry for your LDAP server under "Other Contacts". If you click it it should ask you for a password (once, use your root DN password) - upon success __you will see no contacts__. Click "Clear" on the search field on top of the box and they should populate. You can then add/edit/search the contacts.  
  
 Ximian Evolution assumes that you will not have write access to your LDAP address book unless you have authenticated with the LDAP server. 
+  
+! 6. Caveats  
+  
+* You will see a contact with "Department: Contacts". This is the OU; you can't do anything with this.  
+* If you try and create a user 'Foo', you will get a failure (Error adding card: Other error) which equates to "no sn: field in LDAP".  
+* You shouldn't use the root DN - the next update will concern creating an LDAP user and giving them access to the contacts, but I might tie that into migrating all my system users to LDAP as well.  
+* If you are trying to export address books from mozilla to use via ldap in mozilla it might help to be aware of some bugs ..  
+http://bugzilla.mozilla.org/show_bug.cgi?id=116692 this url contains links to an official mozilla ldap schema and a perl script to help convert the current ldif export to conform with this schema.  
The following authors of this page have not agreed to the WlugWikiLicense. As such copyright to all content on this page is retained by the original authors.
  • JackWasey
  • SusanneWenz
The following authors of this page have agreed to the WlugWikiLicense.

lib/plugin/WlugLicense.php (In template 'html'):99: Warning: Invalid argument supplied for foreach()

lib/plugin/WlugLicense.php (In template 'html'):111: Notice: Undefined variable: ignore_authors

lib/plugin/WlugLicense.php (In template 'html'):111: Notice: Undefined variable: ignore_authors

lib/plugin/WlugLicense.php (In template 'html'):111: Notice: Undefined variable: ignore_authors