Next | Prev | Up | Top | Contents | Index

Customizing the sendmail.cf File

The configuration file describes mailers, tells sendmail how to parse addresses and rewrite message headers, and sets various sendmail options. The standard configuration file shipped with IRIX supports a wide variety of mail configurations and does not work "out of the box."

All examples are based on the default sendmail.cf configuration file as it is shipped with IRIX. Note that sendmail macros and classes are both case sensitive. See "User-Configurable Macros and Classes".


Standalone Station

In the sample configuration in Figure 8-3, there is a single, isolated station named solitaire. Mail is sent only from one user on the station to another user on the same station. No mail is sent to any other station, and no mail is received from any other station.

Using the configmail script, set up mail like this:

/usr/etc/configmail set directdomains NULL /usr/etc/configmail set localdomain NULL /usr/etc/configmail set forwarder NULL /usr/etc/configmail set rootdomain NULL

If you are configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The D macro and class:


Make sure that both the D macro and class are empty.

The F macro and class:


Make sure that both the F macro and class are empty.

The T macro:

Make sure that the T macro is empty.

Note: If this is the only station you are configuring for sendmail, proceed to "Modifying the Aliases Database".


Simple Isolated Network

This is the simplest network mail environment. A number of stations reside on a private network and send mail to each other on a peer-to-peer basis. All stations exist in the same domain; no subdomains exist. There is no connection or gateway between this private network and the outside world. No station in the network has greater responsibility for mail delivery than any other station. No relay or forwarder stations exist. The stations in the network are named lab1, lab2, and lab3. All stations exist under the lab.fictitious.com domain.

Each station in the network uses the same configuration. Using configmail on each station, make the changes shown below. For example, use configmail to set up mail on station lab1:

/usr/etc/configmail set directdomains lab.fictitious.com /usr/etc/configmail set localdomain lab.fictitious.com /usr/etc/configmail set forwarder NULL /usr/etc/configmail set rootdomain NULL

If you are configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The D macro and class:


Change the D macro and class to contain the lab.fictitious.com domain name.

The F macro and class:


Make sure that both the F macro and class are empty.

The T macro:

Make sure that the T macro is empty.
If you modified sendmail.cf by hand, you can copy the modified sendmail.cf file to all other stations in the lab.fictitious.com domain. When complete, proceed to "Modifying the Aliases Database".


Hierarchical (Relay) Network With a Single Domain

In this example, all stations do not bear the same responsibility for mail delivery. One or more stations are designated as mail relay stations, where mail is concentrated for further processing or queueing before delivery.

This scheme has particular advantages if some stations frequently are powered off or are otherwise unable to communicate. In such a situation, one or more relay stations are more reliable; they are never or infrequently out of communication with the network and are designated as mail concentration points. When mail is sent to a station that is down, the mail travels to the relay station, where it is queued for later delivery, rather than being queued on the originating station. When the destination station returns to operation, it is more likely that the relay station will be up than the originating station. Therefore, the mail will be delivered to the destination station in a timely manner.

This hierarchical scheme also offers administrative advantages. For example, if a single station goes down for an extended period of time, or is simply failing to accept mail, the situation is easier to detect when there is a central mail queue. An administrator can check the mail queue on the relay station to see which stations are not accepting mail. If there were no relay station, mail to the down station would be queued on stations throughout the network, and the problem could be harder to spot.

All stations exist under the engr.fictitious.com domain. The stations in the network are named engr1, engr2, and engr3. The mail relay station is engr1. The other stations in the network are expected to send mail through engr1 rather than delivering it directly.

Each of the non-relay stations runs the same sendmail.cf configuration file. The sendmail.cf file on relay station engr1 has a slightly different D class definition.

For example, using the configmail script, configure mail on the relay station engr1:

/usr/etc/configmail set directdomains engr.fictitious.com /usr/etc/configmail set localdomain engr.fictitious.com /usr/etc/configmail set forwarder NULL /usr/etc/configmail set rootdomain engr.fictitious.com

Using the configmail script, set up mail on the remaining stations in the engr.fictitious.com domain. Note that the directdomains parameter is set to NULL on all stations except the relay station engr1.

/usr/etc/configmail set directdomains NULL /usr/etc/configmail set localdomain engr.fictitious.com /usr/etc/configmail set forwarder NULL /usr/etc/configmail set rootdomain engr.fictitious.com

If you are configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The D macro and class


On all stations, change the D macro to contain the engr.fictitious.com domain name.

