Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

www.webdp.net, Event 9 IIS log failed to write entry, wwwxxx jeffs, Catastrophic failure Unexpected method call sequence. 0x8000ffff (-2147418113)., ksh lock a file, [unixODBC][Driver Manager]Driver's SQLAllocHandle on SQL_HANDLE_DBC failed, sed: -e expression #1, char 1: unterminated address regex, procmail + change subject, w2ksp4.exe download, /proc/kallsyms format

Links

XODOX
Impressum

#1: ldap verify, not route

Posted on 2004-11-21 16:20:24 by Leif Neland

My sendmail is in front of an exchange-server.

mail for mycompany.com is sent to exchange.mycompany.com via mailertable,
and outgoing mail is sent to my isp's smarthost with a
define(``SMART_HOST'....)

I need to verify the incoming adresses against exchange.
From my php testscript, I can do a query:

$sr=ldap_search($ds, "ou=My Company, c=US", "mail=me@mycompany.com");

I get a result, if the adress exists, and none if the emailadress doesn't.

Fine, but the result doesn't contain the adress of the exchange, at least
not in a form usable for sendmail.

Sendmail.mc
FEATURE(ldap_routing)dnl
LDAPROUTE_DOMAIN(mydomain.com)dnl
define(`confLDAP_DEFAULT_SPEC', `-h exchange.mydomain.com -b
dc=mydomain,dc=com')


Sendmail.cf
# LDAP routing maps
Kldapmh ldap -1 -T<TMPF> -v mailHost -k
(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))
Kldapmra ldap -1 -T<TMPF> -v mailRoutingAddress -k
(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))

Doing a sendmail -v -d -bv my@mycompany.com
map_lookup(ldapmra, me@mycompany.com) => NOT FOUND (68)
map_lookup(ldapmh, me@mycompany.com) => NOT FOUND (68)

map_lookup(ldapmra, @mycompany.com) => NOT FOUND (68)
map_lookup(ldapmh, @mycompany.com) => NOT FOUND (68)

Is it correct sendmail is looking for a mailHost and a mailRoutingAddress?
Neither is contained in the answer from the exchange ldap.

I can not change the contents of the ldap-server.

As far as I can see, all the examples i can find, queries the ldap-server
for routing information.
I only want to accept mail if the adress exists in ldap, I already know how
to route it, and reject if it doesn't

Surely that is possible?

Leif

Report this message

#2: Re: ldap verify, not route

Posted on 2004-11-22 22:39:53 by per

In article <Nn2od.2060$Lk2.344@news.get2net.dk> "Leif Neland"
<leifn@neland.dk> writes:
>My sendmail is in front of an exchange-server.
>
>mail for mycompany.com is sent to exchange.mycompany.com via mailertable,
>and outgoing mail is sent to my isp's smarthost with a
>define(``SMART_HOST'....)
>
>I need to verify the incoming adresses against exchange.
>From my php testscript, I can do a query:
>
> $sr=ldap_search($ds, "ou=My Company, c=US", "mail=me@mycompany.com");
>
>I get a result, if the adress exists, and none if the emailadress doesn't.
>
>Fine, but the result doesn't contain the adress of the exchange, at least
>not in a form usable for sendmail.

Well, there are many ways to use LDAP from sendmail, ldap_routing is an
implementation of a specific way to do it, it may not work in all
cases. Still, it's pretty tweakable, and as far as results go only
requires that you get *either* an e-mail address *or* a mailhost (or
both) back from LDAP.

Most people trying to use it towards an Exchange server run into the
problem that the actual user@domain "input" address is nowhere to be
found in the LDAP attributes, there's only uid=user or somesuch, which
makes it impossible to use ldap_routing. But apparently that's not your
problem.

>Sendmail.mc
>FEATURE(ldap_routing)dnl
>LDAPROUTE_DOMAIN(mydomain.com)dnl
>define(`confLDAP_DEFAULT_SPEC', `-h exchange.mydomain.com -b
>dc=mydomain,dc=com')
>
>
>Sendmail.cf
># LDAP routing maps
>Kldapmh ldap -1 -T<TMPF> -v mailHost -k
>(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0) )
>Kldapmra ldap -1 -T<TMPF> -v mailRoutingAddress -k
>(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0) )

Yes, the defaults obviously won't work. I don't know if you have
something more-or-less equivalent to the
objectClass=inetLocalMailRecipient stuff, but you clearly do have an
attribute (mail) with the fully-qualified "input" address
(me@mycompany.com) which you apparently know how to route, so getting
that returned for "mail routing address" and nothing for "mail host"
should work for you.

The following is rather silly, since you aren't really using the
ldap_routing functionality, but it may be preferrable to writing a few
custom rules:

