Securing-Optimizing-RH-Linux-1_2_255
Comments and suggestions concerning this book should be mailed to gmourani@videotron.ca
© Copyright 1999-2000 Gerhard Mourani and Open Network Architecture ®
255
·
No client needs to run a sendmail daemon to listen for mail.
The sendmail.cf is the first file reading by Sendmail when it runs and one of the most important
for Sendmail. Among the many items contained in that file are the locations of all the other files,
the default permissions for those files and directories that Sendmail needs. The m4 macro
preprocessor program of Linux is used by Sendmail V8 to produce a Sendmail configuration file.
This macro program will produce the /etc/sendmail.cf configuration file by processing a file
whose name ends in .mc. For this reason, well create this file (sendmail.mc) and put the
necessary macros values in it to allow m4 program to processes (reads) its input and gathers
definitions of macros, then replaces those macros with their values and output the result to create
our sendmail.cf file. Please refer to Sendmail documentation and README file under cf
subdirectory of the V8 Sendmail source distribution for more information.
Step 1
Create the sendmail.mc file (touch /etc/sendmail.mc) and add the following lines:
divert(-1)
dnl This is the macro config file used to generate the /etc/sendmail.cf
dnl file. If you modify this file you will have to regenerate the
dnl /etc/sendmail.cf by running this macro config through the m4
dnl preprocessor:
dnl
dnl cp sendmail.8.9.3.tar.gz /var/tmp
dnl cd /var/tmp
dnl tar xzpf sendmail.8.9.3.tar.gz
dnl cd /var/tmp/sendmail-8.9.3/cf/cf
dnl m4 ../m4/cf.m4 /etc/sendmail.mc > /etc/sendmail.cf
dnl
dnl You will need to have the sendmail source distribution for this to
dnl work.
divert(0)
define(`confDEF_USER_ID',``8:12'')
OSTYPE(`linux')
define(`confAUTO_REBUILD')
define(`confTO_CONNECT', `1m')
define(`confTRY_NULL_MX_LIST',true)
define(`confDONT_PROBE_INTERFACES',true)
define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail')
FEATURE(`smrsh',`/usr/sbin/smrsh')
FEATURE(mailertable)
FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable')
FEATURE(redirect)
FEATURE(always_add_domain)
FEATURE(use_cw_file)
FEATURE(local_procmail)
FEATURE(nouucp)
MAILER(procmail)
MAILER(smtp)
FEATURE(`access_db')
FEATURE(`blacklist_recipients')
FEATURE(`rbl')
This tells sendmail.mc file to set itself up for this particular configuration setup with:
divert(-1) and divert(0)
The divert(-1) will delete the crud in the resulting output file and the divert(0) restores regular
output.