How to retrieve unread status from backup ?

James Cassell fedoraproject at
Wed Mar 29 11:34:12 EDT 2017

On Wed, Mar 29, 2017, at 04:18 AM, Xavier Bestel wrote:
> Hi,
> I have done an unfortunate "mark all as read" on my mailbox, and I'm
> not one of those "mailbox zero" guys. So I have lost some valuable
> information. But I have some (old) backups.
> So my question is: how do I retrieve the "read/unread" status from the
> (not so recent) backup, and how can I reapply it to my running server
> (which continues to receive mails regularly) ?

You could do it with some invocations of imapsync.  The quickest way would also restore any messages you may have deleted since your backup.  Do an imapsync run with your backup server as "host1" and your live server as "host2".

How I'd do it would be to take several steps:
1. Sync from your live server to a temporary server (or temp folder on the same server).
2. Apply a unique imap flag to all messages in the temporary server
3. sync from your backup to the temporary server.  This will clear the unique flag on sync'ed messages.
4. delete from the temporary server all messages that still have the unique flag.
5. sync from the temporary server back to the live server.
6. delete the temporary server

Hope that helps!

James Cassell

More information about the Info-cyrus mailing list