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