Click or drag to resize
MimeKit

ImapImplementation Class

The details of an IMAP client or server implementation.
Inheritance Hierarchy
SystemObject
  MailKit.Net.ImapImapImplementation

Namespace:  MailKit.Net.Imap
Assembly:  MailKit (in MailKit.dll) Version: 2.14.0
Syntax
C#
public class ImapImplementation

The ImapImplementation type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleImapImplementation
Initializes a new instance of the ImapImplementation class.
Top
Properties
  NameDescription
Public propertyAddress
Get or set the postal address of the vendor.
Public propertyArguments
Get or set the command-line arguments used to start the program.
Public propertyCommand
Get or set the command used to start the program.
Public propertyEnvironment
Get or set the environment variables available to the program.
Public propertyCode exampleName
Get or set the name of the program.
Public propertyOS
Get or set the name of the operating system.
Public propertyOSVersion
Get or set the version of the operating system.
Public propertyCode exampleProperties
Get the identification properties.
Public propertyReleaseDate
Get or set the release date of the program.
Public propertySupportUrl
Get or set the support URL.
Public propertyVendor
Get or set the name of the vendor.
Public propertyCode exampleVersion
Get or set the version of the program.
Top
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Remarks
Allows an IMAP client and server to share their implementation details with each other for the purposes of debugging.
Examples
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.HasFlag (ImapCapabilities.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.HasFlag (ImapCapabilities.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.HasFlag (ImapCapabilities.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 && quota.StorageLimit.Value)
                Console.WriteLine ("  Limited by storage space. Using {0} out of {1} bytes.", quota.CurrentStorageSize.Value, quota.StorageLimit.Value);

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

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

        if (client.Capabilities.HasFlag (ImapCapabilities.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);
    }
}
See Also