From: Timo Sirainen Date: Thu, 2 Apr 2020 20:52:46 +0000 (+0300) Subject: lib-index: Add mail_cache_corrupted event X-Git-Tag: 2.3.11.2~359 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=97cbe4b6d371984fee323b6d10f2b3b74a97f844;p=thirdparty%2Fdovecot%2Fcore.git lib-index: Add mail_cache_corrupted event --- diff --git a/src/lib-index/mail-cache.c b/src/lib-index/mail-cache.c index f409b01716..4de6aea9dd 100644 --- a/src/lib-index/mail-cache.c +++ b/src/lib-index/mail-cache.c @@ -44,10 +44,13 @@ void mail_cache_set_corrupted(struct mail_cache *cache, const char *fmt, ...) va_start(va, fmt); T_BEGIN { - mail_index_set_error(cache->index, - "Corrupted index cache file %s: %s", - cache->filepath, - t_strdup_vprintf(fmt, va)); + const char *reason = t_strdup_vprintf(fmt, va); + const char *errstr = t_strdup_printf( + "Deleting corrupted file: %s", reason); + e_error(event_create_passthrough(cache->event)-> + set_name("mail_cache_corrupted")-> + add_str("reason", reason)->event(), "%s", errstr); + mail_index_set_error_nolog(cache->index, errstr); } T_END; va_end(va); }