changeset 3314:3f0c6ed4a950 HEAD

Fixes to expunging first mail.
author Timo Sirainen <tss@iki.fi>
date Fri, 22 Apr 2005 23:55:36 +0300
parents 2fbb6e7ca781
children ced373b587a9
files src/lib-storage/index/mbox/mbox-sync-parse.c src/lib-storage/index/mbox/mbox-sync.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync-parse.c	Fri Apr 22 23:31:27 2005 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync-parse.c	Fri Apr 22 23:55:36 2005 +0300
@@ -325,7 +325,7 @@
 		return TRUE;
 	}
 
-	if (ctx->sync_ctx->dest_first_mail && !ctx->seen_imapbase) {
+	if (ctx->sync_ctx->seq == 1 && !ctx->seen_imapbase) {
 		/* Don't bother allowing X-UID before X-IMAPbase
 		   header. c-client doesn't allow it either, and this
 		   way the UID doesn't have to be reset if X-IMAPbase
--- a/src/lib-storage/index/mbox/mbox-sync.c	Fri Apr 22 23:31:27 2005 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Fri Apr 22 23:55:36 2005 +0300
@@ -601,6 +601,9 @@
 		/* expunging first message, fix space to contain next
 		   message's \n header too since it will be removed. */
 		mail_ctx->mail.space++;
+
+		/* uid-last offset is invalid now */
+                mail_ctx->sync_ctx->base_uid_last_offset = 0;
 	}
 
 	mail_ctx->sync_ctx->expunged_space += mail_ctx->mail.space;
@@ -1105,6 +1108,9 @@
 		/* out of disk space, truncate to empty */
 		(void)ftruncate(sync_ctx->write_fd, 0);
 	}
+
+	sync_ctx->base_uid_last_offset = 0; /* don't bother calculating */
+	sync_ctx->base_uid_last = sync_ctx->next_uid-1;
 	return 0;
 }