Database URL

From Mailutils
Revision as of 23:18, 9 November 2011 by Gray (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

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
kc
Kyoto Cabinet

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