The store runs as the runtime user and needs to able to read and write to the mail partitions, databases, ms.conf, and ms-path. The signs of permission problems are i/o error messages, being unable to open databases and being unable to read the configuration file. Several common causes of permission problems are running reconstruct and msdb_* commands as root (superuser), creating new partitions and not doing the chown sms:sms step.
To repair permission problems do the following at the system command prompt:
chown -R sms:sms /var/md/store /d/d2/mailstore |
reconstruct rebuilds one or more IMAP message store mailbox cache files within a given domain. It can be used to recover from almost any sort of data corruption. Since reconstruct can create new cache files it should be run as the M-Store runtime user.
When reconstruct finds existing header and index files, it attempts to preserve any data in them that is not derivable from the message files themselves. The state that reconstruct attempts to preserve includes: the flag name, flag state, and internal date. reconstruct derives all other information from the message files.
The mailbox arguments must be fully qualified IMAP mailbox names and may need to be quoted on the command line if the name contains shell-specific characters.
Table 5-1. reconstruct Options
Option | Description |
|---|---|
-f config_file | Specify an alternate location for M-Store's configuration file. |
-r | Recursively reconstruct all sub-mailboxes of the mailboxes or mailbox-prefixes given as arguments. If no mailbox arguments are given, all mailboxes within the specified domain will be reconstructed. |
-u | Reconstruct a specific user's mailbox or mailboxes. |
-v | Display program version information on standard error, then exit. |
This command recursively reconstructs all cache files for the personal hierarchy of user foobar@esys.ca
reconstruct -r esys.ca "user/foobar" |
Table 5-2. reconstruct Examples
Description | |
|---|---|
reconstruct -r example.com | Reconstruct all mailboxes in the example.com domain. |
reconstruct -r -u joe example.com | Reconstruct all of joe@example.com's mailboxes. |
reconstruct -u joe example.com INBOX | Reconstruct only joe@example.com's mailbox. |
reconstruct -r -u joe example.com pub | Reconstruct joe@example.com's pub folder and all sub-folders. |
reconstruct foo.com admin | Reconstruct the shared folder admin in the foo.com domain. |
reconstruct -r example.com admin | Reconstruct the shared folder admin and all sub-folders in the example.com domain. |
Database corruption is a very rare event, and may never happen. The possible causes are filesystem corruption, a system crash, and disk failure. To recover a database, run msdb_recover first. If that fails, run msdb_backup, delete the transaction logs and run msdb_recover. If the above fails, one must restore the last good backup.
/etc/md/store/ms.conf | The default M-Store configuration file. |
ms-path /database | The default database home, where ms-path is defined in the ms.conf file. |
ms-path defaults to /var/md/store on all systems. |
|
Transaction logs are support files for the database and are used to help recover the databases on an error. The logs are part of the reason why database corruption is so rare. They can become corrupted, but is a truly rare occurrence. To avoid problems, the system administrator should run msdb_backup at least once a day. The most convenient method is to add a cron job to run msdb_backup at a specified daily time.