Internet Direct (Indy)
Home
PreviousUpNext
TIdIMAP4.ListInferiorMailBoxes@TStringList@TStringList

Retrieves a list of mailboxes contained in the specified mailbox folder hierarchy.

Parameters 
Description 
AMailBoxList 
Optional mailbox or folder to be searched.
 
AInferiorMailBoxList 
Receives mailbox names retreived in the search. 

Boolean - True on success.

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 LastCmdResult 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. 

Please note that IMAP servers are required to have an "Inbox" folder to allow them to receive email for a given user. This may or may not be case-sensitive. Your implementation may require you to create an Inbox folder if it does not already exist. 

WARNING: 

Be careful with the characters you use for mailbox names. Different IMAP servers may allow, and interpret differently, various characters, which is allowed within the IMAP specification. Characters such as ~ / and . may have special meaning in the IMAP servers context, and may produce unexpected results. In practice, some IMAP servers may be case-sensitive and others not. It is recommended that you only use the characters A-Z and 0-9 and that you program to allow for case sensitivity or insensitivity, as applicable. Note that, in general, IdIMAP4 adds double-quotes around mailbox names, which allows the use of spaces in mailbox names, but also note that a perticular IMAP server may not allow spaces (this functionality is necessary to allow IdIMAP4 deal with pre-existing mailboxes that include spaces). 

ListInferiorMailBoxes sets the return value to True when the protocol response contains the value IMAP_OK.

ListMailBoxes ConnectionState EIdConnectionStateError

Internet Direct (Indy) version 10.1.5
Copyright © 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Website http://www.indyproject.org.
Post feedback to the Indy Documentation newsgroup.