No need to use UUIDs. Message IDs just have to be unique. Combining fully qualified hostname, timestamp (even if only with second resolution), process ID, and a random number should be sufficient.

Let's look at some real-world data:

Running grep -h -i --perl '^Message-ID' * in my inbox (in imapdir format, i.e. one file per mail, no special encoding) returns these (duplicate formats mostly removed, some names and numbers X-ed out):

Message-ID: <24746fb3-8c48-1412-5e8b-bfdb6735b214@foken.de> Message-ID: <re-pLd1axQBsDx57b7oqugsM5Ofj-2078PSB9-205B0OGX-ZD2Q32@new +sletter.lieferando.de> Message-ID: <8f31036b-d534-2c6d-fde4-ec03aa28b355@gmx.de> Message-ID: <20170102172202.74342.42518@pde-live-app5> Message-ID: <y-b-vryxQaigSHMT84qhHg@ismtpd0001p1lon1.sendgrid.net> Message-ID: <fe996f03-5674-4184-321a-cc1a4a1e83b5@cXXXXXd.de> Message-ID: <53149ca4-dc49-1a83-2878-d5ac005bee1d@foken.de> Message-ID: <CAJ5Xak6KKnmo-4HxLeNg1aGyRTkmYGdPM6ph=tfCxpg0j_s9gw@mail. +gmail.com> Message-Id: <20170105030539.A68907C4A0@srv162.bader.de> Message-ID: <1bd0c853-751c-d823-8e3b-147d588c296f@foken.de> Message-ID: <286043904.95.XXXX7354XXXX.JavaMail.ggbader1@gtunxlvh00658 +.server.arvato-systems.de> Message-ID: <m0b8cdt0E34Nqdu.RZmta@smtp.rzone.de> Message-ID: <20170122_102124_047518.vroom@perlmonks.org> Message-ID: <1555628483.587.14XXX486XXX.JavaMail.amsap21@degtams2> Message-ID: <01020159f3ff5810-5fXXXXX-215f-4b49-b4dd-3a5eafXXXXX-00000 +0@eu-west-1.amazonses.com> Message-ID: <5890EE9C.2000604@foken.de> Message-ID: <E5-gkhm1jm5-nr113/XX/XXXXX-18f0a3bd@wrk-1505.artegic.net> Message-Id: <20170213123704.2723380261@web3.po23.spacenet.de> Message-ID: <17997d6269704c37af1f86b072d23dc6@pollin-exchange.pollin-d +e.local> Message-ID: <1043052060.59.1488540102150.JavaMail.lithium@sjc1papp91.s +j.lithium.com> Message-ID: <ic974ihadr6t5xjxk1mstfvr.1489696175625@email.android.com> Message-Id: <15b576a93ed-3749-7fc5@webstg-a10.mail.aol.com> Message-Id: <E1d2qiD-0008PH-8Y@enterprise.foken.wtm> Message-ID: <D5261642.F9DB%kontakt@juXXXXXka.de> Message-ID: <001201d2c27b$206d5dd0$61481970$@gmx.de> Message-Id: <20170503161455.17E47482CA@dvm034.uptrade.de> Message-ID: <5.5e9852b0cf96ca350167@NY-WEB01> Message-ID: <8111f0b0-7d50-4564-b756-0a872e7361a5@chd1b02c-4776>

Yes, there are UUIDs, almost always combined with a hostname. But there is also other more or less hashed data. Sometimes, its a plain timestamp (20170503161455 is obviously 2017-05-03 16:14:55) or a unix timestamp (1488540102150 is milliseconds since 1970 for 2017-03-03 11:21:42 UTC). kontakt@juXXXXXka.de is the address I wrote to, it was used as part of the message ID of the reply. And similar to boundary strings, you can find fragments of domain names, hostnames and user agent names in the message IDs, as well as bas64 and hex encoded "junk", and some seemingly random printable characters.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

In reply to Re^2: Generating Message_id email headers by afoken
in thread Generating Message_id email headers by astrobal

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.