Hi,

I'm just following up on this as I've been having a look into it this afternoon.

I'm Cc'ing Marco and Paul as they have posted similar questions (2025/05/06 and 2024/07/15 respectively) that didn't seem to get answered.


In my installation, the seen state files are a combination of twoskip and skiplist. The mailbox I'm dealing with has a twoskip database. I'm not sure how it got this as it's definitely the oldest mailbox in the installation so I'm not sure why other mailboxes have ended up with older database technologies.


I used:

$ sudo /usr/lib/cyrus/bin/mbexamine [email protected] |less

to find the "Unique ID" of the mailbox:

-----
Unique ID: 533fe437493168f5
-----

I then used `cyr_dbtool` to extract the seen data from the running server for that mailbox thus:

$ /usr/lib/cyrus/bin/cyr_dbtool /tmp/andyjpb.seen twoskip show |grep -e '^533fe437493168f5' |cut -f 5 -d ' ' |tr ',' '\n' |less


Based on the documentation at https://www.cyrusimap.org/imap/concepts/deployment/databases.html#seen-state-userid-seen I think this should format the seen data as one seen message UID per line.

However, I get entries like this:

-----
1:614
616:623
632:665
708:785
801:919
927:957
960:978
981:992
...
1406:1412
1451
1458:1467
...
-----

At first I thought the entries with colons might be mappings between two UID namespaces. When I noticed that the data seemed to be in numerical order I thought perhaps they represented ranges of messages.

So I went looking for message 615 expecting it to be unread.

However, my MUA showed it as read.

I used `mbexamine` to find out what Cyrus though of it thus:

$ sudo /usr/lib/cyrus/bin/mbexamine [email protected] |less

-----
000001> UID:00000615 INT_DATE:1228505606 SENTDATE:1228478400 SIZE:6745 > HDRSIZE:2832 LASTUPD :1718370948 SYSFLAGS:20000010 LINES:53 > CACHEVER:6 GUID:36635abb976f24447b8a5529274198b6a3d32301 MODSEQ:455369
     > SYSTEMFLAGS: FLAG_ARCHIVED FLAG_SEEN
     > USERFLAGS: 00000000 00000000 00000000 00000081
-----

It has "FLAG_SEEN" in the "SYSTEMFLAG" but I don't know where it gets that information from: is the system seen state different from the per-user seen state?



I haven't yet looked at my backups as I'm still trying to make sense of what I currently have.


Can anyone help me with the following questions

+ How do I interpret the data in the seen database?

+ In particular, what is the format of the "List of Read UIDS"?

+ What's the difference between FLAG_SEEN and what appears in a user's seen database?

+ Where is the data behind FLAG_SEEN stored?


Right now I want to make sense of why the seen data is displaying as it is. Then I'll work out if or how I can restore the missing data.

If I get that far I have at least one further question:

+ If I end up rewriting the seen state file, what values should I choose for <Last Read Time>, <Last Read UID> and <Last Change Time>?



Thanks for anything anyone can offer.






I'm running Debian's Cyrus 3.0.8-6+deb10u6.


I have a mailbox where the seen state seems to have been corrupt or lost. The MUA shows all messages before 2021/12/09 as read. The seen state seems to be correct for messages after that date.

I have full backups of the machine, including all the Cyrus spool data from periods before the seen state became corrupt and the version of Cyrus has been 3.0.8 throughout.


How would I go about extracting the relevant portion of the seen state from a backup and merging it into the live mailbox?


Sorry if this is covered in the documentation: it seemed to be a specific query that might involve knowing about a number of things so I wanted to post here to get a list of reading and pointers so that I stand the best chance of success.



I have a major Debian upgrade pending and wanted to get this done before the Cyrus version changed in case it becomes harder to merge this state across versions.


Thanks for any pointers you can give me.



Best wishes,
@ndy


--
Best wishes,
@ndy

--
[email protected]
http://www.ashurst.eu.org/
0x7EBA75FF

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

Reply via email to