if (istream_raw_mbox_seek(mbox->mbox_stream, offset) < 0) {
if (offset == 0) {
+ mbox->invalid_mbox_file = TRUE;
mail_storage_set_error(&mbox->storage->storage,
MAIL_ERROR_NOTPOSSIBLE,
"Mailbox isn't a valid mbox file");
sync_flags |= MBOX_SYNC_REWRITE;
}
}
- if (sync_flags != 0) {
+ if (sync_flags != 0 && !mbox->invalid_mbox_file) {
if (mbox_sync(mbox, sync_flags) < 0)
ret = -1;
}
uint32_t mbox_ext_idx;
unsigned int no_mbox_file:1;
+ unsigned int invalid_mbox_file:1;
unsigned int mbox_sync_dirty:1;
unsigned int mbox_do_dirty_syncs:1;
unsigned int mbox_very_dirty_syncs:1;
if (seq == 0) {
if (istream_raw_mbox_seek(mbox->mbox_stream, 0) < 0) {
+ mbox->invalid_mbox_file = TRUE;
mail_storage_set_error(&mbox->storage->storage,
MAIL_ERROR_NOTPOSSIBLE,
"Mailbox isn't a valid mbox file");