Andrew Bates wrote:
I have recently begun playing with Dovecot (1.0.beta8) and have run into an interesting scenario.
The way my email system is set up is that users of different domains have completely different base dn's. For instance, if a user is part of test.com the bind dn would be uid=user,ou=People,dc=test,dc=com. The bind dn for user@domain.com would be uid=user,ou=People,dc=domain,dc=com.
I could not seem to figure out a way to have the binddn adjusted based on a user's @domain so I modified auth-request.c and var-expand.c to include a new variable expansion concept. In the configuration I'm now able to include the following: auth_bind_userdn = uid=%n,ou=People,dc=%c2,dc=%c1
and %c1 will be expanded to the tld, %c2 will be expanded to the next level domain (domain or test in the above example). This will work up to 9 levels of subdomain (1-9). This is very similar in how postfix expands variables with ldap.
heh, this exactly the same issue i reported in [1] but i didn't provide a patch for it...this is a really nice feature for dovecot, i hope Timo can take a look at it.
http://www.dovecot.org/list/dovecot/2006-January/010701.html
Thank you,
-- Andrés Pereira