To follow a recipe successfully, you must clearly understand the instructions it contains. You must understand the difference between folding and stirring and be able to find the spices when the recipe calls for a pinch of cumin. Just as you must be able to find your way around the kitchen to become a cook, you must know your way around the sendmail distribution in order to build or customize a sendmail configuration. The directory structure ”created by the sendmail source code distribution tarball ” contains the tools and ingredients used to build and configure sendmail. The top-level directory created by the tarball is assigned a name that identifies the sendmail version number. At the time of this writing, the current version is sendmail 8.12.9; therefore, the top-level directory is named sendmail-8.12.9 . By the time you read this, there will be a newer version of sendmail, and the directory name will reflect that new version number. An ls of the top-level directory shows the following: [1]
$ ls sendmail-8.12.9 Build doc INSTALL libsmdb mailstats praliases sendmail cf editmap KNOWNBUGS libsmutil Makefile README smrsh contrib FAQ libmilter LICENSE makemap RELEASE_NOTES test devtools include libsm mail.local PGPKEYS rmail vacation Most of these files and directories are used to compile sendmail. The Build script uses the Makefile to compile sendmail and its utilities. The devtools directory is used to set compiler options, as discussed in Recipe 1.2 to Recipe 1.7. The source code is located in aptly named subdirectories. For example, the sendmail source code is in the sendmail directory, the libraries are in directories such as libsm and libsmutil , and the source code of utilities such as makemap and smrsh is located in easily identified directories. There are also several important sources of information in the distribution:
Of all of these important directories and files, the most important (from the perspective of this book) is the cf directory, because the cf directory contains the configuration files (and this is a book about sendmail configuration). The cf directory structureThe m4 source files and libraries used to build the sendmail configuration are located in the cf directory, which contains the following items: $ ls sendmail-8.12.9/cf cf feature m4 ostype sendmail.schema siteconfig domain hack mailer README sh The cf directory contains two files, README and sendmail.schema , and nine subdirectories. The sendmail.schema file is an experimental LDAP schema that predefines attribute types and object classes that can be used with LDAP. The sendmail schema is used in most LDAP examples in this book. The README file is a comprehensive reference to the syntax and usage of all of the m4 macros and variables used to configure sendmail. The README file is an invaluable reference, particularly when used with this book. The directories hack , sh , and siteconfig have very little use for most configurations.
The remaining six directories are the real heart of sendmail configuration. Four of these directories, domain , feature , ostype , and mailer , have the same names as sendmail m4 macros, and provide the source code used by those macros. The purposes of these four directories are:
The other two remaining directories, cf and m4 , contain the master configuration files and macro source libraries used by m4 . The four directories described above contain files that are invoked inside the sendmail configuration by m4 macros. The cf/cf directory and the cf/m4 directory contain m4 source files that are normally invoked on the m4 command line. The cf/m4 directoryThe cf/m4 directory contains the m4 macro definitions and the sendmail.cf skeleton code needed to build a sendmail.cf configuration file. Remember that m4 is a general purpose macro language; it is not a language specifically designed to build sendmail configurations. sendmail configurations are built using macros defined by the sendmail developers. The cf/m4 directory contains the four files that define those macro commands.
The cf subdirectoryThe cf/cf directory is the working directory of sendmail configuration. It contains all of the master configuration files, and it is where you will put your own master configuration file when you build a custom configuration. The directory contains more than 40 files. $ ls sendmail-8.12.9/cf/cf Build generic-hpux10.cf generic-solaris.cf python.cs.mc chez.cs.mc generic-hpux10.mc generic-solaris.mc README clientproto.mc generic-hpux9.cf generic-sunos4.1.cf s2k-osf1.mc cs-hpux10.mc generic-hpux9.mc generic-sunos4.1.mc s2k-ultrix4.mc cs-hpux9.mc generic-linux.cf generic-ultrix4.cf submit.cf cs-osf1.mc generic-linux.mc generic-ultrix4.mc submit.mc cs-solaris2.mc generic-mpeix.cf huginn.cs.mc tcpproto.mc cs-sunos4.1.mc generic-mpeix.mc knecht.mc ucbarpa.mc cs-ultrix4.mc generic-nextstep3.3.cf mail.cs.mc ucbvax.mc cyrusproto.mc generic-nextstep3.3.mc mail.eecs.mc uucpproto.mc generic-bsd4.4.cf generic-osf1.cf mailspool.cs.mc vangogh.cs.mc generic-bsd4.4.mc generic-osf1.mc Makefile Most of these files ”more than 30 of them ”are sample master configuration files. You can identify a master configuration file by the .mc extension. Some are examples meant as educational tools, but most are prototypes or generic files meant to be used as the basis of your own configuration. The generic files designed for specific operating systems are particularly interesting, such as Solaris, HPUX, BSD, Linux, and several others. We use the generic-linux.mc file in Recipe 1.8. Several of the files are identified by the .cf extension. These files are the result of processing master configuration files through m4 ; they are already in the proper format to be used as the sendmail.cf file. It is unlikely , however, that you will use one of these files directly. Unless the generic master configuration file is exactly to your liking, the sendmail configuration file produced from that .mc file will not be what you want. We start with a generic configuration in Recipe 1.8, but the subsequent recipes in this book modify that generic configuration to create the custom configurations we need. |