[dovecot-cvs] dovecot/src/lib-storage/index/mbox mbox-sync-parse.c, 1.40, 1.41 mbox-sync.c, 1.150, 1.151

cras at dovecot.org cras at dovecot.org
Fri Apr 22 23:55:38 EEST 2005


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

Modified Files:
	mbox-sync-parse.c mbox-sync.c 
Log Message:
Fixes to expunging first mail.



Index: mbox-sync-parse.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync-parse.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- mbox-sync-parse.c	8 Apr 2005 15:08:53 -0000	1.40
+++ mbox-sync-parse.c	22 Apr 2005 20:55:36 -0000	1.41
@@ -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

Index: mbox-sync.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/mbox/mbox-sync.c,v
retrieving revision 1.150
retrieving revision 1.151
diff -u -d -r1.150 -r1.151
--- mbox-sync.c	17 Apr 2005 15:53:41 -0000	1.150
+++ mbox-sync.c	22 Apr 2005 20:55:36 -0000	1.151
@@ -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;
 }
 



More information about the dovecot-cvs mailing list