]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Make mail error UID reporting consistent for corrupted cache
authorKarl Fleischmann <karl.fleischmann@open-xchange.com>
Tue, 7 Feb 2023 10:07:05 +0000 (11:07 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Thu, 9 Feb 2023 19:00:52 +0000 (19:00 +0000)
src/lib-index/mail-cache.c
src/lib-storage/mail-storage.c
src/lib-storage/test-mail.c

index 9016414e75ca6247aad61599971ee2c1ed4c1ba8..44e91461206e55c364dd321c3acdee65f2249909 100644 (file)
@@ -75,7 +75,7 @@ void mail_cache_set_seq_corrupted_reason(struct mail_cache_view *cache_view,
 
        mail_index_lookup_uid(cache_view->view, seq, &uid);
        const char *errstr = t_strdup_printf(
-               "Deleting corrupted cache record uid=%u: %s", uid, reason);
+               "UID %u: Deleting corrupted cache record: %s", uid, reason);
        e_error(event_create_passthrough(cache->event)->
                set_name("mail_cache_record_corrupted")->
                add_int("uid", uid)->
index 57731820dfb8ae35a93df21f01a1a15243a408cf..40c17e17974c1c0a6a882eb69d9b8b38c6c0efea 100644 (file)
@@ -3387,9 +3387,7 @@ void mail_set_mail_cache_corrupted(struct mail *mail, const char *fmt, ...)
 
        T_BEGIN {
                mail_cache_set_seq_corrupted_reason(cache_view, mail->seq,
-                       t_strdup_printf("UID %u: %s",
-                                       mail->uid,
-                                       t_strdup_vprintf(fmt, va)));
+                                                   t_strdup_vprintf(fmt, va));
        } T_END;
 
        /* update also the storage's internal error */
index 260e09438dcac87bef414817da061523d5c2c6d8..8d60da69f08657bfc74037a3db035dd5a4cc4af0 100644 (file)
@@ -464,7 +464,7 @@ static void test_bodystructure_corruption_reparsing(void)
        mail_set_seq(mail, 1);
 
        test_assert(mail_get_special(mail, MAIL_FETCH_IMAP_BODY, &value) == 0);
-       test_expect_error_string("Mailbox INBOX: Deleting corrupted cache record uid=1: UID 1: Broken MIME parts in mailbox INBOX: test");
+       test_expect_error_string("Mailbox INBOX: UID 1: Deleting corrupted cache record: Broken MIME parts in mailbox INBOX: test");
        mail_set_cache_corrupted(mail, MAIL_FETCH_MESSAGE_PARTS, "test");
        test_expect_no_more_errors();
        test_assert(mail_get_special(mail, MAIL_FETCH_IMAP_BODYSTRUCTURE, &value) == 0);