The /etc/mail/sendmail.cf file allows you to customize Sendmail to fit your sites requirements. If you take the time to examine the sendmail.cf file you'll discover that it's actually laid out in sections. You'll also find out that the file is heavily commented except for the rule rewriting section.


Let's take a quick look at the sections that make up the sendmail.cf file:


The features that were enabled for this sendmail.cf file
Security Overrides
LDAP maps
Macros and Classes
Options & Timeouts
Queue Groups
Message Precedence
Trusted Users
Message Headers
All of the rewriting rules
Mailers


You'll find that the rewriting rules make up one half to two thirds of the configuration file. The good news is that you shouldn't have to modify the rules rewriting section.


When you look at this file you need to remember that this file is created for Sendmail to use and not for you to read through. What does that mean? It means the faster Sendmail can parse the file then the faster it can do its job. The sendmail.cf file is intentionally written in a very terse manner so the software can process it as fast as possible.


The first letter of each line tells Sendmail what the rest of the line will contain. When you read through the sendmail.cf file keep the following letters in mind:


D = Macros - Contain one value
C = Class Macros - Contain multiple values
E = Environment variable
F = Define a class macro from a file, pipe or database map
H = Header
K = Keyed Database - also called an external database
M = Define a Mail Delivery Agent
O = Define an Option
P = Define a Delivery Priority
Q = Define a Queue
R = Define a rewriting rule
S = Define a ruleset start
T = Declare a trusted user
V = Define the configuration file version
X = Define a mail filter


Sendmail uses m4 macros to build the .cf file. By properly constructing a file with m4 directives you can tailor Sendmail to your liking. In the source tarball is a directory called cf. Inside of this directory is a README file that will attempt to guide you through the configuration process.


m4 is a macro language. What you need to do is to place all the features that you want enabled into a file that ends with .mc, and then feed this file to m4. m4 will then take the directives and create the sendmail.cf file. What's inside the file is just macro names and value pairs. Just because you define a feature doesn't mean it's available for you to use. If you didn't compile in support for say SMTP AUTH, defining it in your sendmail.cf file isn't going to do you any good. A typical line looks something like:


define(macro, value)dnl


All we need now is a list of macros and the values that they can contain. The sendmail README file states that the preferred listing of m4 macros is:


VERSIONID
OSTYPE
DOMAIN
FEATURE
local macro definitions
MAILER
LOCAL_CONFIG
LOCAL_RULE_*
LOCAL_RULESETS


There are a few exceptions to this rule. Local macro definitions which influence a FEATURE() should be done before that feature. For example, a define(`PROCMAIL_MAILER_PATH', ...) should be done before FEATURE(`local_procmail').


You MUST define an operating system environment, or the configuration file will not build. There are several environments available; look at the "ostype" directory for the current list. This macro changes things like the location of the alias file and queue directory. Some of these files are identical to one another.


It is IMPERATIVE that the OSTYPE occur before any MAILER definitions. In general, the OSTYPE macro should go immediately after any version information, and MAILER definitions should always go last.


The second hardest part of configuring Sendmail may be just trying to decide which database to use to get the job done. In some cases there is more than one database that could be used to do the same thing. It's up to you to decide which one you want to use and which one to ignore. The rest of these web pages will provide to you the different names of the macros that you can define in your own .mc file. For a complete listing of all the possible macros please consult the Bat book. Once you've built your own .mc file, then you can use that to build your own sendmail.cf file. http://docs.sun.com under Solaris 10, System Administration, Network Services has a section on how to use Solaris to build a new sendmail.cf file. I used to include that section but since it is subject to change without notice it has been removed from this web site.


The mail service on Solaris 10 is managed by the Service Management Facility.


Administrative actions on this service, such as enabling, disabling, or restarting, can be performed by using the svcadm command. The service's status can be queried by using the svcs command.


Start sendmail.


# svcadm enable network/smtp:sendmail


Stop sendmail.


# svcadm disable network/smtp:sendmail


Next Section: Relaying - 9 of 32



This Web Site Copyright © 1997 - 2008
by Alan Pae - All Rights Reserved