The largest database is the mailbox folders. Each mailbox folder contains the following files:

ÂMessage files—There is one file per message. The file name of each message is the message’s UID followed by a period. The UID is a unique ID that is given to each message.

Âcyrus.header—This file contains a magic number and variable-length information about the mailbox.

Âcyrus.index—This file contains fixed-length information about the mailbox and each message in the mailbox.

Âcyrus.cache—This file contains variable-length information about each message in the mailbox.

Âcyrus.seen—This file contains variable-length state information about each reader of the mailbox.

Reconstructing the Mail Database

The reconstruct tool can be used to recover from corruption in mailbox folders. If reconstruct can find existing header and index files, it attempts to preserve any data in them that can’t be derived from the message files. reconstruct attempts to preserve a mail database state that includes the flag names, flag state, and internal date. All other information is derived from the message files. An administrator may recover from a damaged disk by restoring message files from a backup and then running reconstruct to regenerate what it can of the other files.

The mailboxes file, /var/imap/mailboxes.db, is the most critical file in the entire Cyrus IMAP system. It contains a sorted list of each mailbox on the server, along with the mailboxes quota root and Access Control List (ACL). To reconstruct a corrupted mailbox file, run the reconstruct -mcommand. The reconstruct tool, when invoked with the -mswitch, scavenges and corrects whatever data it can find in the existing mailboxes file. It then scans all partitions listed in the imapd.conf file for additional mailbox folders to put in the mailboxes file.

The cyrus.header file in each mailbox folder stores a redundant copy of the mailbox ACL, to be used as a backup when rebuilding the mailboxes file.

Read the documentation pages at asg.web.cmu.edu/cyrus/download/imapd/ overview.html for more information about the Cyrus backup.

Chapter 12 Working with the Mail Service

197

Page 197
Image 197
Apple Mac OS X Server manual Reconstructing the Mail Database