Configuring sendmail to perform LDAP address lookups
In a nutshell I need to set up a sendmail server (running on CentOS linux) that will look up recipient addresses via LDAP and I'm not having much luck. From what I've read we need to configure sendmail to use LDAP and it looks like I want to use the genericstable for LDAP queries but it doesn't look like its working for me.
Here are the gory details: We have an environment where we have a fairly large LDAP database of users and their primary e-mail addresses. We have a high-performance research cluster (and a second one being planned) that these users can log into and submit jobs for processing. Right now any e-mail generated as a result of those jobs is getting lost because sendmail was never configured properly. We need to set up sendmail to do a lookup in LDAP to determine a users primary e-mail address and use that as the delivery address.
To summarize our LDAP configuration, a typical entry contains the following fields (assuming myself) in ObjectClass=fooPerson:
cn: Bruce Pennypacker
uid: bpennypa (my login name on the servers)
mail: bruce.pennypacker@... (my primary e-mail address)
Assume the base DN for our LDAP setup is "dc=foo,dc=bar"
I know that LDAP lookups work properly from this particular server. I wrote a quick little perl script to verify that it can query the LDAP server and it's working properly.
The first thing I did was build a custom version of sendmail, enabling the LDAPMAP option. This is showing up in the sendmail output when I use -d so I'm sure it was built properly. I then added the following to my sendmail .mc file:
But if I run sendmail -d -bv bpennypa to see if it'll do a lookup and convert the name it doesn't work. I end up with a "user unknown" error. The debug output doesn't seem to indicate any LDAP query occurring. So what am I missing?