jstedfast/MailKit · error · NotSupportedException
The IMAP server does not support the QRESYNC extension.
Error message
The IMAP server does not support the QRESYNC extension.
What it means
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.
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
Example fix
// before
client.EnableQuickResync ();
// after
if ((client.Capabilities & ImapCapabilities.QuickResync) != 0)
client.EnableQuickResync (); Defensive patterns
Strategy: fallback
Validate before calling
if ((client.Capabilities & ImapCapabilities.QuickResync) == 0) return; // skip QRESYNC
Type guard
bool SupportsQresync (ImapClient c) => (c.Capabilities & ImapCapabilities.QuickResync) != 0;
Try / catch
try { client.EnableQuickResync (); } catch (NotSupportedException) { /* proceed without QRESYNC; use CONDSTORE or full sync */ } Prevention
- Always gate extension ENABLE calls behind capability checks
- Design sync logic to degrade gracefully without QRESYNC
- Log server capabilities at connect time for diagnostics
When it happens
Trigger: Calling EnableQuickResync() while (engine.Capabilities & ImapCapabilities.QuickResync) == 0 — i.e. the server's CAPABILITY list lacks QRESYNC.
Common situations: 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.
Related errors
- The IMAP server does not support the UTF8=ACCEPT extension.
- The IMAP server does not support the ID extension.
- QRESYNC needs to be enabled immediately after…
- The IMAP server does not support the IDLE extension.
- The IMAP server does not support the NOTIFY extension.
AI-assisted analysis of jstedfast/MailKit@9d3859a785 (2026-09-15).
Data as JSON: /api/errors/223b95c964dbe93b.
Report an issue: GitHub.
Appendix: source
Thrown at MailKit/Net/Imap/ImapClient.cs:373
{
var ic = QueueCompressCommand (cancellationToken);
engine.Run (ic);
ProcessCompressResponse (ic);
}
bool TryQueueEnableQuickResyncCommand (CancellationToken cancellationToken, [NotNullWhen (true)] out ImapCommand? ic)
{
CheckDisposed ();
CheckConnected ();
CheckAuthenticated ();
if (engine.State != ImapEngineState.Authenticated)
throw new InvalidOperationException ("QRESYNC needs to be enabled immediately after authenticating.");
if ((engine.Capabilities & ImapCapabilities.QuickResync) == 0)
throw new NotSupportedException ("The IMAP server does not support the QRESYNC extension.");
if (engine.QResyncEnabled) {
ic = null;
return false;
}
ic = engine.QueueCommand (cancellationToken, null, "ENABLE QRESYNC CONDSTORE\r\n");
return true;
}
void ProcessEnableResponse (ImapCommand ic)
{
ic.ThrowIfNotOk ("ENABLE");
if (engine.QuirksMode == ImapQuirksMode.iCloud) {
// Note: iCloud's response to the `ENABLE QRESYNC CONDSTORE` command does not include an untagged response
// notifying us that QRESYNC or CONDSTORE have been enabled. Instead, if we get a tagged OK response, weView on GitHub (pinned to 9d3859a785)