ImapCapability Enumeration

A capability supported by an IMAP server.

Definition

Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public enum ImapCapability

Remarks

Capabilities are read as part of the response to the CAPABILITY command that is issued during the connection and authentication phases of the ImapClient.

Example

C#
                    public static void Capabilities ()
{
    using (var client = new ImapClient ()) {
        client.Connect ("imap.gmail.com", 993, SecureSocketOptions.SslOnConnect);

        var mechanisms = string.Join (", ", client.AuthenticationMechanisms);
        Console.WriteLine ("The IMAP server supports the following SASL authentication mechanisms: {0}", mechanisms);

        client.Authenticate ("username", "password");

        if (client.Capabilities.Contains (ImapCapability.Id)) {
            var clientImplementation = new ImapImplementation { Name = "MailKit", Version = "1.0" };
            var serverImplementation = client.Identify (clientImplementation);

            Console.WriteLine ("Server implementation details:");
            foreach (var property in serverImplementation.Properties)
                Console.WriteLine ("  {0} = {1}", property.Key, property.Value);
        }

        if (client.Capabilities.Contains (ImapCapability.Acl)) {
            Console.WriteLine ("The IMAP server supports Access Control Lists.");

            Console.WriteLine ("The IMAP server supports the following access rights: {0}", client.Rights);

            Console.WriteLine ("The Inbox has the following access controls:");
            var acl = client.Inbox.GetAccessControlList ();
            foreach (var ac in acl)
                Console.WriteLine ("  {0} = {1}", ac.Name, ac.Rights);

            var myRights = client.Inbox.GetMyAccessRights ();
            Console.WriteLine ("Your current rights for the Inbox folder are: {0}", myRights);
        }

        if (client.Capabilities.Contains (ImapCapability.Quota)) {
            Console.WriteLine ("The IMAP server supports quotas.");

            Console.WriteLine ("The current quota for the Inbox is:");
            var quota = client.Inbox.GetQuota ();

            if (quota.StorageLimit.HasValue)
                Console.WriteLine ("  Limited by storage space. Using {0} out of {1} kilobytes.", quota.CurrentStorageSize.Value, quota.StorageLimit.Value);

            if (quota.MessageLimit.HasValue)
                Console.WriteLine ("  Limited by the number of messages. Using {0} out of {1} messages.", quota.CurrentMessageCount.Value, quota.MessageLimit.Value);

            Console.WriteLine ("The quota root is: {0}", quota.QuotaRoot);
        }

        if (client.Capabilities.Contains (ImapCapability.Thread)) {
            if (client.ThreadingAlgorithms.Contains (ThreadingAlgorithm.OrderedSubject))
                Console.WriteLine ("The IMAP server supports threading by subject.");
            if (client.ThreadingAlgorithms.Contains (ThreadingAlgorithm.References))
                Console.WriteLine ("The IMAP server supports threading by references.");
        }

        client.Disconnect (true);
    }
}
                  

Members

