[Dovecot] quota in SQL and static userdb
Hello,
which solution will be working or will be working better (performance). Using dovecot 1.2.6 (plugin section contains quota_rule = *:storage=500M:messages=10000 and i need override this default quota for some users)
A) passdb sql(SELECT userid AS user, pw AS password, quota AS userdb_quota_rule FROM users WHERE userid = '%u') + userdb static (uid=500 gid=500 home=/home/mail/%d/%n allow_all_users=yes) - using extra fields quota with no prefetch userdb or B) passdb sql(SELECT userid AS user, pw AS password, quota AS userdb_quota_rule, CONCAT('/home/mail/', domain, '/', user) AS userdb_home, 500 AS userdb_uid, 500 AS userdb_gid FROM users WHERE userid = '%u') + prefetch (eg same sql file)
Solution for LDA only(postfix local delivery) and for another IMAP/POP3 dovecot instance?
And how to implement domain quotas (something like user quotas using dict) ?
Thank you.
-- Lampa
On Fri, 2009-11-20 at 21:57 +0100, Lampa wrote:
A) passdb sql(SELECT userid AS user, pw AS password, quota AS userdb_quota_rule FROM users WHERE userid = '%u') + userdb static (uid=500 gid=500 home=/home/mail/%d/%n allow_all_users=yes) - using extra fields quota with no prefetch userdb
This won't work. passdb's userdb_* fields are used only if you use userdb prefetch.
or B) passdb sql(SELECT userid AS user, pw AS password, quota AS userdb_quota_rule, CONCAT('/home/mail/', domain, '/', user) AS userdb_home, 500 AS userdb_uid, 500 AS userdb_gid FROM users WHERE userid = '%u') + prefetch (eg same sql file)
This should work.
Solution for LDA only(postfix local delivery) and for another IMAP/POP3 dovecot instance?
For LDA you need to add userdb sql (after the prefetch userdb) that does the lookup.
And how to implement domain quotas (something like user quotas using dict) ?
A shared quota between all users in a domain? That's kind of possible with dict quota, but there's currently no way to (easily) recalculate the quota if it gets out of sync. Anyway, you could at least do it with file dict:
quota = dict:user::file:/var/mail/%d/dovecot-domain-quota
Probably with sql dict too, but I can't remember right now how exactly.
Probably with sql dict too, but I can't remember right now how exactly.
This works for us:
dict { quotadict = mysql:/etc/dovecot/dovecot-dict-quota.conf } plugin { quota = dict:INBOX::proxy::quotadict quota2 = dict:shared:%d:ns=shared.:proxy::quotadict }
in the mysql-table, username and domain are stored in the same column
participants (3)
-
Anton Dollmaier
-
Lampa
-
Timo Sirainen