Re: Deleting top-level mailbox with 'delete_mode: delayed'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On Tue, 13 Nov 2007, Bron Gondwana wrote:
>
>> I have "delete_mode: immediate" on the replica and "delete_mode:
>> delayed" on the master.
>
> sync_server doesn't pay any attention to delete_mode, so the option
> shouldn't have any effect on the replica.

Okay, things are a bit more clear now. With "allowusermoves: no", which is
the default, "delete_mode: delayed" doesn't work for deleting user
mailboxes. The quick patch below makes things work but I understand it's
not a clean solution. Am I supposed to enable "allowusermoves" explicitly
when using "delete_mode: delayed"? Would it make sense to add an isdeleted
flag to mboxname_isusermailbox() so the code below could check whether to
override the "allowusermoves" setting for delayed mailbox deletion?
Due to the lack of sane C skills I feel unable to provide a proper fix...

Thanks,
Simon

[root@monster imap]# diff -Nau mboxlist.c.ver-20071114083143 mboxlist.c
--- mboxlist.c.ver-20071114083143       2007-10-01 20:35:59.000000000 +0200
+++ mboxlist.c  2007-11-14 09:42:55.000000000 +0100
@@ -1221,7 +1221,8 @@
              goto done;
            }
            isusermbox = 1;
-       } else if (config_getswitch(IMAPOPT_ALLOWUSERMOVES) &&
+       } else if ((config_getswitch(IMAPOPT_ALLOWUSERMOVES) ||
+                  mboxlist_delayed_delete_isenabled()) &&
                   mboxname_isusermailbox(newname, 1)) {
            /* Special case of renaming a user */
            access = cyrus_acl_myrights(auth_state, oldacl);
@@ -1253,7 +1254,8 @@
     /* Check ability to create new mailbox */
     if (!partitionmove) {
        if (mboxname_isusermailbox(newname, 1)) {
-           if (config_getswitch(IMAPOPT_ALLOWUSERMOVES) &&
+           if ((config_getswitch(IMAPOPT_ALLOWUSERMOVES) ||
+               mboxlist_delayed_delete_isenabled()) &&
                mboxname_isusermailbox(oldname, 1)) {
                if (!isadmin) {
                    /* Only admins can rename users (INBOX to INBOX) */


----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux