[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-rewrite.c, 1.62.2.7, 1.62.2.8

tss at dovecot.org tss at dovecot.org
Wed Feb 28 19:51:27 UTC 2007


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

Modified Files:
      Tag: branch_1_0
	mbox-sync-rewrite.c 
Log Message:
The previous broken X-UID header fixing code was still broken...



Index: mbox-sync-rewrite.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-rewrite.c,v
retrieving revision 1.62.2.7
retrieving revision 1.62.2.8
diff -u -d -r1.62.2.7 -r1.62.2.8
--- mbox-sync-rewrite.c	19 Feb 2007 23:28:57 -0000	1.62.2.7
+++ mbox-sync-rewrite.c	28 Feb 2007 19:51:25 -0000	1.62.2.8
@@ -330,13 +330,16 @@
 		istream_raw_mbox_get_header_offset(sync_ctx->input);
 	mail_ctx->mail.body_size = mails[idx].body_size;
 
-	/* mbox_sync_parse_next_mail() checks that UIDs are growing,
-	   so we have to fool it. */
-	sync_ctx->prev_msg_uid = mails[idx].uid == 0 ? 0 : mails[idx].uid-1;
-	/* If we originally thought that the UID was broken, force the
-	   brokeness now also. Otherwise try to make the UID what we wanted
-	   it originally. */
-	sync_ctx->next_uid = mails[idx].uid_broken ? 0 : mail_ctx->mail.uid - 1;
+	if (mails[idx].uid_broken || mails[idx].uid == 0) {
+		/* If we originally thought that the UID was broken, force the
+		   brokeness now also. Otherwise try to make the UID what we
+		   wanted it originally. */
+		sync_ctx->next_uid = mails[idx].uid;
+		sync_ctx->prev_msg_uid = sync_ctx->next_uid - 1;
+	} else {
+		sync_ctx->next_uid = 1;
+		sync_ctx->prev_msg_uid = 0;
+	}
 
 	first_mail_expunge_extra = 1 +
 		sync_ctx->first_mail_crlf_expunged ? 1 : 0;



More information about the dovecot-cvs mailing list