Projects
Kolab:16
cyrus-imapd-3
0001-Add-support-for-delayed-delete-mode-in-syn...
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Add-support-for-delayed-delete-mode-in-sync_apply_un.patch of Package cyrus-imapd-3 (Revision 1)
Currently displaying revision
1
,
Show latest
From 56cd822d3570c8837c5475a0864192351dc28f8f Mon Sep 17 00:00:00 2001 From: "Jeroen van Meeuwen (Apheleia IT)" <vanmeeuwen@apheleia-it.ch> Date: Tue, 29 Nov 2022 11:38:25 +0100 Subject: [PATCH] Add support for delayed delete mode in sync_apply_unmailbox() and sync_apply_unuser() Signed-off-by: Jeroen van Meeuwen (Apheleia IT) <vanmeeuwen@apheleia-it.ch> --- imap/sync_support.c | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/imap/sync_support.c b/imap/sync_support.c index e6e558d6f..20d84e30f 100644 --- a/imap/sync_support.c +++ b/imap/sync_support.c @@ -3630,6 +3630,7 @@ bail: int sync_apply_unmailbox(struct dlist *kin, struct sync_state *sstate) { const char *mboxname = kin->sval; + int r; struct mboxlock *namespacelock = mboxname_usernamespacelock(mboxname); @@ -3637,9 +3638,20 @@ int sync_apply_unmailbox(struct dlist *kin, struct sync_state *sstate) int delflags = MBOXLIST_DELETE_FORCE | MBOXLIST_DELETE_SILENT; if (sstate->flags & SYNC_FLAG_LOCALONLY) delflags |= MBOXLIST_DELETE_LOCALONLY; - int r = mboxlist_deletemailbox(mboxname, sstate->userisadmin, + + if (!mboxlist_delayed_delete_isenabled()) { + r = mboxlist_deletemailbox(mboxname, sstate->userisadmin, + sstate->userid, sstate->authstate, + NULL, delflags); + } else if (mboxname_isdeletedmailbox(mboxname, NULL)) { + r = mboxlist_deletemailbox(mboxname, sstate->userisadmin, sstate->userid, sstate->authstate, NULL, delflags); + } else { + r = mboxlist_delayed_deletemailbox(mboxname, sstate->userisadmin, + sstate->userid, sstate->authstate, + NULL, delflags); + } mboxname_release(&namespacelock); @@ -3972,11 +3984,24 @@ int sync_apply_unuser(struct dlist *kin, struct sync_state *sstate) int delflags = MBOXLIST_DELETE_FORCE; if (sstate->flags & SYNC_FLAG_LOCALONLY) delflags |= MBOXLIST_DELETE_LOCALONLY; + for (i = list->count; i; i--) { const char *name = strarray_nth(list, i-1); - r = mboxlist_deletemailbox(name, sstate->userisadmin, - sstate->userid, sstate->authstate, - NULL, delflags); + + if (!mboxlist_delayed_delete_isenabled()) { + r = mboxlist_deletemailbox(name, sstate->userisadmin, + sstate->userid, sstate->authstate, + NULL, delflags); + } else if (mboxname_isdeletedmailbox(name, NULL)) { + r = mboxlist_deletemailbox(name, sstate->userisadmin, + sstate->userid, sstate->authstate, + NULL, delflags); + } else { + r = mboxlist_delayed_deletemailbox(name, sstate->userisadmin, + sstate->userid, sstate->authstate, + NULL, delflags); + } + if (r) goto done; } -- 2.37.3
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.