enum mailbox_list_path_type type);
/* Returns TRUE if mailbox is autocreated. */
bool mailbox_is_autocreated(struct mailbox *box);
+/* Returns TRUE if mailbox is autosubscribed. */
+bool mailbox_is_autosubscribed(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,
strcmp(box->set->autocreate, MAILBOX_SET_AUTO_NO) != 0;
}
+bool mailbox_is_autosubscribed(struct mailbox *box)
+{
+ return box->set != NULL &&
+ strcmp(box->set->autocreate, MAILBOX_SET_AUTO_SUBSCRIBE) == 0;
+}
+
static int mailbox_autocreate(struct mailbox *box)
{
const char *errstr;
box->vname, errstr);
return -1;
}
- } else if (box->set != NULL &&
- strcmp(box->set->autocreate,
- MAILBOX_SET_AUTO_SUBSCRIBE) == 0) {
+ } else if (mailbox_is_autosubscribed(box)) {
if (mailbox_set_subscribed(box, TRUE) < 0) {
mail_storage_set_critical(box->storage,
"Failed to autosubscribe to mailbox %s: %s",