星期四, 3月 03, 2005

ldap verify, not route

ldap verify, not route

ldap verify, not route [message #495777] So, 21 November 2004 16:20
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 [at] 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 -v mailHost -k
(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))
Kldapmra ldap -1 -T -v mailRoutingAddress -k
(&(objectClass=inetLocalMailRecipient)(mailLocalAddress=%0))

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

map_lookup(ldapmra, [at] mycompany.com) => NOT FOUND (68)
map_lookup(ldapmh, [at] 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

沒有留言:

張貼留言

改為香港祈禱

助養多年的兩個女孩,一個是孟加拉的,一個是越南的。應該已經差不多成年了吧? 今天,毅然放棄助養,是因為覺得香港的年輕一代更需攜助與支持。宣明會對香港的林鄭災難,以祈禱來解決,那麼我也祈禱那不富裕的外國家庭可以繼續讀書。 香港的未來,更應該給他們校園的陽光,而不是鐵窗密室! ...