POP3传输过程
我想知道是否有人可以帮助我(不是用代码,尽管我会很感激),了解从 POP3 邮件服务器检查和检索消息背后的逻辑。
即,
Establish connection
Validate credentials
Enumerate message list
Check each message to see if it's "new"
Download "new" message(s).
这是这样做的正确方法吗?
谢谢
I was wondering if anyone could help me out (not with code, although that would be appreciated), with the logic behind checking and retrieving messages from a POP3 mail server.
I.e.
Establish connection
Validate credentials
Enumerate message list
Check each message to see if it's "new"
Download "new" message(s).
Would this be the correct way about doing this?
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
观察此类事物的最佳方式是看看其他事物的作用。运行Wireshark或其他一些数据包捕获软件,并使用电子邮件客户端进行检查。不管怎样,POP3 会话的基本原理如下:
除 RETR 之外的所有响应的第一个字符都是 +(成功)或 -(失败)。
如果您在检索消息后将其从服务器上删除,则无需考虑 UIDL。如果您要离开它们,您可以使用 UIDL 获取本地存储的每条消息的唯一 ID,以表明您之前已检索过该消息。
有关更多详细信息,请参阅 RFC。 Wikipedia 还列出了一个更深入的示例,显示服务器响应。
The best way of looking at something like this is to have a look what something else does. Run Wireshark or some other packet capture software, and use an e-mail client to check. Anyway, the basics of a POP3 session are as follows:
The first char of all of the responses except RETR will be a + (success) or a - (failure).
If you are deleting messages off the server after retrieving them, you don't need to bother with UIDL. If you are leaving them, you can use UIDL to get a unique ID for each message which you store locally to show you have retrieved that message before.
For more details, see the RFC. Wikipedia also lists a more in depth example, showing the server response.
这些应该很有用:
POP3 电子邮件客户端 (.NET 2.0)
< a href="http://www.codeproject.com/KB/IP/despop3client.aspx" rel="nofollow noreferrer">POP3 客户端作为 C# 类
使用 C# 从 POP3 服务器检索邮件
POP3 序列图
POP3 参考
These should be useful:
POP3 Email Client (.NET 2.0)
POP3 Client as a C# Class
Retrieve Mail From a POP3 Server Using C#
POP3 Sequence Diagram
POP3 Reference