Re: [Kolab-devel] Kolab 3.x Extension to handle secondary domains internally (Multi-domain patched)
Rickard Osser <[email protected]>
| Newsgroups | gmane.comp.kde.devel.kolab |
|---|---|
| Message-ID | <[email protected]> |
2014-04-02 17:48 skrev Ketil Kvifte: >> Yes, if you run kolab in single domain it does but not in multi-domain >> as > it's implemented with separate dn's (dc=x,dc=y) > >> for each organisation. > > There is a difference between adding 2 domains, and adding 1 domain > with 2 > aliases. domain1.com is separate and domain3.com is an alias for > domain2.com > > # domain1.com, kolab, config > dn: associateddomain=domain1.com,cn=kolab,cn=config > associatedDomain: domain1.com > objectClass: top > objectClass: domainrelatedobject > objectClass: inetdomain > > # domain2.com, kolab, config > dn: associateddomain=domain2.com,cn=kolab,cn=config > associatedDomain: domain2.com > associatedDomain: domain3.com > objectClass: top > objectClass: domainrelatedobject > objectClass: inetdomain > > Making an example user on domain2.com I get: > > postmap -q [email protected] > ldap:/etc/postfix/ldap/local_recipient_maps.cf > [email protected] > > postmap -q [email protected] > ldap:/etc/postfix/ldap/local_recipient_maps.cf > > No output here. I guess that's what you want fixed somehow. You nailed it, that is exactly what I want to do! :) > > I am going to implement a domain that has 1 alias domain soon so will > keep you > posted for how I do it. The fastest and easiest solution is probably > doing a > regexp: > > :/etc/postfix/testregexp > /^(.)*@domain2.com$/ [email protected] > > postmap -q [email protected] regexp:/etc/postfix/testregexp > [email protected] > > > Maybe you want to be able to choose between domain1.com and domain2.com > for > primary email on individual user basis too? Yes, again! :) > I think your solution is better than regexp though. Maybe a better > solution is > possible already or maybe not. I am going to see if a little tweak in > my > local_recipient_maps.cf files fix this issue. You do that, keep me posted but I've spent 3 nights trying to read through the postfix ldap documentation and haven't found a way to dynamically set the search_base based on the result in the domain check. >> Yes, if you run kolab in single domain it does but not in multi-domain >> as > it's implemented with separate dn's (dc=x,dc=y) >> for each organisation. >> I have several different domains which I run withing my business, some >> of them do more or less the same but under different names. >> If I want to use [email protected] and [email protected] I can't as I >> have >> to make a 1 to 1 mapping by hand. >> Now, if I can really do a search for [email protected] inside ldap, get >> the dn which is dc=domain1,dc=com and use that as the search_base then >> that would make it easier to maintain, no hand-patching postfix as >> well as >> being very flexible. > > The difference here I think is that %dc can be calculated by postfix > directly > without any ldap-query. > > dc=%2,dc=%1 match domain1.com if the email is sent to > [email protected], but > match domain2.com if it's sent to [email protected]. > > It does not match anything if it's sent to [email protected] > though. > That's why I search both dc=%3,dc=%2,dc=%1 and dc=%2,dc=%1 for > base_dn. I know, but with my solution it would match all domains in the config ldap-db and if it's there it would return the DN for the domain in ldap and thus search for the e-mail-address in the right place and find it, that would require no extra config. Best regards, Rickard