Docker-mailserver: Restore Emails From Manual Backup?

Created on 15 Jan 2017  路  7Comments  路  Source: tomav/docker-mailserver

I just accidentally deleted nearly all emails from one particular sending address (failed spam deletion rule...). Fortunately the most recent ones are still there and I made a backup about a week ago.

The backup I made was essentially just a cp -r on the folders used by docker-mailserver. It seems to contain all emails.

Now I'm just wondering how I can merge them back into my inbox. Any ideas? I really need them as they contain invoices that I can exclude from tax. 馃槩

A non-manual way would be highly appreciated, as I have far too many emails.

Thanks for the help in advance, hope this isn't the wrong place to ask.

question

All 7 comments

What speaks against just copying the files back? The IMAP server will automatically recompute its index, no need to even restart. As every mail is in its own file, you are not risking overwriting anything.

@theomega You mean simply cp -r backup original should work? That'd be nice. I'll make another backup first and try this tomorrow. Sucks a bit that this will also restore other deleted mails, but whatever - that's not that much of a hassle to re-delete them.

And think about permissions. /var/mail should be owned by docker:docker

Hi @dodekeract, this issue is resolved?

I'll mark it as closed for now. Don't have a lot of time this week to test it. Will re-open if needed.

Be careful with this: if you copy your files back, and, from your original copy, now the users moved emails in some imap folders, then they would have duplicated emails in different folders.

Example:

1 - Monday: you do the backup
2 - Tuesday: a user move one email from Inbox to Archive imap folder
3 - Wednesday: you restore backup by copying back all files the project
4 - Then your user has two copies of the same email, one in Inbox and one in Archive

@citec anything I can do to avoid that issue?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

landergate picture landergate  路  4Comments

m-a-v picture m-a-v  路  4Comments

Hamsterman picture Hamsterman  路  3Comments

capi picture capi  路  4Comments

alen12345 picture alen12345  路  4Comments