deleted and the flushing might cause errors (e.g. EBUSY for
trying to flush a /var/mail mountpoint) */
if (nfs_safe_stat(mbox->path, &st) < 0) {
- mbox_set_syscall_error(mbox, "stat()");
+ if (errno == ENOENT)
+ mailbox_set_deleted(&mbox->ibox.box);
+ else
+ mbox_set_syscall_error(mbox, "stat()");
return -1;
}
/* read-only stream */
st = i_stream_stat(mbox->mbox_file_stream, FALSE);
if (st == NULL) {
+ if (errno == ENOENT) {
+ mailbox_set_deleted(&mbox->ibox.box);
+ return 0;
+ }
mbox_set_syscall_error(mbox, "i_stream_stat()");
return -1;
}
} else {
if (stat(mbox->path, &statbuf) < 0) {
+ if (errno == ENOENT) {
+ mailbox_set_deleted(&mbox->ibox.box);
+ return 0;
+ }
mbox_set_syscall_error(mbox, "stat()");
return -1;
}