Find Gmail url-IDs via IMAP

后端 未结 9 980
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-07 16:02

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

相关标签:
9条回答
  • 2020-12-07 16:30

    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.

    0 讨论(0)
  • 2020-12-07 16:42

    Seems that the google link (https://mail.google.com/mail/#all/124c8f386d41fd3a) points to the whole conversation.

    IMAP itself does not have such feature (grouping conversations)

    [Update]

    It is possible with X-GM-THRID Gmail's IMAP extension.

    124c8f386d41fd3a is Gmail's thread-id in hex.

    You can read more here: http://www.limilabs.com/blog/create-gmail-url-id-via-imap

    0 讨论(0)
  • 2020-12-07 16:43

    It's been a while but anyone who finds themselves looking for this information should read this:

    Gmail provides a unique message ID for each email so that a unique message may be identified across multiple folders. Retrieval of this message ID is supported via the X-GM-MSGID attribute on the FETCH command. The message ID is a 64-bit unsigned integer and is the decimal equivalent for the ID hex string used in the web interface and the Gmail API.

    The following is an example transcript of a call to retrieve the X-GM-MSGID of a message with the FETCH command:

    a006 FETCH 1 (X-GM-MSGID)
    * 1 FETCH (X-GM-MSGID 1278455344230334865) a006 OK FETCH (Success)
    

    The X-GM-MSGID attribute may also be used in the SEARCH or UID SEARCH commands to find the sequence numbers or UID of a message given Gmail's message ID. The following is an example transcript of a call to retrieve the UID of a message using the UID SEARCH command:

     a007 UID SEARCH X-GM-MSGID 1278455344230334865
     * SEARCH 1 a007 OK SEARCH (Success)
    

    the above is an extract from the following source: https://developers.google.com/gmail/imap_extensions?csw=1#access_to_the_gmail_unique_message_id_x-gm-msgid

    0 讨论(0)
提交回复
热议问题