This also removes duplicated code from acl plugin.
Optimized for case where the directory usually exists. */
int mailbox_create_missing_dir(struct mailbox *box,
enum mailbox_list_path_type type);
+/* Returns TRUE if mailbox is autocreated. */
+bool mailbox_is_autocreated(struct mailbox *box);
/* Returns -1 if error, 0 if failed with EEXIST, 1 if ok */
int mailbox_create_fd(struct mailbox *box, const char *path, int flags,
box->reason = p_strdup(box->pool, reason);
}
-static bool mailbox_is_autocreated(struct mailbox *box)
+bool mailbox_is_autocreated(struct mailbox *box)
{
if (box->inbox_user)
return TRUE;
acl_object_deinit(&parent_aclobj);
}
-static bool mailbox_is_autocreated(struct mailbox *box)
-{
- if (box->inbox_user)
- return TRUE;
- return box->set != NULL &&
- strcmp(box->set->autocreate, MAILBOX_SET_AUTO_NO) != 0;
-}
-
static int
acl_mailbox_create(struct mailbox *box, const struct mailbox_update *update,
bool directory)