Skip to content

Commit

Permalink
lib-storage: Implemented new mailbox flag MAILBOX_FLAG_AUTO_CREATE.
Browse files Browse the repository at this point in the history
When this flag is enabled, the mailbox is automatically created when it is opened (if possible and appropriate).
  • Loading branch information
stephanbosch authored and Timo Sirainen committed Oct 4, 2017
1 parent 2ceb75f commit 2d27ea5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/lib-storage/mail-storage.c
Expand Up @@ -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;
}
Expand Down
2 changes: 2 additions & 0 deletions src/lib-storage/mail-storage.h
Expand Up @@ -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 {
Expand Down

0 comments on commit 2d27ea5

Please sign in to comment.