email Message-ID: What is a good algorithm to create this?

Barry A. Warsaw barry at digicool.com
Sun Apr 1 22:37:03 EDT 2001


>>>>> "SK" == Sheila King <sheila at spamcop.net> writes:

    SK> What is a good way for my script to generate Message-IDs?

Here's what I use in Mailman, when posting a message from email to
usenet via the mail->news gateway:

        msg['Message-ID'] = '<mailman.%d.%d.%s@%s>' % (
            time.time(), os.getpid(), mlist.internal_name(), mlist.host_name)

Note that mlist.internal_name() is something like "python-list" and
mlist.host_name is something like "python.org".

I use this particular format because it's regular enough to write a
regexp to recognize it and pull the constituent pieces out.  Seems
like it ought to generate unique enough Message-ID:'s.

-Barry




More information about the Python-list mailing list