1 (edited by tapp 2019-03-08 19:14:42)

Topic: [SOLVED] Problem restoring a mailbox backup.

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.6 MARIADB edition.
- Deployed with iRedMail Easy or the downloadable installer? downloadable
- Linux/BSD distribution name and version:  Centos 7
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello,
I normally perform the backups by rsyncing the complete mailbox directory structure to a remote server. I'm trying to restore a backup of a user's mailbox. After restoring it, I see that the complete mailbox has been restored, but just after the user access her email through thunderbird or SOGo, a lot of messages are deleted.
The proccess I follow is:
* Rename the old Maildir directory in the user's Mailbox directory.
* Restore the Maildir directory from the backup.
* Change ownership of the restored directory to vmail:vmail.
In the following snippet you can see the count of files in the user's mailbox directory, and how it suddenly drops from 9047 to 2924 files.

[root@xmail xxx-2017.02.13.16.53.23]# find Maildir | wc -l
9047
[root@xmail xxx-2017.02.13.16.53.23]# find Maildir | wc -l
9047
[root@xmail xxx-2017.02.13.16.53.23]# find Maildir | wc -l
7380
[root@xmail xxx-2017.02.13.16.53.23]# find Maildir | wc -l
2924
[root@xmail xxx-2017.02.13.16.53.23]# find Maildir | wc -l
2924

Nothing is found in the dovecot logs.

Is there anything I'm doing wrong, or am I omitting something? I think that I have restored some mail files in the past without any issues.
Thanks for your attention.

Guillermo.

2

Re: [SOLVED] Problem restoring a mailbox backup.

tapp wrote:

* Rename the old Maildir directory in the user's Mailbox directory.

What does this "rename" mean?
How did you "restore"?

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

3

Re: [SOLVED] Problem restoring a mailbox backup.

ZhangHuangbin wrote:
tapp wrote:

* Rename the old Maildir directory in the user's Mailbox directory.

What does this "rename" mean?
How did you "restore"?

I renamed the Maildir directory to Maildir.bck in case it may be needed later.
I copied the Maildir directory from the backup in remote server, and thenI changed the ownership of the directory and all files to vmail:vmail.

4

Re: [SOLVED] Problem restoring a mailbox backup.

The removed message on MUA are actually stored under "Maildir.bck". You can copy them back without removing already restored Maildir folder, just override it. Email messages have different file names, so it should be fine and no email is actually override.

----

Does my reply help a little? How about buying me a cup of coffee ($5) as an encouragement?

buy me a cup of coffee

5 (edited by tapp 2019-03-08 17:25:57)

Re: [SOLVED] Problem restoring a mailbox backup.

ZhangHuangbin wrote:

The removed message on MUA are actually stored under "Maildir.bck". You can copy them back without removing already restored Maildir folder, just override it. Email messages have different file names, so it should be fine and no email is actually override.

Thanks for your attention.
It's not working. I have copied all the files from the backup to the Maildir directory, and when the user accesses her mail through the email client or the SOGo interface, the mails are deleted again. I'm simply copying all the files from the Maildir directory from the backup to the real Maildir directory in the iRedMail server, and making sure that the file permissions are correctly set (vmail:vmail). I suppose that it's the correct procedure.
In fact, I have tried to restore another mailbox using the same procedure, and it works, so I think there must be some issue with that mailbox.

Am I missing something? I can't understand why the messages are deleted whenever the user acceses her mailbox.
Thanks in advance.
Best regards

6

Re: [SOLVED] Problem restoring a mailbox backup.

The issue is solved. After trying with another mailbox backup, and seeing the the restore was ok, I found that the backup I was using was not correct. I have tried with the previous day one, and it's ok.
Thanks for your attention.