1

Topic: All messages show as unopened after maildir restore

==== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version (check /etc/iredmail-release):
- Linux/BSD distribution name and version:
- Store mail accounts in which backend (LDAP/MySQL/PGSQL):
- Web server (Apache or Nginx):
- Manage mail accounts with iRedAdmin-Pro?
- Related log if you're reporting an issue:
======== Required information ====
- iRedMail version 0.9.5-1
- Linux/BSD distribution name and version: Ubuntu 14..04.1
- Store mail accounts in which backend MySQL
- Web server (Apache or Nginx): nginx
- Manage mail accounts with iRedAdmin-Pro? no
- Related log if you're reporting an issue:
====

I've been working on a process to restore single mailboxes, I have a script that runs daily and takes a snapshop of /var/vmail using tar. I removed all messages from a test mailbox and copied the test accounts maildir from the snapshot. The messages restore but they are all marked as unread. How do I restore this attribute for single mailboxes.

Thanks for this great project
tim

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: All messages show as unopened after maildir restore

Did you restore files which start with 'dovecot-' in user's mailbox?

3

Re: All messages show as unopened after maildir restore

yes I restored the test accounts entire maildir folder.

# cd /var/vmail/vmail1/domain.com/t/e/s/test-2016.07.09.12.31.52/Maildir
# ls -ls
total 48
4 drwx------ 2 vmail vmail 4096 Jul  9 13:45 cur
0 -rw------- 1 vmail vmail    0 Jul  9 13:38 dovecot-acl-list
8 -rw-r--r-- 1 root  root  8012 Jul  9 13:38 dovecot.index.cache
8 -rw------- 1 vmail vmail 5380 Jul  9 13:45 dovecot.index.log
4 -rw------- 1 vmail vmail   40 Jul  9 13:39 dovecot.index.thread
4 -rw------- 1 vmail vmail  120 Jul  9 13:38 dovecot.mailbox.log
4 -rw------- 1 vmail vmail  153 Jul  9 13:45 dovecot-uidlist
4 -rw------- 1 vmail vmail    8 Jul  9 13:38 dovecot-uidvalidity
0 -rw-r--r-- 1 root  root     0 Jul  9 13:38 dovecot-uidvalidity.57812714
0 -r--r--r-- 1 vmail vmail    0 Jul  9 13:38 dovecot-uidvalidity.578136a9
0 -rw------- 1 vmail vmail    0 Jul  9 13:38 maildirfolder
4 drwx------ 2 vmail vmail 4096 Jul  9 13:38 new
4 -rw------- 1 vmail vmail   28 Jul  9 13:38 subscriptions
4 drwx------ 2 vmail vmail 4096 Jul  9 13:38 tmp
root@mx01:/var/vmail/vmail1/domain.com/t/e/s/test-2016.07.09.12.31.52/Maildir#

4

Re: All messages show as unopened after maildir restore

time4e wrote:

8 -rw-r--r-- 1 root  root  8012 Jul  9 13:38 dovecot.index.cache
0 -rw-r--r-- 1 root  root     0 Jul  9 13:38 dovecot-uidvalidity.57812714

File ownership is wrong.