Skip to content

Commit

Permalink
virtual: Fix highest_mailbox_id if it's wrong
Browse files Browse the repository at this point in the history
  • Loading branch information
cmouse authored and sirainen committed Jul 18, 2017
1 parent f109cdc commit d967ba7
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/plugins/virtual/virtual-sync.c
Expand Up @@ -311,6 +311,14 @@ static void virtual_sync_ext_header_rewrite(struct virtual_sync_context *ctx)

mailbox_pos += sizeof(mailbox);
name_pos += mailbox.name_len;

/* repair the value */
if (ctx->mbox->highest_mailbox_id < mailbox.id)
ctx->mbox->highest_mailbox_id = mailbox.id;
}
if (ctx->mbox->highest_mailbox_id != ext_hdr.highest_mailbox_id) {
ext_hdr.highest_mailbox_id = ctx->mbox->highest_mailbox_id;
buffer_write(buf, 0, &ext_hdr, sizeof(ext_hdr));
}
i_assert(buf->used == name_pos);

Expand Down

0 comments on commit d967ba7

Please sign in to comment.