Sun Java System Messaging Server 6.3 Administration Guide

20.2 Message Store Directory Layout

Figure 20–1 shows the message store directory layout for a server instance. The message store is designed to provide fast access to mailbox contents. The store directories are described in Table 20–2.

Figure 20–1 Message Store Directory Layout

Graphic shows Message Store directory layout.

The message store consists of a number of mailbox databases and the user mailboxes. The mailbox databases consists of information about users, mailboxes, partitions, quotas and other message store related data. The user mailboxes contain the user’s messages and folders. Mailboxes are stored in a message store partition, an area on a disk partition specifically devoted to storing the message store. See 20.10 Configuring Message Store Partitions for details. Message store partitions are not the same as disk partitions, though for ease of maintenance, we recommend having one disk partition for each message store partition.

Mailboxes such as INBOX are located in the store_root. For example, a sample directory path might be:


The table below describe the message store directory.

Table 20–2 Message Store Directory Description




Default: /opt/SUNWmsgsr

The directory on the Messaging Server machine that holds the server program, configuration, maintenance, and information files. 



Top-level directory of the message store. Contains the mboxlist, user, and partition subdirectories.


Contains the automatic message removal rules (expire rules). This optional file can be at different locations. See 20.9 To Set the Automatic Message Removal (Expire and Purge) Feature


Message store database backup snapshots that stored makes periodically.


Contains mailbox database, database (Berkeley DB) that stores information about the mailboxes and quota information. 

folder.db contains information about mailboxes, including the name of the partition where the mailbox is stored, the ACL, and a copy of some of the information in store.idx. There is one entry in folder.db per mailbox

quota.db contains information about quotas and quota usage. There is one entry in quota.db per user.

lright.db - an index for the folders by acl lookup rights.

peruser.db contains information about per-user flags. The flags indicate whether a particular user has seen or deleted a message.

subscr.db contains information about user subscriptions.


Contains active message store process information. 


Not used. 


Contains the message store partitions. A default primary partition is created. Place any other partitions you define in this directory.


Contains all the user mailboxes in the subdirectory of the partition. The mailboxes are stored in a hash structure for fast searching. To find the directory that contains a particular user’s mailbox, use the hashdir utility.


The top-level mail folder for the user whose ID is userid. This contains the user’s INBOX. For the default domain, userid is uid. For hosted domains, userid is uid@domain. A user's incoming messages are delivered to the INBOX here.


A user-defined mailbox on the messaging server. 


An index that provides the following information about mail stored in the /userid/ directory: number of messages, disk quota used by this mailbox, the time the mailbox was last appended, message flags, variable-length information for each message including the headers and the MIME structure, and the size of each message. The index also includes a backup copy of mboxlist information for each user and a backup copy of quota information for each user.


Contains a list of users who have accessed the folder. For each user listed, contains information about the last time the user accessed the folder, the list of messages the user has seen, and the list of messages the user has deleted. 


Contains information about user subscriptions. 


Contains a list of message files that have been expunged, but not removed from disk. This file appears only if there are expunged messages. 


nn is a hash directory that contains messages in the format message_id.msg; nn can be a number from 00 to 99. message_id is also a number. Example: messages 1 through 99 are stored in the .../00 directory. The first message is 1.msg, the second is 2.msg, third 3.msg, and so on. Messages 100 through 199 are stored in the 01 directory; messages 9990 through 9999 are stored in the 99 directory; messages 10000 through 10099 are in the 00 directory, and so on.

20.2.1 Valid UIDs and Folder Names

The following definitions will assist in this discussion:

message store user ID — A mail user's unique identifier in the message store. In the default domain, this is the same as the user's uid attribute in LDAP. In hosted domains this is uid@domain where uid is the uid LDAP attribute and domain is the canonical domain name.

message store mailbox name for commands — Some message store commands require that you specify a mailbox name. The required form of the name is user/userid/mailbox where userid is the message store user ID (see above) and mailbox is a user's mailbox. Specifying INBOX sometimes implies all the user's mailboxes in the message store. For example, the following command:

mboxutil -d user/joe/INBOX

will remove the INBOX and all the folders of user joe. Note that in the context of message stores, folders and mailboxes are synonymous.

Valid UIDs. Valid and invalid UID characters are controlled separately by the MTA and message store mechanisms. That means UID character limitations are specified by the union of MTA and message store limitations. The following characters and strings are invalid as UIDs in the message store:

The following characters are invalid in UIDs in the MTA:

<space> $~=#*+%!@,{}()/\\<>;:\"`[]&?"

The list of characters forbidden by the MTA can be modified by setting the option.dat parameter LDAP_UID_INVALID_CHARS with a string of the forbidden characters using decimal ASCII values, however, you are strongly advised not to change the default constraint. The default setting is as follows and reflect the characters listed above:



Valid mail folder names. The following characters are invalid as folder names:

% * ? and ASCII values less than 20 or greater than 7E hexidecimal (see man ascii).

In addition, folder names must be valid MUTF-7 sequences.