dovecot-1.1: maildir: Convert dovecot-uidlist files to new forma...

dovecot at dovecot.org dovecot at dovecot.org
Sat Jun 21 15:53:47 EEST 2008


details:   http://hg.dovecot.org/dovecot-1.1/rev/5a1cc688483b
changeset: 7705:5a1cc688483b
user:      Timo Sirainen <tss at iki.fi>
date:      Sat Jun 21 15:53:43 2008 +0300
description:
maildir: Convert dovecot-uidlist files to new format immediately when
opening them. Without this it's possible that entries are appended to old
format uidlist in the new format.

diffstat:

1 file changed, 10 insertions(+)
src/lib-storage/index/maildir/maildir-uidlist.c |   10 ++++++++++

diffs (20 lines):

diff -r b27339913053 -r 5a1cc688483b src/lib-storage/index/maildir/maildir-uidlist.c
--- a/src/lib-storage/index/maildir/maildir-uidlist.c	Sat Jun 21 04:39:32 2008 +0300
+++ b/src/lib-storage/index/maildir/maildir-uidlist.c	Sat Jun 21 15:53:43 2008 +0300
@@ -323,6 +323,16 @@ static void maildir_uidlist_update_hdr(s
 	}
 
 	mhdr = &uidlist->mbox->maildir_hdr;
+	if (mhdr->uidlist_mtime == 0) {
+		if (!uidlist->initial_read)
+			(void)maildir_uidlist_refresh(uidlist);
+		if (uidlist->version != UIDLIST_VERSION) {
+			/* upgrading from older verson. don't update the
+			   uidlist times until it uses the new format */
+			uidlist->recreate = TRUE;
+			return;
+		}
+	}
 	mhdr->uidlist_mtime = st->st_mtime;
 	mhdr->uidlist_mtime_nsecs = ST_MTIME_NSEC(*st);
 	mhdr->uidlist_size = st->st_size;


More information about the dovecot-cvs mailing list