]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Wed, 13 Sep 2017 23:39:30 +0000 (01:39 +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 automatically created when it is opened (if possible and appropriate).

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

index 43d52b598516da5fb0053cf59269f1c6602c9e4c..02beaa6e456177a00b6624190a44063228ad2285 100644 (file)
@@ -880,6 +880,8 @@ 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;
 }
index 85ad9e6f22947a83f08c7c506154ffae5d455403..830dbe5f19f5bf5bc3aad5aca0c54ce03db2c7d9 100644 (file)
@@ -61,6 +61,8 @@ enum mailbox_flags {
           The backend shouldn't treat it as corruption if a mail body isn't
           found. */
        MAILBOX_FLAG_USE_STUBS          = 0x800,
+       /* Mailbox is created implicitly if it does not exist. */
+       MAILBOX_FLAG_AUTO_CREATE        = 0x1000,
 };
 
 enum mailbox_feature {