gpt4 book ai didi

python - Python 的 IMAP 库支持哪些线程算法?

转载 作者:太空狗 更新时间:2023-10-30 02:42:10 25 4
gpt4 key购买 nike

documentation for IMAP4.thread()imaplib 库中说

The thread command is a variant of search with threading semantics for the results. Returned data contains a space separated list of thread members.

Thread members consist of zero or more messages numbers, delimited by spaces, indicating successive parent and child.

Thread has two arguments before the search_criterion argument(s); a threading_algorithm, and the searching charset.

我不清楚要为 threading_algorithm 参数使用什么。文档没有指明默认值,source code for the IMAP4.thread() function

def thread(self, threading_algorithm, charset, *search_criteria):
"""IMAPrev1 extension THREAD command.

(type, [data]) = <instance>.thread(threading_algorithm, charset, search_criteria, ...)
"""

name = 'THREAD'
typ, dat = self._simple_command(name, threading_algorithm, charset, *search_criteria)
return self._untagged_response(typ, dat, name)

也没有给我任何想法,即使在深入研究了 _simple_command 辅助函数之后也是如此。

这个论点应该用什么?其他地方有这方面的文档吗?

最佳答案

这取决于服务器; CAPABILITIES 响应应在 THREAD= 键下告诉您服务器支持哪些线程算法。

例如:

* OK [CAPABILITY IMAP4rev1 UIDPLUS CHILDREN NAMESPACE THREAD=ORDEREDSUBJECT THREAD=REFERENCES SORT QUOTA IDLE AUTH=PLAIN ACL ACL2=UNION ID] Courier-IMAP ready. Copyright 1998-2011 Double Precision, Inc.  See COPYING for distribution information.

此服务器支持 ORDEREDSUBJECT 和 REFERENCES 算法。

基线算法的描述在 IMAP SORT and THREAD RFC 中指明。 .

imaplib 是一个非常底层的库,您需要自己解析响应。

关于python - Python 的 IMAP 库支持哪些线程算法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37423089/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com