]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
X-IMAPbase update fix
authorTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2004 22:06:40 +0000 (01:06 +0300)
committerTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2004 22:06:40 +0000 (01:06 +0300)
--HG--
branch : HEAD

src/lib-storage/index/mbox/mbox-sync.c

index 3474b83d1c68d0711f332fd2cce0fdaf914fec27..7c2e29553d6be1dbbfcfa541ad4903f2c41cefb1 100644 (file)
@@ -958,6 +958,15 @@ static int mbox_sync_update_imap_base(struct mbox_sync_context *sync_ctx)
 {
        struct mbox_sync_mail_context mail_ctx;
 
+       if (istream_raw_mbox_seek(sync_ctx->input, 0) < 0) {
+               /* doesn't begin with a From-line, which is weird because it
+                  just did. */
+               mail_storage_set_critical(sync_ctx->ibox->box.storage,
+                       "Unexpectedly lost From-header line from mbox file %s",
+                       sync_ctx->ibox->path);
+               return -1;
+       }
+
        sync_ctx->t = mail_index_transaction_begin(sync_ctx->sync_view, FALSE);
        sync_ctx->update_base_uid_last = sync_ctx->next_uid-1;