[olug] Yahoo LDIF to OpenLDAP

Eric Penne epenne at olug.org
Thu Mar 20 14:56:42 UTC 2003


Here is what I did yesterday trying to get my mozilla ldif file
generated by Yahoo! Addresses into a Debian OpenLDAP installation.

The ldif file bites.

Here is what one entry has:

dn: cn: Chris Penne,mail=cpenne40 at yahoo.com
cn: Chris Penne
sn: Penne
givenname: Chris
objectclass: top
objectclass: person
description:: YWRkcmVzcyBjdXJyZW50IDgvMS8wMA==
locality: Guide<A0>Rock
st: NE
mail: cpenne40 at yahoo.com
postOfficeBox: 255<A0>Nebraska
postalcode: 68942
homephone: (402)<A0>257-2196
xmozillausehtmlmail: FALSE
xmozillauseconferenceserver: 0


To use the the ldapadd function for my system I had to remove/change
some things.

In the first line I had to rewrite it without the mail= and add my ou
and dc like so.  The machine name internally is bang.local  (BTW I'm
running an internal DNS server, tinydns, with dnscache forwarding
requests.)

dn: cn=Chris Penne,ou=People,dc=bang,dc=local

The next challenge was to add all the object classes that contained the
rest of the fields.

Before:
objectclass: top
objectclass: person

After:
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson


I had to change locality to postalAddress:

locality: Guide<A0>Rock to postalAddress: Guide<A0>Rock

I had to remove the countryname designation

I had to remove all xmozilla* lines

I changed postOfficeBox to Street

postOfficeBox: 255<A0>Nebraska to street: 255<A0>Nebraska

Then I did the ldapadd:

ldapadd -x -D "cn=admin,dc=bang,dc=local" -W -f Yahoo.ldif

where -x says to do simple authentication
where -W says to prompt for password for simple authentication
where -D says the Binding DN for permission to add to the LDAP file.
where -f says to pull the information from a file

Eric





More information about the OLUG mailing list