Ahh, for her own mailboxes, the seen state isn't stored in the seen database, 
it's stored in the system flags inside cyrus.index.  That's a little more 
painful to read unless you know the cyrus.index format.  There is a 
Cyrus::IndexFile module in the current Cyrus upstream which can read index 
files going all the way back to 2.2, so it would have no difficulty giving you 
the data from a snapshotted cyrus.index file from the time.

Simplest however might just be to restore a complete snapshot of her account 
for that time and select via IMAP and read the seen state by just connecting 
via IMAP and doing a FETCH FLAGS or "SEARCH SEEN".

Bron.


On Tue, Jun 30, 2026, at 13:51, Jay Sekora wrote:
> Hi and thank you!
> 
> On Tue, Jun 30, 2026 at 11:09:02AM -0400, Bron Gondwana via Info wrote:
> > You can use either cyr_dbtool or cvt_cyrusdb to get the text version -
> > cyr_dbtool is much more powerful.
> 
> This got me part of the way there; I was able to convert mailboxes.db
> and the users .seen file to plain text.
> 
> Interestingly, mailboxes.db has uniqueids for *MANY* of the mailboxes,
> but not for the specific one I'm looking for (which was the user's INBOX).
> I was able to get the uniqueid for the relevant INBOX from the cyrus.header
> file, but that uniqueid does not show up in the user's *.seen file (either
> the original twoskip file or after converting to flat format).  This was both
> on the user's .seen file for her current inbox, which I know she's read
> recently, and also on a restored copy from before her accidental
> deletion/marking-read.
> 
> For reference, here's the (only matching) line in /tmp/mailboxes.flat
> converted from mailboxes.db:
> 
> user.REDACTED   %(A %(REDACTED lrswipkxtecdan cyrus lrswipkxtecda) P faculty 
> F 124565 M 1748834865)
> 
> (although my copypasting doesn't preserve tabs.)
> 
> And the same sort of thing shows up for my own INBOX:
> 
> user.jsekora    %(A %(jsekora lrswipcda cyrus lrswipkxtecda) P staff M 
> 1741542865)
> 
> although there *are* other mailboxes that have uniqueids listed in 
> mailboxes.db (in a separate section at the front, which doesn't list
> anything for my own INBOX or the user's in question):
> 
> [...]
> $RUNQ$ngb736k4jbddz7wreeovkcyt$user.OTHERUSER   
> [...]
> user.OTHERUSER  %(A %(OTHERUSER lrswipkxtecdan) I ngb736k4jbddz7wreeovkcyt P 
> staff V 1777900694 C 1 F 2 M 1782827859)
> 
> I'm guessing the distinction here is the age of the mailbox; many of our
> mailboxes were migrated (via `imapsync`) from our previous IMAP server
> about a year and a half ago; the few I've spot-checked that *do* have
> uniqueids are ones that were created more recently.
> 
> In any case the weirder problem seems to be that the flat file I get
> from this users' twoskip .seen file doesn't seem to have any reference
> either to the name (user.$USERNAME) or uniqueid (f13e2zfxso7s3trbkkz4ddqv)
> of her old inbox.
> 
> I'm really puzzled by this!
> 
> She uses Thunderbird to read her mail.  I'll ask her how she marks things
> as seen and whether she has any Thunderbird extensions installed.
> 
> I'm looking for her seen/unseen state in /var/lib/cyrus/user/U/USERNAME.seen,
> and for her INBOX's uniqueid in /var/lib/cyrus/mailboxes.db (where it doesn't
> show up although other users' do) as well as in cyrus.header in the mailbox
> store (where it does show up).  Is there someplace else I'm missing?
> 
> Jay
> 
> > HOWEVER - in either case, you're looking at mailbox uniqueids in the
> > .seen folder.  So you're going to need to find those our.  With new
> > enough Cyrus, they will be in the mailboxes.db file.  With older cyrus,
> > you're going to have to read them from the cyrus.header files in each
> > mailbox.  3.4.3 might be late enough to have put the uniqueids into the
> > mailboxes.db, I don't remember!  Of course - you can also use cyr_dbtool
> > or cvt_cyrusdb to read the contents of mailboxes.db.
> > NOTE: work on copies of the files, not the original.
> 
> Thanks!
> 
> Jay
> 

--
  Bron Gondwana, CEO, Fastmail Pty Ltd / Fastmail US LLC
  [email protected]


------------------------------------------
Cyrus: Info
Permalink: 
https://cyrus.topicbox.com/groups/info/T643419685ae5113c-M68c2042ad6c35c092e556893
Delivery options: https://cyrus.topicbox.com/groups/info/subscription

Reply via email to