System Administration & Network Administration
email email-server rsync imap cyrus
Updated Wed, 25 May 2022 14:40:00 GMT

Reconstructing cyrus mailboxes with sub-folders

I have a mail server which runs Cyrus-imapd and postfix. I have another server which is to be the backup mail server. I have rsynced one mailbox from the primary server to the backup server to test. As mentioned here, I first rsynced one test mailbox and then copied over it's .seen and .sub files from /var/lib/imap/user/t/testuser over to the same location on the backup server.

Once this is done, I get all the mails in the inbox as is. But there are no sub-folders created and hence, I cannot see the mails in them. On checking the mailbox location for that mailbox, I find that the subfolders have been copied during the rsync processs. I ran reconstruct but to no avail.

Next I manually created one sub-folder (which had the same name as on the original mailbox) for this mailbox and then ran reconstruct. I was then able to see those mails under that sub-folder.

How do I sync the mail boxes such that I don't have to manually create the sub-folders for each user in order to see the mails?


Try reconstruct -rf user/testuser or so -- the -f makes reconstruct examine the directories for cyrus.* datafiles and if it finds them, it will add those directories as sub-folders.

Comments (2)

  • +0 – Ok. I ran reconstruct -rf user/testuser and it created the sub-folders as you said. But all the mails are unread in the sub-folders.. — Aug 19, 2013 at 07:10  
  • +0 – @i.h4d35 Information about read/unread messages and folder subscriptions is stored in the configdirectory defined in /etc/imapd.conf (e.g. /var/lib/cyrus/user/i/i.h4d35(.seen|.sub)) which you would need to sync as well. All in all, Cyrus is cumbersome to handle in HA configurations - you might want to look at Dovecot, which has a number of supported and well-documented modes for operating multiple instances on shared storage or auto-replicating cluster filesystems. — Aug 19, 2013 at 07:34  

External Links

External links referenced by this document: