How to retrieve unread status from backup ?

Xavier Bestel xavier.bestel at free.fr
Fri Mar 31 09:43:34 EDT 2017


... aaand it worked like a charm !
I spent way more time setting up a new serveur from the backup than
doing the flags restore. Thanks again !

	Xav

Le jeudi 30 mars 2017 à 09:49 +0200, Xavier Bestel a écrit :
> Thanks a lot Bron, precisely the kind of thing I was looking for :)
> 
> Regards,
> 	Xav
> 
> Le mercredi 29 mars 2017 à 12:12 -0500, Bron Gondwana a écrit :
> > Actually, if you restore from backup to another Cyrus instance and
> > can log in it's very easy using search-extended:
> > 
> > telnet restoreserver 143
> > . login username password
> > . select INBOX
> > . UID SEARCH RETURN () UNSEEN
> > * ESEARCH (TAG ".") UID ALL
> > 1015337,1015340:1015366,1015378:1015379,1015381,1015384
> > . logout
> > 
> > telnet productionserver 143
> > . login username password
> > . select INBOX
> > . uid store 1015337,1015340:1015366,1015378:1015379,1015381,1015384
> > -flags \Seen
> > . logout
> > 
> > And you're done :)  Repeat the search for any other mailbox.
> > 
> > Bron.
> > 
> > On Wed, 29 Mar 2017, at 10:34, James Cassell wrote:
> > > 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!
> > > 
> > > V/r,
> > > James Cassell
> > > ----
> > > Cyrus Home Page: http://www.cyrusimap.org/
> > > List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cy
> > > ru
> > > s/
> > > To Unsubscribe:
> > > https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus
> > 
> > 
> 
> ----
> Cyrus Home Page: http://www.cyrusimap.org/
> List Archives/Info: http://lists.andrew.cmu.edu/pipermail/info-cyrus/
> To Unsubscribe:
> https://lists.andrew.cmu.edu/mailman/listinfo/info-cyrus


More information about the Info-cyrus mailing list