{"record":{"id":"45f8fe54bdd5ddd1","repo":"jstedfast/MailKit","slug":"the-imap-server-does-not-support-the-qresync-extension-45f8fe","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/ImapFolder.cs","lineNumber":342,"sourceCode":"\t\t\t\treturn folder.OnUntaggedFetchResponseAsync (engine, index, ic.CancellationToken);\n\n\t\t\tfolder.OnUntaggedFetchResponse (engine, index, ic.CancellationToken);\n\n\t\t\treturn Task.CompletedTask;\n\t\t}\n\n\t\tImapCommand QueueOpenCommand (FolderAccess access, uint uidValidity, ulong highestModSeq, IList<UniqueId> uids, CancellationToken cancellationToken)\n\t\t{\n\t\t\tif (access != FolderAccess.ReadOnly && access != FolderAccess.ReadWrite)\n\t\t\t\tthrow new ArgumentOutOfRangeException (nameof (access));\n\n\t\t\tif (uids == null)\n\t\t\t\tthrow new ArgumentNullException (nameof (uids));\n\n\t\t\tCheckState (false, false);\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 (!Supports (FolderFeature.QuickResync))\n\t\t\t\tthrow new InvalidOperationException (\"The QRESYNC extension has not been enabled.\");\n\n\t\t\tstring qresync;\n\n\t\t\tif ((Engine.Capabilities & ImapCapabilities.Annotate) != 0 && Engine.QuirksMode != ImapQuirksMode.iCloud)\n\t\t\t\tqresync = string.Format (CultureInfo.InvariantCulture, \"(ANNOTATE QRESYNC ({0} {1}\", uidValidity, highestModSeq);\n\t\t\telse\n\t\t\t\tqresync = string.Format (CultureInfo.InvariantCulture, \"(QRESYNC ({0} {1}\", uidValidity, highestModSeq);\n\n\t\t\tif (uids.Count > 0) {\n\t\t\t\tvar set = UniqueIdSet.ToString (uids);\n\t\t\t\tqresync += \" \" + set;\n\t\t\t}\n\n\t\t\tqresync += \"))\";\n","sourceCodeStart":324,"sourceCodeEnd":360,"githubUrl":"https://github.com/jstedfast/MailKit/blob/9d3859a7855e3e17582c07fd01972b8e262bf176/MailKit/Net/Imap/ImapFolder.cs#L324-L360","documentation":"This NotSupportedException is thrown by QueueOpenCommand when opening a folder with QuickResync (QRESYNC) data while the server's CAPABILITIES do not advertise QRESYNC. The QRESYNC parameter on SELECT is only valid on servers supporting RFC 7162's QuickResync extension.","triggerScenarios":"Calling ImapFolder.Open with a signature accepting highestModSeq/resynchronization data (or ImapClient enabling QRESYNC open options) when ImapCapabilities.QuickResync is not present in Engine.Capabilities.","commonSituations":"Developers who enabled CONDSTORE-style caching and pass a HighestModSeq on Open against older or minimal IMAP servers (e.g. some self-hosted/pop3-ish gateways) that lack QRESYNC; server capability changed after a migration.","solutions":["Check (client.Capabilities & ImapCapabilities.QuickResync) != 0 before requesting QuickResync; fall back to a plain Open.","Fall back to UID-based incremental fetch: compare UidValidity and re-fetch via Search/GetMessages by UID instead of mod-seq resync.","Enable QRESYNC support on the server (e.g. Dovecot: mail_plugins += imap_qresync / notify).","Use client.Open with ImapEngineState-based plain folder open when capability is absent."],"exampleFix":"// before\nfolder.Open(FolderAccess.ReadWrite, (uint)folder.HighestModSeq);\n\n// after\nif ((client.Capabilities & ImapCapabilities.QuickResync) != 0)\n    folder.Open(FolderAccess.ReadWrite, (uint)folder.HighestModSeq);\nelse\n    folder.Open(FolderAccess.ReadWrite);","handlingStrategy":"validation","validationCode":"if ((client.Capabilities & ImapCapabilities.QuickResync) == 0) { folder.Open(FolderAccess.ReadWrite); } else { folder.Open(FolderAccess.ReadWrite, highestModSeq); }","typeGuard":null,"tryCatchPattern":"try { folder.Open(access, highestModSeq); } catch (NotSupportedException) { folder.Open(access); }","preventionTips":["Inspect client.Capabilities after Connect and branch your open strategy.","Enable QRESYNC on the server (e.g. Dovecot imap_qresync plugin) if resync is required.","Log server capabilities at startup to detect capability regressions after upgrades.","Design sync code with a non-QRESYNC fallback path."],"tags":["imap","mailkit","qresync","server-capability"],"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"}