Web linux-server.50webs.com

Linux Mail Server

The m4 Macro Control File:

The /usr/share/sendmail-cf/cf directory's prototype files contain m4 macro commands. In addition to lots of comments, the tcpproto.mc file contains the macros shown in the listing below


VERSIONID(`$Id: tcpproto.mc,v 8.13.22.1 2000/08/03 15:25:20 ca Exp $')
OSTYPE(`unknown')
FEATURE(`nouucp', `reject')
MAILER(`local')
MAILER(`smtp')

The file tcpproto.mc also contains divert and dnl commands. A divert(-1) command precedes a large block of comments. m4 skips everything between a divert(-1) command and the next divert command. A divert(0) command ends the block of comments. Lines following a divert(0) command are processed by m4. The dnl command is used for single-line and partial-line comments. Everything after a dnl command up to the next newline character is skipped. If dnl appears at the beginning of a line, the entire line is treated as a comment. The comments from the tcpproto.mc file are not included in the listing.

The VERSIONID macro defines version-control information. The version-control information can be anything you wish. Normally, it is information significant to some version control package. This macro is optional, and is just ignored in this discussion.

The OSTYPE macro loads the m4 source file from the ../ostype directory that defines the operating system information. The ostype directory contains more than 40 predefined operating system macro files, one of which is linux.m4. The OSTYPE macro is required.

The FEATURE macro defines an optional sendmail feature. The nouucp feature in the tcpproto.mc prototype file means that no UUCP address processing code will be included in the sendmail configuration. Later, we will add our own FEATURE macros to create a complete custom configuration.

The MAILER macros are the last macros in the sample file. The MAILER(local) macro adds the local mailer and the prog mailer to the configuration. The MAILER(smtp) macro adds mailers for SMTP, Extended SMTP, 8-bit SMTP, on-demand SMTP, and relayed mail. All of these mailers were described earlier in the chapter, and are all of the mailers needed for the configuration.

Creating a sendmail.cf for a Linux system from the tcpproto.mc prototype file could be as simple as changing the OSTYPE line from unknown to linux and then processing the file with the m4 command. The sendmail.cf file output by m4 would be ready for sendmail. In fact, it would be almost identical to the linux.smtp.cf configuration file delivered with Slackware Linux. Every custom configuration for Linux must begin by setting OSTYPE to linux in order to process the linux.m4 source file.

.