ImapUseXList Property
Gets or sets whether to use XLIST extension which allows the application to detect special folders like Sent, Drafts, Trash.

Namespace: MailBee.ImapMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public bool UseXList { get; set; }

Property Value

Type: Boolean
If true, MailBee will issue XLIST command instead of LIST when the application calls DownloadFolders(Boolean, String, String) method. If false, regular LIST command will be used (no flags denoting special folders will be available). The default value is true if the server supports XLIST.

Even if you set this property to true, it may still return false if the server does not support XLIST. Usually, you do not need to set it explicitly as MailBee will set it to true automatically if the server supports XLIST. MailBee reads the IMAP capabilities at the moment of connecting to the server (in some cases, it can re-read the capabilities later but this does not affect XLIST extension). It's safe to assume that once Connect(String, Int32, Socket, EndPoint) method finished, you can examine the value of UseXList property to determine if the server supports well-known folder types.

If you want to disable using XLIST, keep in mind that MailBee automatically sets this property to match the server capabilities when it encounters XLIST support in the server response (usually, during login), so you'll need to set it AFTER you logged in. For instance, just before DownloadFolders(Boolean, String, String) call.

When UseXList is true, and you called DownloadFolders(Boolean, String, String) method specifying subscribedOnly=false, you can then examine Flags property of each Folder object in the retured collection for extra flags, like Drafts or Inbox.

A better alternative to XLIST is SPECIAL-USE extension. If it's supported by the server, extended flags will be returned by the regular LIST command. Gmail supports both XLIST and SPECIAL-USE (although SPECIAL-USE does not appear in its CAPABILITITES list).

Note Note

XLIST extension provides XLIST version of LIST command but no XLSUB command (LSUB lists subscribed-only folders). Thus, it's not possible to get extended flags only for subscribed folders, XLIST extension has no effect when you call DownloadFolders(Boolean) method passing subscribedOnly as true.

However, this can be different with SPECIAL-USE capable servers and Gmail. Gmail provides extended folder flags for all commands: LIST, LSUB, XLIST. Most SPECIAL-USE capable servers support extended flags for both LIST and LSUB (although SPECIAL-USE RFC document requires this only for LIST).

With Gmail, as it in fact supports SPECIAL-USE, you can even set UseXList to false and still get all the flags. Small differences between LIST and XLIST output still exist in Gmail at the moment of writing (e.g. XLIST provides localized INBOX name when Gmail interface is not English while LIST always returns "INBOX").

See Also