IMAP4 0 The server implements the core IMAP4 commands.
IMAP4rev1 1 The server implements the core IMAP4rev1 commands.
Status 2 The server supports the STATUS command.
Acl 3 The server supports the ACL extension defined in rfc2086 and rfc4314.
Quota 4 The server supports the QUOTA extension.
LiteralPlus 5 The server supports the LITERAL+ extension.
Idle 6 The server supports the IDLE extension.
MailboxReferrals 7 The server supports the MAILBOX-REFERRALS extension.
LoginReferrals 8 the server supports the LOGIN-REFERRALS extension.
Namespace 9 The server supports the NAMESPACE extension.
UidPlus 10 The server supports the UIDPLUS extension.
StartTLS 11 The server supports the STARTTLS extension.
LoginDisabled 12 The server supports the LOGINDISABLED extension.
Id 13 The server supports the ID extension.
Children 14 The server supports the CHILDREN extension.
MultiAppend 15 The server supports the MULTIAPPEND extension.
Binary 16 The server supports the BINARY content extension.
Unselect 17 The server supports the UNSELECT extension.
UrlAuth 18 The server supports the URLAUTH extension.
Catenate 19 The server supports the CATENATE extension.
CondStore 20 The server supports the CONDSTORE extension.
ESearch 21 The server supports the ESEARCH extension.
SaslIR 22 The server supports the SASL-IR extension.
Compress 23 The server supports the COMPRESS extension.
Within 24 The server supports the WITHIN extension.
Enable 25 The server supports the ENABLE extension.
QuickResync 26 The server supports the QRESYNC extension.
SearchResults 27 The server supports the SEARCHRES extension.
Language 28 The server supports the LANGUAGE extension.
I18NLevel 29 The server supports the I18NLEVEL extension.
Sort 30 The server supports the SORT extension.
Thread 31 The server supports the THREAD extension.
Annotate 32 The server supports the ANNOTATE extension.
ListExtended 33 The server supports the LIST-EXTENDED extension.
Convert 34 The server supports the CONVERT extension.
ESort 35 The server supports the ESORT extension.
Context 36 The server supports the CONTEXT extension.
Metadata 37 The server supports the METADATA extension.
MetadataServer 38 The server supports the METADATA-SERVER extension.
Notify 39 The server supports the NOTIFY extension.
Filters 40 The server supports the FILTERS extension.
UrlAuthBinary 41 The server supports the URLAUTH=BINARY extension.
UrlPartial 42 The server supports the URL-PARTIAL extension.
ListStatus 43 The server supports the LIST-STATUS extension.
SortDisplay 44 The server supports the SORT=DISPLAY extension.
SpecialUse 45 The server supports the SPECIAL-USE extension.
CreateSpecialUse 46 The server supports the CREATE-SPECIAL-USE extension.
FuzzySearch 47 The server supports the SEARCH=FUZZY extension.
MultiSearch 48 The server supports the MULTISEARCH extension.
ImapSieve 49 The server supports the IMAPSIEVE extension.
Move 50 The server supports the MOVE extension.
UTF8Accept 51 The server supports the UTF8=ACCEPT extension.
UTF8Only 52 The server supports the UTF8=ONLY extension.
LiteralMinus 53 The server supports the LITERAL- extension.
AppendLimit 54 The server supports the APPENDLIMIT extension.
Unauthenticate 55 The server supports the UNAUTHENTICATE extension.
StatusSize 56 The server supports the STATUS=SIZE extension.
ListMyRights 57 The server supports the LIST-MYRIGHTS extension.
ObjectID 58 The server supports the OBJECTID extension.
Replace 59 The server supports the REPLACE extension.
SaveDate 60 The server supports the SAVEDATE extension.
Preview 61 The server supports the PREVIEW extension.
IMAP4rev2 62 The server implements the core IMAP4rev2 commands described in rfc9051.
QuotaSet 63 The server supports the QUOTASET extension.
QuotaResourceStorage 64 The server supports the STORAGE resource type defined by the QUOTA extension (QUOTA=RES-STORAGE).
QuotaResourceMessage 65 The server supports the MESSAGE resource type defined by the QUOTA extension (QUOTA=RES-MESSAGE).
QuotaResourceMailbox 66 The server supports the MAILBOX resource type defined by the QUOTA extension (QUOTA=RES-MAILBOX).
QuotaResourceAnnotationStorage 67 The server supports the ANNOTATION-STORAGE resource type defined by the QUOTA extension (QUOTA=RES-ANNOTATION-STORAGE).
Partial 68 The server supports the PARTIAL extension.
InProgress 69 The server supports the INPROGRESS extension.
UidOnly 70 The server supports the UIDONLY extension.
ListMetadata 71 The server supports the LIST-METADATA extension.
JmapAccess 72 The server supports the JMAPACCESS extension.
MessageLimit 73 The server supports the MESSAGELIMIT extension.
SaveLimit 74 The server supports the SAVELIMIT extension.
UidBatches 75 The server supports the UIDBATCHES extension.
XList 76 The server supports the XLIST extension (GMail).
GMailExt1 77 The server supports the X-GM-EXT1 extension (GMail).

See Also