[Dovecot] userdb static & Quota from LDAP?
Hi all,
I just configured Dovecot 2.0.14 for "virtual" (i.e. non-system-) users:
passdb { driver = ldap args = /etc/dovecot/conf.d/ldap-passdb.ext } userdb { driver = static args = uid=vmail gid=vmail home=/var/maildir/%u }
Works fine so far - thanks for this great piece of software, Timo!!!
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=%$
My quota configuration looks like this:
plugin { quota = maildir:Mailbox-Quota quota_rule = *:storage=1G quota_warning = storage=80%% /usr/local/bin/quotawarn.sh 80 %u quota_warning2 = storage=95%% /usr/local/bin/quotawarn.sh 95 %u }
Using this setup, "doveadm quota get -u username" doesn't reveal any quota information (except from the "headings"). Instead, dovecot logs: doveadm(username): Fatal: GID 0 isn't permitted
When switching back to userdb static, I receive the correct (but also) static quota information.
What am I doing wrong?
Thank you very much, Christian Schmidt
-- question = ( to ) ? be : ! be; -- Wm. Shakespeare
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.)
Hello Timo,
Timo Sirainen, 12.09.2011 (d.m.y):
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.)
This is working now:
user_attrs = mailQuota=quota_rule=*:bytes=%$
Thank you, Timo!
Gruss/Regards, Christian Schmidt
-- You're at the end of the road again.
participants (3)
-
Christian Schmidt
-
Christian Schmidt
-
Timo Sirainen