Internet Direct (Indy) Version 9.0.2 Beta
|
function RenameMailBox(const AOldMBName: String; const ANewMBName: String): Boolean;
Renaming the "INBOX" mailbox is permitted, and has special behavior. It moves all messages in INBOX to a new mailbox with the given name, leaving INBOX empty. If the server implementation supports inferior hierarchical names of INBOX, these are unaffected by a rename of INBOX.
RenameMailBox requires that the value of ConnectionState contain either csAuthenticated or csSelected, or an EIdConnectionStateError exception will be raised.
RenameMailBox calls SendCmd using the IMAP4 RENAME command to alter the mailbox name. RenameMailBox sets the return value to True when ResultNo contains the value wsOk.