Mercurial > dovecot > core-2.2
changeset 18947:41fabc9aa4c7
lazy-expunge: If MAIL_FETCH_REFCOUNT fails because mail is expunged, ignore the error.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 17 Aug 2015 19:31:42 +0300 |
parents | c71c4dceee97 |
children | b9ccd6349654 |
files | src/plugins/lazy-expunge/lazy-expunge-plugin.c |
diffstat | 1 files changed, 8 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- 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') {