John Edward Miller writes:
Unsubscribe to a folder before renaming it, or do not use folder
subscriptions.
This doesn't solve the root problem, that is, that when a user renames
INBOX.folder1 to INBOX.folder2 the client software expects
INBOX.folder1.subfolder1 to become INBOX.folder2.subfolder1, etc.
If "folder1" is a subfolder directory, the IMAP client should refer to it as
"INBOX.folder1." -- with a trailing folder hierarchy separator character:
a LIST "" "INBOX.folder1*"
* LIST (\HasNoChildren) "." "INBOX.folder1.subfolder1"
* LIST (\Noselect \HasChildren) "." "INBOX.folder1"
a OK LIST completed
a RENAME "INBOX.folder1." "INBOX.folder2."
a OK Folder renamed.
a LIST "" "INBOX.folder2*"
* LIST (\HasNoChildren) "." "INBOX.folder2.subfolder1"
* LIST (\Noselect \HasChildren) "." "INBOX.folder2"
a OK LIST completed
As you recall, you would create a folder directory by executing "CREATE
INBOX.folder1.", and not "CREATE INBOX.folder1", which creates a folder.
Therefore, if you executed "CREATE INBOX.folder1." to create this folder
directory, it logically follows that to rename it, you would you the same
name when renaming it.