]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 13 Sep 2017 23:46:12 +0000 (01:46 +0200)
committerTimo Sirainen <tss@dovecot.fi>
Wed, 4 Oct 2017 22:07:46 +0000 (01:07 +0300)
When this flag is enabled, the mailbox is implicitly subscribed to when it is created automatically.

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

index 02beaa6e456177a00b6624190a44063228ad2285..e472b3efc983f176fba01af93018c9a604bc35ed 100644 (file)
@@ -888,6 +888,8 @@ bool mailbox_is_autocreated(struct mailbox *box)
 
 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 830dbe5f19f5bf5bc3aad5aca0c54ce03db2c7d9..9b9a967185ff0127418f3c0d6fea5c1b225c9b37 100644 (file)
@@ -63,6 +63,8 @@ enum mailbox_flags {
        MAILBOX_FLAG_USE_STUBS          = 0x800,
        /* 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
 };
 
 enum mailbox_feature {