MailboxDatabase

Choose a mailbox database V8.12 and later

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 is for use in headers and in the $x sendmail macro ($x on page 851).

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 whether the user is permitted to run programs (The /etc/shells File on page 180).

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=methodconfiguration file (V8.12 and later)
-OMailboxDatabase=methodcommand 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 ...

Get sendmail, 4th 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.