Barra Seck writes:
My api should retrieve the mails one by one and all the time indicates with 5 decimals an identifier to the current retrieved mail and to the next mail.
Seems like you need to map the hard way - persistent mappings from the UIDVALIDITY+UID to your own numbers.

The simplest mapping would be subtraction. Like this:

if ( you have an offset for this UIDVALIDITY )
read the offset from persistent storage
else
use take the smallest UID in the mailbox as offset
wite that offset into persistent storage
use "your number = uid - offset" to map between UIDs and your numbers

Your messages will be numbered from 0 to whatever, where "whatever" is the number of messages that have been delivered (and perhaps deleted) since the oldest message was delivered.

That'll usually work quite well. There'll be problems when 100,000 messages have been added to the mailbox, and in a few other cases. I think that's almost inescapable: If you want to represent messages with five-digit numbers and there are more than 99,999 messages, something has to break.

Or perhaps you can use MSNs.

--Arnt


Reply via email to