Skip to content

Commit

Permalink
imapc: Don't try to add mails to index if they already exist there
Browse files Browse the repository at this point in the history
Broken by 259a4ca when imapc was used
with (not in-memory) index files.

This caused errors like "Append with UID 200, but next_uid = 201"
  • Loading branch information
sirainen authored and villesavolainen committed Mar 15, 2018
1 parent 1a4511e commit 5773cd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib-storage/index/imapc/imapc-mailbox.c
Expand Up @@ -401,7 +401,8 @@ imapc_mailbox_msgmap_update(struct imapc_mailbox *mbox,
} else {
/* newly seen message */
imapc_msgmap_append(msgmap, rseq, uid);
if (uid < mbox->min_append_uid) {
if (uid < mbox->min_append_uid ||
uid < mail_index_get_header(mbox->delayed_sync_view)->next_uid) {
/* message is already added to index */
} else {
mail_index_append(mbox->delayed_sync_trans,
Expand Down

0 comments on commit 5773cd2

Please sign in to comment.