dovecot-2.0: sdbox: Don't break when trying to access mail that'...

dovecot at dovecot.org dovecot at dovecot.org
Sun Mar 21 16:50:14 EET 2010


details:   http://hg.dovecot.org/dovecot-2.0/rev/d87741f0e95a
changeset: 10963:d87741f0e95a
user:      Timo Sirainen <tss at iki.fi>
date:      Sun Mar 21 16:50:11 2010 +0200
description:
sdbox: Don't break when trying to access mail that's just being expunged.

diffstat:

 src/lib-storage/index/dbox-single/sdbox-mail.c |  14 ++++----------
 1 files changed, 4 insertions(+), 10 deletions(-)

diffs (25 lines):

diff -r b7d7b44fcbc8 -r d87741f0e95a src/lib-storage/index/dbox-single/sdbox-mail.c
--- a/src/lib-storage/index/dbox-single/sdbox-mail.c	Fri Mar 19 21:40:13 2010 +0200
+++ b/src/lib-storage/index/dbox-single/sdbox-mail.c	Sun Mar 21 16:50:11 2010 +0200
@@ -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)


More information about the dovecot-cvs mailing list