[Dovecot] userdb static & Quota from LDAP?

Timo Sirainen tss at iki.fi
Mon Sep 12 13:33:27 EEST 2011


On Fri, 2011-09-09 at 23:58 +0200, Christian Schmidt wrote:
> userdb {
>   driver = static
>   args = uid=vmail gid=vmail home=/var/maildir/%u
> }

These can be replaced with global settings:

mail_uid = vmail
mail_gid = vmail
mail_home = /var/maildir/%u

> Now I'd like to add per-user quotas that will also be stored in the
> LDAP directory, and I'm not sure how to put things together.
> IMHO quota is the only "userdb information" requested from LDAP, and
> I'd like to leave all the other "userdb pieces" as the are. I changed
> the userdb definition to:
> userdb {
>   driver = ldap
>   args = /etc/dovecot/conf.d/ldap-userdb.ext
> }
> 
> My /etc/dovecot/conf.d/ldap-userdb.ext contains (along other lines):
> 
> user_attrs = uid=vmail,gid=vmail,home=/var/maildir/%u,mailQuota=quota=quota_rule=*:storage=%$

Just set those global settings and drop uid/gid/home from here. Or you
could get them working here too, but the syntax is slightly wrong:

user_attrs = =uid=vmail, =gid=vmail, ..

(With the above settings you're telling Dovecot that LDAP "uid" field
will be assigned to Dovecot's "vmail" field, and the "gid" field
immediately overrides it, and LDAP "home" field's value is set to
Dovecot's "/var/maildir/%u" field.)




More information about the dovecot mailing list