On Mon, 10 Sep 2007, Andy Lyttle wrote:
How can I add quota support (RFC 2087) to imapd?

Simple answer: write code.

More complex answer:

To start, you have to decide exactly what RFC 2087 means on your system. RFC 2087 quotas are not at all like UNIX quotas.

In RFC 2087, every mailbox has zero or more "quota roots", and the quota root is what has the quota. The quota root, in turn, has some number of named resource limits. RFC 2087 only suggests STORAGE and MESSAGE for resource limits. None of this maps particularly well to any sort of UNIX quota mechanism.

One possibility is not to use UNIX quotas at all, but instead to implement your own database of quotas. Then the message delivery process, and the COPY and APPEND support in IMAP, is made to enforce this. This only works if you have a standalone IMAP server since anyone with shell access can easily evade it. Note too that you have to update the database every time a message is added to any mailbox.

If you try to do UNIX quotas, but SETQUOTA is not likely to be implementable as anything other than returning a NO. Hence it is a read-only mechanism. You can't return STORAGE, since RFC 2087 defines it as not including overhead data, so you have to make it return something like UNIXSTORAGE.

Last but not least, you have to find an IMAP client that actually implements RFC 2087 and does something useful with its support.


Now, if your actual question is "how do I apply quotas to IMAP users", that's an ENTIRELY DIFFERENT question. Unless you sit down and write your own quota system as noted above, RFC 2087 does nothing to help you.

You can apply UNIX quotas to your IMAP users as an external mechanism. It imapd hits an over-quota condition, it will try to undo whatever it was doing to cause the problem. Depending upon your operating system's implementation of quotas, that may or may not succeed.

A more reasonable approach is to use soft quotas, not hard quotas, and have mail delivery stop at soft quotas. Hard quotas are likely to cause problems.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
_______________________________________________
Imap-uw mailing list
Imap-uw@u.washington.edu
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to