Chapter 9. File and Directory Layouts

The following chapter is a detailed description of the M-Store filesystem. It is meant to be used as a quick reference for determining the files and directories used in M-Store. All files are located in three default directory paths:

Configuration Files

/etc/md/store/

Executable Support Files

/usr/local/md/

Run Time Data

/var/md/store/

The subdirectories and expected files at each location are organized into quick reference tables. A short description details the files found in each subdirectory.

Configuration Files

The configuration files are static files used to configure the M-Store runtime environment. These files are usually edited once when the software package is first installed, then remain static until the system administrator decides to change the configuration of the software.

Table 9-1. /etc/md/store/ Configuration Files

Extended Path

File Name

Description

 

ms.conf

The default message store configuration file. See Chapter 10, “File Descriptions”

 for a complete list of options.

 

ms.conf.sample

Sample configuration file.

 

rc.m-store.sam ple

Sample boot/shutdown script

 

license.dat

The default message store license file that enables operation and determines the number of users that can be created. The path of the license file may be changed in the ms.conf configuration file.


Runtime Control

The runtime control of the message store is managed by the rc.m-store bootscript. See “Message Store Configuration (ms.conf)” in Chapter 10 for further details.

The following is the platform specific locations of the installed bootscript:

Table 9-2. Locations of the Installed Bootscript

Platform

Bootscript Location

IRIX

/etc/init.d/rc.m-store

Linux

/etc/rc.d/init.d/rc.m-store


Executable Support Files

These files are runtime files that make up the M-Store package, along with the online manpages and server documentation. This root is defined as the configuration option executable-base-path.

Table 9-3. /usr/local/md/ Executable Support Files

Extended Path

File Name

Description

doc/

m-store_manpages.ps

Collection of all man pages in PostScript form.

 

m-store_name .pdf

All M-Store manuals in Adobe Acrobat format.

lib/msg_tab/

admin_--.msg

Default message files for store sub-systems.

 

plug_--.msg

 

 

sasl_--.msg

 

 

store_--.msg

 

lib/plugins/

 

Location of dynamically loadable SASL mechanism plugins. See impad “M-Store Message Server (imapd)” in Chapter 11

  for further details.

lib/store/plugins/

 

Future alternate location of dynamically loadable SASL mechanism plugins.

lib/tcl8.2/

lib/tk8.2/

history.tcl

Installations of TCL 8.2 and TK 8.2 for use with the setup wizard and msadm_tclsh utilities. Additional sub-directories and files relating to the tcl/tk utilities are also found here.

lib/tkwizard/

 

Data files for the M-Store setup wizard.

man/cat5/

 

man pages for M-Store configuration and file locations.

man/cat8/

 

man pages for M-Store tools and utilities.

sbin/

 

M-Store runtime files.

 

authproxyd

Authentication Proxy Server.

 

deliver

Utility to deliver mail into M-Store.

 

imapd

IMAP daemon.

 

lmtpd

LMTP daemon delivery server.

 

lmtpd-oq

LMTP daemon for over quota delivery.

 

msadm_bulkadd

Utility to add and create accounts for multiple users.

 

msadm_bulkdel

Utility to delete accounts for multiple users.

 

msadm_tclsh

Administration Command Interpreter.

 

msdb_archive

Utility to list the transaction files that are no longer involved in active transactions and can be deleted to save disk space.

 

msdb_backup

Utility to create live backups of M-Store.

 

msdb_checkpoint

Utility to checkpoint the M-Store transaction logs.

 

msdb_deadlock

Utility to detect and abort deadlocked transactions.

 

msdb_recover

Utility to recover the M-Store database from corruption or failure.

 

msdb_restore

Utility to restore the database from a previous msdb_backup created backup.

 

msdb_test

Utility to test, initialize, or recover M-Store database files. Use it often to ensure database integrity.

 

pop3d

POP3 front-end daemon.

 

reconstruct

Utility to recover from mailbox cache file corruption.

 

storemgr

Manages the store processes.

 

store_setup

Utility to setup M-Store.


Runtime Data Files

These files contain the dynamically changing information maintained by the M-Store package. As a rule, the files in this part of the filesystem are controlled and updated by the M-Store software itself, and are not accessed directly by an administrator or end-user. Users should never, and never need to, directly modify any files in the directories listed here with the exception of the /var/md/store/etc/nologin file and the /var/md/store/backup directory. Back up all of the files listed here on a regular basis, as they contain all of the critical user data (for example, e-mail message data).

The following files are rooted in /var/md/store. This root is defined as the configuration option ms-path.

Table 9-4. /var/md/store/ Runtime Data Files

Extended Path

File Name

Description

backup/

MSDB_Backup_<MM>-<DD> -<YYYY>_<HR-MN>

Default location of database backups created with msdb_backup.

database/

__db_lock.share

Shared memory segments used by the database.

 

__db_mpool.share

 

 

__db_txn.share

 

 

