/* i guess in theory the empty_md5 is valid and can happen,
but it's almost guaranteed that it means the MD5 sum is
missing. recalculate it. */
- offset = istream_raw_mbox_get_start_offset(mbox->mbox_stream);
+ offset = mbox->mbox_lock_type == F_UNLCK ? 0 :
+ istream_raw_mbox_get_start_offset(mbox->mbox_stream);
mbox->mbox_save_md5 = TRUE;
if (mbox_sync(mbox, MBOX_SYNC_FORCE_SYNC |
MBOX_SYNC_READONLY) < 0)
return -1;
- if (istream_raw_mbox_seek(mbox->mbox_stream, offset) < 0) {
- i_error("mbox %s sync lost during MD5 syncing",
- _mail->box->name);
- return -1;
+ if (mbox->mbox_lock_type != F_UNLCK) {
+ if (istream_raw_mbox_seek(mbox->mbox_stream,
+ offset) < 0) {
+ i_error("mbox %s sync lost during MD5 syncing",
+ _mail->box->name);
+ return -1;
+ }
}
if (!mbox_mail_get_md5_header(mail, value_r)) {