[Dovecot] LDAP auth and multiple attributes to construct the mail path

Anatoly Ivanov anatoly.ivanov at gmail.com
Fri Aug 31 02:45:34 EEST 2012


Hello,

So I am trying to construct mail path for my LDAP user lookups, and i need
to use two attributes instead of one.

For examle, my LDAP directory has two attributes: departmentAttr and
userIDAttr, and I want the maildir to reside in
/home/${departmentAttr}/${userIDAttr}

Unfortunately, I cannot seem to find a way to configure dovecot this way.
Right now, I have something like

user_attrs      = departmentAttr=mail=maildir:/home/%$/%u

But %u is the username (which in my environment can easily change, so I
cannot use this for maildir location).

Any ideas on how to achieve that?

So far I have just one brute-force solution - to create an attribute
MailDirAttr, and populate it with concatenation of
departmentAttr+'/'+userIDAttr by means of a scheduled task. This sounds
like unnecessary information duplication, which is usually a very bad
practice.

So, again - any ideas?

Thank you,
Anatoly.


More information about the dovecot mailing list