Timo Sirainen wrote:
On 6.1.2010, at 16.45, leo wrote:
passdb: driver: sql args: /usr/local/etc/dovecot-sql.conf
OK, password_query is read.
userdb: driver: static args: uid=6000 gid=6000 home=/home/vmail/%d/%n allow_all_users=yes
This userdb static catches everything! The below userdb sql is never used because of it, remove it.
userdb: driver: sql args: /usr/local/etc/dovecot-sql.conf
Okay.
user_query = SELECT '/home/vmail/%d/%n' as home, 'maildir:/home/vmail/%d/%n' as mail, 6000 AS uid, 6000 AS gid, concat('*:bytes=', mailbox.quota) AS quota_rule FROM mailbox WHERE mailbox.username = '%u' AND active = '1'
Looks ok, except I wouldn't make home = mail. http://wiki.dovecot.org/VirtualUsers/Home
password_query = SELECT password, '/home/vmail/%d/%n' as home, 'maildir:/home/vmail/%d/%n' as mail, 6000 AS uid, 6000 AS gid, concat('dict:bytes=', quota) AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
The home, mail, uid, gid, quota_rules are useless here. They're not used for anything. If you want to optimize, you could use prefetch userdb. http://wiki.dovecot.org/UserDatabase/Prefetch
Hello Timo, I'm impressed yours bull's-eye. Of course now is everything working, I've got my quota per user not global. I also added 'Maildir' to the end of mail path, but I don't have idea how to prefetch with quota limits. I tried something but I lost concept. Quota was/is the most important.
Big Thanks for help Leo