On the relay station engr1, make sure that the D class contains the engr.fictitious.com domain name so that engr1 sends mail directly to all stations in the engr.fictitious.com domain.

On the remaining stations, make sure that the D class is empty so that they do not send mail directly to other stations. (They are to send the mail to engr1.)

The F macro and class


Make sure that the F macro and class are empty.

The T macro

On all stations, change the T macro to contain the engr.fictitious.com domain name.
For engr1 to be recognized as the mail relay station, the special relay station name "relay" (as defined by the R macro) must be one of the station aliases that belongs to engr1. Include the station name "relay" in the entry for engr1 in /etc/hosts or the DNS or NIS equivalent.

When you have completed this exercise, proceed to "Modifying the Aliases Database".


Hierarchical (Relay) Network With Multiple Domains

In this example, the hierarchical model is extended to multiple subdomains. This type of environment is a logical extension of the preceding one and is probably the easiest model to expand as the number of stations on the network increases. The environment requires that domain names be used for proper mail addressing.

The entire local domain is named corp.fictitious.com. There is one subdomain under the corp.fictitious.com domain: fin.corp.fictitious.com. The stations in the corp.fictitious.com domain are corp1, corp2, and corp3. The stations in the fin.corp.fictitious.com domain are fin1, fin2, and fin3. corp3 is the relay for the corp.fictitious.com domain; fin3 is the relay for the fin.corp.fictitious.com domain.

The stations in each of the two domains (corp.fictitious.com and fin.corp.fictitious.com) are configured much like those described in the preceding subsections.

Using the configmail script, set up mail on the relay station corp3:

/usr/etc/configmail set directdomains corp.fictitious.com

/usr/etc/configmail set localdomain corp.fictitious.com

/usr/etc/configmail set forwarder NULL

/usr/etc/configmail set rootdomain corp.fictitious.com

Using the configmail script, set up mail on the relay station fin3:

/usr/etc/configmail set directdomains fin.corp.fictitious.com

/usr/etc/configmail set localdomain fin.corp.fictitious.com

/usr/etc/configmail set forwarder NULL

/usr/etc/configmail set rootdomain corp.fictitious.com

Using the configmail script, set up mail on the remaining non-relay stations in the corp.fictitious.com domain. Note that the directdomains parameter is set to NULL on non-relay stations.

/usr/etc/configmail set directdomains NULL

/usr/etc/configmail set localdomain corp.fictitious.com

/usr/etc/configmail set forwarder NULL

/usr/etc/configmail set rootdomain corp.fictitious.com

Using the configmail script, set up mail on the remaining non-relay stations in the fin.corp.fictitious.com domain. Note that the directdomains parameter is set to NULL on non-relay stations.

/usr/etc/configmail set directdomains NULL

/usr/etc/configmail set localdomain fin.corp.fictitious.com

/usr/etc/configmail set forwarder NULL

/usr/etc/configmail set rootdomain corp.fictitious.com

If you are configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The D macro

For all stations in the corp.fictitious.com domain, change the D macro to contain the corp.fictitious.com domain name.

For all stations in the fin.corp.fictitious.com domain, change the D macro to contain the fin.corp.fictitious.com domain name.

The D class:

On the relay station corp3, make sure that the D class contains the corp.fictitious.com domain name so that corp3 will send mail directly to all stations in the corp.fictitious.com domain.

On the relay station fin3, make sure that the D class contains the fin.corp.fictitious.com domain name so that fin3 will send mail directly to all stations in the fin.corp.fictitious.com domain.

On the remaining stations in the network, make sure that the D class is empty so that they do not send mail directly to other stations.

The F macro and class:


Make sure that the F macro and class are empty.

The T macro:

On each of the stations, change the T macro to contain the corp.fictitious.com domain name.
For the relay stations corp3 and fin3 to be recognized as such, the special relay station name "relay" (as defined by the R macro) must be an alias for each of them. There can be only one relay alias in the /etc/hosts file. Here is how to set up each alias:

When you have completed this procedure, proceed to "Modifying the Aliases Database".


Complex (Forwarder) Hierarchical (Relay) Network With Domains

This section explains how to configure a station to act as the forwarder station; a forwarder station can be added to any of the scenarios described in the preceding subsections. Please see "sendmail Network Configurations" for an explanation of the forwarder station concept as used by IRIX sendmail.

This discussion applies to mail environments of all types. Whatever the form of your internal mail environment, whenever you want to use a mail gateway station between your internal mail network and the external world, a forwarder station is required. The sendmail configuration for using this forwarder station is exactly the same for all stations on the internal side of the gateway.

