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
Right click with your mouse inside the visble area of the web-page somehwhere. A context menu should appear, select "view page source". Alternativeley just type ctrl-u. A completely new browser tab will open and in the address bar of this new tab you can see the URL that you are looking for.
When you use IMAP, you can read your Gmail messages on multiple devices, and messages are synced in real time. You can also read Gmail messages using POP.
For non-Gmail clients, Gmail supports the standard IMAP, POP, and SMTP protocols. The Gmail IMAP, POP, and SMTP servers have been extended to support authorization via the industry-standard OAuth 2.0 protocol.
Gmail provides an attribute: X-GM-THRID
for thread id.
You can use imap fetch
function for getting the thread id.
Also see the documentation here.
Found something. May be someone need. I don't know how to use ruby, I want use php, but don't know how to extend standart imap functions in php.
openssl s_client -crlf -connect imap.gmail.com:993 . login username password . select inbox . FETCH 1 (X-GM-THRID)
you'll get something like this * 1 FETCH (X-GM-THRID 1327644190303473294)
next you need to convert it from decimal to hexadecimal value:
<?php echo dechex(1327644190303473294); ?> //return 126cbd5b5f264e8e
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With