POP3传输过程

发布于 2024-09-01 03:29:59 字数 264 浏览 5 评论 0原文

我想知道是否有人可以帮助我(不是用代码,尽管我会很感激),了解从 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

氛圍 2024-09-08 03:29:59

观察此类事物的最佳方式是看看其他事物的作用。运行Wireshark或其他一些数据包捕获软件,并使用电子邮件客户端进行检查。不管怎样,POP3 会话的基本原理如下:

USER username
PASS password
LIST                <-- Shows the size of each waiting message
UIDL                <-- Shows a unique ID for each waiting message
RETR 1              <-- Retrieves message with index 1
DELE 1              <-- Deletes the message you just retrieved
QUIT

除 RETR 之外的所有响应的第一个字符都是 +(成功)或 -(失败)。

如果您在检索消息后将其从服务器上删除,则无需考虑 UIDL。如果您要离开它们,您可以使用 UIDL 获取本地存储的每条消息的唯一 ID,以表明您之前已检索过该消息。

有关更多详细信息,请参阅 RFCWikipedia 还列出了一个更深入的示例,显示服务器响应。

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:

USER username
PASS password
LIST                <-- Shows the size of each waiting message
UIDL                <-- Shows a unique ID for each waiting message
RETR 1              <-- Retrieves message with index 1
DELE 1              <-- Deletes the message you just retrieved
QUIT

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.

情域 2024-09-08 03:29:59

这些应该很有用:

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文