GNU bug report logs -
#58472
[PATCH] Make `message-unique-id' less prone to collisions
Previous Next
Reported by: Stefan Kangas <stefankangas <at> gmail.com>
Date: Wed, 12 Oct 2022 16:09:01 UTC
Severity: wishlist
Tags: patch
Done: Stefan Kangas <stefankangas <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Matt Armstrong <matt <at> rfc20.org> writes:
> Most email I get today to use a UUID or UUID-like Message-ID, like this:
>
> Message-ID: <736d10a6-001f-4a29-a1d4-554f58733b69 <at> dfw1s10mta1086.xt.local>
> Message-ID: <1815053947.8446619.1665544925708 <at> lor1-app45123.prod.linkedin.com>
> Message-ID: <01000183b9eaa6f8-411d1f4c-b573-472d-b45f-47b0c4eb6ace-000000 <at> email.amazonses.com>
> Message-ID: <CABqZ1wa8MxrieVKZ11adZUV2qB_CnpMJoFEn-U3d5CQ7z7smWw <at> mail.gmail.com>
Those are 30-51 characters in length. I also note that Gmail uses both
lower case and upper case characters.
>> If we limit the length of the time string to 12 characters, and the
>> total length to 25 characters (including the ".gnu" part), we still have
>> a guaranteed 9 characters of random data, or 46 bits of entropy.
>
> I suspect that most mailers use more randomness than that.
So I guess we might as well bump this up to 30 characters in total,
which gives us 72 bits. The Message-IDs would look like:
cnkrs75yamag1k7x8rnt3y50za.gnu <at> stefankangas.se
cnkrifkirauwuwfkzs3rcit8cq.gnu <at> stefankangas.se
We could go longer, but it's also nice to have something which is not an
absolute abomination to look at.
If we add in upper case characters too, we can encode the time with one
less character. So we end up with 89 bits of randomness and this:
1Z2KnqE1t2bSgUWkcu53M34Y4y.gnu <at> stefankangas.se
1Z2KbUgleGoe0WRJ3jbiM0mE7W.gnu <at> stefankangas.se
If we don't want to always start the Message-ID with the same characters
(which makes them more distinct, at a glance), we could just reverse the
time string:
QlRXPpmK2Z1kUklxIpMNZpChOu.gnu <at> stefankangas.se
Z59YikmK2Z1FSmYj172SAdPpuX.gnu <at> stefankangas.se
> Some of the SHA hash algorithms are in the public domain. Could they be
> added to Emacs and used for UUID generation here?
We have `secure-hash'. Is that what you mean? Or do you mean to use a
proper RFC 4122 UUID?
All we need is for the Message-ID to be unique though, so some ad hoc
solution is probably fine.
This bug report was last modified 2 years and 173 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.