37.2. The Sendmail Configuration Module

Sendmail is the most popular MTA in use on the Internet today and has been since it was first developed. It is included as standard with almost all variants of the UNIX operating system, and works the same on all of them. It has many useful features for routing and processing email, such as aliases, domain routing, and user-creatable forward files.

Sendmail has a one-to-one mapping between UNIX users and mailboxes. Each user has his own mail file, typically in the /var/mail or /var/spool/mail directory. Each time a message is delivered to a user, it is appended to the file with the same name as the user in that directory, such as /var/mail/jcameron. Sendmail has no concept of “mail users.” If you want to create a new mailbox, you will need to add a new UNIX user as explained in Chapter 4.

Sendmail can accept email in two different ways, either from an SMTP connection or by another program invoking the sendmail command with the right parameters and feeding the email to it as input. Either way, the message is delivered to either a local user's mailbox or to another system. As you would expect, if the Sendmail server process is not running, then it is impossible for email to be sent to your system via SMTP. Any queued email will also not be delivered.

Sendmail's primary configuration file is appropriately named sendmail.cf, and is found in the /etc or /etc/mail directory. There are also separate text and DBM format files for local domains, mail forwarding aliases, address mappings, and other features discussed later in this chapter. Almost all of these additional files are actually in the UNIX DBM database format but are built from a corresponding text file that the system administrator (and Webmin) can edit. Sendmail only reads the DBM files though and rechecks them for every message received so that any change to one of the databases files becomes immediately active.

To set up Sendmail using Webmin, you will need to visit the Sendmail Configuration module, which can be found under the Servers category. Assuming you have the server installed, the module's main page will look like the example shown in Figure 37.1.

Figure 37.1. The Sendmail Configuration module.


If the module cannot find the Sendmail server program or primary configuration file on your system, an error message to that effect will be displayed instead. Check your Linux distribution CD or website for the sendmail package, and install it using the Software Packages module (covered in Chapter 12). If other packages whose names start with sendmail- are available (such as sendmail-cf or sendmail-docs), install them as well.

This error can also occur in the unlikely event that you have installed Sendmail or its configuration file in a different location than the one the module expects. By default, it assumes that you will use the packages that come with your operating system, but these are often out-of-date. For this reason, you may have compiled and installed the latest version in a different directory. If so, see Section 37.15 “Configuring the Sendmail Configuration Module” for instructions on how to change the program and configuration file paths.

Sendmail has gone through many different releases over the years, and in that time its primary configuration file (usually found at /etc/sendmail.cf) has changed. If you are running a very old version or using an old configuration file, the module's main page will display an error message indicating that the file format is not supported. Configurations older than version 7 trigger this error, but fortunately they are rarely found on modern UNIX systems.

If no error message appears on the main page, the table of icons shown in Figure 37.1 will be displayed. Each can be clicked on to access one of Sendmail's features, such as mail aliasing, domain routing, or the mail queue. The rest of this chapter explains how to use the pages and forms under each of the icons. Next to the name of each icon (such as Address Mapping) is the internal name of the Sendmail configuration feature in brackets that it controls, such as virtuser. These names are mostly useful to experienced administrators who want to know how the icons in the module relate to actual configuration files and directives.

When clicked on, some of the icons may display a message like Your Sendmail configuration does not have the address mapping (virtuser) feature enabled. On many operating systems, the primary Sendmail configuration file does not have all the available features activated by default. To make the chosen icon's pages available, follow the instructions in Section 37.11 “Adding Sendmail Features with M4”.

If the Sendmail server process is running, a button labeled Stop Sendmail will appear at the bottom of the main page. As its name suggests, clicking on this button will shut down the server so that your system no longer accepts SMTP connections and no longer scans the mail queue. When Sendmail is not running, a Start Sendmail button will appear instead, which can be used to start the server process.

If you want Sendmail to run all the time, use the Bootup and Shutdown module (covered in Chapter 9) to have its server process started at boot time. Most packages will include an action script that can be enabled, and may even be enabled by default. If yours does not, you will need to create an action that runs the command /usr/sbin/sendmail -bd -q30m at boot time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.3.154