]> dgit.raspbian.org Git - dovecot.git/commitdiff
[PATCH 2/2] lib-storage: Remove MAILBOX_FLAG_AUTO_CREATE and MAILBOX_FLAG_AUTO_SUBSCRIBE
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 11 Jun 2026 17:20:40 +0000 (17:20 +0000)
committerNoah Meyerhans <noahm@debian.org>
Wed, 16 Sep 2026 19:06:35 +0000 (15:06 -0400)
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

src/lib-storage/mail-storage-lua.c
src/lib-storage/mail-storage.c
src/lib-storage/mail-storage.h

index b1ec6563fe228eed7b639b8fed96f4ff459163f1..591d8587563bd20f31674ef3a036d73d2b0499b8 100644 (file)
@@ -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),
index 5fe4b81fe8e5b491b03893b9101f3d322144b72d..ab435107b4910db721cb79d1eba427d49bd38bc4 100644 (file)
@@ -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;
 }
index 6768c972faefeafe1a3c14c5da91e25a88931e1e..a217621ba194cda3718955fd6399fff01320d19f 100644 (file)
@@ -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. */