53

How unique is the Message ID header of an email? If I address an email to two people, will the both have the same Message ID? Or will they be different?

(This is assuming nobody's doing any funny business. I know that with spam, all the rules go out the window...)

3 Answers 3

52

According to RFC2822 - Internet Message Format, the short answer is that the "Message ID should be unique for each instance of the message"; however, the MESSAGE-ID field is considered optional and how the MESSAGE-ID field is created is up to the server. Quoted below:

The "Message-ID:" field provides a unique message identifier that refers to a particular version of a particular message. The uniqueness of the message identifier is guaranteed by the host that generates it (see below). This message identifier is intended to be machine readable and not necessarily meaningful to humans. A message identifier pertains to exactly one instantiation of a particular message; subsequent revisions to the message each receive new message identifiers. Note: There are many instances when messages are "changed", but those changes do not constitute a new instantiation of that message, and therefore the message would not get a new message identifier. For example, when messages are introduced into the transport system, they are often prepended with additional header fields such as trace fields (described in section 3.6.7) and resent fields (described in section 3.6.6). The addition of such header fields does not change the identity of the message and therefore the original "Message-ID:" field is retained. In all cases, it is the meaning that the sender of the message wishes to convey (i.e., whether this is the same message or a different message) that determines whether or not the "Message-ID:" field changes, not any particular syntactic difference that appears (or does not appear) in the message.

3
  • 11
    When you say each "instance" of the message, are you saying that each recipient will have a different message ID? Nov 6, 2012 at 16:09
  • @james.garriss: if you include someone in the To or Cc header, they are "intended" to get the same message. Arguably this is not the case if you bcc someone. I would expect all to/cc'd recipients to get the same message-id and consider it a bug if they didn't. Off-hand I don't know where I fall on the bcc divide.
    – jmoreno
    Apr 10, 2016 at 3:40
  • 1
    Gmail assigns the same Message-Id to all recipients of an email, including bcc recipients.
    – John
    Aug 6, 2023 at 8:51
18

Typically, all recipients will receive exactly the same message, both body and headers, with the exception of headers that are added en-route (eg: "Received" headers). The Message-ID header is generated by the sender, so all recipients should see the same Message-ID.

3
  • 2
    Example: if you subscribe to two lists and someone cross-posts a single message, you may receive two messages with one Message-ID. Some e-mail clients will show both. More advanced clients such as Apple Mail are designed to show multiple copies, of one message, as one. Jun 10, 2012 at 8:59
  • 2
    Yep, RFC be damned... what people really want is an id per message, not per instance. Feb 1, 2014 at 17:38
  • This may be true, but there's no requirement for the sender to generate the Message-ID, and it's common that they don't (e.g. most web apps don't). In most of those cases, the Message-ID gets generated by the first MTA that the message gets sent through. Also, in the modern age of tracking deliverability and the like, it's very common to generate a unique sender address for each email that goes out, in order to help identify which recipient was associated with any bounce that might occur, or identification as spam (which turns up in DSPAM reports), etc.
    – mc0e
    Jan 9, 2015 at 21:26
4

for bulk mailing, it's better to be unique for each mail, the message id may be the only information your get back from spam notifications or bounces so it should be unique for each message.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.