# HG changeset patch # User Timo Sirainen # Date 1110810768 -7200 # Node ID a9a5a399a027b4b6e3bfcd7681065e502dfc2e78 # Parent 938f948651f1e5f5fecdf570fb2cf515b460a8b4 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. diff -r 938f948651f1 -r a9a5a399a027 src/lib-storage/index/mbox/mbox-sync.c --- 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)) {