Hello Bron,

does tombstone stand for deleted mailbox, which the user cannot see,
but the filesystem sees?

Adding new fields to mailboxes.db is all good, but ctl_mboxlist -d/-u
does not dump/undump these extra fields.

Greetings
  Дилян



On Wed, 2021-09-15 at 16:27 +1000, Bron Gondwana wrote:
> This is a big of a rambling description of the format for
> mailboxes.db on master now - in the UUID mailboxes world.  It doesn't
> cover all the 'T' keys for mailbox keys, you can find those in the
> code :p
> 
> So we have three types of keys.  Note that the separators are ASCII
> controls, but I've replaced them with some visible unicode blocks for
> clarity.
> 
> A keys (ACLs)
> 
> AU▓
> br...@fastmaildev.com▓fastmaildev.com▒user░masteruser_autocacps9y░#ad
> dressbooks░Shared
> 
> These are reverse ACLs - "AU" means "by userid" and then there's a
> userid and then a mailbox name in dbname format (separated by the
> domain and mailbox separators)
> 
> N keys (dbnames)
> 
> Then there's the N keys for mailboxes by name (prefix N, then a
> dbname), e.g.
> 
> This always contains the current entry at that name, which is either
> an active record like this:
> 
> Nfastmaildev.com▒user░brong░#addressbooks░Default %(T a I 081435ec-
> aa31-40b3-806b-b509cecfc4ab P default V 1625642463 C 40 F 42 M
> 1625642453 A %(br...@fastmaildev.com lrswipkxtecdn admin
> lrswipkxtecdan anyone p))
> 
> Or a tombstone record like this:
> 
> Nfastmaildev.com▒user░brong░foo░bar %(T ed I 42d62919-ba7a-4ceb-83d1-
> c467c7e8bb1a C 185 F 186 M 1629961550)
> 
> I keys (mailboxid / uniqueids)
> 
> Finally, there's the "I" key, and the "I" key is supposed to map from
> the mailboxid back to the name, as well as the history of previous
> names for the record:
> 
> e.g.
> 
> I081435ec-aa31-40b3-806b-b509cecfc4ab %(T a N
> "fastmaildev.com▒user░brong░#addressbooks░Default" P default V
> 1625642463 C 40 F 42 M 1625642453 A %(br...@fastmaildev.com
> lrswipkxtecdn admin lrswipkxtecdan anyone p) H ())
> 
> So that's a duplicate of the N record right now, as well as
> potentially having history of previous names in the 'H' key.
> 
> Some examples with IMAP commands and the results:
> 
> . CREATE INBOX.name1
> . OK [MAILBOXID (a5b8c609-3d15-4a84-9e26-4777d900ee4a)] Completed
> . RENAME INBOX.name1 INBOX.name2
> * OK rename INBOX.name1 INBOX.name2
> . OK Completed
> . RENAME INBOX.name2 INBOX.name3
> * OK rename INBOX.name2 INBOX.name3
> . OK Completed
> 
> Which has the following records in the mailboxes.db:
> 
> Ia5b8c609-3d15-4a84-9e26-4777d900ee4a %(T e N
> "fastmaildev.com▒user░brong░name3" P default V 1631685931 C 274 F 277
> M 1631685945 A %(br...@fastmaildev.com lrswipkxtecdn admin
> lrswipkxtecdan anyone p) H (%(N "fastmaildev.com▒user░brong░name2" F
> 277 M 1631685945) %(N "fastmaildev.com▒user░brong░name1" F 276 M
> 1631685937)))
> Nfastmaildev.com▒user░brong░name1     %(T ed I a5b8c609-3d15-4a84-
> 9e26-4777d900ee4a V 1631685931 C 274 F 276 M 1631685937)
> Nfastmaildev.com▒user░brong░name2     %(T ed I a5b8c609-3d15-4a84-
> 9e26-4777d900ee4a V 1631685931 C 274 F 277 M 1631685945)
> Nfastmaildev.com▒user░brong░name3     %(T e I a5b8c609-3d15-4a84-
> 9e26-4777d900ee4a P default V 1631685931 C 274 F 277 M 1631685945 A
> %(br...@fastmaildev.com lrswipkxtecdn admin lrswipkxtecdan anyone p))
> 
> If we then create a NEW "name1" folder, the record gets replaced, but
> the old history for the old uniqueid still contains the name, e.g:
> 
> . CREATE INBOX.name1
> . OK [MAILBOXID (7f6809ae-51ae-48b5-b7ae-c44fdba2480d)] Completed
> 
> I7f6809ae-51ae-48b5-b7ae-c44fdba2480d %(T e
> N "fastmaildev.com▒user░brong░name1" P default V 1631685932 C 278 F
> 278 M 1631686420 A %(br...@fastmaildev.com lrswipkxtecdn admin
> lrswipkxtecdan anyone p) H ())
> Ia5b8c609-3d15-4a84-9e26-4777d900ee4a %(T e N
> "fastmaildev.com▒user░brong░name3" P default V 1631685931 C 274 F 277
> M 1631685945 A %(br...@fastmaildev.com lrswipkxtecdn admin
> lrswipkxtecdan anyone p) H (%(N "fastmaildev.com▒user░brong░name2" F
> 277 M 1631685945) %(N "fastmaildev.com▒user░brong░name1" F 276 M
> 1631685937)))
> Nfastmaildev.com▒user░brong░name1     %(T e I 7f6809ae-51ae-48b5-
> b7ae-c44fdba2480d P default V 1631685932 C 278 F 278 M 1631686420 A
> %(br...@fastmaildev.com lrswipkxtecdn admin lrswipkxtecdan anyone p))
> 
> And if you create and then delete a mailbox, then you wind up with a
> tombstone I record as well (I'm using LOCALDELETE to avoid the rename
> version of delete on my testbed)
> 
> . CREATE INBOX.magic
> . OK [MAILBOXID (19ec8479-808e-4b98-ad43-dcc68370a954)] Completed
> . LOCALDELETE INBOX.magic
> . OK Completed
> 
> I19ec8479-808e-4b98-ad43-dcc68370a954 %(T ed N
> "fastmaildev.com▒user░brong░magic" V 1631687046 C 284 F 286 M
> 1631687050 H ())
> Nfastmaildev.com▒user░brong░magic     %(T ed I 19ec8479-808e-4b98-
> ad43-dcc68370a954 V 1631687046 C 284 F 286 M 1631687050)
> 
> (And of course - if it has a rename history before then, that will
> also show up in the 'H' key on the 'I' record)
> 
> Hopefully this is some interesting information for people :)
> 
> Cheers,
> 
> Bron.
> 
> --
>   Bron Gondwana, CEO, Fastmail Pty Ltd
>   br...@fastmailteam.com
> 
> 
> Cyrus / Devel / seediscussions +participants
> +delivery optionsPermalink

------------------------------------------
Cyrus: Devel
Permalink: 
https://cyrus.topicbox.com/groups/devel/T6583bb81b1e88240-Md85df53ff92bd1d91b9ab737
Delivery options: https://cyrus.topicbox.com/groups/devel/subscription

Reply via email to