[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Openldap and Sendmail - Is someone know how t do ?


On Wed, 26 Jan 2000, Fabrice Nouet wrote:

> Hello all,
> I try to use sendmail with Openldap.
> After including ldap libraries (-lldap -llber ) to enable sendmail
> to work with Openldap,
> I added the below line to my sendmail.cf
> Kluser ldapx -b "o=Top" -h "localhost" -k "maildrop=%s" -v mail
> In my ldap base I have such an entry:
> cn=test,ou=org,o=Top
> objectclass: Top
> objectclass: organizationUnit
> objectclass: User
> cn: test
> mail: t.test@milou.fno.fr
> maildrop: logintest
> I created a Unix count which name is logintest
> and now I try to send a email like this:
> mail t.test@milou.fno.fr
> This doesnot work !!!!!
> Is someone has an idea about what is wrong ?


What is the actual query to the LDAP server?  You might want to look at it
to see that it's what you expect.  If you compiled with -DSUNET_ID, the
query it's making is "(maildrop=ttestmiloufnofr)".  If not, it's

Either way, you've got it backwards.  -k (key) is the attribute to which
you pass the email address (%s).  -v (value) is the attribute to which it
should be rewritten.  Try this:

Kluser ldapx -b "o=Top" -h "localhost" -k "mail=%s" -v maildrop

Be sure that mail is indexed (pretty standard) or it'll take forever.

I'd strongly recommend looking at how sendmail 8.10 does the LDAP stuff.
*Much* nicer.  Very cool stuff, in fact.  I've got it running for
8.10beta10, but 8.10beta12 just came out last week, and I'm gonna give
that a go.

I was going to implement automatic mail routing using 8.9.3, but 8.10 has
exactly what I was looking for (the LDAP maps perform better, too).  It
has really made a difference.

Don Badrak <dbadrak@census.gov>              301.457.8263 work
Telecommunications Office                    301.457.4438 fax
U.S. Bureau of the Census
Suitland MD, USA