sendmail

sendmailSearch this book
Previous: 19.2 Build with m4Chapter 19
V8 m4 Configuration
Next: 19.4 m4 Macros by Function
 

19.3 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.

Table 19.2: Required and Recommended m4 Items
ItemDescription
OSTYPE()Section 19.3.1RequiredSupport for your operating system
MAILER()Section 19.3.2RequiredNecessary delivery agents
DOMAIN()Section 19.3.3, "DOMAIN()"RecommendedCommon domain wide information
FEATURE()Section 19.3.4, "FEATURE()"RecommendedSolutions 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.

19.3.1 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)

19.3.2 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.

Table 19.3: MAILER Delivery Agents
MAILER()Delivery agents it declares
cyruscyrus, cyrusbb
faxfax
locallocal, prog
mail11mail11
phqueryph
poppop
procmailprocmail
smtpsmtp, esmtp, smtp8, relay
usenetusenet
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 Section 30.4, "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 Section 30.3, "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 Section 19.6.40) can be used to force your delivery agent definitions to be grouped with the others.

19.3.3 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 Section 19.6.42, MASQUERADE-AS) in your domain file. Domain files also form a natural location for the definition of site-specific relays (see Section 19.4.5, "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.

19.3.4 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/keyword.m4 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.

Table 19.4: FEATURE Keywords
KeywordVersionDescription
allmasqueradeSection 19.6.6, FEATURE(allmasquerade)V8.2 and aboveMasquerade the sender too
always_add_domainSection 19.6.7, FEATURE(always-add-domain)V8.1 and aboveAdd the local domain even on local mail
bestmx_is_localSection 19.6.8, FEATURE(bestmx-is-local)V8.6 and aboveAccept best MX record as local if in $=w
bitdomainSection 19.6.9, FEATURE(bitdomain)V8.1 and aboveConvert BITNET addresses into Internet addresses
domaintableSection 19.6.10, FEATURE(domaintable)V8.2 and aboveAccept old as equivalent to new domain
genericstableSection 19.6.11, FEATURE(genericstable)V8.8 and aboveTransform sender addresses
limited_masqueradeSection 19.6.12, FEATURE(limited-masquerade)V8.8 and aboveOnly masquerade $=M hosts
local_procmailSection 19.6.13, FEATURE(local-procmail)V8.7 and aboveUse procmail(1) as local delivery agent
mailertableSection 19.6.14, FEATURE(mailertable)V8.1 and aboveDatabase selects new delivery agents
masquerade_entire_domainSection 19.6.15, FEATURE(masquerade-entire-domain)V8.8 and aboveMasquerade all hosts under a domain
masquerade_envelopeSection 19.6.16, FEATURE(masquerade-envelope)V8.7 and aboveMasquerade the envelope too
nocanonifySection 19.6.17, FEATURE(nocanonify)V8.1 and aboveDon't canonify with $[ and $]
nodnsSection 19.6.18, FEATURE(nodns)V8.6Omit DNS support from configuration file
nouucpSection 19.6.19, FEATURE(nouucp)V8.1 and aboveEliminate all UUCP support
nullclientSection 19.6.20, FEATURE(nullclient)V8.6 and aboveRelay all mail through a mail host
redirectSection 19.6.21, FEATURE(redirect)V8.1 and aboveAdd support for address.REDIRECT
smrshSection 19.6.22, FEATURE(smrsh)V8.7 and aboveUse smrsh (sendmail restricted shell)
notstickySection 19.6.23, FEATURE(notsticky)V8.1 thru V8.6Don't differ user from user@local.host
stickyhostSection 19.6.24, FEATURE(stickyhost)V8.7 and aboveDiffer user from user@local.host
use_ct_fileSection 19.6.25, FEATURE(use-ct-file)V8.7 and aboveUse /etc/sendmail.ct for a list of trusted users
use_cw_fileSection 19.6.26, FEATURE(use-cw-file)V8.1 and aboveUse /etc/sendmail.cw for local hostnames
uucpdomainSection 19.6.27, FEATURE(uucpdomain)V8.1 and aboveConvert UUCP hosts via a database
virtusertableSection 19.6.28, FEATURE(virtusertable)V8.8 and aboveSupport for virtual domains

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


Previous: 19.2 Build with m4sendmailNext: 19.4 m4 Macros by Function
19.2 Build with m4Book Index19.4 m4 Macros by Function