if (mbox_sync_read_index_syncs(sync_ctx, uid, &expunged) < 0)
return -1;
- if (uid != 0) {
+ rec = NULL;
+ if (uid != 0 && !mail_ctx->pseudo) {
ret = mbox_sync_read_index_rec(sync_ctx, uid, &rec);
if (ret < 0)
return -1;
/* this UID was already in index and it was
expunged */
uid = 0;
+ rec = NULL;
}
}
if (uid == 0) {
mail_ctx->need_rewrite = TRUE;
mail_ctx->mail.uid = sync_ctx->next_uid++;
sync_ctx->prev_msg_uid = mail_ctx->mail.uid;
- rec = NULL;
}
if (!expunged) {
return ret;
}
- if (!expunged) {
+ if (!expunged && !mail_ctx->pseudo) {
if (mbox_sync_update_index(sync_ctx, &mail_ctx->mail,
rec) < 0)
return -1;