Using an OpenLDAP directory for Thunderbird address book lookups
I wanted thunderbird to be able to look up addresses in my OpenLDAP directory. It worked out of the box somewhat using the standard inetorgperson attributes. But i wanted to map some of my POSIX attributes so Thunderbird would recognize them and therefore there would be more information in the address book entry.
Here is a table of ldap attributes thunderbird is interested in.
http://www.mozilla.org/projects/thunderbird/specs/ldap.html
This is based on a less than perfect schema that mozilla came up with.
Anyway, Thunderbird already gave me the First name(givenName), lastname(sn), displayname(cn), and email(mail) bits from each address book entry, but i wanted it to fill in the Nickname from the POSIX gecos attribute(It usually contains a little more information than just the name), so this is what had to be done on the OpenLDAP side
my DIT for this example is dc=example,dc=com and my users entries will be in ou=user
First i had to download and install the mozilla LDAP schema from https://wiki.mozilla.org/MailNews:Mozilla_LDAP_Address_Book_Schema
I had to then define a new “relay” database at the botton of my slapd.conf, it looks something like this:
database relay
suffix “dc=addresses”
relay “ou=user,dc=example,dc=com”
overlay rwm
rwm-suffixmassage “ou=user,dc=example,dc=com
map attribute mozillaNickname gecos
map attribute mail *
map attribute uid *
map attribute sn *
map attribute givenname *
map attribute cn *
map attribute *
This will create a second virtual DIT called dc=addresses which will use the “real” ldap directory(ou=user,dc=example,dc=com) as a back-end. This will map the gecos to the mozilla nickname and it will now appear in the users address book entry in thunderbird, it also blocks all information except the bits that are needed like displayname, cn, givenname, sn. It would probably be advisable to apply some ACLs to this aswell just incase.
This is only an example. If you have other attributes that might fit into an address book entry then you can map them to the mozilla atrributes.