Thunderbird 在哪里存储通过 POP 下载的最后一条消息的 UID?

发布于 2024-07-10 10:48:57 字数 781 浏览 5 评论 0原文

我使用 Thunderbird 通过 POP3 接收电子邮件。 我已将 Thunderbird 配置为在服务器上留下电子邮件。 假设有一天我使用 POP3 检索 (RETR) 10 封电子邮件,然后我晚上就注销了。 一夜之间,又有 10 封邮件发送到我的邮箱。 当我第二天早上启动 Thunderbird 时,STAT 命令应该显示 20 条消息。 但是,Thunderbird 不应下载前 10 条消息; 它应该从消息 11(或消息 11 的唯一标识符或 UID)开始。 Thunderbird 将发送 POP3 UIDL 命令,然后将 UID 与 Thunderbird 昨天检索到的最后一条消息的 UID 进行比较。 它将发现最后一个 UID 与消息 10 的 UIDL 列表匹配,然后 Thunderbird 将 RETR 11RETR 12 等。

就我而言,POP3 STAT 命令显示 POP 服务器上有 5379 条邮件。 我已经收到了大约 5000 个。 由于某种原因,Thunderbird 希望下载所有 5379 条消息,而不是从 5001 条开始。我正在尝试对此进行调试,并正在寻找 Thunderbird 认为是检索到的最后一条消息的 UID。

有谁知道 Thunderbird(在 Windows 上)在哪里存储最后一个 UID,它将用于与 UIDL(列表)进行比较?

有没有办法手动设置它,以便我可以强制 Thunderbird 开始检索接近 5001 的位置?

I use Thunderbird to receive email using POP3. I have Thurnderbird configured to leave email on the server. Lets say one day I uses POP3 to retrieve (RETR) 10 email messages, then I logout for the night. Overnight 10 more messages are sent to my mailbox. When I fire up Thunderbird the next morning, the STAT command should show 20 messages. However, Thunderbird should not download the first 10 messages; it should start at message 11 (or the unique identifier or UID for message 11). Thunderbird will send a POP3 UIDL command, then compare the UID's to the UID of the last message Thunderbird retrieved yesterday. It will find that the last UID matches the UIDL list for message 10, then Thunderbird will RETR 11, RETR 12, and so on.

In my case, the POP3 STAT command shows that I have 5379 messages on the POP server. I have already received about 5000 of them. For some reason Thunderbird wants to download all 5379 messages instead of starting at 5001. I am trying to debug this and was looking for the UID that Thunderbird thinks was the last message retrieved.

Does anyone know where Thunderbird (on Windows) stores the last UID, which it will use to compare to the UIDL (list)?

Is there a way to manually set it so I can force Thunderbird to start retrieving somewhere close to 5001?

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

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

发布评论

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