__db.001

 

database/data/

acl.db

Individual database tables used by M-Store ID explained in more detail below.

 

administrators.db

 

 

authmap.db

 

 

domain.db

See above, M-Store Database Tools.

 

identifiers.db

See above, M-Store Database Tools.

 

mailboxaccess.db

See above, M-Store Database Tools.

 

mailboxbyid.db

See above, M-Store Database Tools.

 

mailboxbyname.db

See above, M-Store Database Tools.

 

quota.db

 

 

sec.db

 

 

subscription.db

 

 

userbyid.db

 

 

userbyname.db

 

database/transaction_log/

__db_log.share

Shared memory segments shared between processes (__db_*.share), database tables (data/*.db), and the transaction log files (transaction_log/log\. *). The path of the transaction log directory is defined by the transaction-log- \directory configuration option and defaults to the location presented here.

 

log.0000000001

Default location of various database log files.

etc/nologin/

 

Location of the imapd and pop3d shutdown file.

ipc/

authproxyd

lmtpd

UNIX domain socket files for authproxyd and lmtpd communications.

ipc/.tf/

user

Holds ticket files for the kerberos4 authproxyd authentication mechanism. This directory only exists if the kerberos4 authproxyd mechanism is used.

lock/mbox/

__db.001

This directory contains shared memory segments used by the locking sub-system throughout the mailstore.

lock/pop/

__db.001

This directory contains shared memory segments used by the locking sub-system throughout the mailstore.

log/

 

This directory is reserved for future telemetry logging.

mailstore/

 

Recommended location for the physical message store.

mailstore/XX/YY/ZZ/

fdb.cache

Contains pre-parsed envelope and body information for each message.

 

fdb.header

Contains general information about the mailbox itself.

 

fdb.index

Contains various mailbox and per message information.

 

fdb.seen

Tracks the seen and recent flags on a per message per user basis.

 

1.

Stored messages in RFC822 format.

 

2.

Stored messages in RFC822 format.

 

...

 

run/

authproxyd.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

imapd.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

lmtpd.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

msdb_checkpoint.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

msdb_deadlock.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

pop3d.lock

Lock file containing the process ID of each running daemon process. File ensures that only one instance of the daemon is running for a given message store. Multiple instances of an M-Store daemon must use different configuration files with each ms-path value.

 

storemgr.lock

 

tmp/

 

The location for all temporary M-Store processes.


M-Store Database Files

The following files are used for the database administration functions:

Table 9-5. M-Store Database Files

Database Tool

Description

msdb_archive

Lists the transaction log files that are no longer involved in active transactions and can be archived or deleted to decrease disk space.

msdb_backup

Runs a live backup of the database.

msdb_checkpoint

Checkpoints the transaction logs.

msdb_recover

Recovers the database after corruption or failure.

msdb_restore

Restores the database from a previous backup

msdb_test

Tests the database for usability. Use it often to ensure database integrity, as it can detect and repair most database problems.

msdb_upgrade

Creates and initializes a new database or upgrades an existing one. This should only be run once after an install.

M-Store uses a Sleepycat database to store mailstore meta-data. Database tables containing information regarding domains, users, and mailboxes are stored in the /var/md/store/database/data directory. Modifications to the database tables are executed as atomic transactions to prevent race conditions and keep the data consistent. The /var/md/store/database/transaction_log directory contains log files of the transaction data. In the case of corruption or system failure, the transaction logs can be used to recover the database data. The database is integral to the message store and should only be operated upon by the msdb_* applications.

If any database files are missing, the message store becomes unusable. In such a case, a backup containing all database files must be restored. So it is strongly recommended that backups are completed on a regular basis. Failure to recover or restore a missing database file is a irrecoverable error and cannot be repaired. The recreation of all database files will be necessary.

M-Store Physical Mailbox Files

The path to physical mailboxes is hashed to balance the mailbox distribution throughout one or more disk partitions. Such balancing also keeps the number of subdirectories in any directory small to maintain fast access speed.

Each mailbox has a unique path determined by its partition (or mailstore), two levels of hashing (in hexadecimal), and its unique numerical mailbox identifier. For example the mailbox user/joe/INBOX in the example.com domain may have the path:

/var/md/store/mailstore/0E/C2/16183

where /var/md/store/mailstore is in the mailstore path, 0E is the first hash level, C2 is the second hash level, and 16183 is the mailbox id. The path to a particular mailbox can be determined using the msadm_tclsh administration tool (see mbox_get_user_path in “User Mailbox Management Commands” in Chapter 12.

Table 9-6. M-Store Binary Mailbox Files

fdb.cache

fdb.header

fdb.index

fdb.seen

Each mailbox contains at least four files. There are four fdb binary files containing cached information regarding the mailbox and each message. The mailbox also contains the messages held within it; each message is stored in a separate file in RFC822 format. The mailbox files should never be, nor ever need to be, edited by hand.