Search code examples
emailemail-headers

How to guarantee an email is unique?


An email has a Message-ID that is guarenteed unique by either the client program sending the email or the first email server (source).

To declare an email as unique then, I'd need both the Message-ID and an ID of the client program sending the email or first mail server- is this possible? I can't find any reference to the latter in the following email standards:


Solution

  • Mail clients often use a universally unique identifier (UUID) for this purpose – which (in this case) is just a special formatting of a random number. Since 122 of the 128 bits are chosen randomly, the chance of a collision is vanishingly small.

    There are two main reasons why mail clients should add the Message-ID:

    • If the outgoing mail server adds the Message-ID, then this information is missing in the sent folder on the incoming mail server, which means the sender couldn't use it for conversation threading, defeating its purpose.
    • The mail client may submit several versions of the same message to the outgoing mail server, such as mentioning each Bcc recipient in its own copy of the message, and all these versions should have the same Message-ID.