SDB:Restoring Deleted Mail Messages From a Backup
Situation
You have deleted some e-mail messages by mistake and want to restore them from an available backup. You use Cyrus as your IMAP server and have made a backup of the directory /var/spool/imap/.
Procedure
Cyrus saves the user's mail in the directory:
/var/spool/imap/user/<user_name>/
There is a file for each message. File names consist of successive numbers followed by a dot. To prevent existing messages with an identical "number" from being overwritten, it is advisable to first create an additional folder in which to install the backup.
Use the webmail interface to create a new folder under the relevant user (e.g., backup). To do this, select Configuration -> Folder -> New folder. The system creates a new folder with the path /var/spool/imap/user/<user_name>/backup/
(make sure not to create the folder manually. Otherwise, Cyrus will ignore it.)
Copy the messages to restore from your backup to the new folder. Restart your mailbox to make Cyrus acknowledge the new messages with
cyrus@slox:~> reconstruct -r user/<user_name>
or simply reconstruct without any option to restart all mailboxes.
Tip:
You can use the grep command to find messages based on certain criteria, such as the sender or subject. For example:
cyrus@slox:/tmp/<archive>/var/spool/imap/user> grep "From: testuser@slox.de" /smith/*
<keyword>backup,restore,email,imap,slox,mailserver,tar</keyword>