Internet Direct (Indy) Version 9.0.2 Beta
TIdIMAP4.ListInferiorMailBoxes
Retrieves a list of mailboxes contained in the specified mailbox folder hierarchy.

function ListInferiorMailBoxes(AMailBoxList: TStringList; AInferiorMailBoxList: TStringList): Boolean;
Parameters
AMailBoxList: TStringList
Optional mailbox or folder to be searched.

AInferiorMailBoxList: TStringList
Receives mailbox names retreived in the search.

Returns
Boolean - True on success.

Description
ListInferiorMailBoxes is a Boolean function that retrieves a list of mailboxes contained in the specified mailbox folder hierarchy.

ListInferiorMailBoxes can be used when the container folder might include many child mailboxes, and the search might be time consuming. ListInferiorMailBoxes requires that the value of ConnectionState be csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised.

When AMailBoxList in unassigned (Nil), ListInferiorMailBoxes will search for child mailboxes in the currently selected mailbox using the IMAP LIST command. ListInferiorMailBoxes calls ParseListResultDetails to populate the AInferiorMailBoxList variable with the contents of CmdResultDetails including the default "INBOX".

When AMailBoxList contains valid TStrings values, ListInferiorMailBoxes retrieves the child mailbox list for each line in AMailBoxList and accumulates the parsed results in AInferiorMailBoxList.

ListInferiorMailBoxes sets the return value to True when ResultNo contains wsOk.