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:

store_root/partition/primary/=user/53/53/=mack1

The table below describe the message store directory.

Table 20–2 Message Store Directory Description

Location  

Content/Description  

msg-svr-base

Default: /opt/SUNWmsgsr

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

store_root

msg-svr-base/data/store

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

./store.expirerule

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

store_root/dbdata/snapshots

Message store database backup snapshots that stored makes periodically.

store_root/mboxlist/

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.

store_root/session/

Contains active message store process information. 

store_root/user/

Not used. 

store_root/partition/

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

store_root/partition/primary/=user/

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.

.../=user/hashdir/hashdir/userid/

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.

.../userid/folder

A user-defined mailbox on the messaging server. 

.../userid/store.idx

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.

.../userid/store.usr

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. 

.../userid/store.sub

Contains information about user subscriptions. 

.../userid/store.exp

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


.../userid/nn/
or
.../userid/folder/nn/

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:


DAP_UID_INVALID_CHARS=32,33,34,35,36,37,38,40,41,42,43,44,47,58,59,60,61,
62,63,64,91,92,93,96,123,125,126

LDAP_UID_INVALID_CHARS=32,33,34,35,36,37,38,40,41,42,43,44,47,58,59,60,61,
62,63,64,91,92,93,96,123,125,126

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.