Login Main site Create account

05.10.2005 14:16

Importing Thunderbird Addressbooks to OpenLDAP server


Yesterday I tried to import all address book entries from Mozilla Thunderbird into an OpenLDAP server. That was quite a pain, because the TB-exported LDIF-scheme did not import into LDAP, so I had to do quite some stuff.
  1. Import the mozillaOrgPerson_V0.6.2 schema into your ldap-server
  2. Adjust slapd.conf's sizelimit option if your address book contains more than 500 (= default value) entries
  3. Run the conversion script to fix all issues regarding TB-Addressbook Export and OpenLDAP LDIF import.


1. Import the mozillaOrgPerson schema

Download the mozillaOrgPerson_V0.6.2 schema and copy it to "/etc/ldap/schema/".
Add the following include statement anywhere on top of your "/etc/ldap/slapd.conf" file.
include         /etc/ldap/schema/mozillaOrgPerson_V0.6.2.schema
After this, restart your slapd.

2. Adjust slapd.conf's sizelimit option

If your address book has more than 500 entries, you need to set the sizelimit option in slapd.conf. By default, it is not mentioned and so I added a newline at the end of the file containing the following directive:
# Because we have more than 500 entries in our database...
sizelimit       1500

3. Run the conversion script

I wrote a cool perl script to prepare the exported LDIF-file from Thunderbirds addressbook for importing it into my OpenLDAP server (I used phpldapadmin to import the file).

Check out the syntax highlighted version of the script for a precise explanation of what it does exactly or alternatively download the script.

I was very happy to have a LDIF-source file with soooo many exceptions and unusual statements so I could take care of all of them.
If you experience any errors or want to provide additional features to this script, please contact me on the usual ways.

Happy converting :)
Currently no comments to this entry (http://tuxx-home.at/archives/2005/10/05/T14_16_49/index.html)


Your comment (HTML tags will be stripped !!):

To verify You are not a bot, type down text from this image.

Your try: