Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] Re: UniqueID for email messages

From: greggirwin:mindspring at: 8-Nov-2003 18:23

Hi Phil, puc> When an email is send from rebol by default it doesnt have a message-ID puc> By using send/header we can add text to the message-ID field, but how puc> should the message-ID be calculated? Well, it looks like it needs to be <something>@<host>, at least per the RFC it needs to match the rules for an address. So, that gives us the only hard guideline, beyond guaranteeing uniqueness. ;) Looks like most of them use the senders host. Some even include the whole address. It looks like some folks use a timestamp (e.g. combine "now/date - some-date" and "to decimal! now/time") combined with a random element, or perhaps a value based on hashing the user part of the address; could even do a checksum/secure on it I suppose. I've used the CoCreateGUID stuff under Windows before, for similar purposes (unique object IDs), but that's not portable. The idea behind the algorithm is good though. Can't remember the DCE spec on it, but I'm pretty sure there's a counter to go with the timestamp and maybe something that checks for time-warps as well. Then you generate a unique hardware element (based on the NIC or other bits of info combined). I guess the big questions are: How unique do you need it to be? That is, how much effort do you want to put into guaranteeing uniqueness. How big can it be? The longer you make it, the easier it will be to make it unique. Another question would be: Are there any particular uses you want to leverage it for beyond just being a unique ID? I'm always leery of commandeering things like that, but it's worth asking. -- Gregg