I think I figured it out...
I reformatted all of the quotas from the old vpopmail style (e.g. 400M, which is 400 megabytes) to the Maildir++ format (e.g. 419430400S,2000C which is 400MB or 2000 messages quota). Here's my new user_query (we don't limit by message count, hence 0C... UID/GID is specific to the box):
user_query = SELECT pw_dir as home, 508 AS uid, 503 AS gid, concat('*:backend=', if(pw_shell LIKE 'NOQUOTA', '0S', pw_shell), ',0C') as quota_rule FROM vpopmail WHERE pw_name = '%n' AND pw_domain = '$d'
I'm still using vpopmail's delivery agent, but now the quotas are understood by both vpopmail and dovecot, so It's all good :-)
Vlad
Timo Sirainen wrote:
On Fri, 2009-03-13 at 09:09 -0500, Vlad Sedov wrote:
My vpopmail installation keeps the quota information in the mysql database (pw_shell field) instead of maildirsize. The quota is in maildir format, e.g. 400M or 50331648S.
The 400M means 400 messages, right? "backend" limit is supposed to work here, but I don't know if anyone's actually tried it yet. So try something like:
select concat('*:backend=', pw_shell) as quota_rule, ..
Unlimited quota is specified as NOQUOTA.
That probably gives an error. You should return 0 instead. For that you need to use MySQL's CASE or IF somehow.