]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap: Move ENABLE's mail_utf8_extensions check to UTF8=ACCEPT callback
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 10 Feb 2025 07:51:17 +0000 (09:51 +0200)
committerAki Tuomi <aki.tuomi@open-xchange.com>
Wed, 12 Feb 2025 10:34:39 +0000 (12:34 +0200)
src/imap/imap-client.c

index 628e22f6e1bafff85923a685bc416fdbe8f89b94..0e51012311b5f003831117b7b26138a01b657f73 100644 (file)
@@ -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;