From: Stephan Bosch Date: Wed, 13 Sep 2017 23:46:12 +0000 (+0200) Subject: lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE. X-Git-Tag: 2.3.0.rc1~933 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=df97180092ae581323dc96c7795c737721e966a0;p=thirdparty%2Fdovecot%2Fcore.git lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_SUBSCRIBE. When this flag is enabled, the mailbox is implicitly subscribed to when it is created automatically. --- diff --git a/src/lib-storage/mail-storage.c b/src/lib-storage/mail-storage.c index 02beaa6e45..e472b3efc9 100644 --- a/src/lib-storage/mail-storage.c +++ b/src/lib-storage/mail-storage.c @@ -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; } diff --git a/src/lib-storage/mail-storage.h b/src/lib-storage/mail-storage.h index 830dbe5f19..9b9a967185 100644 --- a/src/lib-storage/mail-storage.h +++ b/src/lib-storage/mail-storage.h @@ -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 {