Topic Path: Symbol Reference > Classes > TIdIMAP4 Class > TIdIMAP4 Methods > FindHowServerCreatesFolders Method
TIdIMAP4.FindHowServerCreatesFolders Method

Determine the method used to create folders on the remote IMAP4 server.

function FindHowServerCreatesFolders: TIdIMAP4FolderTreatment;

FindHowServerCreatesFolders is a TIdIMAP4FolderTreatment function used to determine the method used to create folders on the remote IMAP4 server. FindHowServerCreatesFolders examines and probes the mailbox hierarchy for the current IMAP4 account to derive the return value for the method. 

TIdIMAP4FolderTreatment includes the following values and associated meanings: 


Value Meaning 

---- ------


ftAllowsTopLevelCreation Folders can be created at the same level as Inbox (the top level) 
ftFoldersMustBeUnderInbox Folders must be created under INBOX, such as INBOX.Sent 
ftDoesNotAllowFolderCreation Won't allow you create folders at the top level or under Inbox (may be read-only connection) 
ftCannotTestBecauseHasNoInbox Won't allow top-level folder creation but cannot test creation under Inbox because it does not exist 
ftCannotRetrieveAnyFolders No folders present for that user, cannot be determined 


FindHowServerCreatesFolders attempts to get any existing mailbox names for the current account using ListMailBoxes. If no mailboxes are found, the value ftCannotRetrieveAnyFolders is returned. 

When an "Inbox" or "INBOX" mailbox is found, FindHowServerCreatesFolders will try to create temprary top-level and inferior mailboxes. Temporary mailboxes are deleted prior to exiting from the method. 

If the an Inbox cannot be located, the value ftCannotTestBecauseHasNoInbox is returned. 

If neither top-level or inferior mailboxes are allowed, the value ftDoesNotAllowFolderCreation is returned.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.