From: Timo Sirainen Date: Sat, 31 May 2008 11:27:27 +0000 (+0300) Subject: Rewrite X-IMAPbase: header before updating index file header, so that we X-Git-Tag: 1.1.rc8~19 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4ca7ca056c5039424c66581582052881854794a3;p=thirdparty%2Fdovecot%2Fcore.git Rewrite X-IMAPbase: header before updating index file header, so that we write the latest mtime as sync_stamp. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index fc632b0573..3cdcc3aef2 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -1534,6 +1534,14 @@ static int mbox_sync_do(struct mbox_sync_context *sync_ctx, ignore them, as we've overwritten them above. */ index_sync_changes_reset(sync_ctx->sync_changes); + if (sync_ctx->base_uid_last != sync_ctx->next_uid-1 && + ret == 0 && !sync_ctx->delay_writes && + sync_ctx->base_uid_last_offset != 0) { + /* Rewrite uid_last in X-IMAPbase header if we've seen it + (ie. the file isn't empty) */ + ret = mbox_rewrite_base_uid_last(sync_ctx); + } + if (mbox_sync_update_index_header(sync_ctx) < 0) return -1; @@ -1791,14 +1799,6 @@ again: sync_ctx.t = NULL; sync_ctx.index_sync_ctx = NULL; - if (sync_ctx.base_uid_last != sync_ctx.next_uid-1 && - ret == 0 && !sync_ctx.delay_writes && - sync_ctx.base_uid_last_offset != 0) { - /* Rewrite uid_last in X-IMAPbase header if we've seen it - (ie. the file isn't empty) */ - ret = mbox_rewrite_base_uid_last(&sync_ctx); - } - if (ret == 0 && mbox->mbox_fd != -1 && mbox->ibox.keep_recent && !sync_ctx.mbox->mbox_readonly) { /* try to set atime back to its original value */