[KLUG Members] Pesky LDAP

Adam Williams members@kalamazoolinux.org
08 Sep 2002 18:10:01 -0400


>Greetings.  I am new on the list.  My troubles are primarily in the LDAP 
>area as I am currently involved in a reseach project involveing same.
>I've heard that such questions are at least moderately welcomed here.
>:-)
>In particular, I am trying to set up a series of address books on my 
>system.  1 that is global and 1 for each user.
>Here are some reletively simple questions I am currently trying to answer:
>1. What are the filters used by Mozilla/Netscape/Outlook?

My version of Netscape does a filter like -

conn=2 op=1 SRCH base="dc=Whitemice,dc=Org" scope=2 filter="(cn=*adam*)"

So it finds the object -

dn: cn=Adam Williams,ou=People,dc=Whitemice,dc=Org
uid: awilliam
cn: Adam Williams
givenName: Adam
sn: Williams
mail: awilliam@Whitemice.Org
mailRoutingAddress: awilliam@estate1.whitemice.org
mailHost: estate1.whitemice.org
objectClass: inetLocalMailRecipient
objectClass: person
objectClass: organizationalPerson
objectClass: inetOrgPerson
objectClass: account
objectClass: posixAccount
objectClass: top
objectClass: kerberosSecurityObject
objectClass: calEntry
objectClass: evolutionPerson
krbName: awilliam@WHITEMICE.ORG
loginShell: /bin/bash
uidNumber: 500
gidNumber: 100
homeDirectory: /home/awilliam
gecos: Adam Williams
calFBURL: http://estate1/freebusy/awilliam@whitemice.org
o: BOTWM
title: Chief
ou: Grand Rapids
roomNumber: 13
telephoneNumber: 6164568931
facsimileTelephoneNumber: 
postalAddress: 537 Shirley St
displayName: Whitemice
homePostalAddress: 537 Shirley St
mobile: 
pager: 
street: Shirley
homePhone: 
initials: ATW
labeledURI: http://www.kalamazoolinux.org/projects/awilliam/
...

That is, if I do the default search from the address book dialog.

If you set "loglevel -1" in slapd.conf, "local4.* /var/log/ldap" in
/etc/syslog.conf, then "touch /var/log/ldap; chmod 660
/var/log/ldap;service syslog restart;service ldap restart" you should
see the filters hit the server.  

> 2. How can I add an ldif record exported from Mozilla/Netscape to either 
>ou=People or ou=AddressBk if the base is "dc=example,dc=net"?
>>dn: cn=MyTestUser Smith,mail=Dude@spudly.com

Rewrite the dn entirely.  What comes out of Netscape is bogus.

Make it cn=MyTestUser,ou=Addressbook,dc=example,dc=net

or maybe a multivalued dn
cn=MyTestUser+mail=Dude@spudly.com,ou=Addressbook,dc=example,dc=net

but I think the latter gets pretty unreadable after awhile.