{"record":{"id":"bcd2951d10dd00b7","repo":"jstedfast/MailKit","slug":"the-pop3-server-does-not-support-the-utf8-extension","errorCode":null,"errorMessage":"The POP3 server does not support the UTF8 extension.","messagePattern":"The POP3 server does not support the UTF8 extension\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"MailKit/Net/Pop3/Pop3Client.cs","lineNumber":1594,"sourceCode":"\t\t\toctets = total = 0;\n\t\t\tengine.Uri = null;\n\n\t\t\tif (host != null)\n\t\t\t\tOnDisconnected (host, port, options, requested);\n\t\t}\n\n\t\t#endregion\n\n\t\tbool CheckCanEnableUTF8 ()\n\t\t{\n\t\t\tCheckDisposed ();\n\t\t\tCheckConnected ();\n\n\t\t\tif (engine.State != Pop3EngineState.Connected)\n\t\t\t\tthrow new InvalidOperationException (\"You must enable UTF-8 mode before authenticating.\");\n\n\t\t\tif ((engine.Capabilities & Pop3Capabilities.UTF8) == 0)\n\t\t\t\tthrow new NotSupportedException (\"The POP3 server does not support the UTF8 extension.\");\n\n\t\t\treturn !utf8;\n\t\t}\n\n\t\t/// <summary>\n\t\t/// Enable UTF8 mode.\n\t\t/// </summary>\n\t\t/// <remarks>\n\t\t/// The POP3 UTF8 extension allows the client to retrieve messages in the UTF-8 encoding and\n\t\t/// may also allow the user to authenticate using a UTF-8 encoded username or password.\n\t\t/// </remarks>\n\t\t/// <param name=\"cancellationToken\">The cancellation token.</param>\n\t\t/// <exception cref=\"System.ObjectDisposedException\">\n\t\t/// The <see cref=\"Pop3Client\"/> has been disposed.\n\t\t/// </exception>\n\t\t/// <exception cref=\"ServiceNotConnectedException\">\n\t\t/// The <see cref=\"Pop3Client\"/> is not connected.\n\t\t/// </exception>","sourceCodeStart":1576,"sourceCodeEnd":1612,"githubUrl":"https://github.com/jstedfast/MailKit/blob/9d3859a7855e3e17582c07fd01972b8e262bf176/MailKit/Net/Pop3/Pop3Client.cs#L1576-L1612","documentation":"Pop3Client.EnableUTF8 throws this NotSupportedException when the connected POP3 server did not advertise the UTF8 capability in its CAPA response. The UTF8 extension (RFC 6856) is optional, so the client cannot switch the session into UTF-8 mode and refuses instead of sending an unsupported command.","triggerScenarios":"Calling EnableUTF8 (directly or via options likeauthentication with UTF-8 credentials) against a server whose CAPA output lacks UTF8; older POP3 servers or minimal/embedded servers without RFC 6856 support.","commonSituations":"Authenticating with non-ASCII usernames/passwords against a legacy server; connecting to old ISP or appliance POP3 servers; assuming all modern servers implement every RFC extension.","solutions":["Don't call EnableUTF8; guard by checking client.Capabilities.HasFlag (Pop3Capabilities.UTF8) first.","Use ASCII credentials, or rely on SASL mechanisms that handle encoding (e.g. plain SASL over TLS).","Upgrade or reconfigure the POP3 server to advertise UTF8 if internationalized credentials are required.","Wrap EnableUTF8 in try/catch for NotSupportedException and continue without UTF-8 mode."],"exampleFix":"// before\nclient.Connect (host, port);\nclient.EnableUTF8 ();\nclient.Authenticate (user, pass);\n// after\nclient.Connect (host, port);\nif (client.Capabilities.HasFlag (Pop3Capabilities.UTF8))\n    client.EnableUTF8 ();\nclient.Authenticate (user, pass);","handlingStrategy":"validation","validationCode":"bool utf8Supported = client.Capabilities.HasFlag (Pop3Capabilities.UTF8);\nif (!utf8Supported)\n    return; // skip UTF-8 mode; use ASCII credentials or SASL","typeGuard":null,"tryCatchPattern":"try {\n    client.EnableUTF8 (cancellationToken);\n} catch (NotSupportedException) {\n    // server lacks UTF8 extension: proceed without it\n}","preventionTips":["Feature-test capabilities before calling extension-specific APIs (Capababilities.HasFlag)","Avoid non-ASCII credentials unless the server advertises UTF8","Prefer SASL authentication mechanisms over raw AUTH for encoding-sensitive credentials"],"tags":["pop3","utf8","capability","mailkit","rfc6856"],"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"}