From: Timo Sirainen Date: Thu, 11 Jun 2026 17:20:40 +0000 (+0000) Subject: [PATCH 2/2] lib-storage: Remove MAILBOX_FLAG_AUTO_CREATE and MAILBOX_FLAG_AUTO_SUBSCRIBE X-Git-Tag: archive/raspbian/1%2.4.1+dfsg1-6+rpi1+deb13u7^2~103 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=01e642d12c557f1595f0cb497558c9e389818936;p=dovecot.git [PATCH 2/2] lib-storage: Remove MAILBOX_FLAG_AUTO_CREATE and MAILBOX_FLAG_AUTO_SUBSCRIBE These flags were set only by mail delivery (lib-lda) and Sieve fileinto (Pigeonhole), both of which now create the target mailbox explicitly with mailbox_create(). Nothing sets the flags anymore, so remove them and drop the flag checks from mailbox_is_autocreated() and mailbox_is_autosubscribed(). As a result mailbox_is_autocreated() reflects only mailboxes that virtually already exist (the user's INBOX and admin-configured "auto" mailboxes), so the ACL plugin again enforces the CREATE right for delivery-autocreated mailboxes in shared and public namespaces. Gbp-Pq: Name 0002-lib-storage-Remove-MAILBOX_FLAG_AUTO_CREATE-and-MAIL.patch --- diff --git a/src/lib-storage/mail-storage-lua.c b/src/lib-storage/mail-storage-lua.c index b1ec656..591d858 100644 --- a/src/lib-storage/mail-storage-lua.c +++ b/src/lib-storage/mail-storage-lua.c @@ -33,8 +33,6 @@ static struct dlua_table_values lua_storage_mail_storage_flags[] = { DLUA_TABLE_ENUM(MAILBOX_FLAG_NO_INDEX_FILES), DLUA_TABLE_ENUM(MAILBOX_FLAG_KEEP_LOCKED), DLUA_TABLE_ENUM(MAILBOX_FLAG_IGNORE_ACLS), - DLUA_TABLE_ENUM(MAILBOX_FLAG_AUTO_CREATE), - DLUA_TABLE_ENUM(MAILBOX_FLAG_AUTO_SUBSCRIBE), DLUA_TABLE_ENUM(MAILBOX_SYNC_FLAG_FULL_READ), DLUA_TABLE_ENUM(MAILBOX_SYNC_FLAG_FAST), diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 5fe4b81..ab43510 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -1375,16 +1375,12 @@ bool mailbox_is_autocreated(struct mailbox *box) { if (box->inbox_user) return TRUE; - if ((box->flags & MAILBOX_FLAG_AUTO_CREATE) != 0) - return TRUE; return box->set != NULL && strcmp(box->set->autocreate, MAILBOX_SET_AUTO_NO) != 0; } bool mailbox_is_autosubscribed(struct mailbox *box) { - if ((box->flags & MAILBOX_FLAG_AUTO_SUBSCRIBE) != 0) - return TRUE; return box->set != NULL && strcmp(box->set->autocreate, MAILBOX_SET_AUTO_SUBSCRIBE) == 0; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 6768c97..a217621 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -74,10 +74,6 @@ enum mailbox_flags { quota updates (possibly resulting in broken quota). and This is useful for example when deleting entire user accounts. */ MAILBOX_FLAG_DELETE_UNSAFE = 0x400, - /* Mailbox is created implicitly if it does not exist. */ - MAILBOX_FLAG_AUTO_CREATE = 0x1000, - /* Mailbox is subscribed to implicitly when it is created automatically */ - MAILBOX_FLAG_AUTO_SUBSCRIBE = 0x2000, /* Run fsck for mailbox index before doing anything else. This may be useful in fixing index corruption errors that aren't otherwise detected and that are causing the full mailbox opening to fail. */