search - imap "search all"范围 : all folders/current folder?

标签 search imap directory

我想弄清楚 IMAP 的 search (带参数: "unseen all" )命令是通过搜索邮箱中的所有文件夹还是仅搜索当前选定的文件夹来工作?

IE。选择时INBOX并发出 search命令,它没有找到任何新消息。

选择“收件箱”
* 383 存在
* 0 最近
[...]
一个看不见的搜索
* 搜索
一个好的成功

但是当我进入一个有新消息的文件夹时,它可以工作:

选择“收件箱/test1/test2”
[...]
一个 uid 搜索看不见所有
* 搜索 7 8 9

它检测到三个新消息,这是事实。所以我的问题是,这种行为是否正确?不应该search unseen all在所有文件夹中搜索新邮件?

最佳答案

根据RFC

The SEARCH command searches the mailbox for messages that match the given searching criteria. Searching criteria consist of one or more search keys. The untagged SEARCH response from the server contains a listing of message sequence numbers corresponding to those messages that match the searching criteria.



其中关键字 ALL 指的是

All messages in the mailbox; the default initial key for ANDing.



所以,不,似乎没有一种标准的方式来做你正在寻找的东西(尽管可能有各种 IMAP 服务器的插件可以促进这一点)。

关于search - imap "search all"范围 : all folders/current folder?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5700478/

相关文章:

c# - Directory.GetFiles() 返回完整路径

mysql - 如何允许在搜索查询中使用连字符进行全文搜索

iphone - 搜索一系列字典

python - 新版本的 Python 在 imaplib.IMAP4_SSL() 上挂起

java - 类格式错误 : Illegal class modifiers in class . .. 0x209

c++ - 在测试工具下获取当前可执行目录失败

Maven 组装插件 : include file without taking its path folders

algorithm - 在文件中找到相同的两行

python - 如何提高数据框中的搜索索引

gmail - 如何查找其他语言的 Gmail 邮箱