Configure with m4
The
process of building a sendmail configuration
file begins by creating a file of m4 statements.
Traditionally, the suffix for such files is .mc.
The cf/cf directory contains examples of many
.mc files. Of special interest are those that
begin with generic, for these can serve as
boilerplates in developing your own .mc files:
generic-bsd4.4.mc generic-mpeix.mc generic-sunos4.1.mc generic-hpux10.mc generic-nextstep3.3.mc generic-ultrix4.mc generic-hpux9.mc generic-osf1.mc generic-linux.mc generic-solaris.mc
All .mc files require specific minimal statements.
For a SunOS 4.1.4 site on the Internet, for example, the following
are minimal:
OSTYPE(sunos4.1)dnl ← see Section 4.2.2.1 MAILER(local)dnl ← see Section 4.2.2.2 MAILER(smtp)dnl← see Section 4.2.2.2
To build a configuration file from these statements, you would place them into a file—say, localsun.mc—then run the following command:
% ./Build localsun.cf
Using M4=/usr/5bin/m4
rm -f localsun.cf
/usr/5bin/m4 ../m4/cf.m4 localsun.mc > localsun.cf || ( rm -f localsun.cf && exit 1 )
chmod 444 localsun.cfHere, you run the Build[1] script found in the cf/cf directory. You pass it the name of your mc file with the “.mc” suffix changed to a “.cf” suffix. The Build script uses m4 to expand your mc file into a full-fledged configuration file.
Another way to build a configuration file is by running m4 by hand:
% m4 ../m4/cf.m4 localsun.mc > sendmail.cfHere, the ../m4/cf.m4 tells
m4 where to look for its default configuration ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access