简体   繁体   中英

What is the maximum value for UID in an email inbox folder?

I'm working on an application that uses the UID to fetch emails from exchange server. The UID appears to be only 6 digits long. Does that mean its maximum value is 999999? It's possible my inbox will reach over 1 million emails and I need a way to uniquely identify each email in the Inbox folder.

By the RFC , it can be up to a 32-bit number, so 4,294,967,295:

Unique Identifier (UID) Message Attribute: 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.

If you've had more than 4 billion emails in the past, the server will be forced to reindex, and change the UIDVALIDITY , invalidating any client caches. If you currently have more than 4 billion, this cannot be strictly represented by an IMAP server.

Any given server implementation may have lower limits. The numbers aren't zero padded, so it's likely you just haven't had a million messages yet. When you do, you'll start seeing seven-digit UIDs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM