我正在寻找一种搜索我邮件服务器上所有IMAP文件夹的方法。我最近发现了IMAP ESEARCH command,它扩展了通常的SEARCH命令来搜索文件夹。但是,我似乎无法使其发挥作用。
我已检查邮件服务器是否支持ESEARCH
。 telnet进入后,我执行了以下操作:
* OK JAMES IMAP4rev1 Server Server server-address is ready.
A1 LOGIN test test
A1 OK LOGIN completed.
A2 CAPABILITY
* CAPABILITY SASL-IR IDLE LITERAL+ AUTH=PLAIN CONDSTORE ESEARCH CHILDREN UIDPLUS UNSELECT WITHIN ENABLE I18NLEVEL=1 SEARCHRES IMAP4rev1 NAMESPACE QRESYNC
A2 OK CAPABILITY completed.
A3 LIST "" "*"
* LIST (\HasNoChildren) "." "INBOX"
* LIST (\HasNoChildren) "." "Drafts"
* LIST (\HasNoChildren) "." "Sent"
* LIST (\HasNoChildren) "." "Trash"
A3 OK LIST completed.
请注意ESEARCH
的存在。然后我尝试了以下ESEARCH
,但失败了。
A4 ESEARCH IN (mailboxes "INBOX") unseen
A4 BAD failed. Unknown command.
普通搜索工作正常:
A5 SELECT INBOX
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
...
A5 OK [READ-WRITE] SELECT completed.
A6 SEARCH UNSEEN
* SEARCH 3
A6 OK SEARCH completed.
从我可以阅读的规范和formal syntax这应该工作。任何帮助或指示将非常感激。