使用Python库在IMAP中移动邮件 [英] Move mail in IMAP with Python library
本文介绍了使用Python库在IMAP中移动邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在IMAP中将邮件移动到其他文件夹似乎很困难.
Moving a message to a different folder seems quite difficult in IMAP.
请参见 IMAP:如何移动邮件从一个文件夹发送到另一个文件夹
如何在不进行过多编码的情况下用Python做到这一点?
How can I do this in Python without coding too much?
我更喜欢重用:-)
推荐答案
imaplib
标准模块已为您服务.
The imaplib
standard module is at your service.
除了链接问题中的方法外,您还可以使用非标准的 MOVE
命令和 IMAP4._simple_command
(请参见 copy()
实现,其语法相同)在检查 self.capabilities
是否存在"MOVE"
存在之后.
Apart from the method in the linked question, you can use a nonstandard MOVE
command with IMAP4._simple_command
(see copy()
implementation, its syntax is the same)
after checking self.capabilities
for "MOVE"
presence.
这篇关于使用Python库在IMAP中移动邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文