From: Timo Sirainen Date: Sun, 21 Mar 2010 14:50:11 +0000 (+0200) Subject: sdbox: Don't break when trying to access mail that's just being expunged. X-Git-Tag: 2.0.beta4~5 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b30584ea5916834e73dcb3672e870291968a9054;p=thirdparty%2Fdovecot%2Fcore.git sdbox: Don't break when trying to access mail that's just being expunged. --HG-- branch : HEAD --- diff --git a/src/lib-storage/index/dbox-single/sdbox-mail.c b/src/lib-storage/index/dbox-single/sdbox-mail.c index 77c55bd525..d3bfebaa07 100644 --- a/src/lib-storage/index/dbox-single/sdbox-mail.c +++ b/src/lib-storage/index/dbox-single/sdbox-mail.c @@ -15,17 +15,11 @@ static void sdbox_mail_set_expunged(struct dbox_mail *mail) { struct mail *_mail = &mail->imail.mail.mail; - struct sdbox_mailbox *mbox = (struct sdbox_mailbox *)_mail->box; - - (void)mail_index_refresh(_mail->box->index); - if (mail_index_is_expunged(_mail->transaction->view, _mail->seq)) { - mail_set_expunged(_mail); - return; - } - mail_storage_set_critical(_mail->box->storage, - "Unexpectedly lost uid=%u", _mail->uid); - mbox->sync_rebuild = TRUE; + /* syncing code first unlinks the file, and index is updated later. + so at this point we don't know if the file was unexpectedly lost + or if it's just being expunged. just assume the latter. */ + mail_set_expunged(_mail); } static bool sdbox_mail_file_set(struct dbox_mail *mail)