[Dovecot] dict quota and quota recalculation
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Tue, 13 Apr 2010, Alex wrote:
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).
See: http://wiki.dovecot.org/PreAuth You are using a "pre-auth"'ed session, that means uid/gid has to be set before running the command.
Regards,
Steffen Kaiser -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux)
iQEVAwUBS8RW7L+Vh58GPL/cAQIXBQgAo8o2JAbWLm3mbW1mpmGVm3RpVBH0u1rD CCTl92z8+iR3r5Pv6hNPGwXfSJ75KTXcwMbNcVj8qQQcZJdsJ6nIcCpzE8sLn9Mz 4m0gjfwtlEbsO3XCvyxpxnebhM0rCVodyZoq6DQOy3cVbcjwzG29IEx/CoQPQ/Y3 Gfl6fyJJRmWHYvVjIhYB36phOsO1if9zNm2JIRni6dSrWc83OIVPfQrQjzdEMi+k XjtykE83wC7fxHnDTdlQc8pbEaO1hfw8xGtaLLgZci0v+ytf+FZljXM4PiBX0vEd nSmaqsC8lJ4RPcTIjaMstm/IbV+IRVrQfGfCV/fPlW2B5bcoG7Wreg== =6wNc -----END PGP SIGNATURE-----
participants (2)
-
Alex
-
Steffen Kaiser