After installing a new server with dovecot 1.2.4, I found there is some new dovecot-uidvalidity* files in user's Maildir directory. However, I did not see such files in other servers with dovecot 1.1.2 (around 2008/07). What is function of those files? What will happen if I delete that files? I am curious why need to keep 2 files: dovecot-uidvalidity dovecot-uidvalidity.4aa4fa4c since the content of dovecot-uidvalidity is '4aa4fa4c' why do we need extra files? Thanks Timo for providing the wonderful dovecot software! Hope you don't mind my stupid questions. Sincerely, Tim Chen
On Wed, 2009-09-09 at 16:07 +0800, Tim Chen wrote:> After installing a new server with dovecot 1.2.4, I found there is some new > dovecot-uidvalidity* files in user's Maildir directory. However, I did > not see such files in other servers with dovecot 1.1.2 (around 2008/07). > > What is function of those files?To assign a unique UIDVALIDITY to created mailboxes.> What will happen if I delete that files?They get recreated when you create a new mailbox.> I am curious why need to keep 2 files: > dovecot-uidvalidity > dovecot-uidvalidity.4aa4fa4c > since the content of dovecot-uidvalidity is '4aa4fa4c' > why do we need extra files?It's a trick to be able to assign the UIDVALIDITY really fast and without locking. dovecot-uidvalidity.<UIDV> is the authoritative file and <UIDV> value is cached in dovecot-uidvalidity. So assigning a new UIDVALIDITY goes like: 1. Read <UIDV> from dovecot-uidvalidity 2. rename dovecot-uidvalidity.<UIDV> to dovecot-uidvalidity.<UIDV+1> 3. Write dovecot-uidvalidity.<UIDV+1> to dovecot-uidvalidity If step 1 or step 2 fails (rare), it fallbacks to slower behavior where it finds readdir()s through the directory to find the latest dovecot-uidvalidity.<UIDV>. -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 197 bytes Desc: This is a digitally signed message part URL: <dovecot.org/pipermail/dovecot/attachments/20090909/afeabaa6/attachment-0002.bin>