LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 06-27-2012, 01:22 PM   #1
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Rep: Reputation: 16
OpenLDAP + Thunderbird Contacts


Greetings --Yesterday was my first in-depth exposure to LDAP. I've tried a variety of tricks to complete this project but all have failed. In short, I'd like to setup an LDAP server to serve the contact data typically held (locally) by Thunderbird. I've followed this doc:

http://blog.wains.be/2006/04/01/an-o...r-thunderbird/

Which points to this schema:

http://blog.wains.be/pub/thunderbird.schema

When I attempt to import ldif data, exported directly from Thunderbird, I get a syntax error:

ldapadd -xv -D "cn=AddressManager,dc=domain,dc=be" -f /tmp/f.ldif -W

Code:
[...]

ldapadd: Invalid syntax (21)
	additional info: objectclass: value #4 invalid per syntax

f.ldif:

Code:
dn: cn=Karsten F
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Karsten
sn: F
cn: Karsten F
modifytimestamp: 1332229548
mozillaHomeStreet: Foo Bar 99
mozillaHomeLocalityName: 20122 Hamburg
mozillaHomeCountryName: Germany
 
Old 06-27-2012, 11:09 PM   #2
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
It looks like your dn is not correct.

I'm thinking it should look like this:

Code:
dn: cn=Karsten F,dc=domain,dc=be
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Karsten
sn: F
cn: Karsten F
modifytimestamp: 1332229548
mozillaHomeStreet: Foo Bar 99
mozillaHomeLocalityName: 20122 Hamburg
mozillaHomeCountryName: Germany
It may not like the Thunderbird.schema, then again it isn't throwing errors when you start slapd process.
If that doesn't work could you post your slapd.conf file?
 
Old 06-27-2012, 11:31 PM   #3
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Original Poster
Rep: Reputation: 16
kbscores: Thanks for the response. I did try that, as well as a bunch of other permutations / combinations of stuff. In appending
',dc=domain,dc=be' to the end of 'dn:' I get the following:

Code:
[...]
adding new entry "cn=Karsten F,dc=domain,dc=be"
modify complete
ldapadd: Invalid syntax (21)
	additional info: objectclass: value #4 invalid per syntax
I was led in the direction that it's one of the 'objectclass:' entries but that would just result in 'value #n invalid per syntax' (given whatever line I had removed).
 
Old 06-28-2012, 08:23 AM   #4
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Which schemas are being used in slapd.conf? If the appropriate schema does not exist then it wouldn't understand the objectclasses associated with that schema. I know that multiple schemas are required for some objectclasses as well. Also check for trailing spaces on the ldif. Sometimes if there is an extra space on a line in the ldif it won't recognize it.
 
Old 06-28-2012, 08:56 AM   #5
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Original Poster
Rep: Reputation: 16
I cleaned trailing spaces with a sed trick. As for the schema, in addition to the default schemas made available in openldap-2.3 I'm only using the one posted above. So this gives me:

Code:
include         /etc/openldap/schema/core.schema
include         /etc/openldap/schema/cosine.schema
include         /etc/openldap/schema/inetorgperson.schema
include         /etc/openldap/schema/nis.schema
#
include         /etc/openldap/schema/thunderbird.schema
So it's the thunderbird.schema the example above uses. I've not modified any of the schema files.
 
Old 06-28-2012, 12:33 PM   #6
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Ok - so those schema load in the order they are listed. I see you have a comment line - Do you have nis.schema commented out in slapd.conf? If not, comment out nis.schema - there may be conflicts with nis.schema and the thunderbird.schema
 
Old 06-28-2012, 12:58 PM   #7
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Original Poster
Rep: Reputation: 16
I tried both with and without nis.schema and the result is the same. I'm beginning to wonder if it's necessarily _the schema_ per se but rather this bit, that I did in step 13 'Inject the directory structure'

Code:
ldapadd -xv -D "cn=AddressManager,dc=domain,dc=be" -f directory_def.ldif -W
directory_def.ldif:

Code:
dn: dc=domain,dc=be
objectclass: top
objectclass: dcObject
objectclass: organization
dc: domain
o: Name of your company

Problem is... I have no idea values to experiment with in adding additonal 'objectclass:' definitions. And of course, that could be the wrong tree to bark up anyhow...
 
Old 06-29-2012, 10:18 AM   #8
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Are you able to add other entries?

dn has to match the path to the attributes.

So for instance the first thing you want to add is the base:

dn: dc=domain,dc=be
objectclass: top
objectclass: dcObject
objectclass: organization
dc: domain
o: Name of your company

Next you will want to add the management account.

dn: cn=AddressManager,dc=domain,dc=be
objectclass: organizationalRole
cn: AddressManager


Now you will add you different directories:

