{"record":{"id":"7c7f517f007131a8","repo":"jstedfast/MailKit","slug":"the-imap-server-does-not-support-the-id-extension","errorCode":null,"errorMessage":"The IMAP server does not support the ID extension.","messagePattern":"The IMAP server does not support the ID extension\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"warning","filePath":"MailKit/Net/Imap/ImapClient.cs","lineNumber":524,"sourceCode":"\t\t/// An IMAP protocol error occurred.\n\t\t/// </exception>\n\t\tpublic void EnableUTF8 (CancellationToken cancellationToken = default)\n\t\t{\n\t\t\tif (!TryQueueEnableUTF8Command (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\tImapCommand QueueIdentifyCommand (ImapImplementation clientImplementation, CancellationToken cancellationToken)\n\t\t{\n\t\t\tCheckDisposed ();\n\t\t\tCheckConnected ();\n\n\t\t\tif ((engine.Capabilities & ImapCapabilities.Id) == 0)\n\t\t\t\tthrow new NotSupportedException (\"The IMAP server does not support the ID extension.\");\n\n\t\t\tvar command = new StringBuilder (\"ID \");\n\t\t\tvar args = new List<object> ();\n\n\t\t\tif (clientImplementation != null && clientImplementation.Properties.Count > 0) {\n\t\t\t\tcommand.Append ('(');\n\t\t\t\tforeach (var property in clientImplementation.Properties) {\n\t\t\t\t\tcommand.Append (\"%Q \");\n\t\t\t\t\targs.Add (property.Key);\n\n\t\t\t\t\tif (property.Value != null) {\n\t\t\t\t\t\tcommand.Append (\"%Q \");\n\t\t\t\t\t\targs.Add (property.Value);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcommand.Append (\"NIL \");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcommand[command.Length - 1] = ')';","sourceCodeStart":506,"sourceCodeEnd":542,"githubUrl":"https://github.com/jstedfast/MailKit/blob/9d3859a7855e3e17582c07fd01972b8e262bf176/MailKit/Net/Imap/ImapClient.cs#L506-L542","documentation":"ImapClient.Identify sends the IMAP ID command (RFC 2971) to exchange client/server implementation info. MailKit throws this NotSupportedException when the server did not advertise the ID capability, since the command would be rejected by the server anyway.","triggerScenarios":"Calling Identify(...) (via QueueIdentifyCommand) while (engine.Capabilities & ImapCapabilities.Id) == 0 — server CAPABILITY lacks ID.","commonSituations":"Calling Identify on servers that don't support RFC 2971 (many consumer IMAP servers); sending client info unconditionally in setup code; some servers also block ID to hide software versions.","solutions":["Check (client.Capabilities & ImapCapabilities.Id) != 0 before calling Identify","Skip identification gracefully — it is optional per RFC 2971 and not required for normal operation","If server identification is needed for debugging, use a server that supports ID or inspect IMAP greeting/capabilities instead"],"exampleFix":"// before\nclient.Identify (new ImapImplementation { Name = \"MyApp\" });\n// after\nif ((client.Capabilities & ImapCapabilities.Id) != 0)\n    client.Identify (new ImapImplementation { Name = \"MyApp\" });","handlingStrategy":"validation","validationCode":"if ((client.Capabilities & ImapCapabilities.Id) != 0) client.Identify (impl);","typeGuard":"bool SupportsId (ImapClient c) => (c.Capabilities & ImapCapabilities.Id) != 0;","tryCatchPattern":"try { client.Identify (impl); } catch (NotSupportedException) { /* server lacks RFC 2971 ID; skip identification */ }","preventionTips":["Treat Identify as optional and capability-gated","Never include Identify in mandatory setup paths","Log capabilities to know whether ID info is available"],"tags":["imap","id-extension","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"}