Quota Maintenance

On occasion, quotas will get horked. A common corrupted quota scenario goes like this: a user receives alerts from his client that he cannot save mail to his folders.[41] You use cyradm to check his quota, and everything looks fine—he has plenty of space. However, you check a little deeper and you see that his mail is being deferred to the queue and is not being delivered to his mailbox, which usually happens when a user is over quota. A quick way to determine whether the problem is quota-related is to use the quota command to fix the user’s quota root (run the command as user cyrus from the shell prompt):

$quota user.
               username

After running quota, run cyradm and check the quota again. Chances are that it will report the user as being over quota when you run it this time.

The quota command, when run with no command-line arguments, can also be used to report quota limits and usage on your entire user base:

$quota
Quota  % Used    Used Root
15360       0       0 user.aa0002
15360       0       0 user.aa0006
15360       0     137 user.aa0008
15360       0       0 user.aa0009

If quotas become corrupted, all that is required to fix the problem is to run the quota command with the –f switch:

$quota -f

The command may require several minutes to complete, depending on the number of users your system supports. More information on quota subsystem maintenance is provided in later in the chapter.

[41] The errors depend on the client and can range from “permission denied” to “cannot save to mailbox.”

Get Managing IMAP now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.