Adding mailbox name to quota warnings

Vesa-Matti J Kari vmkari at
Wed Oct 28 04:57:35 EDT 2015


Yesterday we had a user who was getting the IMAP ALERT:

  "Mailbox is at 90% of quota"

but his personal IMAP account (i.e. inbox and its subfolders) was not to
blame. Instead, he had administrator privileges to nearly 200 bulletin
boards. Outlook kept complaining about one of those boxes but did not
tell the user which one.

I was able to track down the correct bulletin board by using a mailbox
list dump and a simple shell script, but it was a bit tedious.

That is why I began to wonder whether the Cyrus IMAP server could be more
verbose in its quota alerts.

The patch for adding mailbox name to the quota warnings is attached.

However, I am not sure whether it is sensible to apply it, for the
following reasons:

1) When the personal IMAP account is close to exceeding its quota,
   the warnings can be misleading, since it is the *whole* hierarchy
   that is to blame, not the individual folders

2) Folder hierarchies can be deep, thus resulting in long warning

What do you think?

The problem 1 could be fixed by using a more complicated patch. Before
issuing the warning, you could check whether the mailbox name starts with
"inbox." or equals "inbox", and then issue a generic warning without a
mailbox name. In the other cases (those would be mostly bulletin boards, I
guess) you would issue the more speficific warning.

If you choose to apply the patch, then it is probably best to add the
mailbox name to the IMAP_NO_OVERQUOTA case too.

               Tietotekniikkakeskus / Helsingin yliopisto
                 IT department / University of Helsinki
-------------- next part --------------
diff -ru cyrus-imapd-2.4.17/imap/imapd.c cyrus-imapd-2.4.17-patched/imap/imapd.c
--- cyrus-imapd-2.4.17/imap/imapd.c	2012-12-01 21:57:54.000000000 +0200
+++ cyrus-imapd-2.4.17-patched/imap/imapd.c	2015-10-28 10:15:42.101968195 +0200
@@ -3776,7 +3776,7 @@
 		    int usageint = (int) usage;
 		    prot_printf(imapd_out, "* NO [ALERT] ");
 		    prot_printf(imapd_out, error_message(IMAP_NO_CLOSEQUOTA),
-				usageint);
+				name, usageint);
 		    prot_printf(imapd_out, "\r\n");
diff -ru cyrus-imapd-2.4.17/imap/ cyrus-imapd-2.4.17-patched/imap/
--- cyrus-imapd-2.4.17/imap/	2012-12-01 21:57:54.000000000 +0200
+++ cyrus-imapd-2.4.17-patched/imap/	2015-10-28 10:15:32.925934301 +0200
@@ -195,7 +195,7 @@
    "Mailbox is over quota"
-   "Mailbox is at %d%% of quota"
+   "Mailbox %s is at %d%% of quota"
    "Message %d no longer exists"

More information about the Cyrus-devel mailing list