Hi Marco,
On Fri, Jun 19, 2020, at 6:44 PM, Marco wrote:
> wow, yes, it works. With this config, after the Cyrus restart the
> mailboxes.db and the skipstamps dbs are created and the error disappears
> from syslog.
Great! I've updated the documentation, and the website should update shortly.
> I suggested the possibility to choose the recovery date (ie: all
> messages and mailboxes deleted or expunged from to ). I
> hope you could add this feature.
Yep, I saw that, thanks for the request :)
> I now tried a restore, but I still have some problems. I very appreciate
> if you could read the following issue.
>
> My goal is to recover a message that was removed (expunged) from the
> IMAP server, ignoring already existing messages.
>
> It seems the "-x" flag could help. It seems it allows to restore and
> unexpunge a previously expunged messages in the IMAP server.
No, you've misunderstood. The "-x" flag is to ONLY restore expunged messages.
If you've specified a list of mailboxes or messages on the command line, and
some of them are not expunged, the "-x" option will cause it to ignore the ones
that are not expunged, and only restore the expunged ones. The "-X" option
does the inverse -- they're filters. Without one of these filters, it will
restore everything you asked for, regardless of its expunged status.
So like, maybe a user has deleted some stuff, and you don't want to mess around
figuring out which individual messages they need restored, so you just want to
restore everything, and let the user figure it out. This is what -x is for --
so you can say "restore the contents of mailbox foo, but only the expunged
stuff" or "restore every mailbox (-a), but only the expunged stuff".
Think about it: if the messages _weren't_ expunged, there would usually be no
need to restore them from backup! You would simply remove the \Deleted flag
over IMAP. So, you are almost always using restore to bring back expunged
messages, thus there is no special flag needed to enable this functionality.
(But, if you had lost an entire server to some disaster, and restoring to its
replacement, then you would need to also restore the unexpunged stuff.)
> Yesterday I expunged the message 16ceead9802286784d7a54c5bc782891f76f2f2e:
>
> 2020-06-18T15:44:37.374556+02:00 tst-msg03 cyrus/imap[9461]: auditlog:
> expunge sessionid=
> mailbox=
> uniqueid= uid=<32092> modseq=<46828>
> sysflags= guid=<16ceead9802286784d7a54c5bc782891f76f2f2e>
>
>
> I tried today to restore it:
> cyr_restore -v -U -x tst-msg03.example.com -u
> utente.archivi...@example.com 16ceead9802286784d7a54c5bc782891f76f2f2e
> example.com!user.utente^archivista: trying to keep
> uidvalidity(1550228105), uniqueid(nvf96uirjgfs6xaekwwc7g44),
> highestmodseq(46828)
>
> and I see:
> 2020-06-19T09:29:24.030624+02:00 tst-msg03 cyrus/imap[32742]: login:
> tst-msg03-bck.example.com [10.102.42.169] cyr_restore LOGIN User logged
> in SESSIONID=
>
> 2020-06-19T09:29:24.162909+02:00 tst-msg03 cyrus/imap[32742]: auditlog:
> append sessionid=
> mailbox=
> uniqueid= uid=<32096> modseq=<46829>
> sysflags= guid=<16ceead9802286784d7a54c5bc782891f76f2f2e>
> messageid=
>
> 2020-06-19T09:29:24.163058+02:00 tst-msg03 cyrus/imap[32742]: auditlog:
> expunge sessionid=
> mailbox=
> uniqueid= uid=<32096> modseq=<46829>
> sysflags= guid=<16ceead9802286784d7a54c5bc782891f76f2f2e>
>
> 2020-06-19T09:29:24.167561+02:00 tst-msg03 cyrus/imap[32742]: auditlog:
> modseq sessionid=
> mailbox=
> uniqueid= highestmodseq=<46829>
>
> 2020-06-19T09:29:24.215036+02:00 tst-msg03 cyrus/imap[32742]: USAGE
> cyr_restore user: 0.042492 sys: 0.015435
>
> 2020-06-19T09:29:24.215191+02:00 tst-msg03 cyrus/imap[32742]: auditlog:
> traffic sessionid=
> bytes_in=<2412> bytes_out=<1039>
>
> 2020-06-19T09:29:32.855379+02:00 tst-msg03 cyrus/sync_client[32566]:
> IOERROR: zero length response to MAILBOXES (end of file reached)
>
> 2020-06-19T09:29:32.855682+02:00 tst-msg03 cyrus/sync_client[32566]:
> IOERROR: zero length response to RESTART (end of file reached)
>
> 2020-06-19T09:29:32.855713+02:00 tst-msg03 cyrus/sync_client[32566]:
> Error in do_sync(): bailing out! Bad protocol
>
> 2020-06-19T09:29:32.855738+02:00 tst-msg03 cyrus/sync_client[32566]:
> Processing sync log file /var/lib/imap/sync/bck/log-run failed: Bad protocol
>
> I tried again and I see the same result, but without the IOERROR:
>
> 2020-06-19T09:36:51.153939+02:00 tst-msg03 cyrus/imap[32762]: login:
> tst-msg03-bck.example.com [10.102.42.169] cyr_restore LOGIN User logged
> in SESSIONID=
>
> 2020-06-19T09:36:51.199742+02:00 tst-msg03 cyrus/imap[32762]:
> example.com!user.utente^archivista: same message appears twice 32096 32097
>
> (why twice? It expunges 32096 just above)
>
> 2020-06-19T09:36:51.225525+02:00 tst-msg03 cyrus/imap[32762]: auditlog:
> append sessionid=
> mailbox=
> uniqueid= uid=<32097> modseq=<46834>
> sysflags= guid=<16ceead9802286784d7a54c5bc782891f76f2f