评论(4

燕归巢 2024-07-17 10:48:57

Thunderbird 有一个名为 popstate.dat 的文件,其中包含 UID、时间戳(纪元)和一只旗。 该标志指示 Thunderbird 对关联消息执行的操作。

显然,Thunderbird 实际上并不像我上面描述的那样工作。 我认为 Thunderbird 会执行以下操作。 它发送 POP3 UIDL 命令来获取存储在 POP 服务器上的 UID 列表。 然后,它会将此列表与 popstate.dat 中存储的 UID 进行比较。 popstate.dat 中尚未存在的任何 UID 都是要检索的新消息。 UIDL 命令先前返回消息号和关联的 UID。 然后,Thunderbird 必须使用与尚未检索到的 UID 关联的消息号执行 POP3 RETR 命令。 Thunderbird 还必须查看 popstate.dat 中的标志并对关联消息采取任何操作。 例如,标志 d 告诉 Thunderbird 删除关联的消息。 f 标志意味着 Thunderbird 只有消息的截断部分,应该检索完整的消息。

在某个时刻,Thunderbird 会使用新消息更新 popstate.dat。 我认为这发生在所有操作完成后对 popstate.dat 的批量更新中。 也就是说,如果有 10 条新消息需要检索,则在检索完所有 10 条消息之前,popstate.dat 不会更新。

我认为我的问题出在服务器上。 显然,我们的基础设施升级到了新版本的 POP 服务器,并且在新版本上分配了新的 UID。 我的 popstate.dat 拥有所有旧的 UID。 到新 POP 服务器的 UIDL 发送 Thunderbird 未在 popstate.dat 中列出的 5000 多个 UID 列表。 因此,Thunderbird 继续下载所有 5000 多条消息。 如果新的 POP 服务器保留了旧的 UID,那么 Thunderbird 就会发现我已经检索了 5000 多条消息中的大部分,并且会下载我没有的消息。 我认为我的组织中的大多数人都使用 Outlook,而不使用 POP3,但是对 POP 服务器进行的版本更新并没有给这些用户带来问题。 似乎需要额外小心以确保新服务器与旧服务器具有相同的 UID。 活到老,学到老!

Thunderbird has a file called popstate.dat that contains the UID, an timestamp (epoch), and a flag. The flag indicates the action that Thunderbird is to perform for the associated message.

Evidently, Thunderbird does not actually work like I described above. I think Thunderbird does the following. It sends a POP3 UIDL command to get a list of the UID's stored on the POP server. It then compares this list to the UID's stored in popstate.dat. Any UID's that are not already in popstate.dat are new messages to be retrieved. The UIDL command previously returned the message number and the associated UID. Thunderbird must then do an POP3 RETR command using the message number associated with the UID's that it has not yet retrieved. Thunderbird must also look at the flag in popstate.dat and take any actions for the associated message. For example, the flag d tells Thunderbird to delete the associated message. The f flag means that Thunderbird has only a truncated part of the message and should retrieve the full message.

At some point Thunderbird updates the popstate.dat with the new messages. I think this happens in a batch update to popstate.dat after all the actions have been completed. That is, if there are 10 new messages to retrieve, popstate.dat is not updated until all 10 messages have been retrieved.

I think my problem resides on the server. Apparently our infrastructure upgraded to a new version of the POP server and new UIDs were assigned on the new version. My popstate.dat had all the old UIDs. The UIDL to the new POP server send a list of 5000+ UIDs that Thunderbird did not have listed in popstate.dat. So, Thunderbird proceeded to download all 5000+ messages. If the new POP server had retained the old UID's then Thunderbird would have seen that I already had retrieved most of the 5000+ messages and would have just downloaded the ones that I did not have. I think most people in my organization use Outlook and do not use POP3, and however the version update was done to the POP server did not cause a problem for those users. Seems like some extra care was needed to ensure the new server had the same UIDs as the old server. Live and learn!

鹤舞 2024-07-17 10:48:57

服务器软件有哪个版本?

http://courier.sourcearchive.com/documentation/0.60。 0-2/pop3dserver_8c-source.html

00718 ** 消息的 UIDL 实际上只是其文件名,直到第一个 MDIRSEP 字符

您可能只需要将 popstate.dat 中 UIDL 的第一部分替换为新的?

Which version of server software there is?

http://courier.sourcearchive.com/documentation/0.60.0-2/pop3dserver_8c-source.html

00718 ** The UIDL of the message is really just its filename, up to the first MDIRSEP character

May be you just need to replace first part of UIDL in popstate.dat to new ones?

や莫失莫忘 2024-07-17 10:48:57

Thunderbird 有一个扩展可以查找重复项并删除它们。 例如,基于消息 ID(通常由邮件的原始发件人生成,因此不会随基础设施更新而改变)。

There is an extension for Thunderbird to find duplicates and delete them. e.g. based on message-id (which is usually generated by the original sender of the mail and thus hasn't changed with your infrastructure update).

生来就爱笑 2024-07-17 10:48:57

也许不是OP正在寻找的答案,但这可能对他有帮助。
我也遇到过类似的问题,为了解决这些问题,我创建了一个小的 php 脚本来重建 popstate 文件。
您可以在这里找到它:

https://github.com/Magentron/rebuild_thunderbird_popstate

用于重建 Thunderbird 的 popstate.dat 文件的简单 PHP 脚本。 主要是
当 Thunderbird 崩溃并开始检索所有消息后很有用
已保存在邮件服务器上。 将生成的默认文件
是 popstate.dat.GENERATED。 如果将其更改为 popstate.dat 文件
相应的 Thunderbird 目录,请确保 Thunderbird 是
关闭,否则您可能会遇到更多问题。

请注意,我们并没有尝试让这个代码成为我曾经见过的最好的代码
写...

注意:Windows 支持已存在,但从未测试过!

用法

usage: rebuild_popstate.php [-d] [-i n] [-s] [-v] [-f file] server [ port ]
    -c      CRLF flag, use when talking to Windows servers
    -d      debug flag
    -f      output filename (if popstate.dat, Thunderbird needs to be closed!)
    -i      ignore the last n messages (for if you don't have them yet)
    -s      use for secure POP3 (SSL/TLS)
    -v      verbose flag

Perhaps not the answer the OP is exactly looking for, but it may probably help him.
I have had similar problems and to resolve them I have created a small php script to rebuild the popstate file.
You can find it here:

https://github.com/Magentron/rebuild_thunderbird_popstate

Simple PHP script to rebuild the Thunderbird's popstate.dat file. Primarily
useful when Thunderbird crashes and after starts retrieving all messages
that have been kept on the mail server. Default file that will be generated
is popstate.dat.GENERATED. If you change this to the popstate.dat file in
the appropriate Thunderbird directory, please make sure that Thunderbird is
closed, otherwise you might have more problems.

Please note that no attempt has been made to make this the best code I ever
wrote...

NB: Windows support is there, but never tested!

Usage

usage: rebuild_popstate.php [-d] [-i n] [-s] [-v] [-f file] server [ port ]
    -c      CRLF flag, use when talking to Windows servers
    -d      debug flag
    -f      output filename (if popstate.dat, Thunderbird needs to be closed!)
    -i      ignore the last n messages (for if you don't have them yet)
    -s      use for secure POP3 (SSL/TLS)
    -v      verbose flag
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文