通过IMAP查找Gmail网址ID [英] Find Gmail url-IDs via IMAP

查看:172
本文介绍了通过IMAP查找Gmail网址ID的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最喜欢的Gmail功能之一是能够将url标记为某些类似以下内容的消息:

https://mail.google.com/mail/#all/124c8f386d41fd3a



我想要做的是编写一个脚本,通过IMAP访问我的Gmail帐户,并创建一个HTML页面,其中包含上述链接,供我感兴趣的每条消息使用。



但是,似乎无法从IMAP信封或UUID属性中找到124c8f386d41fd3aID。我发现的所有message-id和uuids都是不同的格式,不能用于生成到我的收件箱的有效链接。



有人知道如何查找那些url-id在IMAP中?



- FelixGeisendörferaka the_undefined

PS:我使用Ruby和我以前的尝试包括:

$ pre $ imap.fetch(message_id,UID)
imap.fetch(message_id, ENVELOPE)
imap.fetch(message_id,...)

我试过所有属性在 ruby​​ imap文档中列出了FetchData

解决方案

实际上,获取消息直接链接的唯一官方方法是通过atom feed为未读消息提供( https://gmail.google.com/gmail/feed/atom )...
唯一的困难是你ha已经可以进行身份​​验证了,这在使用Feed时并不常见,而且目前有15条新消息的限制,所以任何新消息都会推出最老的消息!
我希望他们能尽快以其他方式提供,无论是通过IMAP还是API ...


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

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.

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.

Does anybody know how to find those url-IDs in IMAP?

-- Felix Geisendörfer aka the_undefined

PS: I am using Ruby and my previous attempts included:

imap.fetch(message_id, "UID")
imap.fetch(message_id, "ENVELOPE")
imap.fetch(message_id, ...)

I tried all properties listed for FetchData in the ruby imap docs

解决方案

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网址ID的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