IMAP - msgno 和 uid 之间的区别?

发布于 2024-12-13 20:42:20 字数 45 浏览 0 评论 0原文

msgno 和 uid 有什么区别?即使消息被删除,它们看起来总是一样的!?

What is the difference between msgno and uid? It looks like they always are the same even if msgs are deleted!?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

南风起 2024-12-20 20:42:20

正如http://www.php.net/manual/en 上所说/function.imap-uid.php

此函数返回给定消息序列号的 UID。 UID 是唯一标识符,不会随时间变化,而消息序列号可能会随着邮箱内容的变化而变化。

As it says on http://www.php.net/manual/en/function.imap-uid.php:

This function returns the UID for the given message sequence number. An UID is a unique identifier that will not change over time while a message sequence number may change whenever the content of the mailbox changes.

当爱已成负担 2024-12-20 20:42:20

就我而言,uid 始终与 msgno 和 message_id 相同。

最糟糕的是,当我删除邮件服务器上的邮件时,msgno 和 UID 会按到达顺序重新归因

我制作了一个小脚本,使用 imap_search 和 imap_overview 获取邮件以获取标头,我使用 imap_uid($this->GetConnection(),$msgno);强制从 MSGNO 获取 UID,结果为:

echo "MSGNO : $msgno UID : $overview->uid UIDBYNO : "。 $mbox->GetUidByNum($msgno)."
";

MSGNO : 851 UID : 851 UIDBYNO : 851
MSGNO : 852 UID : 852 UIDBYNO : 852
MSGNO : 853 UID : 853 UIDBYNO : 853
MSGNO : 854 UID : 854 UIDBYNO : 854
MSGNO : 855 UID : 855 UIDBYNO : 855
MSGNO : 856 UID : 856 UIDBYNO : 856
MSGNO : 857 UID : 857 UIDBYNO : 857

所以
1)uid不是唯一的
2) msg​​no 始终与 uid 相同

也许邮件服务器不尊重 RFC!

In my case, uid is always the same as msgno and message_id

The worst it's that when i delete messages on the mail server, msgno and UID are reattributed in the order of arrival.

I have make a little script which fetch mails with imap_search and imap_overview to get headers, i use imap_uid($this->GetConnection(),$msgno); to force get the UID from the MSGNO and here the result :

echo "MSGNO : $msgno UID : $overview->uid UIDBYNO : ". $mbox->GetUidByNum($msgno)."
";

MSGNO : 851 UID : 851 UIDBYNO : 851
MSGNO : 852 UID : 852 UIDBYNO : 852
MSGNO : 853 UID : 853 UIDBYNO : 853
MSGNO : 854 UID : 854 UIDBYNO : 854
MSGNO : 855 UID : 855 UIDBYNO : 855
MSGNO : 856 UID : 856 UIDBYNO : 856
MSGNO : 857 UID : 857 UIDBYNO : 857

So
1) uid isn't unique
2) msgno is always the same as uid

Maybe the mailserver doesn't respect the RFC !

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