The Minimal mc File

Every mc file requires minimal information. Table 19.2 shows which m4 items are required and also lists two that are recommended.

Required and Recommended m4 Items
Item Description
OSTYPE() Required Support for your operating system
MAILER() Required Necessary delivery agents
DOMAIN() "DOMAIN()" Recommended Common domain wide information
FEATURE() "FEATURE()" Recommended Solutions to special needs

Note that what is minimally required for a workstation differs from what is minimally required for a central mail server. We recommend that you use these recommendations as a jumping-off point and investigate all the m4 techniques that are available.

OSTYPE()

Support for various operating systems is supplied with the OSTYPE m4 command. Every mc file must declare the operating system with this command. The available support is supplied by files in the _CF_DIR_/ostype directory. A listing of those files looks something like this:

aix2.m4 bsdi1.0.m4 irix4.m4 ptx2.m4 ultrix4.m4 aix3.m4 bsdi2.0.m4 irix5.m4 riscos4.5.m4 unknown.m4 altos.m4 dgux.m4 isc4.1.m4 sco3.2.m4 uxpds.m4 amdahl-uts.m4 domainos.m4 linux.m4 solaris2.m4 aux.m4 dynix3.2.m4 maxion.m4 sunos3.5.m4 bsd4.3.m4 hpux10.m4 nextstep.m4 sunos4.1.m4 bsd4.4.m4 hpux9.m4 osf1.m4 svr4.m4

To include support, select the file that best describes your operating system, delete the m4 suffix from its name, and include the resulting name in an OSTYPE declaration:

OSTYPE(`ultrix4.1')

Here, support for the DEC Ultrix operating system is defined. Note that some of these are not entirely accurate. For example, ultrix4.1.m4 includes support for Ultrix versions 4.2 and 4.3, and sunos4.1.m4 includes support for SunOS versions 4.1.2, 4.1.3., and 4.1.4.

If you pick a name for which no file exists, or if you misspell the name of the file, an error similar to the following will print:

m4: Can't open ../ostype/ultrux4.1.m4: No such file or directory

If you omit the OSTYPE declaration entirely, you will get the following error:

*** ERROR: No system type defined (use OSTYPE macro)


MAILER()

Delivery agents are not automatically declared. Instead, you must specify which ones you want to support and which ones to ignore. Support is included by using the MAILER m4 macro:

MAILER(`local')

This causes support for both the local and prog delivery agents to be included. This is the minimal declaration (even if you don't intend to perform local or program delivery).

Other delivery agents that are recognized by the MAILER() technique are listed in Table 19.3.

MAILER Delivery Agents
MAILER() Delivery agents it declares
cyrus cyrus, cyrusbb
fax fax
local local, prog
mail11 mail11
phquery ph
pop pop
procmail procmail
smtp smtp, esmtp, smtp8, relay
usenet usenet
uucp\*= uucp, uucp-old, uucp-new, uucp-dom, uucp-uudom

If you use both uucp and smtp, put smtp first.

New delivery agents can be created by devising a new m4 file in the _CF_DIR_/mailers directory. The MAILER() m4 technique performs its inclusion by reading a file with the delivery agent name suffixed with m4 from that directory.

Some delivery agent equates, such as F= and M=, can be modified with the m4 configuration technique. Table 30.1 (see "The Equates") lists all the equates and shows where to find further information about each of them. By investigating those sections, you can discover how to tune particular equates with the m4 technique. For example, the following mc lines define the program used for local delivery to be mail.local:

define(`LOCAL_MAILER_PATH', `/usr/local/bin/mail.local') MAILER(local)

Note that all modifications to equates must precede the corresponding MAILER() definition. See "m4 Configuration Syntax" for a complete description of MAILER() and all the ins and outs of using it.

Also note that beginning with V8.8, the MAILER_DEFINITIONS m4 command (see ) can be used to force your delivery agent definitions to be grouped with the others.

DOMAIN()

For large sites it can be advantageous to gather all configuration decisions that are common to the entire domain into a single file. The directory to hold domain information files is called _CF_DIR_/domain. The configuration information in those files is accessed by using the DOMAIN() m4 technique, for example,

DOMAIN(`uofa.edu')

This line in any of your mc files causes the file _CF_DIR_/domain/uofa.edu.m4 to be included at that point. Examples that come with the distribution illustrate subdomains under Berkeley.EDU. One boilerplate file, named generic.m4, can be used as a starting point for your own domainwide file. For example, if all hosts at your site masquerade behind one email name, you might want to put MASQUERADE_AS (see MASQUERADE-AS) in your domain file. Domain files also form a natural location for the definition of site-specific relays (see "Relays").

If the domain that is specified does not exist or is misspelled, an error similar to the following will be printed:

m4: Can't open ../domain/generik.m4: No such file or directory

The use of DOMAIN() is not mandatory but is recommended.

FEATURE()

V8 sendmail offers a number of features that you may find very useful. To include a feature, include an m4 command like one of the following in your mc file:

FEATURE(keyword) FEATURE(keyword, argument)

These declarations causes a file of the name _CF_DIR_/feature/keywordm4 to be read at that place in your mc file. The available keyword files are summarized in Table 19.4 and each is explained in the section at the end of this chapter. Note that some keywords require an additional argument.

FEATURE Keywords
Keyword Version Description
allmasquerade FEATURE(allmasquerade) and above Masquerade the sender too
always_add_domain FEATURE(always-add-domain) and above Add the local domain even on local mail
bestmx_is_local FEATURE(bestmx-is-local) and above Accept best MX record as local if in $=w
bitdomain FEATURE(bitdomain) and above Convert BITNET addresses into Internet addresses
domaintable FEATURE(domaintable) and above Accept old as equivalent to new domain
genericstable FEATURE(genericstable) and above Transform sender addresses
limited_masquerade FEATURE(limited-masquerade) and above Only masquerade $=M hosts
local_procmail FEATURE(local-procmail) and above Use procmail(1) as local delivery agent
mailertable FEATURE(mailertable) and above Database selects new delivery agents
masquerade_entire_domain FEATURE(masquerade-entire-domain) and above Masquerade all hosts under a domain
masquerade_envelope FEATURE(masquerade-envelope) and above Masquerade the envelope too
nocanonify FEATURE(nocanonify) and above Don't canonify with $[ and $]
nodns FEATURE(nodns) Omit DNS support from configuration file
nouucp FEATURE(nouucp) and above Eliminate all UUCP support
nullclient FEATURE(nullclient) and above Relay all mail through a mail host
redirect FEATURE(redirect) and above Add support for address.REDIRECT
smrsh FEATURE(smrsh) and above Use smrsh (sendmail restricted shell)
notsticky FEATURE(notsticky) thru V8.6 Don't differ user from user@local.host
stickyhost FEATURE(stickyhost) and above Differ user from user@local.host
use_ct_file FEATURE(use-ct-file) and above Use /etc/sendmail.ct for a list of trusted users
use_cw_file FEATURE(use-cw-file) and above Use /etc/sendmail.cw for local hostnames
uucpdomain FEATURE(uucpdomain) and above Convert UUCP hosts via a database
virtusertable FEATURE(virtusertable) and above Support for virtual domains

All the features available are described in detail at the end of this chapter (see "Alphabetized m4 Macros").