M4 configuration in Sendmail
M4 is a Macro program which allows to define key value pairs i.e names with values, such as configuration options with values and responsible for expanding the values to syntax that sendmail that recognizes.
eg:- sendmail.mc(Human readable config file) file is the input taken by M4 to create sendmail.cf(sendmail readable) file.
Generation Of Sendmail Configuration Files:
If u are installing the sendmail from the source code all the configuration examples and M4 files that needed while converting the "*.mc" file will be present inside the directory /sendmail-8.14.2/cf. and if you are using the rpm based binaries all the configurations example and M4 files that needed while converting the "*.mc" file will be present inside /usr/share/sendmail-cf
The following is the basic configurations that needed by sendmail in sendmail.mc file to start with
divert(-1)
divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl
/sendmail-8.14.2/cf or /usr/share/sendmail-cf directory:
m4/: directory contains the files that is used for compiling M4 with sendmail config file while running the Build script from the sub-directory cf/ (or #m4 sendmail.mc > sendmail.cf)
README.txt: file contains all the derivatives that can be understood ( M4 preprocessor )by sendmail inside this directory.
cf/: In /sendmail-8.14.2/cf or /usr/share/sendmail-cf "cf/" is the sub-directory which contains the M4 configuration files. generic-linux.mc & generic-linux.cf are the two config files that is used for generation of sendmail.cf file. These configuration file is enough to create a minimum level of sendmail server on Linux distros.
sendmail.mc file is used by MTA and submit.cf file is used by MSP.
Basic Derivatives and struchure of sendmail.mc:
dnl = delete through new line
This tells the M4 deamon to delete any superfluous or excessive new lines after creation of subsequent derivatives for mc files to cf file.
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
.forward file path
maximum mail Header Length.
use of cw file etc.
MAILER(local)dnl &
MAILER(smtp)dnl
Here every mailer has their own defnitions. inlcudes the path of program and the rules.
local mailer permits the redirection of the msgs in to programs.
Running
`./Build install-cf`
In source:
[root@centos cf]# pwd
/root/sendmail/sendmail-8.14.2/cf/cf
[root@centos cf]# m4 ../m4/cf.m4 sendmail.mc
#m4 sendmail.mc > sendmail.cf
No comments:
Post a Comment
tag ur valuable ideas below