Hello,

What you are after is generating a UID (Universal Unique IDentifier). 
There are libraries and console apps already written to do this.  If you
using linux, try this at the command line:

[EMAIL PROTECTED] james]$ uuidgen
7b79045a-0bfe-46a7-8a61-1d1008c03830

It will give you a totally unique 32 digit identifier that is partialy
based on mac address, time, etc.  No two will ever be alike, even from the
same machine at the same time.

Many people (myself included) use UUID for unqique DB primary keys.  They
allow tables to be combined across multiple machines and databased without
fear of overlap.

I checked out DBmail a while ago and send in some new indexes for the
MySQL DB schema that was in use at the time.  Tonight I just decided to
check up on the list again.  I'm glad to see that there is a little
interest in revisiting the DB schema.  I think DBmail could be increadibly
powerful once it has a schema and index structure that is truely optimized
for real world IMAP use.  (POP3 is another story and easier in my opinion)

If properly executed, with the proper schema and indexing in MySQL, DBmail
could be far faster then anything out there. (Cyrus, etc)  Full text
search indicies alone would make it amazing, but that does involve
breaking out the headers and creating a new schema.

-James



(Jesse Norell said:
> Hello,
>
>  One more time - in my second patch for this fixed the
> race condition with simultaneous inserts, but I left out
> the fix for delivering to multiple recipients.  This one
> does both (it doesn't seed rand() because it only uses
> it for a changing/unique value).  It's been running fine
> for 16 hours now on our system.  If someone could think
> of a way to get a truely unique value across multiple
> machines, between multiple processes on one machine,
> and can eg. be incremented per recipient in a single
> message, it'd be better (eg. select some uniqueness from
> the common database server to seed rand(), or...).
>
> Jesse
>
>> unique_id fix (*)                         Jesse Norell       tmp-empty
value fails with db constraints
>
>
>
> --
> Jesse Norell
> [EMAIL PROTECTED]



Reply via email to