methodiMailboxAccess.RenameFolder
function RenameFolder(const aAddress, aFrom, aTo: string): Boolean;
IMAP RENAME. It is NOT one directory rename: a maildir++ child is a sibling directory whose name carries the parent's, so '.Sent' moving to '.Archive' has to take every '.Sent.*' with it or the children are orphaned under a parent that no longer exists. INBOX instead moves only its messages, with flags, to a fresh UIDVALIDITY. INBOX keeps its UIDVALIDITY and UIDNEXT, and its children stay put. An exclusive POP3 maildrop refuses the operation. Each message move is atomic: failure returns False with moved messages at the target and the remainder in INBOX, each present exactly once. Both indexes reserve the full UID map before moving; rescans retire absent rows. IT MUST NOT OVERWRITE: a target that already exists is False, or a rename silently merges two mailboxes. Ordinary RENAME keeps UIDs and UIDVALIDITY unless the target's history is unknown, or its equal epoch is legacy or ambiguous. Matching proven source and target history identify this same incarnation only without unknown history; any recorded legacy lifetime stays ambiguous. Ordinary folder moves are rolled back on failure. If any reverse move also fails, all reverse moves are attempted, then eMailRenameError reports each name left at its destination as current -> original path.