[Python] MSGraph ImmutableId of a message changes when draft is sent

Discussão em 'Python' iniciado por Stack, Abril 23, 2025.

  1. Stack

    Stack Membro Participativo

    I am trying to keep track of emails sent using the MSGraph API. If an email is sent using the Reply endpoint, it understandably does not return the messageId property that I need in the response body. Searching around on the internet suggested that if I need to keep track of a message's messageId, that I should:

    • use immutableIds
    • create a draft using the create draft to reply endpoint
    • record the immutableId of the draft
    • send the draft using the send endpoint
    • I should then be able to use the recorded messageId to retrieve the email message in question and do whatever I need to do

    Per the previously linked documentation for immutableIds


    An item's immutable ID won't change so long as the item stays in the same mailbox. That means that immutable ID will NOT change if the item is moved to a different folder in the mailbox.
    ​

    My experience directly contradicts this quote. Unless I am misunderstanding how this all works? I was under the impression that creating a draft instantiates a Message object, and sending the draft essentially alters and moves that Message object to the sentItems folder, which should not change the messageId. However, I am observing that the messageId does in fact change after being sent.

    Is there a way to reliably get the messageId of a message after it has been sent?

    Continue reading...

Compartilhe esta Página