{"record":{"id":"651336364c1b9319","repo":"jstedfast/MailKit","slug":"the-imap-server-does-not-support-the-utf8-accept-extension","errorCode":null,"errorMessage":"The IMAP server does not support the UTF8=ACCEPT extension.","messagePattern":"The IMAP server does not support the UTF8=ACCEPT extension\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"MailKit/Net/Imap/ImapClient.cs","lineNumber":462,"sourceCode":"\t\t\tif (!TryQueueEnableQuickResyncCommand (cancellationToken, out var ic))\n\t\t\t\treturn;\n\n\t\t\tengine.Run (ic);\n\n\t\t\tProcessEnableResponse (ic);\n\t\t}\n\n\t\tbool TryQueueEnableUTF8Command (CancellationToken cancellationToken, [NotNullWhen (true)] out ImapCommand? ic)\n\t\t{\n\t\t\tCheckDisposed ();\n\t\t\tCheckConnected ();\n\t\t\tCheckAuthenticated ();\n\n\t\t\tif (engine.State != ImapEngineState.Authenticated)\n\t\t\t\tthrow new InvalidOperationException (\"UTF8=ACCEPT needs to be enabled immediately after authenticating.\");\n\n\t\t\tif ((engine.Capabilities & ImapCapabilities.UTF8Accept) == 0)\n\t\t\t\tthrow new NotSupportedException (\"The IMAP server does not support the UTF8=ACCEPT extension.\");\n\n\t\t\tif (engine.UTF8Enabled) {\n\t\t\t\tic = null;\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tic = engine.QueueCommand (cancellationToken, null, \"ENABLE UTF8=ACCEPT\\r\\n\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Enable the UTF8=ACCEPT extension.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// Enables the <a href=\"https://tools.ietf.org/html/rfc6855\">UTF8=ACCEPT</a> extension.\n\t\t/// </remarks>\n\t\t/// <param name=\"cancellationToken\">The cancellation token.</param>","sourceCodeStart":444,"sourceCodeEnd":480,"githubUrl":"https://github.com/jstedfast/MailKit/blob/9d3859a7855e3e17582c07fd01972b8e262bf176/MailKit/Net/Imap/ImapClient.cs#L444-L480","documentation":"MailKit throws this NotSupportedException when EnableUTF8 is called but the server's CAPABILITY response did not include UTF8=ACCEPT (ImapCapabilities.UTF8Accept). The RFC 6855 extension must be advertised by the server; the client cannot enable it unilaterally.","triggerScenarios":"Calling EnableUTF8() while (engine.Capabilities & ImapCapabilities.UTF8Accept) == 0 — the server did not advertise UTF8=ACCEPT.","commonSituations":"Connecting to servers without RFC 6855 support (older Dovecot/Courier configs); calling EnableUTF8 unconditionally in cross-server code; expecting UTF8 mailbox names to work on legacy servers.","solutions":["Check (client.Capabilities & ImapCapabilities.UTF8Accept) != 0 before calling EnableUTF8","Fall back to modified-UTF7 mailbox naming (ImapFolder encoding handles this automatically) when unsupported","Enable RFC 6855 support on the server if internationalized mailbox names/headers are required"],"exampleFix":"// before\nclient.EnableUTF8 ();\n// after\nif ((client.Capabilities & ImapCapabilities.UTF8Accept) != 0)\n    client.EnableUTF8 ();","handlingStrategy":"fallback","validationCode":"if ((client.Capabilities & ImapCapabilities.UTF8Accept) == 0) return; // use modified-UTF7 names instead","typeGuard":"bool SupportsUtf8Accept (ImapClient c) => (c.Capabilities & ImapCapabilities.UTF8Accept) != 0;","tryCatchPattern":"try { client.EnableUTF8 (); } catch (NotSupportedException) { /* fall back to modified UTF-7 mailbox names */ }","preventionTips":["Check UTF8Accept capability before enabling","Rely on MailKit's automatic modified-UTF7 encoding as the default path","Document server requirements if internationalized names are mandatory"],"tags":["imap","utf8","notsupported","capability","mailkit"],"backgroundTag":"feature-not-enabled","analyzedSha":"9d3859a7855e3e17582c07fd01972b8e262bf176","analyzedAt":"2026-09-15T15:46:11.592Z","contentChangedAt":"2026-09-15T15:46:11.592Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}