File 0001-Accept-existing-ancestors-to-new-mailboxes.patch of Package cyrus-imapd-3
From b7e92363efd8955e9abb0300805d28cf6ec06588 Mon Sep 17 00:00:00 2001
From: Christian Mollekopf <mollekopf@apheleia-it.ch>
Date: Fri, 3 Mar 2023 15:11:34 +0100
Subject: [PATCH] Accept existing ancestors to new mailboxes
I've been running into this when creating multiple shared mailboxes,
such as shared/Resources/test1@kolab.org, shared/Resources/test2@kolab.org.
After the first mailbox, any subsequent mailbox creation with an @ in
the name would fail (because it tried to recreate the shared mailbox).
The regression was introduced by 31d612831f719cfa288e7e03e51ff553bc9c6a50,
and only affects the localcreate path (seems to work fine in a murder)
---
imap/imapd.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/imap/imapd.c b/imap/imapd.c
index bd97a0b31..4abcd27dc 100644
--- a/imap/imapd.c
+++ b/imap/imapd.c
@@ -7150,6 +7150,12 @@ localcreate:
imapd_userid, imapd_authstate,
flags, NULL/*mailboxptr*/);
if (r) {
+ // If the mailbox already exists this should be fine.
+ // TODO: check acl?
+ if (r == IMAP_MAILBOX_EXISTS) {
+ r = 0;
+ continue;
+ }
// XXX should we delete the ancestors we just created?
break;
}
--
2.39.1