]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
sdbox: Don't break when trying to access mail that's just being expunged.
authorTimo Sirainen <tss@iki.fi>
Sun, 21 Mar 2010 14:50:11 +0000 (16:50 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 21 Mar 2010 14:50:11 +0000 (16:50 +0200)
--HG--
branch : HEAD

src/lib-storage/index/dbox-single/sdbox-mail.c

index 77c55bd52592f03b3e002d2d147c62999afdc9ea..d3bfebaa0761c2b7a1580e8eafb0e7c906c15a9c 100644 (file)
 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)