通过 IMAP 查找 Gmail url-ID [英] Find Gmail url-IDs via IMAP
问题描述
我最喜欢的 Gmail 功能之一是能够为某些邮件的网址添加书签,如下所示:
One of my favourite features of Gmail is the ability to bookmark urls to certain messages like this:
https://mail.google.com/mail/#all/124c8f386d41fd3a
我想做的是编写一个脚本,通过 IMAP 访问我的 Gmail 帐户并创建一个 HTML 页面,其中包含指向我感兴趣的每封邮件的链接.
What I would like to do is write a script that accesses my Gmail account via IMAP and creates an HTML page with links like the above to each message I am interested in.
但是,似乎无法从 IMAP 信封或 UUID 属性中找到124c8f386d41fd3a"ID.我发现的所有消息 ID 和 uuid 格式不同,不能用于生成指向我的收件箱的有效链接.
However, it seems there is no way to find the "124c8f386d41fd3a" ID from the IMAP envelope or UUID properties. All the message-ids and uuids I am finding are of a different format and can't be used to produce valid links to my inbox.
有人知道如何在 IMAP 中找到这些 url-ID 吗?
Does anybody know how to find those url-IDs in IMAP?
-- Felix Geisendörfer aka the_undefined
-- Felix Geisendörfer aka the_undefined
PS:我正在使用 Ruby,我之前的尝试包括:
PS: I am using Ruby and my previous attempts included:
imap.fetch(message_id, "UID")
imap.fetch(message_id, "ENVELOPE")
imap.fetch(message_id, ...)
我尝试了 ruby imap 文档中为 FetchData 列出的所有属性
推荐答案
实际上,唯一官方获取消息直接链接的方法是通过 gmail 提供的未读消息的 atom feed (https://gmail.google.com/gmail/feed/atom)...唯一的困难是您必须进行身份验证,这在使用提要时并不常见,并且目前有 15 条新消息的限制,因此任何较新的消息都会踢出"最旧的消息!我希望他们很快会以其他方式提供它,无论是通过 IMAP 还是 API...
Actually, the only official method for getting a direct link to a message is through the atom feed gmail provides for unread messages (https://gmail.google.com/gmail/feed/atom)... The only difficulty is that you have to authenticate, which is not so common using feeds, and there's currently a limitation of like 15 new messages, so any newer message will "kick out" the oldest! I hope they'll soon provide it in some other way, be it through IMAP or API...
这篇关于通过 IMAP 查找 Gmail url-ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!