On Tue, 2010-07-27 at 16:35 +1200, Andrew Bruce wrote:
We run a flat domain for AD (lets call it newzealand.local), and then under each users account that gets email, in the E-mail field in AD,
On Wed, 04 Aug 2010 17:31:09 +0100, Timo Sirainen tss@iki.fi wrote: they
have an email address like user1@auckland, user2@wellington, user3@chch and so on.
So I guess this is all you need..
This was done using a query filter that returned a person's email address from AD, chopped it into separate user/domain parts around the '@' symbol and using these to determine where the mail should be stored.
But now I need to get Dovecot to be able to do the same thing in order to present the email to the user.
Dovecot can do that easily internally already. I guess what you want is:
pass_attrs = email=user, .. user_attrs = email=user, ..
mail_location = maildir:/mail/%d/%n/Maildir
or something.
I've tried this, but it doesn't seem to work. I've set in /etc/dovecot/dovecot-ldap.conf: pass_attrs = mail=user user_attrs = mail=user
and in dovecot.conf mail_location = maildir:/mirror/mail/%d/%Ln:INDEX=/var/spool/indexes/%u
and when I login as the user I get a user folder created at: /mirror/mail/user
It's like the user part is getting cut off at the '@' and then the domain part is just being dropped, rather than passed back for use in the mail_location.
Any other ideas?