Hi,

an alternative solution, if you have delayed expunge mode and auditlogs,
is to restore the deleted mails with unexpunge, and finde the UID in logs
with  "grep $username | grep "auditlog: touched " | grep "sysflags=.*SE.*"

Kind regards

   Michael Menge

Quoting Jay Sekora <[email protected]>:

Hi!  I have a user who accidentally marked all her mail as "read" and
needs read state of her messages restored from backups.  At the same
time, she also accidentally deleted a bunch of messages, but also has
gotten lots of new mail since then.

So I think what I need to do is restore her old inbox as of just before
this happened to a new folder location (that part is easy), and then get
a copy of her $username.seen file from the same backup, extract the
seen/unseen data from the .seen file, and apply seen/unseen state to
the corresponding messages in the new (restored) folder location.

So the two pieces of this that I don't know how to do are (1) dumping
the twoskip file to a text format that I can get the seen/unseen message
UIDs out of, and (2) correlating the folder IDs in the twoskip file with
folder names I can select in `cyradm`.  (If there's an easier way to do
this I'd love to hear it!)

So, (1) is there a script available somewhere to dump twoskip files to
a text format?  And (2) how can I get a list of folder names and
corresponding folder IDs as found (apparently) in the twoskip file?
(2) seems like something I ought to know, but I don't. :-)

(Running `strings` on the twoskip file suggests the folders are stored
as IDs like "xhz89kuj0c4m8w0ey4tafenk1" rather than folder names like
"user.so-and-so".  But presumably the output of `strings` might include
values that are deleted or superceded, and in any case it looks like
the actual message UIDs are in binary rather than textual format in
the twoskip file.)

Jay

PS -- This is on Ubuntu 22.04 with Cyrus 3.4.3 as packaged by Ubuntu.
But I can't imagine the package maintainers broke the twoskip file
format. :-)

PPS -- I found
https://github.com/cyrusimap/cyrus-imapd/blob/master/lib/cyrusdb_twoskip.c
but my C is pretty rusty and I don't feel confident trying to convert that
to perl or python or something on my own.  The other way I've thought
of to do this is to bring up an entire second IMAP server, restore the
user's inbox and .seen file to it as of a consistent date, and use
`imapsync` to synchronize seen/unseen state from the restore with the
production IMAP server — assuming the folder ID is actually stored
*in* the folder directory itself.  That sounds even worse than trying
to parse the twoskip file.

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



--
--------------------------------------------------------------------------------
Michael Menge                          Tel.: (49) 7071 / 29-70316
Universität Tübingen                   Fax.: (49) 7071 / 29-5912
Zentrum für Datenverarbeitung          mail: [email protected]
Wächterstraße 76
72074 Tübingen

Attachment: smime.p7s
Description: S/MIME-Signatur


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

Reply via email to