James uses a number of different repositories to both store message data (email, news messages) and user information. User repositories store user information, including user names, authentication information, and aliases. Mail repositories store messages that have been delivered locally. Spool repositories store messages that are still being processed. Finally, news repositories are used to store news messages.
Aside from the type of data they store, repositories are distinguished by where they store data. There are three types of storage - File, Database, and DBFile.
File-based repositories store all data in the file system. In general, these repositories are extremely simple to configure, but may compare poorly in terms of performance when compared to other repository types. File repositories are not recommended for large or performance-critical configurations. In the default configuration, all repositories are file repositories.
File repository paths typically begin with the prefix "file". Paths are relative to the application base directory, unless the path begins with a slash. As an example, assume that James is running in /usr/james/phoenix/apps/james. Then "file://var/mail/spool/" would refer to the directory /usr/james/phoenix/apps/james/var/mail/spool. And "file:///var/mail/spool/" (note the extra '/') would refer to the directory /var/mail/spool.
All repository types (mail, spool, user, and news) have file-based implementations. No special configuration is required to enable file-based repositories
Database repositories store all data in an administrator-supplied database. Configuration is somewhat more complex, requiring that the administrator adjust the data-connections section. Detailed directions are included in the sample configuration file. The administrator will need to know the JDBC driver class, the appropriate URL for use with his database, and a valid username/password for the database.
If the administrator wants to configure a database other than MySQL, it will be necessary to add the jar or zip file containing the JDBC driver classes to the lib subdirectory of the installation directory. This will allow Phoenix to properly load the driver when it is initializing the database repository. The MySQL driver is pre-packaged with James.
Database repository paths typically begin with the prefix "db". The format is "db://<data-source>/<table>" where <data-source> is the name of the data-source defined in the data-connections section. And <table> is the particular table associated with the repository.
Mail, spool, and user repositories have JDBC-based implementations.
This is a special repository type used only for mail repositories. DBFile repositories store the body of a mail message in the file system, while headers are stored in the database. This allows the administrator to minimize the size of data stored in the database, while conserving most of the performance of the database repository.
Only mail repositories have dbfile-based implementations.