[dovecot-cvs] dovecot/src/lib-storage/index/maildir maildir-uidlist.c, 1.51.2.7, 1.51.2.8

tss at dovecot.org tss at dovecot.org
Mon Mar 19 15:59:19 EET 2007


Update of /var/lib/cvs/dovecot/src/lib-storage/index/maildir
In directory talvi:/tmp/cvs-serv31364

Modified Files:
      Tag: branch_1_0
	maildir-uidlist.c 
Log Message:
If uidlist file doesn't exist but index files do, resync the maildir to
create the uidlist.



Index: maildir-uidlist.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/maildir/maildir-uidlist.c,v
retrieving revision 1.51.2.7
retrieving revision 1.51.2.8
diff -u -d -r1.51.2.7 -r1.51.2.8
--- maildir-uidlist.c	10 Mar 2007 20:58:44 -0000	1.51.2.7
+++ maildir-uidlist.c	19 Mar 2007 13:59:17 -0000	1.51.2.8
@@ -468,8 +468,19 @@
 	unsigned int idx;
 
 	rec = maildir_uidlist_lookup_rec(uidlist, uid, &idx);
-	if (rec == NULL)
-		return NULL;
+	if (rec == NULL) {
+		if (uidlist->last_mtime != 0)
+			return NULL;
+
+		/* the uidlist doesn't exist. */
+		if (maildir_storage_sync_force(uidlist->mbox) < 0)
+			return NULL;
+
+		/* try again */
+		rec = maildir_uidlist_lookup_rec(uidlist, uid, &idx);
+		if (rec == NULL)
+			return NULL;
+	}
 
 	*flags_r = rec->flags;
 	return rec->filename;



More information about the dovecot-cvs mailing list