The m4 technique uses a huge number of macros to accomplish the complex task of creating configuration files for all possible circumstances. Most are detailed in the reference section at the end of this chapter. Others are documented in chapters dedicated to particular subjects. Here, we summarize all m4 macros by classification or function.
define(`ALIAS_FILE', `nis:-N mail.aliases')
Configuring options with the m4 technique is described in Section 34.3, "Configuring with V8 m4 Options" (with the individual m4 option names listed in Table 34.3 of that section). Options are described in general in Chapter 34, Options .
Defined macros may be declared in your mc file. Those that are useful are listed in Table 31.5 of Section 31.8, "Macros with the m4 Technique" . That section also describes the general technique of defining macros via m4 . To illustrate, for example,
causes the value
The m4 technique allows custom rules and rule sets to be inserted in a variety of convenient ways. The complete list of m4 keywords that affect rules is shown in Table 19.5 .
To illustrate, consider the following technique for adding a rule to rule set 0:
LOCAL_RULE_0 R$* <@ $=w . $=m> $* $#local $: $1 @here.ourdomain
Here, we add a rule to rule set 0 that accepts any address with a host part
in the class
Masquerading is the process of transforming the local hostname in addresses into that of another host. This results in the mail message appearing to come from that other host rather than from the local host. Masquerading is most often used in domains where email is addressed to the domain rather than to individual hosts inside the domain.
Masquerading usually rewrites header-sender addresses. Some m4 features allow you also to rewrite envelope addresses. The complete list of all definitions and features that affect masquerading is shown in Table 19.6 .
A relay is a rule that sends all of one type of mail to a specific destination. One example would be email FAX transmissions. Clearly, even though local mail should be delivered locally, mail to the pseudo-user fax should always be sent to a special FAX-handling machine.
The complete list of relays supported by the V8 sendmail m4 technique is shown in Table 19.7 .
All relays are declared in the same fashion. For example,
define(`LOCAL_RELAY', `smtp:relay.sub.domain.') trailing dot
Relays fit into the flow of rules through rule set 0 like this:
The m4 configuration technique includes four UUCP options to choose from. They are listed in Table 19.8 .
Note that two items in the table are marked as obsolete. This is because
all of their functions have been moved into the
Support for UUCP can be included in your mc file with the MAILER command (see Section 19.3.2 ):
This declares six  delivery agents and the rules to support them. They are listed in Table 19.9 .
If support for SMTP delivery agents is also included prior to
UUCP, then the last two additional delivery agents are included (
When processing UUCP mail (addresses that contain a
The choice of which delivery agent to use for UUCP delivery is under the control
of the SITECONFIG
macro described above (see
Which you choose depends on what version of UUCP you are running locally
and what version is being run at the other end of the connection. There are far
too many variations on UUCP to allow specific recommendations here.
In general, you need to choose between a domain form of address (
) and a UUCP form (
) and then go with the delivery agent
that makes the most sense for you.
We recommend that you start with the most domain-correct agent,
If you are running an old version of UUCP, you may have to use this
delivery agent. All addresses are turned into the
user becomes yourhost!user firstname.lastname@example.org becomes yourhost!host.domain!user
This delivery agent can deliver only to one recipient at a time, so it can spend a lot of time transmitting duplicate messages. If at all possible, avoid using this delivery agent.
Newer releases of UUCP can send to multiple recipients at once.
If yours is such a release, you may use the
More modern implementations of UUCP can understand and correctly
handle domain style addresses in headers (although they still
At the receiving end, the message mail arrives with the five character "