Find Gmail url-IDs via IMAP

后端 未结 9 990
爱一瞬间的悲伤
爱一瞬间的悲伤 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: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

提交回复
热议问题