重新处理来自 pop3 帐户的错误电子邮件
我有一个从 pop3 帐户读取电子邮件的应用程序。当我连接到该帐户时,我会下载所有新电子邮件并处理正文和附件。
如果处理其中一封电子邮件时出现错误,我想在下次连接时再次下载它,但由于我只收到新电子邮件,并且失败的电子邮件已下载,所以我无法收到它,因此无法尝试处理它再次。
我可以使用任何 pop3 命令来执行此操作吗?或者我必须在本地存储失败的电子邮件?
I have an application that read emails from a pop3 account. When I connect to the account I download all new emails and process body and attachments.
If there is an error processing one of the emails I would like to download it again next time I connect but since I only get new emails and the failed one was already downloaded I don't get it so I can't try to process it again.
Can I do it this with any pop3 command or I have to store locally failed emails?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只要您在下载邮件后不删除邮件,它们就应该保留在服务器上,以便您可以再次检索它们。换句话说,这应该是默认发生的。有关详细信息,请参阅 RFC 1939。
您使用什么 POP3 客户端库?
编辑:我想您的 POP3 服务器可能会在您检索邮件后将其删除,尽管这样做相当粗鲁。针对免费 POP3 服务器(例如 GMail)运行客户端代码,看看它的行为是否有任何不同,可能会很有趣。
如果您没有对 POP3 连接进行 SSL 加密,那么运行 Wireshark 来查看可能也很有趣客户端和服务器之间的网络到底发生了什么。 (POP3 是一种纯文本协议,通过查看网络跟踪很容易理解。)要使用 Wireshark,请进入“捕获”菜单,选择“选项”,确保选择您的接口,输入“tcp 端口 110”的捕获过滤器”,然后按开始。
如果您愿意发布您的客户端代码,我们也许可以提供更多帮助。
As long as you're not deleting the messages after downloading them, they should remain on the server so that you can retrieve them again. In other words, this should happen by default. See RFC 1939 for details.
What POP3 client library are you using?
Edit: I guess it's possible that your POP3 server is deleting messages after you retrieve them once, although that would be rather rude of it. It might be interesting to run your client code against a free POP3 server like GMail to see if it acts any different.
If you're not SSL-encrypting your POP3 connection, then it might also be interesting to run Wireshark to see what exactly is happening over the network between your client and the server. (POP3 is a plaintext protocol and is very easy to understand from looking at a network trace.) To use Wireshark, go under the Capture menu, choose Options, make sure that your interface is selected, enter a Capture Filter of "tcp port 110", and press Start.
If you're willing to post your client code, we might be able to offer some more help.