IMAP Message UID
[This post was originally posted as a Stackoverflow question.]
In RFC3501 there is
184.108.40.206. Unique Identifier (UID) section:
A 32-bit value assigned to each message, which when used with the unique identifier validity value (see below) forms a 64-bit value that MUST NOT refer to any other message in the mailbox or any subsequent mailbox with the same name forever.
Most tools like
Zend\Mail in PHP use the microtime, process id and uname to generate an UID for an email. So I get something like
1400603156.789.5617.imac.home,S=129:2,S. This is not conform with RFC3501. Zend Mail can handle Maildir format so I don’t care about managing email files on the harddisk. But if I can’t handle Zend Mail’s UID for RFC conform transmission I need a separate database where I have an allocation.
So I still need to manage the UIDs in a separate place. Or is there another solution?
Update, 2014-05-21 12:02: Solution
Yes, generally an IMAP server keeps a database of UIDs separate and maps them to say, Maildir files. They are not intrinsic to the email themselves, they are added by the server for client convenience.