changeset 3673:9dd3cdef8644 HEAD

When expunging the first mail that has X-IMAPbase header and moving it to next mail, make sure the X-UID header gets appended after X-IMAPbase header. Otherwise UIDs of all mails will change.
author Timo Sirainen <tss@iki.fi>
date Thu, 27 Oct 2005 12:28:23 +0300
parents b18e05b0170d
children 0bca23bf1b71
files src/lib-storage/index/mbox/mbox-sync-parse.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync-parse.c	Thu Oct 20 12:27:47 2005 +0300
+++ b/src/lib-storage/index/mbox/mbox-sync-parse.c	Thu Oct 27 12:28:23 2005 +0300
@@ -372,6 +372,13 @@
 	ctx->sync_ctx->prev_msg_uid = value;
 	ctx->mail.uid = value;
 
+	if (ctx->sync_ctx->dest_first_mail && ctx->seq != 1) {
+		/* if we're expunging the first mail, delete this header since
+		   otherwise X-IMAPbase header would be added after this, which
+		   we don't like */
+		return FALSE;
+	}
+
 	ctx->hdr_pos[MBOX_HDR_X_UID] = str_len(ctx->header);
 	ctx->parsed_uid = value;
 	parse_trailing_whitespace(ctx, hdr);