rollback to archiving checkpoint? Need help!!
julesa at pcf.com
Mon Apr 4 19:02:36 EDT 2005
Alex Meier wrote:
> Hi, list!
> is there a possibility to rollback the cyrus databases to a recent
> checkpoint? As I have understood the mechanisms, there is a archiving
> checkpoint process which stores the changes to the mail database to a
> How does this work? Is it possible to rollback a few hours?
Even if you could, it wouldn't help, because the message content isn't
stored in a db. The db files are just for quick indexing and storage of
metadata such as seen flags etc. The content of each message is stored
in an individual file, probably under /var/spool/imap on your system. If
the folders have been expunged, the data files have been deleted.
> It's not purely curiosity which drives me. I'm facing a very serious
> problem where apparently a person has undeliberately deleted all
> mails in his IMAP inbox, now he's crying for help. How can I possibly
> help him? I have root privileges to his machine and as a instant
> action I froze all dirs which seemed relevant to me. Thus, I copied
> the contents of: /var/lib/imap /var/spool/imap /var/log/messages
You might be able to "un-delete" them if they weren't expunged, but
that's probably a long shot by now. The procedure for un-deleting, if by
some miracle they haven't been expunged, would depend on what mail
client you're using. It's just the removal of the "deleted" flag from
If the messages were expunged and you have a backup, you can pull the
files in /var/spool/imap from a backup, and then as the cyrus user, run
"reconstruct -rf user.userid.folder" to incorporate the restored message
files into the mailbox indexes.
If he/she actually deleted mailboxes/folders, you may have to recreate
those using an IMAP client (to add them to the mailboxes db) before
restoring the backup files. Some versions of Cyrus' reconstruct won't
automatically create new entries in the mailboxes db. If there are large
numbers of folders to restore, people have written simple scripts to
update the mailboxes db automagically, see the list archives.
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html
More information about the Info-cyrus