What is wrong with this IMAP ESEARCH command syntax?

ぃ、小莉子 提交于 2019-12-24 17:19:34

问题


I am looking for a way to search across all IMAP folders on my mail server. I recently discovered the IMAP ESEARCH command, which extends the usual SEARCH command to search across folders. I cannot, however, seem to make it work.

I have checked that the mail server supports ESEARCH. After telnet-ing in, I executed the following:

* 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.

Note the presence of ESEARCH. I then tried the following ESEARCH, which fails.

A4 ESEARCH IN (mailboxes "INBOX") unseen
A4 BAD failed. Unknown command.

An ordinary search works fine:

A5 SELECT INBOX
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen)
...
A5 OK [READ-WRITE] SELECT completed.
A6 SEARCH UNSEEN
* SEARCH 3
A6 OK SEARCH completed.

From what I can read of the spec and the formal syntax this should work. Any help or pointers would be much appreciated.


回答1:


That document indicates ESEARCH is described by capability MULTISEARCH.

Capability ESEARCH might be something else?




回答2:


The ESEARCH capability indicates that the server supports RFC 4731 and RFC4466 which defined the ESEARCH reponse and an extended format of the SEARCH command.

The MULTISEARCH capability (RFC 6237) builds upon the ESEARCH capability to make it possible to search in another mailbox than the currently selected one. The command syntax you're using requires MULTISEARCH.



来源:https://stackoverflow.com/questions/12683288/what-is-wrong-with-this-imap-esearch-command-syntax

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!