(I don't know much about LDAP, but I'm starting this page to encourage someone that does to give me a clue.)
There are two ways to use LDAP from exmh:
ldapper
http://www-users.aston.ac.uk/~oweng/ldapper-1.2/
That page includes instructions for integrating it with exmh.
This version only seems to understand X.500-style directory roots (o=Some Place,c=GB) as opposed to the DNS-style one we use (dc=hw,dc=ac,dc=uk).
The other disadvantage to ldapper is there is no way to compose a message to multiple recipients or to add a recipient to an in-progress message using it.
One advantage to using ldapper is the ability to see additional information from the LDAP directory entry, such as phone numbers. This has absolutely nothing to do with exmh or sending email, but it could be useful anyway.
Ldapper locates and communicates with exmh using your X server. It is not necessary for ldapper to run on the same system as exmh as long as they both display on the same X server. If you habitually have multiple copies of exmh displayed on one X server there is no way to control which one ldapper will choose to invoke the compose on.
Command line LDAP search program
An extension to the Address Database code added the ability to use a command line LDAP search program to "expand" addresses in the same way as can be done with MH/nmh aliases and Address Database entries. This is only available from the Simple Editor (sedit) message composer in exmh. To use it you must correctly set some preference entries in the Address Database preference panel. Once that is done a search is accomplished by typing a partial name or mail address in the sedit compose window and then hitting the expand key (default is Ctrl-Tab, it is customizable via the Simple Edit Bindings panel).
Harvey Eneman reports successfully using openldap-2.1.14 with exmh 2.6.1. The ldapsearch options used implicitly by exmh did change recently. Hal DeVore has successfully used openldap-2.0.21 with exmh 2.6.1 and also with exmh 2.5 but the required preferences settings are different.
Address Database Preferences for LDAP
Set up the Address Database Preferences (verified with openldap 2.0.21 and exmh 2.6.1, ymmv)
Then, in sedit, type a partial name or address and hit the expand key (default is ctrl-tab).
Testing from an xterm
It is useful to ensure that your LDAP server is responding and that your preferences are resulting in a well formed query. You can construct an equivalent query using the ldapsearch program directly from an xterm. Here's a sample (this would all be on one line but is split for readability):
ldapsearch -H ldap://es01-hou.bmc.com -x -b "o=BMC Software,c=US"
"(|(cn=*sando*)(mail=*sando*)(sn=*sando*)(givenname=*sando*))" cn mailIt is constructed from the following parts: