Name

MailboxDatabase

Synopsis

To perform delivery, sendmail needs to find information about any recipient or sender that is local. The items of interest are:

Numeric IDs

The uid and gid of the user are important because they determine what files can be read or written and which programs can be run.

Full Name

The full name for use in headers and the $x sendmail macro ($x).

Home Directory

The home directory for the user is needed to locate the user’s ~/.forward file, to locate the place to write the ~/dead.letter file, or to set the correct directory for starting programs.

Shell

The user’s shell is needed to determine if the user is permitted to run programs (Section 10.8.3).

In the past, all of this information was gathered using getpwent(3). Beginning with V8.12 sendmail, it is possible to specify this or a different method using an API designed to allow you to write your own method.

The MailboxDatabase option is used to specify how user information is acquired:

O MailboxDatabase=method             configuration file (V8.12 and later) 
-OMailboxDatabase=method             command line (V8.12 and later) 
define(`confMAILBOX_DATABASE',method) mc configuration (V8.12 and later) 

Here, the method is of type string. The default (and, as of V8.12, the only) method is the literal string pw, which means to use getpwent(3). An LDAP implementation of a method is included in the source as an example. If you wish to write your own method, see the code in libsm/mbdb.c.

The MailboxDatabase option is not safe. If it is ...

Get Sendmail, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.