Chapter 23. The K (Database-Map) Configuration Command

Database maps can be used to look up information in databases, to perform transformations (such as dequoting), to perform computations, and to store values into macros. In their database role, they offer these advantages:

  • Information can be easily changed without having to restart sendmail because database information is external to the configuration file.

  • The sendmail program starts up faster because only the location of the information is stored at startup, not the information itself.

  • Rules are made more versatile because database information can be used in the RHS of rules. Class macros are still of use in the LHS.

To fully appreciate sendmail databases, consider the only alternative, the F configuration command. For example, mail that is sent via UUCP is a typical application that requires lists of information:

FU /etc/mail/uuhosts

Here, the external file /etc/mail/uuhosts contains a list of UUCP hosts connected to the local machine. If the list rarely changes, the F command is appropriate. On the other hand, if the list is volatile and changes often, the F command has drawbacks. The file /etc/mail/uuhosts is read only when the configuration file is processed. Any change to that file is ignored by a running sendmail (such as the daemon). To make the change effective, the daemon needs to be restarted.

In such volatile situations, storing UUCP information in a database is preferred. A change to a database is immediately available ...

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

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.