return TRUE;
}
-int dbox_mailbox_open(struct mailbox *box)
+int dbox_mailbox_check_existence(struct mailbox *box)
{
const char *box_path = mailbox_get_path(box);
"stat(%s) failed: %m", box_path);
return -1;
}
+ return 0;
+}
+int dbox_mailbox_open(struct mailbox *box)
+{
if (index_storage_mailbox_open(box, FALSE) < 0)
return -1;
mail_index_set_fsync_mode(box->index,
void dbox_storage_destroy(struct mail_storage *storage);
uint32_t dbox_get_uidvalidity_next(struct mailbox_list *list);
void dbox_notify_changes(struct mailbox *box);
+int dbox_mailbox_check_existence(struct mailbox *box);
int dbox_mailbox_open(struct mailbox *box);
int dbox_mailbox_create(struct mailbox *box,
const struct mailbox_update *update, bool directory);
{
struct mdbox_mailbox *mbox = (struct mdbox_mailbox *)box;
+ if (dbox_mailbox_check_existence(box) < 0)
+ return -1;
if (dbox_mailbox_open(box) < 0)
return -1;
struct sdbox_index_header hdr;
bool need_resize;
+ if (dbox_mailbox_check_existence(box) < 0)
+ return -1;
+
if (sdbox_mailbox_alloc_index(mbox) < 0)
return -1;