MBOX-Line: From mrc+imap at panda.com  Tue Jun  1 15:58:25 2010
To: imap-protocol@u.washington.edu
From: Mark Crispin <mrc+imap@panda.com>
Date: Fri Jun  8 12:34:43 2018
Subject: [Imap-protocol] Persistence of UIDs across moves
In-Reply-To: <4C058BF2.22215.5F102940@David.Harris.pmail.gen.nz>
References: <4C058BF2.22215.5F102940@David.Harris.pmail.gen.nz>
Message-ID: <alpine.OSX.2.00.1006011543010.77397@hsinghsing.panda.com>

On Wed, 2 Jun 2010, David Harris wrote:
> *   User moves a message from inbox to another mailbox.
> *   User moves the same message from the other mailbox back to the
>    inbox.
> The question is, does IMAP expect that the message will have the
> same UID after being moved back into the inbox?

No.

Once a message is expunged from a mailbox its UID is gone forever (at
least as long as the UIDVALIDITY last).

Now, if the "move" was implemented as copy+delete WITHOUT expunging the
message in the source mailbox, then that message could be undeleted and
thus retain the same UID.  But in this case, it wasn't "moved back"
(except perhaps in a users GUI); it was never expunged.

However, that kind of "move" and "move back" would be a client-side
implementation.  A server has no latitude to make that kind of decision.

> It is possible to read this as meaning that once any specific message
> has been assigned a UID in a folder, it should always have that UID
> any time it is replaced in that folder, until such time as UIDVALIDITY
> changes.

Fortunately, that reading is incorrect.

Perhaps the text should have said "single immutable instance of a message"
instead of "single immutable message".

The incorrect reading would make sense in a world with global UIDs.  IMAP
does not have global UIDs.  If it did, it would require the invalidation
of either the property of strict ascendency of UIDs or the property that
new messages always are appended to the mailbox sequence space (instead of
inserted).

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.