FEATURE(`ldap_routing', `null', `ldap -1 -T<TMPF> -v mail -k mail=%0', `bounce')

I.e. you specify the "null" map (undocumented, always fails) for
<mailHost>, and just ask to get the "mail" attribute back for
<mailRoutingAddress>. (You may want to add objectClass or somesuch in an
appropriate form to the filter.) Assuming that your actual routing is
then based on MX or mailertable for the domain, it should "just work"
(the result of ldap_routing is looked up in mailertable as of 8.12.0).

>Is it correct sendmail is looking for a mailHost and a mailRoutingAddress?
>Neither is contained in the answer from the exchange ldap.

Yes it is, see above - you're just not asking for it.

>I can not change the contents of the ldap-server.
>
>As far as I can see, all the examples i can find, queries the ldap-server
>for routing information.
>I only want to accept mail if the adress exists in ldap, I already know how
>to route it, and reject if it doesn't

You can find an example of this in

http://groups.google.com/groups?selm=bt6avm%247b8%241@hedela nd.org

--Per Hedeland
per@hedeland.org

Report this message

#3: Re: ldap verify, not route

Posted on 2004-11-23 00:55:59 by Leif Neland

Per Hedeland wrote:
> In article <Nn2od.2060$Lk2.344@news.get2net.dk> "Leif Neland"
> <leifn@neland.dk> writes:
>> My sendmail is in front of an exchange-server.
>>
>> mail for mycompany.com is sent to exchange.mycompany.com via
>> mailertable, and outgoing mail is sent to my isp's smarthost with a
>> define(``SMART_HOST'....)
>>
>> I need to verify the incoming adresses against exchange.
>> From my php testscript, I can do a query:
>>
>> $sr=ldap_search($ds, "ou=My Company, c=US", "mail=me@mycompany.com");
>>
> The following is rather silly, since you aren't really using the
> ldap_routing functionality, but it may be preferrable to writing a few
> custom rules:
>
> FEATURE(`ldap_routing', `null', `ldap -1 -T<TMPF> -v mail -k
> mail=%0', `bounce')
>
> I.e. you specify the "null" map (undocumented, always fails) for
> <mailHost>, and just ask to get the "mail" attribute back for
> <mailRoutingAddress>. (You may want to add objectClass or somesuch in
> an appropriate form to the filter.) Assuming that your actual routing
> is
> then based on MX or mailertable for the domain, it should "just work"
> (the result of ldap_routing is looked up in mailertable as of 8.12.0).

Thanks, it worked. I did not want to add objectClass, why would I?

Leif

Report this message

#4: Re: ldap verify, not route

Posted on 2004-11-23 08:20:36 by per

In article <h9vod.12957$6A4.249@news.get2net.dk> "Leif Neland"
<leifn@neland.dk> writes:
>Per Hedeland wrote:
>> In article <Nn2od.2060$Lk2.344@news.get2net.dk> "Leif Neland"
>> <leifn@neland.dk> writes:
>>> My sendmail is in front of an exchange-server.
>>>
>>> mail for mycompany.com is sent to exchange.mycompany.com via
>>> mailertable, and outgoing mail is sent to my isp's smarthost with a
>>> define(``SMART_HOST'....)
>>>
>>> I need to verify the incoming adresses against exchange.
>>> From my php testscript, I can do a query:
>>>
>>> $sr=ldap_search($ds, "ou=My Company, c=US", "mail=me@mycompany.com");
>>>
>> The following is rather silly, since you aren't really using the
>> ldap_routing functionality, but it may be preferrable to writing a few
>> custom rules:
>>
>> FEATURE(`ldap_routing', `null', `ldap -1 -T<TMPF> -v mail -k
>> mail=%0', `bounce')
>>
>> I.e. you specify the "null" map (undocumented, always fails) for
>> <mailHost>, and just ask to get the "mail" attribute back for
>> <mailRoutingAddress>. (You may want to add objectClass or somesuch in
>> an appropriate form to the filter.) Assuming that your actual routing
>> is
>> then based on MX or mailertable for the domain, it should "just work"
>> (the result of ldap_routing is looked up in mailertable as of 8.12.0).
>
>Thanks, it worked. I did not want to add objectClass, why would I?

A discussion of the purpose of this for the LASER schema can be found
towards the end of the "Overview" section in the Internet-Draft (long
expired, but can be found e.g. at http://www.sendmail.org/m4/laser.txt).
Whether the usage of objectClass in your Exchange server, or some other
attribute, fits that description - or whether there is any need for it
given the contents of your database - is a question only you can answer,
I think. (The need to avoid lookups for other domains should already be
covered by sendmail's LDAPROUTE_DOMAIN[_FILE]() macros.)

--Per Hedeland
per@hedeland.org

Report this message