Building the m4 Configuration File

Now that the m4 source files have been created for the operating system and the domain, create a new m4 configuration file to use them. All of the m4 macros related to rewriting the outbound addresses are in the foobirds.m4 file. The macros that are specific to the Linux distribution are in the linux.m4 file. We need to include those files in the configuration.

Begin by changing to the ../cf directory and copying the file to Then change the file permission for to 644 to make sure that the file is writable by the owner.

Now, modify the file to reflect the new configuration. To do that, change "unknown" in the OSTYPE macro to "linux", and add a DOMAIN(foobirds) line to the macro control file. For the sake of clarity, we also change the information on the VERSIONID line. The tail command in Listing 5.12 shows the macros in the edited file.

Listing 5.12: A Customized Macro Control File

# tail -7 divert(0)dnl 03/16/2002')



FEATURE(~nouucp', "reject')



The next step is to process the file through m4:

The sample shows the m4 command format used to build a file. The pathname ../m4/ cf.m4 is the path to the m4 source tree required to build a file. The new macro control file is, of course, m4 reads the source files ../m4/cf.m4 and, and it outputs the file The file output by the m4 command is in the correct format for a file.

We used three files—ostype/linux.m4, domain/foobirds.m4, and cf/—which together total less than 30 lines. These files create a file that contains more than 1000 lines. The m4 macros are clearly the best way to build a custom sendmail configuration.

Was this article helpful?

0 0

Post a comment