diff -Naur cyrus-imapd-2.1.16/imap/imapd.c cyrus-imapd-2.1.16.rmquota/imap/imapd.c
--- cyrus-imapd-2.1.16/imap/imapd.c	2003-09-24 17:16:02.000000000 +0300
+++ cyrus-imapd-2.1.16.rmquota/imap/imapd.c	2003-12-02 20:56:54.843981000 +0200
@@ -4519,6 +4519,7 @@
 char *quotaroot;
 {
     int newquota = -1;
+    int rmquota = 0;
     int badresource = 0;
     int c;
     int force = 0;
@@ -4534,7 +4535,10 @@
     if (c != ')' || arg.s[0] != '\0') {
 	for (;;) {
 	    if (c != ' ') goto badlist;
+	    if (strcasecmp(arg.s, "remove") == 0) rmquota = 1;
+	    else
 	    if (strcasecmp(arg.s, "storage") != 0) badresource = 1;
+
 	    c = getword(imapd_in, &arg);
 	    if (c != ' ' && c != ')') goto badlist;
 	    if (arg.s[0] == '\0') goto badlist;
@@ -4571,7 +4575,10 @@
 						   imapd_userid, mailboxname);
 
 	if (!r) {
-	    r = mboxlist_setquota(mailboxname, newquota, force);
+	    if (!rmquota)
+	       r = mboxlist_setquota(mailboxname, newquota, force);
+	    else
+	       r = mboxlist_unsetquota(mailboxname);
 	}
     }
 
diff -Naur cyrus-imapd-2.1.16/imap/mboxlist.c cyrus-imapd-2.1.16.rmquota/imap/mboxlist.c
--- cyrus-imapd-2.1.16/imap/mboxlist.c	2003-11-04 23:39:18.000000000 +0200
+++ cyrus-imapd-2.1.16.rmquota/imap/mboxlist.c	2003-12-04 23:27:54.215934000 +0200
@@ -2117,10 +2117,12 @@
  */
 int mboxlist_unsetquota(const char *root)
 {
+    char newquota[MAX_MAILBOX_PATH+1];
     char quota_path[MAX_MAILBOX_PATH+1];
     char pattern[MAX_MAILBOX_PATH+1];
     int fd;
     int r=0;
+    struct mailbox mailbox;
 
     if (!root[0] || root[0] == '.' || strchr(root, '/')
 	|| strchr(root, '*') || strchr(root, '%') || strchr(root, '?')) {
@@ -2150,9 +2152,50 @@
     if(unlink(quota_path) == -1) {
 	syslog(LOG_ERR, "could not unlink %s (%m)", quota_path);
 	r = IMAP_SYS_ERROR;
+        goto error_noclose;
+    }
+
+    if (mailbox_findquota(newquota, sizeof(newquota), root)) { 
+
+	    r = mailbox_open_header(newquota, 0, &mailbox);
+	    if (r) goto error_noclose;
+
+	    r = mailbox_lock_header(&mailbox);
+	    if (r) goto error;
+
+	    r = mailbox_open_index(&mailbox);
+	    if (r) goto error;
+
+	    r = mailbox_lock_index(&mailbox);
+	    if (r) goto error;
+
+	    r = mailbox_lock_quota(&mailbox.quota);
+	    if (r) goto error;
+
+	    /*
+	     * Have to update all affected mailboxes
+	     */
+	    strlcpy(pattern, root, sizeof(pattern));
+	    strlcpy(pattern, ".*", sizeof(pattern));
+
+	    mboxlist_changequota(root, 0, 0, &mailbox.quota);
+	    mboxlist_findall(NULL, pattern, 1, 0, 0, mboxlist_changequota, &mailbox.quota);
+
+	    r = mailbox_write_quota(&mailbox.quota);
+	    if (r) goto error;
     }
 
     return r;
+
+error:
+    mailbox_unlock_quota(&mailbox.quota);
+    mailbox_close(&mailbox);
+error_noclose:
+   syslog(LOG_ERR, "LOSTQUOTA: error while unsetting quota root for %s "
+		   " and its children.  Try running quota -f",
+         root);
+
+   return r;
 }
 
 /*
diff -Naur cyrus-imapd-2.1.16/imap/mboxlist.h cyrus-imapd-2.1.16.rmquota/imap/mboxlist.h
--- cyrus-imapd-2.1.16/imap/mboxlist.h	2003-08-09 02:08:52.000000000 +0300
+++ cyrus-imapd-2.1.16.rmquota/imap/mboxlist.h	2003-12-02 20:56:54.855645000 +0200
@@ -172,6 +172,7 @@
 /* set or create quota root */
 int mboxlist_setquota(const char *root, int newquota, int force);
 int mboxlist_unsetquota(const char *root);
+int mboxlist_updatequota(char* pattern, const char* newquota, const char* root);
 
 /* returns a malloc() string that is the representation in the mailboxes 
    file.  for ctl_mboxlist */
