Subject: [Imap-uw] Changing UIDVALIDITY on Empty Folders

From: Marc Blank <[email-masked]>
Date: Mon, 18 Jul 2005 08:50:56 -0700

Hi, all.

I've noticed that on at least one server running UW-IMAP, that an empty 
folder (in this case Drafts), when SELECTed at various times and in 
various sessions, keeps returning a different UIDVALIDITY value.  Is 
this correct behavior?

Marc
_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

---

From: Mark Crispin <[email-masked]>
Date: Mon, 18 Jul 2005 10:17:46 -0800

On Mon, 18 Jul 2005, Marc Blank wrote:
> folder (in this case Drafts), when SELECTed at various times and in various 
> sessions, keeps returning a different UIDVALIDITY value.  Is this correct 
> behavior?

It's permitted behavior by the IMAP specification.  UW imapd does not 
consider it to be good behavior, but it's unavoidable.

What's going on is that the file is truly empty, and thus does not have 
any metadata.  In traditional UNIX mailbox format, the widely-derided "DO 
NOT DELETE" internal pseudo-message (which UW imapd, Pine, etc. hides) 
contains the metadata; but this upsets some people, and so they do things 
to prevent the pseudo-message and/or destroy it.  [The issue is shell 
tests that treat empty files as "no mail" and non-empty files as "mail 
exists"]

Fortunately, since the mailbox is empty, a changing UIDVALIDITY value 
should not overly-upset a client.  The client should just say "oh well" 
and update its record of the UIDVALIDITY.  Since, as you saw, this can be 
routine in some environments, it's not an event that is worth logging, 
much less complainig to the user.

In some formats, such as UW imapd's preferred mbx, an empty mailbox is not 
an empty file, and thus this problem does not occur.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.
_______________________________________________
Imap-uw mailing list
[email-masked]
https://mailman1.u.washington.edu/mailman/listinfo/imap-uw

---

From: Marc Blank <[email-masked]>
Date: Mon, 18 Jul 2005 12:12:09 -0700

I was hoping that I could use the UIDVALIDITY in some way to identify a 
"unique" folder on the server (i.e. with the name).  But obviously this 
won't work...

Marc

Mark Crispin wrote:
>> I've noticed that on at least one server running UW-IMAP, that an 
>> empty folder (in this case Drafts), when SELECTed at various times and 
>> in various sessions, keeps returning a different UIDVALIDITY value.  
>> Is this correct behavior?
> 
> 
> any metadata.  In traditional UNIX mailbox format, the widely-derided 
> "DO NOT DELETE" internal pseudo-message (which UW imapd, Pine, etc. 
> hides) contains the metadata; but this upsets some people, and so they 
> do things to prevent the pseudo-message and/or destroy it.  [The issue 
> is shell tests that treat empty files as "no mail" and non-empty files 
> as "mail exists"]
> 
> and update its record of the UIDVALIDITY.  Since, as you saw, this can 
> be routine in some environments, it's not an event that is worth 
> logging, much less complainig to the user.
> 
> In some formats, such as UW imapd's preferred mbx, an empty mailbox is 
> not an empty file, and thus this problem does not occur.
> 
> -- Mark --
>

---

From: Mark Crispin <[email-masked]>
Date: Mon, 18 Jul 2005 11:38:43 -0800

On Mon, 18 Jul 2005, Marc Blank wrote:
> "unique" folder on the server (i.e. with the name).  But obviously this won't 
> work...

Well, in a sense it does, but perhaps not in the sense you hoped.  The 
mailbox name + UIDVALIDITY certainly identifies a unique instance in that 
it won't be duplicated by some other mailbox.  You can rely upon that.

But you can't assume that this identification is static; although a mail 
store which does not maintain UIDVALIDITY for mailboxes with messages 
can be considered defective (although not "non-compliant").  Some of the 
formats supported by UW imapd are defective in this way, although the 
major formats are not.

The default setting of UW imapd avoids changing UIDVALIDITY even with 
traditional UNIX mailbox format; but there isn't much that can be done if 
the site (or user) insists (deliberately or inadvertantly) upon sabotaging 
the mechanism that is used.

-- Mark --