[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: uidvalid



On 12 Aug 2000, Anthony Doggett wrote:

> What /is/ the purpose of uid validity?

IMAP servers use so-called uids (universal ids? unique ids?) to
identify each message in a folder, in addition to Message-IDs.
In order to allow freedom of implementation, the uids aren't required
to stay valid arbitrarily long, however.

For example, an IMAP server could number the messages sequentially:
the first message in a folder gets number 1 and so on.  Now, these
numbers change when a message is deleted from the server.  So after
message deletion, the uids become invalid.

This is where uidvalidity comes in: as long as the uidvalidity value
for a folder stays the same, you can count on the uids to stay the
same, too.  But when the uidvalidity value changes, the uids may be
wrong.

Gnus also identifies messages by number (in addition to Message-ID).
Suppose you have a folder with 10 messages, and you have read them
all.  Then Gnus stores that you have read messages 1 through 10.  Now
suppose two messages are deleted, and one new message arrives.  The
new message will have number 9, and so Gnus thinks that you have
already read it.

Therefore, Gnus warns you whenever the uidvalidity value changes.

I _think_ that the following can be done successfully: say M-x
gnus-group-clear-data RET on the IMAP group, then use `G p' to remove
the uidvalidity value.  This will cause Gnus to `forget' that you have
read messages 1 through 10 for the group.  But the next time the IMAP
server is contacted (or when Gnus starts?), Gnus will ask the server
for the marks.  And the IMAP server still knows which messages you
have read, and nnimap reads that information from the IMAP server.  So
the next time you enter the group, Gnus should update its information.

Does this actually work?  If it does, it might be useful to have M-x
gnus-group-clear-data RET clear out the uidvalidity value, too.  Then
it becomes easier to deal with the uidvalidity problem.  It could even
be made automatic, with proper care and feeding.

kai
-- 
I like BOTH kinds of music.