dn: cn=Karsten F,dc=domain,dc=be
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Karsten
sn: F
cn: Karsten F
modifytimestamp: 1332229548
mozillaHomeStreet: Foo Bar 99
mozillaHomeLocalityName: 20122 Hamburg
mozillaHomeCountryName: Germany


It is hard to tell since that is a custom schema. Just to verify the schema is in this directory /etc/openldap/schema/thunderbird.schema?
 
Old 06-29-2012, 10:44 AM   #9
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Original Poster
Rep: Reputation: 16
Hey --thanks again for the suggestions. By being able to "able to add other entries" I assume you mean the ldif data. So for example, in attempting to do what you've noted above this is what I get (note: this is a 2nd run):

Code:
mogwai:/tmp>ldapadd -xv -D "cn=AddressManager,dc=domain,dc=be" -f im1.ldif -W
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add objectclass:
	top
	dcObject
	organization
add dc:
	domain
add o:
	Name of your company
adding new entry "dc=domain,dc=be"
modify complete
ldapadd: Already exists (68)

----
mogwai:/tmp>ldapadd -xv -D "cn=AddressManager,dc=domain,dc=be" -f im2.ldif -W
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add objectclass:
	organizationalRole
add cn:
	AddressManager
adding new entry "cn=AddressManager,dc=domain,dc=be"
modify complete
ldapadd: Already exists (68)

----
mogwai:/tmp>ldapadd -xv -D "cn=AddressManager,dc=domain,dc=be" -f j.ldif -W
ldap_initialize( <DEFAULT> )
Enter LDAP Password: 
add objectclass:
	top
	person
	organizationalPerson
	inetOrgPerson
	mozillaAbPersonAlpha
add givenName:
	Karsten
add sn:
	F
add cn:
	Karsten F
add modifytimestamp:
	1332229548
add mozillaHomeStreet:
	Foo Bar 99
add mozillaHomeLocalityName:
	20122 Hamburg
add mozillaHomeCountryName:
	Germany
adding new entry "cn=Karsten F,dc=domain,dc=be"
modify complete
ldapadd: Invalid syntax (21)
	additional info: objectclass: value #4 invalid per syntax
The contents are exactly what you've posted above...
Code:
mogwai:/tmp>cat im1.ldif 
dn: dc=domain,dc=be
objectclass: top
objectclass: dcObject
objectclass: organization
dc: domain
o: Name of your company
-----
mogwai:/tmp>cat im2.ldif 
dn: cn=AddressManager,dc=domain,dc=be
objectclass: organizationalRole
cn: AddressManager
-----
mogwai:/tmp>cat j.ldif 
dn: cn=Karsten F,dc=domain,dc=be
objectclass: top
objectclass: person
objectclass: organizationalPerson
objectclass: inetOrgPerson
objectclass: mozillaAbPersonAlpha
givenName: Karsten
sn: F
cn: Karsten F
modifytimestamp: 1332229548
mozillaHomeStreet: Foo Bar 99
mozillaHomeLocalityName: 20122 Hamburg
mozillaHomeCountryName: Germany
 
Old 07-02-2012, 09:11 AM   #10
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Have you tried re-downloading the schema...Is there an updated version out there perhaps?
 
Old 07-02-2012, 12:13 PM   #11
kbscores
Member
 
Registered: Oct 2011
Location: USA
Distribution: Red Hat
Posts: 259
Blog Entries: 9

Rep: Reputation: 32
Also I found this link that says there are some things missing from the schema.

http://boplicity.nl/confluence/displ...resses+to+LDAP

Hopefully that will provide some more insight.
 
Old 07-02-2012, 01:25 PM   #12
ezekieldas
Member
 
Registered: Mar 2010
Posts: 122

Original Poster
Rep: Reputation: 16
Hey kbscores --thanks so much for your help on this one. I triple check that schema for cleanliness and did quite a bit of searching for alternate schema, solutions, etc. I _did not_ find that post that you mentioned above so I'm eager to try that out. I'll report back on whether that offered some positive results!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Thunderbird Addressbook with OpenLDAP ridingthestorm Linux - Server 3 08-12-2011 04:27 PM
How to synchronize the contacts folder in Thunderbird? xpucto Linux - Newbie 2 04-01-2011 06:15 AM
nss_ldap, openldap and openldap-server ... what is openldap for? chakkerz Linux - Server 2 08-13-2009 07:16 PM
thunderbird/ldap show ALL contacts Clemente Linux - Software 0 05-14-2007 05:02 AM
LXer: Jigsaw Business Contacts Marketplace Soars Past 3 Million Contacts ... LXer Syndicated Linux News 0 07-18-2006 07:54 AM


All times are GMT -5. The time now is 05:32 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration