From ef2bf6cca3dec42f61b50f90d2d283a7a697ebfe Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 10 Feb 2025 09:51:17 +0200 Subject: [PATCH] imap: Move ENABLE's mail_utf8_extensions check to UTF8=ACCEPT callback --- src/imap/imap-client.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/imap/imap-client.c b/src/imap/imap-client.c index 628e22f6e1..0e51012311 100644 --- a/src/imap/imap-client.c +++ b/src/imap/imap-client.c @@ -1575,13 +1575,6 @@ bool client_enable(struct client *client, unsigned int feature_idx) return TRUE; const struct imap_feature *feat = imap_feature_idx(feature_idx); - - if ((feat->mailbox_features & MAILBOX_FEATURE_UTF8ACCEPT) != 0 && - !client->set->mail_utf8_extensions) { - e_debug(client->event, "Client attempted to enable UTF8 when it's disabled"); - return FALSE; - } - if (!feat->callback(client)) return FALSE; @@ -1640,6 +1633,11 @@ static bool imap_client_enable_qresync(struct client *client) #ifdef EXPERIMENTAL_MAIL_UTF8 static bool imap_client_enable_utf8accept(struct client *client) { + if (!client->set->mail_utf8_extensions) { + e_debug(client->event, "Client attempted to enable UTF8 when it's disabled"); + return FALSE; + } + if (client->mailbox != NULL) mailbox_enable(client->mailbox, MAILBOX_FEATURE_UTF8ACCEPT); return TRUE; -- 2.47.3