]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Change default mail_cache_fields
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 28 Feb 2025 11:23:45 +0000 (13:23 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 7 Mar 2025 08:01:55 +0000 (10:01 +0200)
The new default reflects the fields used by IMAP clients commonly nowadays.

Unit test must be changed also a bit to pass with the changes, since when
returning header from cache it drops the CR character.

src/lib-settings/settings-history-core.txt
src/lib-storage/mail-storage-settings.c
src/lib-storage/test-mail.c

index 4b999ecd139445ef1c68db00fdf8165473edda3b..961c83bf85dfdf36d36e4d996c498aeaa9e74701 100644 (file)
@@ -1,2 +1,3 @@
 default        service/lmtp/service_restart_request_count      unlimited       2.4.1   
 default        service/auth/unix_listener/auth-userdb/unix_listener_group              2.4.1   
+default        mail_cache_fields       flags   2.4.1   
index ef8ff6d440bc7643bdffd9f6fd4c4b6d234bbe3e..f8396fadab0888a7a586adfa91b0ee127ff5504c 100644 (file)
@@ -192,7 +192,18 @@ const struct mail_storage_settings mail_storage_default_settings = {
 
 static const struct setting_keyvalue mail_storage_default_settings_keyvalue[] = {
        { "layout_index/mailbox_list_storage_escape_char", "^" },
-       { "mail_cache_fields", "flags" },
+#define MAIL_CACHE_FIELDS_DEFAULT \
+       "flags " \
+       /* IMAP ENVELOPE: */ \
+       "hdr.date hdr.subject hdr.from hdr.sender hdr.reply-to hdr.to hdr.cc hdr.bcc hdr.in-reply-to hdr.message-id " \
+       /* Commonly used by clients: */ \
+       "date.received size.virtual imap.bodystructure mime.parts hdr.references " \
+       /* AppSuite, at least: */ \
+       "hdr.importance hdr.x-priority " \
+       "hdr.x-open-xchange-share-url " \
+       /* POP3: */ \
+       "pop3.uidl pop3.order"
+       { "mail_cache_fields", MAIL_CACHE_FIELDS_DEFAULT },
        { "mail_never_cache_fields", "imap.envelope" },
        { NULL, NULL }
 };
index 718684d8a5c0f0e15cea4f7bf4ca9da5a2d65c29..a2900fe91e297e8107e8fda3b15747da3e4365a1 100644 (file)
@@ -339,6 +339,7 @@ static void test_attachment_flags_during_header_fetch(void)
                .driver = "sdbox",
                .extra_input = (const char *const[]) {
                        "mail_attachment_detection_options=add-flags",
+                       "mail_cache_fields=flags",
                        "mail_never_cache_fields=mime.parts",
                        NULL
                },