Gmail imap 无法访问标题中带有 space(或其他转义字符)的文件夹

Gmail imap can't access folders with space (or other escapted characters) in the title

假设我通过 shell

连接到 imap.gmail.com
>> openssl s_client -connect imap.gmail.com:993 -crlf
>> a1 login asdasd@gmail.com asdasdasdasd

正在获取文件夹列表:

>> a1 list "" *

回复:

....
* LIST (\HasChildren) "/" "github"
* LIST (\HasNoChildren) "/" "Wizz&AKA-Air"
....

现在让我们尝试select邮箱:

这行得通:

a1 select "github"

回复:

* FLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk $NotPhishing $Phishing)
* OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted \Seen $NotJunk $NotPhishing $Phishing \*)] Flags permitted.
* OK [UIDVALIDITY 639992816] UIDs valid.
* 4 EXISTS
* 0 RECENT
* OK [UIDNEXT 5] Predicted next UID.
* OK [HIGHESTMODSEQ 4768827]
a1 OK [READ-WRITE] github selected. (Success)

这将return错误:

a1 select "Wizz&AKA-Air"

回复:

a1 select "Wizz&AKA-Air"
a1 NO [NONEXISTENT] Unknown Mailbox: Wizz&AKA-Air (now in authenticated state) (Failure)

所以,“&AKA-”只是白space的转义,但是我不能select白space的邮箱。有什么想法吗?

文件夹 "Wizz Air" 最初是从 Yandex.com 上的邮箱导入的,这就是问题所在。我重命名标签然后重命名回来后问题就解决了