From: Stephan Bosch Date: Wed, 13 Sep 2017 23:39:30 +0000 (+0200) Subject: lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE. X-Git-Tag: 2.3.0.rc1~934 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2d27ea5063099b1b2afb466d4db4d898b4a7fe2e;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE. When this flag is enabled, the mailbox is automatically created when it is opened (if possible and appropriate). --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 43d52b5985..02beaa6e45 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -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; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 85ad9e6f22..830dbe5f19 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -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 {