{"record":{"id":"223b95c964dbe93b","repo":"jstedfast/MailKit","slug":"the-imap-server-does-not-support-the-qresync-extension","errorCode":null,"errorMessage":"The IMAP server does not support the QRESYNC extension.","messagePattern":"The IMAP server does not support the QRESYNC extension\\.","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"MailKit/Net/Imap/ImapClient.cs","lineNumber":373,"sourceCode":"\t\t{\n\t\t\tvar ic = QueueCompressCommand (cancellationToken);\n\n\t\t\tengine.Run (ic);\n\n\t\t\tProcessCompressResponse (ic);\n\t\t}\n\n\t\tbool TryQueueEnableQuickResyncCommand (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 (\"QRESYNC needs to be enabled immediately after authenticating.\");\n\n\t\t\tif ((engine.Capabilities & ImapCapabilities.QuickResync) == 0)\n\t\t\t\tthrow new NotSupportedException (\"The IMAP server does not support the QRESYNC extension.\");\n\n\t\t\tif (engine.QResyncEnabled) {\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 QRESYNC CONDSTORE\\r\\n\");\n\n\t\t\treturn true;\n\t\t}\n\n\t\tvoid ProcessEnableResponse (ImapCommand ic)\n\t\t{\n\t\t\tic.ThrowIfNotOk (\"ENABLE\");\n\n\t\t\tif (engine.QuirksMode == ImapQuirksMode.iCloud) {\n\t\t\t\t// Note: iCloud's response to the `ENABLE QRESYNC CONDSTORE` command does not include an untagged response\n\t\t\t\t// notifying us that QRESYNC or CONDSTORE have been enabled. Instead, if we get a tagged OK response, we","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/jstedfast/MailKit/blob/9d3859a7855e3e17582c07fd01972b8e262bf176/MailKit/Net/Imap/ImapClient.cs#L355-L391","documentation":"MailKit throws this NotSupportedException when EnableQuickResync is called but the server did not advertise the QRESYNC capability in its CAPABILITY response. QRESYNC enables quick resynchronization of cached messages/flags, but the server must support it; the client cannot force it.","triggerScenarios":"Calling EnableQuickResync() while (engine.Capabilities & ImapCapabilities.QuickResync) == 0 — i.e. the server's CAPABILITY list lacks QRESYNC.","commonSituations":"Connecting to older or minimal IMAP servers (e.g. some Exchange configs, courier without RFC 7162) that lack QRESYNC support; enabling it unconditionally in code without checking capabilities.","solutions":["Check (client.Capabilities & ImapCapabilities.QuickResync) != 0 before calling EnableQuickResync","Skip QRESYNC and use the normal IMAP flow (UNCHANGE/CONDSTORE may still be available) when the capability is absent","Update or reconfigure the IMAP server to enable RFC 7162 support if quick resync is required"],"exampleFix":"// before\nclient.EnableQuickResync ();\n// after\nif ((client.Capabilities & ImapCapabilities.QuickResync) != 0)\n    client.EnableQuickResync ();","handlingStrategy":"fallback","validationCode":"if ((client.Capabilities & ImapCapabilities.QuickResync) == 0) return; // skip QRESYNC","typeGuard":"bool SupportsQresync (ImapClient c) => (c.Capabilities & ImapCapabilities.QuickResync) != 0;","tryCatchPattern":"try { client.EnableQuickResync (); } catch (NotSupportedException) { /* proceed without QRESYNC; use CONDSTORE or full sync */ }","preventionTips":["Always gate extension ENABLE calls behind capability checks","Design sync logic to degrade gracefully without QRESYNC","Log server capabilities at connect time for diagnostics"],"tags":["imap","qresync","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"}