Unix Network Admin   «Prev 

Example Configuration File

Suppose we want to modify the generic-solaris2.mc file so that our sendmail configuration forwards mail from our machine CLIENT.corporation.com, rewriting the outgoing mail so that it appears to be from [email protected], not [email protected].
We copy the file to a new file (our_configuration.mc) and add a “MASQUERADE_AS” directive to the file. We also change the VERSIONID keyword:

divert(0)dnl
VERSIONID(`Based on generic-solaris2.mc for 
corporation.com')
OSTYPE(solaris2)dnl
DOMAIN(generic)dnl
MASQUERADE_AS(corporation.com)
MAILER(local)dnl
MAILER(smtp)dnl

The file must also be in the cf/cf subdirectory. To create the sendmail.cf command, make sure that your current directory is
SENDMAILSRC/cf

and issue the following command:
m4 ../cf/m4/cf.m4 our_configuration.mc 
> newsendmail.cf

This command preloads M4, then uses the cf.m4 program to create a new file. Notice that you must enter the full path to all of the sendmail configuration files. After testing, you can then copy this file to the /etc/ directory, then kill and restart sendmail.