Marcus Jodorf wrote:
CONCAT('dirsize:storage=', ROUND( mailbox.quota / 1024 ) ) AS quota
FROM mailbox WHERE username = '%u' AND active = '1' user_query = SELECT maildir, 125 AS uid, 125 AS gid,\I solved this in a similar way using views with postgresql.
But the real problem IMHO is not bytes vs. kilobytes (solution is very simple as you showed above) but dovecot treating '0' values in the database literally. All the other programs take '0' as unlimited quota and therefore it's very easy to experience an unpleasant surprise with dovecot-lda.
If you run postfixadmin as mentioned above you will probably completely lock out all your users with unlimited quota. I could be wrong here but IIRC postfixadmin uses '0' for unlimited/unset quota, too.
Luckily i don't have any users with unlimited quota so i did not ran in to this problem but, is there any solution to solve this in the (My)SQL query?
Peter