11.19.07
Connecting OS X Address Book.app to LDAP
Up until now, this posting to the openldap-software mailing list by Apple employee Gary La Voy is by far the most complete description I’ve ever seen of the LDAP fields supported by Mail.app. I suppose this is all there is to know about LDAP and Address Book - unless of course more has been added in Leopard.
Just now, I stumbled across this Ethereal dump of Address Book’s query to an LDAP server which is extremely valuable. This O’Reilly page also has a useful summary if you’re just getting started, but it’s really the Ethereal dump that’s going to save you. (You can install Ethereal via MacPorts)
Here’s the complete dump of the LDAP Connection from Address Book:
Lightweight Directory Access Protocol
LDAP Message, Search Request
Message Id: 2
Message Type: Search Request (0x03)
Message Length: 291
Response In: 8
Base DN: (null)
Scope: Subtree (0x02)
Dereference: Never (0x00)
Size Limit: 0
Time Limit: 30
Attributes Only: False
Filter: (|(givenname=carmo)(sn=carmo)(cn=carmo)(mail=carmo))
Attribute: givenName
Attribute: sn
Attribute: cn
Attribute: mail
Attribute: telephoneNumber
Attribute: facsimileTelephoneNumber
Attribute: o
Attribute: title
Attribute: ou
Attribute: buildingName
Attribute: street
Attribute: l
Attribute: st
Attribute: postalCode
Attribute: c
Attribute: jpegPhoto
Attribute: mobile
Attribute: co
Attribute: pager
Attribute: destinationIndicator
Attribute: labeledURI
Attribute: IMHandle
I just did some OpenLDAP debugging and got this list of attributes for Leopard 10.5.1:
givenName sn cn mail telephoneNumber facsimileTelephoneNumber o title ou buildingName street l st postalCode c jpegPhoto mobile co pager destinationIndicator labeledURI IMHandle
Once you get all of these popped into an LDAP directory entry, the result is something like this:

Note that IMHandle, buildingName, commonName, pager, ou and co fields do not get displayed on the contact card. Additionally, only one email address will be displayed (the first one) regardless of how many email addresses exist on the contact record. I’ve spent several hours trying to get IMHandle to work (apple-imhandle), but it never seems to populate. Apparently, I’m not the only one with this issue. Save yourself the trouble - don’t bother.
Apparently Mac OS X Server is required if you want to serve up Instant Messenger contact info.