Linux – How restore qmail backup files

backupcdpemaillinux

We are using qmail as our mail application on a linux server. A few weeks ago our server crashed and we had everything installed from scratch and our users started to send & receive email again. The problem is they have lost their old emails. We have a back up of the whole qmail directory. But I don't know how to restore the old emails without losing the new ones. It's worth mentioning that I don't have any problem with restoring old sent mails. When I copy email files into .sent-mail/cur directory, I have them restored in sent box of users, but restoring files in /cur directory doesn't work for inbox emails and I can't get them restored.

Best Answer

It sounds like you're using the maildir storage format (one folder on the server for each folder, and within three directories "cur", "new" and "tmp", each containing one file for each email).

Manipulating email within Maildirs is just a matter of copying the files around. You should be able to restore all your old email by copying all the old files to the new directories.

However, make sure your users restart their email clients after doing this, because mail clients and server tend to get confused if the contents change on-the-fly.

Related Topic