ImapGetFolderQuota Method
Gets the quota (resource usage limit) of the specified folder.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public FolderQuota GetFolderQuota(
	string folderName


Type: SystemString
The full name of the folder to get the quota of.

Return Value

Type: FolderQuota
FolderQuota object if the quota information was downloaded successfully; otherwise, a null reference (Nothing in Visual Basic).
MailBeeProtocolExtensionNotSupportedExceptionQUOTA not supported by the server and ThrowExceptions is true.
MailBeeExceptionAn error occurred and ThrowExceptions is true.

This method can be used to obtain the folder quota information such as maximum allowed size of the folder, the current size of the folder, etc.

To get the quota set for the entire account on the IMAP4 server, the developer can use GetAccountQuota method.

Note Note
This method uses QUOTA capability be supported by the IMAP4 server. The developer can check if QUOTA capability is supported using GetExtension(String) method.
This sample gets Inbox folder quota information and displays the maximum allowed size of the folder (the top limit of the total size in bytes of all messages in the folder).
using System;
using MailBee;
using MailBee.ImapMail;
class Sample
    static void Main(string[] args)
        Imap imp = new Imap();

        // Connect to the server and log in the account.
        imp.Login("", "secret");

        if (imp.GetExtension("QUOTA") != null)
            // Download Inbox folder quota information.
            FolderQuota quota = imp.GetFolderQuota("Inbox");

            if (quota.MaxStorageSize > -1)
                Console.WriteLine(quota.MaxStorageSize +
                    " is the maximum allowed total size (in bytes) " +
                    "of all messages in the folder.");
            Console.WriteLine("QUOTA capability not supported, sorry");

See Also