33. Database Macros
Contents:
Database macros are special forms of defined macros. When used with certain special operators, they can cause rules to access information in external files. Database macros offer these advantages:
To fully appreciate
sendmail
databases, consider the only
alternative, the
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
In such volatile situations, storing UUCP information in a database is preferred. A change to a database is immediately available to the running daemon, eliminating the need to kill and restart.
V8
sendmail
is designed to rewrite addresses on the basis of
information looked up in external databases or in its internal symbol table.
It can use a wide variety of database forms, ranging from
ndbm
(3) files (see
Section 33.8.3, dbm
) to Hesiod network maps
(see
Section 33.8.6, hesiod
).
The 33.1 Enable at Compile TimeVendors that provide V8 sendmail in precompiled form may or may not provide access to all the types of databases that V8 sendmail supports. If your online documentation lacks this information, you can run strings (1) on sendmail to discover what it supports:
%
In this implementation of
sendmail
, NDBM (the If you download and compile sendmail yourself, you may include any supported databases. Support is declared on the DBMDEF= line in the appropriate Makefile for your system. Possible definitions for DBMDEF= are shown in Table 33.1 .
For example, the Makefile.ULTRIX file might include this line:
DBMDEF= -DNDBM -DNEWDB -DNIS which includes support for ndbm (3), db (3), and nis (3) databases, [2] whereas the Makefile.SunOS.5.x file might include the following:
DBMDEF= -DNDBM -DNIS -DNISPLUS which excludes db (3) support but includes nisplus (3) support.
If you omit all database support (by undefining DBMDEF, for example,
or not supplying support indications after the equal sign),
sendmail
will
be unable to maintain its aliases in database format. Also, any
attempt to rebuild the aliases database (with
newalias
or
with
Cannot rebuild aliases: no database format defined Cannot create database for alias file /etc/aliases: No such device Note that if you add new map types, you may have to also add libraries to the LIBS= line in your Makefile . |
|