Difference between revisions of "Database URL"

From Mailutils
Jump to navigationJump to search
m
Line 23: Line 23:
 
then <tt>gdbm://</tt> will be assumed by default.
 
then <tt>gdbm://</tt> will be assumed by default.
  
 +
<div id="param"></div>
 
The optional <tt>params</tt> is a list of [[File_Safety_Checks#safety-checks|safety check criteria]], separated by semicolons.  The <tt>default</tt> keyword is synonymous with <tt>all</tt>.
 
The optional <tt>params</tt> is a list of [[File_Safety_Checks#safety-checks|safety check criteria]], separated by semicolons.  The <tt>default</tt> keyword is synonymous with <tt>all</tt>.
 
In addition to the usual safety criteria, the following parameter can be used:
 
In addition to the usual safety criteria, the following parameter can be used:

Revision as of 07:05, 27 October 2011

A database URL describes a hash database for use with the libmu_dbm library. In its full form it has the following syntax:

 scheme://dbfile;params

Of all its parts, only dbfile is required. It specifies the file name (either absolute or relative) of the database file. If the underlying implementation stores the database in two files (as it is the case with NBDM), dbfile will be used as a base name for those files (i.e. the suffixes .pag and .dir will be appended to it).

If scheme is specified, it declares the DBM implementation to use. Valid values are:

gdbm

GNU DBM

bdb

Berkeley DB

ndbm
Traditional NDBM
tc
Tokyo Cabinet
Note: The latter is not yet implemented

In the absense of scheme the default database implementation will be used. This is the first one shown in the list of DBMs when configuring the package. For example, if configure showed:

 Use DBM ....................... GDBM,Berkeley DB v. 4,NDBM

then gdbm:// will be assumed by default.

The optional params is a list of safety check criteria, separated by semicolons. The default keyword is synonymous with all. In addition to the usual safety criteria, the following parameter can be used:

+owner
Enable the MU_FILE_SAFETY_OWNER_MISMATCH check. Assume that the database files must be owned by the real UID of the current user.
owner=user
Enable that check and set the user which must own the database file. The user argument is either a valid user name or UID.
-owner
Disable that check.

Examples:

 /etc/apop.db
 bdb:///etc/apop.db
 bdb:///etc/apop.db;owner=root;all;-grdfil