[Dovecot] Multiple quota roots with quota-fs backend
Ralf Becker
beckerr at fh-trier.de
Tue Jul 8 17:49:59 EEST 2008
Today I've tried to configure multiple filesystem quotas, with some
strange results.
These are my two filesystems; both using quotas:
* /dev/mail mounted to /var/spool/mail
using AIX quotas for all users. Mailbox format is 'mbox' and
they are named '/var/spool/mail/<logname>'
* filer0:/vol/home mounted to /home/f0 via nfs
using netapp quotas for all users. Mailboxes are all 'mbox'
and located in '~<logname>/Mail'
I've configured _two_ quota roots as described here:
http://wiki.dovecot.org/Quota/FS?highlight=(two%20filesystems)
plugin {
quota = fs:Home:mount=/home/f0
quota2 = fs:Spool:mount=/var/spool/mail
}
This works like a charm, but when testing the configuration,
the result was just surprising:
* OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND
UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS
LIST-EXTENDED I18NLEVEL=1 QUOTA AUTH=PLAIN] Dovecot ready.
. login rfttest XXX
. OK Logged in.
. getquotaroot "INBOX"
* QUOTAROOT "INBOX" "Home" "Spool"
* QUOTA "Home" (STORAGE 310360 1048576)
* QUOTA "Spool" (STORAGE 89708 1000000)
. OK Getquotaroot completed.
. getquotaroot "Trash"
* QUOTAROOT "Trash" "Home" "Spool"
* QUOTA "Home" (STORAGE 310360 1048576)
* QUOTA "Spool" (STORAGE 89708 1000000)
. OK Getquotaroot completed.
. logout
* BYE Logging out
. OK Logout completed.
You see, that _always_ both quota roots are reported, whether
the references mailbox is actually placed on this filesystem or not.
However reading RFC2087 confirms me in the idea, that just the
_related_ quota roots should be listed:
-------------------------------8<-----------------------------------------
4.3. GETQUOTAROOT Command
Arguments: mailbox name
Data: untagged responses: QUOTAROOT, QUOTA
Result: OK - getquota completed
NO - getquota error: no such mailbox, permission denied
BAD - command unknown or arguments invalid
The GETQUOTAROOT command takes the name of a mailbox and returns the
list of quota roots for the mailbox in an untagged QUOTAROOT
response. For each listed quota root, it also returns the quota
root's resource usage and limits in an untagged QUOTA response.
Example: C: A003 GETQUOTAROOT INBOX
S: * QUOTAROOT INBOX ""
S: * QUOTA "" (STORAGE 10 512)
S: A003 OK Getquota completed
------------------------------->8-----------------------------------------
So in my opinion correctly reported quota roots should look like this:
* OK [CAPABILITY IMAP4rev1 SASL-IR SORT THREAD=REFERENCES MULTIAPPEND
UNSELECT LITERAL+ IDLE CHILDREN NAMESPACE LOGIN-REFERRALS UIDPLUS
LIST-EXTENDED I18NLEVEL=1 QUOTA AUTH=PLAIN] Dovecot ready.
. login rfttest XXX
. OK Logged in.
. getquotaroot "INBOX"
* QUOTAROOT "INBOX" "Spool"
* QUOTA "Spool" (STORAGE 89708 1000000)
. OK Getquotaroot completed.
. getquotaroot "Trash"
* QUOTAROOT "Trash" "Home"
* QUOTA "Home" (STORAGE 310360 1048576)
. OK Getquotaroot completed.
. logout
* BYE Logging out
. OK Logout completed.
Now I known what I want... but how to get it :-)
While I see no way to use namespaces and/or quota rules to configure
this behavior, patching quota.c, quota-fs.c and quota-private.h seems
to be an option.
A downside of this is, that I've to extend the quota plugin interface
(quota_backend_vfuncs) defined in quota-private.h by adding an new
callback function. Since all other quota backends don't have this new
function, they have to initialize it with NULL. So there are side
effects to other quota backends.
This is the reason why I want to discuss the above described
problem (and solution) before posting my patch :-)
Regards, Ralf
--
______________________________________________________________________
Dipl.-Inform. (FH) Ralf Becker Rechenzentrum (r/ft) der FH Trier
(Network|Mail|Web|Firewall) University of applied sciences
Administrator Schneidershof, D-54293 Trier
Mail: beckerr at fh-trier.de Fon: +49 651 8103 499
WWW: http://www.fh-trier.de/~beckerr Fax: +49 651 8103 214
______________________________________________________________________
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 6087 bytes
Desc: S/MIME Cryptographic Signature
Url : http://dovecot.org/pipermail/dovecot/attachments/20080708/d0e87c90/attachment-0001.bin
More information about the dovecot
mailing list