'UserDatabaseSpec'' ''''


Specify user database V8.1 and later

V8 sendmail, if compiled with USERDB defined (USERDB), can use a special, internally understood database called the User Database. Addresses that are defined in the User Database can be looked up and modified after aliasing but before the processing of the user's ~/.forward file.

The workings of this database are described in userdb. The UserDatabaseSpec option defines the name and location of the file containing this User Database information.

The forms of the UserDatabaseSpec option are as follows:

O UserDatabaseSpec=path,...           configuration file (V8.7 and later) 
-OUserDatabaseSpec=path,...           command line (V8.7 and later) 
define(`confUSERDB_SPEC',``path,...'')    mc configuration (V8.7 and later) 
OUpath,...                            configuration file (deprecated) 
-oUpath,...                           command line (deprecated) 

The argument path, . . . is of type string and is a comma-[74] or space-separated list of elements. Those elements can be database pathnames, or other information as described next. If path, . . . is missing or if the entire option is missing, the User Database is not used. Otherwise, the User Database is used, and each database is accessed in turn, leftmost to rightmost, in the list of paths. There is no default for the mc technique.

[74] When the argument to an m4 define command contains one or more commas, that argument should be enclosed in double half-quotes.

The elements of path, . . . can either be pathnames of files or other methods of lookup, depending on the first character of each:


A lead slash causes the element to be interpreted as a pathname; for example, /etc/mail/userdb.


A leading @ causes a copy of the message for each user to be forwarded to a specified host. The assumption is that the other host is in a better position to perform user database lookups. Such a declaration looks like @dbhost.our.domain. Note that this form of declaration must be last in the list that constitutes path, . . . because it always succeeds.


Beginning with V8.7, a leading h or H causes sendmail to perform a case-insensitive comparison of the path to the string hesiod. If they match, user database inquiries are looked up via Hesiod services.

For example, the following declares two user databases. The /etc/mail/userdb database is used first. If the entry is not found in that database, it will be forwarded to the host mail.here.us for handling there:

O UserDatabaseSpec=/etc/mail/userdb,@mail.here.us

Any leading character other than those shown here causes an error message to be printed and that particular path, . . . element to be ignored:

Unknown UDB spec badpath

If UDB_DEFAULT_SPEC is defined when sendmail is compiled (UDB_DEFAULT_SPEC), that value becomes the default if the UserDatabaseSpec option is missing. If UDB_DEFAULT_SPEC is undefined, the default becomes NULL and no User Database lookups are performed.

The UserDatabaseSpec option is not safe. If specified from the command line, it can cause sendmail to relinquish its special privileges.

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command