From: Timo Sirainen Date: Mon, 6 Sep 2010 14:41:25 +0000 (+0100) Subject: maildir: If we see duplicate file with retry_rewind set, try rewinding first. X-Git-Tag: 2.0.2~18 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f84e7cabe355c6416898b7ae82b7d59acc3c7fbd;p=thirdparty%2Fdovecot%2Fcore.git maildir: If we see duplicate file with retry_rewind set, try rewinding first. --- diff --git a/src/lib-storage/index/maildir/maildir-uidlist.c b/src/lib-storage/index/maildir/maildir-uidlist.c index d5fc253116..0ecfbc4974 100644 --- a/src/lib-storage/index/maildir/maildir-uidlist.c +++ b/src/lib-storage/index/maildir/maildir-uidlist.c @@ -534,9 +534,12 @@ static bool maildir_uidlist_next(struct maildir_uidlist *uidlist, /* This can happen if expunged file is moved back and the file was appended to uidlist. */ i_warning("%s: Duplicate file entry at line %u: " - "%s (uid %u -> %u)", + "%s (uid %u -> %u)%s", uidlist->path, uidlist->read_line_count, line, - old_rec->uid, uid); + old_rec->uid, uid, uidlist->retry_rewind ? + " - retrying by re-reading from beginning" : ""); + if (uidlist->retry_rewind) + return FALSE; /* Delete the old UID */ maildir_uidlist_records_array_delete(uidlist, old_rec); /* Replace the old record with this new one */