0

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?

3

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.

  • 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.. – rahuL Aug 19 '13 at 7:10
  • @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. – the-wabbit Aug 19 '13 at 7:34
1

try reconstruct -rf user.testuser

It should give you an output like this:

discovered user.testuser.subfolder1
discovered user.testuser.subfolder2
discovered user.testuser.subfolder3
discovered user.testuser.subfolder4

Then check your frontend (Web UI or desktop client) and you may find the subfolders re-created

  • Note: whether a dot (.) or a slash (/) is used as a hierarchy separator is configurable in /etc/imapd.conf through the unixhierarchysep configuration parameter. The default is indeed "no", so dots are used, but I have seen distros giving a sample config where it is set to "yes". – the-wabbit Aug 19 '13 at 7:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.