The internal mail environment consists of the domain corp.fictitious.com and any or all domains under corp.fictitious.com (fin.corp.fictitious.com). All stations within the corp.fictitious.com domain are capable of communicating with each other. For example, there is no physical restriction to prevent station fin1.fin.corp.fictitious.com from sending mail to corp1.corp.fictitious.com.

Station corp2.corp.fictitious.com can connect to all stations within the corp.fictitious.com domain and can also connect to stations in other domains, such as engr.fictitious.com. Station corp2.corp.fictitious.com is therefore the forwarder station to all domains beyond the corp.fictitious.com domain. In this example, station corp2.corp.fictitious.com is aliased to corp2 for ease of addressing in the internal mail environment.

In addition to the changes to sendmail.cf required for the internal mail environment, make the following changes to the sendmail.cf file on all stations within the corp.fictitious.com domain. Using the configmail script, change the appropriate parameter:

/usr/etc/configmail set forwarder corp2.corp.fictitious.com corp2
If configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The F macro:

Make sure that the F macro contains the station name corp2.corp.fictitious.com.

The F class:

Make sure that the F class contains the two names corp2 and corp2.corp.fictitious.com, by which the forwarder station is known.
When you have completed the procedure, proceed to "Modifying the Aliases Database".


UUCP Mail

The default sendmail.cf file shipped with IRIX includes support for sending mail through UUCP. This section discusses these capabilities and explains how to integrate UUCP mail into the local mail environment. UUCP support can be added to any of the scenarios described in the preceding subsections.

The sendmail.cf file directs sendmail to read the /etc/uucp/Systems file on startup. All UUCP station names are read from this file, and stations marked "domain-machine" are noted. If a UUCP pathalias database is maintained on the station, the location of the database is set with the P macro.

If the /etc/uucp/Systems file indicates that there are stations connected to the local station through UUCP, sendmail sends mail received on the local station, and addressed to one of the stations described in the /etc/uucp/Systems file, on to the proper place. If the P macro is set and points to a valid UUCP pathalias database, sendmail will attempt to find a UUCP path to a station for which it cannot find an address or MX record. If the database returns a good UUCP path to the destination station, sendmail attempts to send the mail to the left-most station on the path.

Depending upon the network environment, UUCP mail may range from the only form of network mail to one part of a much larger network mail environment. The following sections describe a common technique for adding UUCP to an existing local area mail network.

Sample Environment

The local domain is named uk.com. Station uk1.uk.com is the forwarder station, as described in "Complex (Forwarder) Hierarchical (Relay) Network With Domains" in "Customizing the sendmail.cf File".

To avoid forwarder loops, the default sendmail.cf file permits only one forwarder station to be configured. Therefore, station uk1.uk.com is also the UUCP forwarder station.

Changes to sendmail.cf

No changes to sendmail.cf are necessary beyond those required to configure station uk1.uk.com as the forwarder station. (See "Complex (Forwarder) Hierarchical (Relay) Network With Domains".) If station uk1.uk.com maintains a pathalias database, the P macro should be set to the pathname of the pathalias database.

Other Changes

The /etc/uucp/Systems file must also be configured before sendmail will see any of the UUCP-connected stations. For more information see Chapter 7, "UUCP."

When you have completed this procedure, look ahead to "Modifying the Aliases Database".


Non-Domain Addressing

This section discusses issues related to a mail network that does not use domain addressing. Note that all of the previously discussed mail environments, with the exception of the "hierarchical multi-domain" environment, are possible in a network that does not implement domains.

If a network does not use domain addressing, specific changes are required in the sendmail.cf file on all stations in the network. First, make changes to the sendmail.cf file as described in the appropriate examples in this section. Next, make the following changes, even if they replace changes you have just made.

Using the configmail script, set up mail on each station on the network.

/usr/etc/configmail set directdomains NULL

/usr/etc/configmail set localdomain NULL

/usr/etc/configmail set rootdomain NULL

If you are configuring the sendmail.cf file by hand, make the required adjustments to the following macros and classes:

The D macro and class


Make sure that the D macro and class are both empty.

The T macro

Make sure that the T macro is empty.
In an isolated network, you must create the file /etc/resolv.conf and add this line:

hostresorder local bind yp

For more information about the resolv.conf file, see the resolv.conf(4) reference page.

When you have completed this procedure, proceed to "Modifying the Aliases Database".


Next | Prev | Up | Top | Contents | Index