changeset 3200:a9a5a399a027 HEAD

When writing the dummy message after all messages were expunged from mbox, the UIDVALIDITY value was set to 0 if X-IMAP/X-IMAPbase header wasn't read. This caused the next parsing to treat the header invalid and didn't recognize it as dummy message.
author Timo Sirainen <tss@iki.fi>
date Mon, 14 Mar 2005 16:32:48 +0200
parents 938f948651f1
children 2bf86099376e
files src/lib-storage/index/mbox/mbox-sync.c
diffstat 1 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/mbox/mbox-sync.c	Sun Mar 13 01:51:58 2005 +0200
+++ b/src/lib-storage/index/mbox/mbox-sync.c	Mon Mar 14 16:32:48 2005 +0200
@@ -955,6 +955,11 @@
 static int mbox_write_dummy(struct mbox_sync_context *sync_ctx)
 {
 	string_t *str;
+	unsigned int uid_validity;
+
+	uid_validity = sync_ctx->base_uid_validity != 0 ?
+		sync_ctx->base_uid_validity : sync_ctx->hdr->uid_validity;
+	i_assert(uid_validity != 0);
 
 	str = t_str_new(1024);
 	str_printfa(str, "%sDate: %s\n"
@@ -968,8 +973,7 @@
                     mbox_from_create("MAILER_DAEMON", ioloop_time),
 		    message_date_create(ioloop_time),
 		    my_hostname, dec2str(ioloop_time), my_hostname,
-		    sync_ctx->base_uid_validity,
-		    sync_ctx->next_uid-1);
+		    uid_validity, sync_ctx->next_uid-1);
 
 	if (pwrite_full(sync_ctx->fd, str_data(str), str_len(str), 0) < 0) {
 		if (!ENOSPACE(errno)) {