sendmail

sendmailSearch this book
Previous: 16.1 The cf/cf DirectoryChapter 16
The null.mc File and m4
Next: 16.3 Run m4
 

16.2 The null.mc File

Now we will create a file called null.mc, which, when later processed, will create a client.cf-style configuration file. The null.mc fill will be very small, containing only these three lines:

include(`../m4/cf.m4')
OSTYPE(`sunos4.1')
FEATURE(`nullclient',`mail.us.edu')

These three lines do everything that the preceding 11 chapters did and more. We discuss them individually, then show how to process the file.

16.2.1 include

Naturally, a configuration is not simply plucked from thin air. Instead the master prototype configuration needs to be read and processed with the following command: [1]

[1] See ../README for a description of how to replace this line with similar information on the command line when processing. The include line inside your null.mc file is portable to all versions of m4. The command line form is highly version dependent, but allows you to maintain your .mc files outside the sendmail distribution.

include(`../m4/cf.m4')

Note that the expression inside the parentheses begins with a reverse apostrophe and ends with a forward one. These opposing half quotes are used by m4(1) to prevent a test from being interpreted as a macro. The expression ../m4/cf.m4 is taken to be the pathname of a file. That file is read at this point as though it were actually typed in here.

16.2.2 OSTYPE

A number of values in the configuration file will differ from operating system to operating system. The location of the queue directory, for example, is /var/spool/mqueue for IRIX 5.x but /usr/spool/mqueue for BSD 4.3 Unix. To declare the proper value for your operating system, look in the ../ostype directory:

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

Pick the operating system closest to yours. For SunOS 4.1.4 systems, for example, choose sunos4.1.m4.

Whichever you choose, include support for it by stripping the .m4 suffix and including the resulting name in an OSTYPE declaration:

        sunos4.1.m4
           -v
         becomes
           -v
OSTYPE(`sunos4.1')

Remember to surround the result in a reverse and forward apostrophe pair.

16.2.3 FEATURE

The last line in our null.mc file provides the magic incantation of a client.cf-style file:

FEATURE(`nullclient',`mail.us.edu')

Two arguments inside the parentheses, separated by a comma, are required. The first argument, nullclient, tells m4(1) to create a null (do-nothing) client (.cf) file. The second argument is the canonical name of the mail hub. Just as we did for the client.cf file, we use the hostname mail.us.edu. You should, of course, use the canonical name of your own mail hub.


Previous: 16.1 The cf/cf DirectorysendmailNext: 16.3 Run m4
16.1 The cf/cf DirectoryBook Index16.3 Run m4