jstedfast/MailKit · error · NotSupportedException

The IMAP server does not support the ACL extension.

Error message

The IMAP server does not support the ACL extension.

What it means

NotSupportedException thrown by QueueGetAccessControlListCommand when the server does not advertise the ACL extension (RFC 4314). GETACL is therefore unavailable, so GetAccessControlListAsync cannot be performed.

Solutions

  1. Check (client.Capabilities & ImapCapabilities.Acl) before calling ACL APIs
  2. Manage permissions through the server's native admin interface (e.g. Exchange admin center, Gmail delegation settings) instead
  3. Choose/enable an IMAP server with RFC 4314 ACL support (Dovecot, Cyrus) if ACL via IMAP is required
  4. Fallback: handle NotSupportedException gracefully and surface 'permissions not manageable over IMAP' to users

Example fix

// before
var acl = await folder.GetAccessControlListAsync();
// after
if ((client.Capabilities & ImapCapabilities.Acl) != 0) {
    var acl = await folder.GetAccessControlListAsync();
} else {
    // manage permissions out-of-band
}
Defensive patterns

Strategy: validation

Validate before calling

if ((client.Capabilities & ImapCapabilities.Acl) == 0)
    return null; // ACL not available on this server

Type guard

bool SupportsAcl(IMapClient c) => (c.Capabilities & ImapCapabilities.Acl) != 0;

Try / catch

try {
    acl = await folder.GetAccessControlListAsync();
} catch (NotSupportedException) {
    acl = null; // handle out-of-band
}

Prevention

When it happens

Trigger: Calling folder.GetAccessControlListAsync() on a server whose ImapCapabilities lacks ImapCapabilities.Acl.

Common situations: Many mainstream IMAP servers (e.g. some default Exchange/Outlook.com, Gmail via certain frontends) do not expose IMAP ACL; using a shared-mailbox ACL API against a personal account.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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

Appendix: source

Thrown at MailKit/Net/Imap/ImapFolder.cs:2322

				token = await engine.PeekTokenAsync (ic.CancellationToken).ConfigureAwait (false);
			} while (token.Type != ImapTokenType.Eoln);
		}

		static Task UntaggedAclHandler (ImapEngine engine, ImapCommand ic, int index, bool doAsync)
		{
			if (doAsync)
				return ParseAclAsync (engine, ic);

			ParseAcl (engine, ic);

			return Task.CompletedTask;
		}

		ImapCommand QueueGetAccessControlListCommand (CancellationToken cancellationToken)
		{
			if ((Engine.Capabilities & ImapCapabilities.Acl) == 0)
				throw new NotSupportedException ("The IMAP server does not support the ACL extension.");

			CheckState (false, false);

			var ic = new ImapCommand (Engine, cancellationToken, null, "GETACL %F\r\n", this);
			ic.RegisterUntaggedHandler ("ACL", UntaggedAclHandler);
			ic.UserData = new AccessControlList ();

			Engine.QueueCommand (ic);

			return ic;
		}

		AccessControlList ProcessGetAccessControlListResponse (ImapCommand ic)
		{
			ProcessResponseCodes (ic, null);

			ic.ThrowIfNotOk ("GETACL");

View on GitHub (pinned to 9d3859a785)