On Mon, 2012-01-16 at 11:42 +0100, RaSca wrote:
passdb sql { args = /etc/dovecot/dovecot-sql.conf } userdb passwd { } userdb static { args = uid=5000 gid=5000 home=/mail/mailboxes/%d/%n@%d allow_all_users=yes }
You're using SQL only for passdb lookup.
plugin { quota = maildir:/mail/mailboxes/%d/%n@%d
The above path probably doesn't do what you intended. It's only the user-visible quota root name. It could just as well be "User quota" or something.
The db connection works, this is /etc/dovecot/dovecot-sql.conf:
driver = mysql connect = host=<myserver> dbname=mail user=<myuser> password=<mypassword> default_pass_scheme = CRYPT password_query = SELECT username, password FROM mailbox WHERE username='%u' user_query = SELECT username AS user, maildir AS home, CONCAT('*:storage=', quota , 'B') AS quota_rule FROM mailbox WHERE username = '%u' AND active = '1'
user_query isn't used, because you aren't using userdb sql.