jstedfast/MailKit · error · NotSupportedException

The POP3 server does not support the UTF8 extension.

Error message

The POP3 server does not support the UTF8 extension.

What it means

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.

Solutions

  1. Don't call EnableUTF8; guard by checking client.Capabilities.HasFlag (Pop3Capabilities.UTF8) first.
  2. Use ASCII credentials, or rely on SASL mechanisms that handle encoding (e.g. plain SASL over TLS).
  3. Upgrade or reconfigure the POP3 server to advertise UTF8 if internationalized credentials are required.
  4. Wrap EnableUTF8 in try/catch for NotSupportedException and continue without UTF-8 mode.

Example fix

// before
client.Connect (host, port);
client.EnableUTF8 ();
client.Authenticate (user, pass);
// after
client.Connect (host, port);
if (client.Capabilities.HasFlag (Pop3Capabilities.UTF8))
    client.EnableUTF8 ();
client.Authenticate (user, pass);
Defensive patterns

Strategy: validation

Validate before calling

bool utf8Supported = client.Capabilities.HasFlag (Pop3Capabilities.UTF8);
if (!utf8Supported)
    return; // skip UTF-8 mode; use ASCII credentials or SASL

Try / catch

try {
    client.EnableUTF8 (cancellationToken);
} catch (NotSupportedException) {
    // server lacks UTF8 extension: proceed without it
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of jstedfast/MailKit@9d3859a785 (2026-09-15). Data as JSON: /api/errors/bcd2951d10dd00b7. Report an issue: GitHub.

Appendix: source

Thrown at MailKit/Net/Pop3/Pop3Client.cs:1594

			octets = total = 0;
			engine.Uri = null;

			if (host != null)
				OnDisconnected (host, port, options, requested);
		}

		#endregion

		bool CheckCanEnableUTF8 ()
		{
			CheckDisposed ();
			CheckConnected ();

			if (engine.State != Pop3EngineState.Connected)
				throw new InvalidOperationException ("You must enable UTF-8 mode before authenticating.");

			if ((engine.Capabilities & Pop3Capabilities.UTF8) == 0)
				throw new NotSupportedException ("The POP3 server does not support the UTF8 extension.");

			return !utf8;
		}

		/// <summary>
		/// Enable UTF8 mode.
		/// </summary>
		/// <remarks>
		/// The POP3 UTF8 extension allows the client to retrieve messages in the UTF-8 encoding and
		/// may also allow the user to authenticate using a UTF-8 encoded username or password.
		/// </remarks>
		/// <param name="cancellationToken">The cancellation token.</param>
		/// <exception cref="System.ObjectDisposedException">
		/// The <see cref="Pop3Client"/> has been disposed.
		/// </exception>
		/// <exception cref="ServiceNotConnectedException">
		/// The <see cref="Pop3Client"/> is not connected.
		/// </exception>

View on GitHub (pinned to 9d3859a785)