changeset 12077:e2a267b64619

maildir: If we see duplicate file with retry_rewind set, try rewinding first.
author Timo Sirainen <tss@iki.fi>
date Mon, 06 Sep 2010 15:41:25 +0100
parents a05834588ffb
children ab72c0760133
files src/lib-storage/index/maildir/maildir-uidlist.c
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Fri Sep 03 19:10:28 2010 +0100
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Mon Sep 06 15:41:25 2010 +0100
@@ -534,9 +534,12 @@
 		/* 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 */