On Mon, 2007-04-02 at 16:14 +0200, Emiliano Gabrielli (aka AlberT) wrote:
CONCAT('maildir:storage=', CEIL(quota/1000)) AS userdb_quota FROM mailbox WHERE username = '_test_@XXXXXXX.it'
There is the "maildir". It should say "dict" there instead if you want it to use dict. So change it from user_query.
dovecot: Apr 02 16:11:36 Error: IMAP(_test_@XXXXXXX.it): dict quota: URI missing from parameters: dict:storage=10240
maybe I have totally misundestood how this plugin works ... ;-(
this is the lines in my dovecot.cof: dict { quotadict = mysql:/etc/dovecot/dovecot-dict-quota.conf } plugin { quota = dict:storage=20480:messages=1000 proxy::quotadict }
I think the misunderstandment is that plugin { quota } is completely ignored, because it's overridden by your user_query statement.
and here are the SQL queries in the dovecot-sql.conf:
user_query = SELECT 10000 AS uid, 10000 AS gid, '/var/vmail/domains/%d/%n' as home, 'maildir:/var/vmail/domains/%d/%n' as mail, CONCAT('maildir:storage=', CEIL(quota/1000)) AS quota FROM mailbox WHERE username = '%u' AND active = '1'
So here should be:
CONCAT('dict:storage=2', ceil(quota/1000), ' proxy::quotadict') AS quota
(or quota /1024?)
password_query = SELECT username as user, password, '/var/vmail/domains/%d/%n' as userdb_home, 'maildir:/var/vmail/domains/%d/%n' as userdb_mail, 10000 AS userdb_uid, 10000 AS userdb_gid, CONCAT('maildir:storage=', CEIL(quota/1000)) AS userdb_quota FROM mailbox WHERE username = '%u'
If you want to use the userdb_* here you should also enable prefetch userdb, otherwise they're ignored.