box->index_prefix);
}
-int index_storage_mailbox_exists(struct mailbox *box, bool auto_boxes,
+int index_storage_mailbox_exists(struct mailbox *box,
+ bool auto_boxes ATTR_UNUSED,
enum mailbox_existence *existence_r)
{
- return index_storage_mailbox_exists_full(box, auto_boxes,
- NULL, existence_r);
+ return index_storage_mailbox_exists_full(box, NULL, existence_r);
}
-int index_storage_mailbox_exists_full(struct mailbox *box, bool auto_boxes,
- const char *subdir,
+int index_storage_mailbox_exists_full(struct mailbox *box, const char *subdir,
enum mailbox_existence *existence_r)
{
struct stat st;
const char *path, *path2;
- if (strcmp(box->name, "INBOX") == 0 &&
- (box->list->ns->flags & NAMESPACE_FLAG_INBOX_USER) != 0 &&
- auto_boxes) {
- /* INBOX always exists */
- *existence_r = MAILBOX_EXISTENCE_SELECT;
- return 0;
- }
-
/* see if it's selectable */
path = mailbox_list_get_path(box->list, box->name,
MAILBOX_LIST_PATH_TYPE_MAILBOX);
const char *index_prefix);
int index_storage_mailbox_exists(struct mailbox *box, bool auto_boxes,
enum mailbox_existence *existence_r);
-int index_storage_mailbox_exists_full(struct mailbox *box, bool auto_boxes,
- const char *subdir,
+int index_storage_mailbox_exists_full(struct mailbox *box, const char *subdir,
enum mailbox_existence *existence_r);
int index_storage_mailbox_open(struct mailbox *box, bool move_to_memory);
int index_storage_mailbox_enable(struct mailbox *box,
return FALSE;
}
-static int maildir_mailbox_exists(struct mailbox *box, bool auto_boxes,
- enum mailbox_existence *existence_r)
+static int
+maildir_mailbox_exists(struct mailbox *box, bool auto_boxes ATTR_UNUSED,
+ enum mailbox_existence *existence_r)
{
- return index_storage_mailbox_exists_full(box, auto_boxes,
- "cur", existence_r);
+ return index_storage_mailbox_exists_full(box, "cur", existence_r);
}
static int maildir_mailbox_open(struct mailbox *box)
return 0;
}
+ if (strcmp(box->name, "INBOX") == 0 && box->inbox_user && auto_boxes) {
+ /* INBOX always exists */
+ *existence_r = MAILBOX_EXISTENCE_SELECT;
+ return 0;
+ }
+
return box->v.exists(box, auto_boxes, existence_r);
}