dovecot-1.2: dbox rebuild: Dont try to give unknown maildir file...

dovecot at dovecot.org dovecot at dovecot.org
Thu Jan 22 06:44:14 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/b45d3705f7d5
changeset: 8676:b45d3705f7d5
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Jan 22 02:42:35 2009 +0200
description:
dbox rebuild: Dont try to give unknown maildir files UIDs that are after uidlist's nextuid.
Although it might allow keeping the same UIDs after repeated rebuilds, if
any of the files were deleted at some point the UIDs would change and that
would be just worse.

diffstat:

1 file changed, 1 insertion(+), 16 deletions(-)
src/lib-storage/index/dbox/dbox-sync-rebuild.c |   17 +----------------

diffs (35 lines):

diff -r 3be909959c02 -r b45d3705f7d5 src/lib-storage/index/dbox/dbox-sync-rebuild.c
--- a/src/lib-storage/index/dbox/dbox-sync-rebuild.c	Thu Jan 22 02:39:52 2009 +0200
+++ b/src/lib-storage/index/dbox/dbox-sync-rebuild.c	Thu Jan 22 02:42:35 2009 +0200
@@ -339,30 +339,15 @@ static int dbox_sync_new_maildir(struct 
 static int dbox_sync_new_maildir(struct dbox_sync_rebuild_context *ctx)
 {
 	struct mail_index_view *trans_view;
-	const struct mail_index_header *hdr;
 	char *const *fnames;
 	unsigned int i, count;
-	uint32_t next_uid, seq;
 	int ret = 0;
 
 	fnames = array_get(&ctx->maildir_new_files, &count);
 	if (count == 0)
 		return 0;
 
-	/* try to give them UIDs beginning from uidlist's next_uid */
-	next_uid = maildir_uidlist_get_next_uid(ctx->maildir_uidlist);
-	trans_view = mail_index_transaction_open_updated_view(ctx->trans);
-	for (i = 0; i < count; i++) {
-		if (mail_index_lookup_seq(trans_view, next_uid, &seq))
-			break;
-	}
-
-	if (i == count)
-		ctx->maildir_new_uid = next_uid;
-	else {
-		hdr = mail_index_get_header(trans_view);
-		ctx->maildir_new_uid = hdr->next_uid;
-	}
+	ctx->maildir_new_uid = mail_index_get_header(trans_view)->next_uid;
 	mail_index_view_close(&trans_view);
 
 	for (i = 0; i < count && ret == 0; i++) {


More information about the dovecot-cvs mailing list