IMAP SEARCH 复杂查询
我需要查找 IMAP 邮箱中包含 somestring
且来自 [电子邮件受保护]
或 TO [电子邮件受保护]
。
尝试做:
49:51.53 > JBPM3 SEARCH CHARSET utf-8 "BODY \"somestring\" (OR (TO \"[email protected]\") (FROM \"[email protected]\"))"
接收:
49:51.71 < JBPM3 BAD Could not parse command
如何使用 GMail 使其工作?
I need to find all mails in IMAP mailbox which contains somestring
in BODY and is FROM [email protected]
or TO [email protected]
.
Trying to do:
49:51.53 > JBPM3 SEARCH CHARSET utf-8 "BODY \"somestring\" (OR (TO \"[email protected]\") (FROM \"[email protected]\"))"
Receiving:
49:51.71 < JBPM3 BAD Could not parse command
How to make it work using GMail?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以跳过括号 '(' ')' 对 IMAP 中的逻辑表达式进行分组。
波兰表示法中不需要括号(请参阅下面的编辑):
您还可以使用 gmail 搜索语法 (X-GM-RAW) 命令:
http://www.limilabs.com/blog/search-gmail -using-gmails-search-syntax
[编辑]
IMAP 搜索中有时需要括号。这是因为 AND 运算符可以有 2 个以上的操作数,并且没有明确定义:
http://www.limilabs.com/blog/imap-search-requires-parentheses
You may skip parenthesis '(' ')' to group logical expressions in IMAP.
Parenthesis are not needed in Polish Notation (see edit below):
You could also use gmail search syntax (X-GM-RAW) command:
http://www.limilabs.com/blog/search-gmail-using-gmails-search-syntax
[Edit]
Parenthesis are sometimes required in IMAP SEARCH. This is because AND operator can have more than 2 operands and is not explicitly defined:
http://www.limilabs.com/blog/imap-search-requires-parentheses