dovecot-2.2: lazy-expunge: If MAIL_FETCH_REFCOUNT fails because ...

dovecot at dovecot.org dovecot at dovecot.org
Mon Aug 17 16:32:25 UTC 2015


details:   http://hg.dovecot.org/dovecot-2.2/rev/41fabc9aa4c7
changeset: 18947:41fabc9aa4c7
user:      Timo Sirainen <tss at iki.fi>
date:      Mon Aug 17 19:31:42 2015 +0300
description:
lazy-expunge: If MAIL_FETCH_REFCOUNT fails because mail is expunged, ignore the error.

diffstat:

 src/plugins/lazy-expunge/lazy-expunge-plugin.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r c71c4dceee97 -r 41fabc9aa4c7 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Aug 17 19:28:55 2015 +0300
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon Aug 17 19:31:42 2015 +0300
@@ -150,13 +150,19 @@
 {
 	struct lazy_expunge_transaction *lt =
 		LAZY_EXPUNGE_CONTEXT(_mail->transaction);
-	const char *value;
+	const char *value, *errstr;
 	unsigned long refcount;
+	enum mail_error error;
 
 	if (mail_get_special(_mail, MAIL_FETCH_REFCOUNT, &value) < 0) {
+		errstr = mailbox_get_last_error(_mail->box, &error);
+		if (error == MAIL_ERROR_EXPUNGED) {
+			/* already expunged - just ignore it */
+			return 0;
+		}
 		mail_storage_set_critical(_mail->box->storage,
 			"lazy_expunge: Couldn't lookup message's refcount: %s",
-			mailbox_get_last_error(_mail->box, NULL));
+			errstr);
 		return -1;
 	}
 	if (*value == '\0') {


More information about the dovecot-cvs mailing list