Re: LDAP Queries HELP

Pedro Algarvio <[email protected]> Thu, 08 Jun 2006 20:53:36 +0100
Newsgroups gmane.comp.isp.ispman.devel
Message-ID <[email protected]>
Well, Joerg stated that with this setup, we would need some sort of  
per user routing mechanism/query'ing.

After some time spent bugging f3ew on #postfix, he said I could use  
transport_maps to do the correct user based routing, so as an example,  
a domain hadled localy:

[email protected]    lmtp:unix:/var/imap/socket/lmtp
[email protected]    lmtp:unix:/var/imap/socket/lmtp

For a domain handled on another backend:
[email protected]    lmtp:[192.168.1.2]
[email protected]    lmtp:[192.168.1.2]

But, a user from domain1 could be handled by the server that handles  
domain2, ie:
[email protected]    lmtp:[192.168.1.2]


For this to work, we can stop adding virtual domains to mydestination,  
but we must also drop the use of virtual_alias_domains.

I've made postfix query the ldap db for the mailRoutingAddress, which  
now contains lmtp:[10.1.0.10] or lmtp:unix:/var/imap/socket/lmtp,  
althoug the logs were a bit awkward, ie:
Jun  8 20:29:24 ispman slapd[5707]: conn=5115 op=1 SRCH  
base="o=ispman,dc=ufsoft,dc=org" scope=2 deref=0  
filter="(|(mailLocalAddress=\2A)(mailAlias=\2A))"

It was able to find the correct routing:
Jun  8 20:25:40 ispman postfix/lmtp[8230]: C2DABE50FC:  
to=<[email protected]>,  
relay=/var/imap/socket/lmtp[/var/imap/socket/lmtp], delay=1,  
status=sent (250 2.1.5 Ok)
Jun  8 20:29:24 ispman postfix/lmtp[8374]: ED069A6103:  
to=<[email protected]>, relay=none, delay=1, status=deferred (connect to  
10.1.0.10[10.1.0.10]: Connection refused)

The last connection was refused because I have no lmtp running at that  
address, but I guess it proves that this kind of routing works, right?

My ultimate questions reside on:
- What will be lost/broken by not using virtual_alias_domains
- Will it be correct to use the mailRoutingAddress ldap entry field to  
store the vaule of for example, lmtp:[192.168.1.2], and if not, what  
should be done about this?


-- 
Pedro Algarvio
   __ ___  ___ _______        ___ __
|   Y   .'  _|   _   .-----.'  _|  |_   .-----.----.-----.
|.  |   |   _|   1___|  _  |   _|   _|__|  _  |   _|  _  |
|.  |   |__| |____   |_____|__| |____|__|_____|__| |___  |
|:  1   |    |:  1   |                             |_____|
|::.. . |    |::.. . |  ufs [AT] ufsoft [DOT] org
`-------'    `-------'    ufs [AT] sapo [DOT] pt