Hi I am trying to migrate my courier server to dovecot and I've run into some problems. One of the motive that I chose to migrate is quota reporting mechanism which in courier is a pain (if you need to display an accurate quota usage in the control panel). So I follow the instructions on migrations , I convert all the mailboxes, and the next step was to populate the quota table (I use quota/dict).
The quota table is empty. From the console (as root): #echo "x GETQUOTAROOT Inbox" | USER=test@domain.net /usr/local/sbin/dovecot --exec-mail imap
- the result is : | email | used_quota | messages | +----------------+------------+----------+ | test@domain.net | 0 | 0 |
From mailling logs , relevant parts :
dict quota: user=test@domain.net, uri=proxy::quotadict, noenforcing=0 Namespace: type=private, prefix=, sep=., inbox=yes, hidden=no, list=yes, subscriptions=yes maildir: data=~ maildir++: root=/root, index=, control=, inbox=/root Namespace : Using permissions from /root: mode=0750 gid=-1
- and in the root folder I can see all dovecot specific files (dovecot*)
So basically if I execute the script as root the maildir is root the uid/gid is root I search and I found a trick for home :
HOME=/home/sites/domain.net/mail/test/Maildir/; USER=test@domain.net; echo "1 getquotaroot inbox" | /usr/local/sbin/dovecot -c /usr/local/etc/dovecot.conf --exec-mail imap
(but first I must put used_quota and messages values on -1 in the quota table)
If I run this , all dovecot files are created in the user homedir (correct) but with the wrong uid/gid (root). If I change the owner of that files , next time I run the same command , nothing changes (uid/gid remain vmail.vmail).
My questions are :
- is there a way to avoid this behavior (the owner of the dovecot files after quota recreation)?
- is there a better way to force all users quota recalculation?
PS: and yes , I need to know all quotas even if the user haven't yet login