From: Timo Sirainen Date: Mon, 14 Jun 2004 04:54:05 +0000 (+0300) Subject: fixes X-Git-Tag: 1.1.alpha1~3987 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ab3c1eab9ca13916358a9e8b12df8212fefb7dbf;p=thirdparty%2Fdovecot%2Fcore.git fixes --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/mbox/mbox-sync-rewrite.c b/src/lib-storage/index/mbox/mbox-sync-rewrite.c index 2903489794..8e936b8f4b 100644 --- a/src/lib-storage/index/mbox/mbox-sync-rewrite.c +++ b/src/lib-storage/index/mbox/mbox-sync-rewrite.c @@ -394,7 +394,7 @@ int mbox_sync_rewrite(struct mbox_sync_context *sync_ctx, buffer_t *mails_buf, // FIXME: error handling ret = -1; } - mails[1].from_offset -= offset - end_offset; + mails[1].from_offset -= end_offset - start_offset; idx++; start_offset += offset - end_offset; diff --git a/src/lib-storage/index/mbox/mbox-sync.c b/src/lib-storage/index/mbox/mbox-sync.c index 91be657d8e..cda172fb0b 100644 --- a/src/lib-storage/index/mbox/mbox-sync.c +++ b/src/lib-storage/index/mbox/mbox-sync.c @@ -203,14 +203,18 @@ update_from_offsets(struct index_mailbox *ibox, struct mail_index_transaction *t, buffer_t *mails_buf, uint32_t seq1, uint32_t seq2) { - uint32_t extra_idx = ibox->mbox_extra_idx; const struct mbox_sync_mail *mails; + uint32_t extra_idx = ibox->mbox_extra_idx; + uint64_t offset; mails = buffer_get_modifyable_data(mails_buf, NULL); for (; seq1 <= seq2; seq1++, mails++) { - uint64_t offset = mails->from_offset; - mail_index_update_extra_rec(t, seq1, extra_idx, &offset); + if (mails->uid != 0) { + offset = mails->from_offset; + mail_index_update_extra_rec(t, seq1, extra_idx, + &offset); + } } }