|
|
The user database is built from a text file using the makemap utility. The text file is a series of lines corresponding to user database records; each line has a key and a value separated by white space. The key is always in the format described in ``Structure of the user database''. For example:
eric:maildropThis text file is normally installed in a system directory; for example, it might be called /etc/userdb. To make the database version of the map, enter:
Then reference the database file in the sendmail
configuration file.
For example, include the
following line in the configuration file:
OU/etc/userdb
sendmail adds the .db suffix when doing the database search.
The location of this database is controlled with the UserDatabaseSpec option.
The database is a sorted (BTree-based) structure.
User records are stored with the key:
user-name:field-name
The sorted database format ensures that user records are clustered together. Meta-information is always stored with a leading colon.
Field names define both the syntax and semantics of the value. Currently, the defined fields include:
If you have specified one or more databases using the U option, the databases will be searched for a ``user:maildrop'' entry. If found, the mail will be sent to the specified address.
If the first token passed to the user part of the ``local'' mailer is an at sign, the at sign will be stripped off and the database lookup will be skipped. The intent is that the user database will act as a set of defaults for a cluster (for example, the computer science department of a university); mail sent to a specific machine should ignore these defaults.
When mail is sent, the name of the sender is looked up in the database. If that sender has a mailname record, the value of that record is used as their outgoing name. For example, eric might have a record:
eric:mailname Eric.Allman@CS.Berkeley.EDUThis would cause eric's outgoing mail to be sent as Eric.Allman.
If a ``maildrop'' is found for the sender, but no corresponding ``mailname'' record exists, the record ``:default:mailname'' is consulted. If present, this is the name of a host to override the local host (for example, CS.Berkeley.EDU). The effect is that anyone known in the database gets their outgoing mail stamped as user@CS.Berkeley.EDU, but people not listed in the database use the local hostname. ``Creating a user information database''.