IMAP - msgno 和 uid 之间的区别?
msgno 和 uid 有什么区别?即使消息被删除,它们看起来总是一样的!?
What is the difference between msgno and uid? It looks like they always are the same even if msgs are deleted!?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如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.
就我而言,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) msgno 始终与 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 !