From: Timo Sirainen Date: Mon, 10 Feb 2025 07:51:17 +0000 (+0200) Subject: imap: Move ENABLE's mail_utf8_extensions check to UTF8=ACCEPT callback X-Git-Tag: 2.4.1~228 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ef2bf6cca3dec42f61b50f90d2d283a7a697ebfe;p=thirdparty%2Fdovecot%2Fcore.git imap: Move ENABLE's mail_utf8_extensions check to UTF8=ACCEPT callback --- 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;