[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cyrus mailbox restore


On 05.08. 13:45, Hans du Plooy wrote:
> I'm obviously doing this wrongly.  What is the correct way to restore a
> cyrus mailbox?

You will need the file /var/lib/cyrus/mailboxes.db or a clear-text dump
of it, which can be created by running 'su - cyrus -c "/usr/sbin/ctl_mboxlist -d"'.
Do you have a backup of mailboxes.db?  It contains ownership and access
rights to all mailboxes known to cyrus.  In the worst case, you can also
create the clear-text dump of this file by hand and convert it to the
format needed by cyrus.

The clear-text format of mailboxes.db looks like this:
user.hansdp.sub.mail.box        default hansdp  lrswipcda

Each line contains the info on a mailbox.  The column separator is a
tab, the columns are name of the mailbox, partition, owner, and access
rights (the example above should be fine for a user mailbox).

Every directory in /var/spool/cyrus/mail/*/user/* that contains a file
named cyrus.header is a mailbox.

You can use the command ctl_mboxlist to recreate the mailboxes.db file
from the clear-text format file.  Please note that ctl_mboxlist should
be run as user cyrus:
  'su - cyrus -c "/usr/sbin/ctl_mboxlist -u < mboxlist.clear-text'
(I haven't actually tried this, so beware).

The cyrus-wiki[0] contains some helpful hints as well.



[0]: http://acs-wiki.andrew.cmu.edu/twiki/bin/view/Cyrus

Reply to: