This section describes four basic types of mail configurations and briefly outlines the tasks required to set up each configuration. You might find this section useful if you need to set up a new mail system or if you are expanding an existing one. The configurations start with the most basic case (mail completely local, no connection to the outside world) and increase in complexity to a two-domain configuration with a mail gateway.
To set up a mail system, regardless of its configuration, you need these elements:
Alias files with an alias for each user to point to the place where mail is stored
A postmaster alias for the person who administers mail services
How you set up the configuration file and the alias file and where you put the mailboxes depend on the configuration you choose.
As system administrator, you should decide on a policy for updating aliases and for forwarding mail messages. You might set up an aliases mailbox as a place for users to send requests for mail forwarding and for changes to their default mail alias. If your system uses NIS or NIS+, you can administer forwarding rather than forcing users to manage it themselves.
The simplest mail configuration, shown in Figure 2-1, is one mail host with two or more workstations connected to it. Mail is completely local. All the clients store mail on their local disks and are acting as mail servers. Mail addresses are parsed using the /etc/mail/aliases files.
To set up this kind of mail configuration, you need:
The default /etc/mail/sendmail.cf file on each mail client system (no editing required)
A server designated as the mail host (add mailhost.domainname to the /etc/hosts file on the mail host; then if you are not running NIS or NIS+, add the mail host IP address line to the /etc/hosts file of all mail clients)
Matching /etc/mail/aliases files on any system that has a local mailbox (unless you are running NIS or NIS+)
Enough space in /var/mail on each mail client system to hold the mailboxes
In this configuration, each mail client mounts its mail from one mail server that provides mail spooling for client mailboxes. This server can also be the mail host. This configuration makes it easy to back up the mailboxes for each client.
To set up this kind of mail configuration, you need:
The default /etc/mail/sendmail.cf file on each mail client system (no editing required)
A server designated as the mail host (add mailhost.domainname to the /etc/hosts file on the mail host; then if you are not running NIS or NIS+, add the mail host IP address line to the /etc/hosts file of all mail clients)
Matching /etc/mail/aliases files on any system that has a local mailbox (unless you are running NIS or NIS+)
Entries in each mail client's /etc/vfstab file or /etc/auto_direct (if autofs is used) to mount the /var/mail directory
Enough space in /var/mail on the mail server to hold the client mailboxes
The most common mail configuration in a small network is shown in Figure 2-2. One system is the mail server, the mail host, and the mail gateway to the outside world. Mail is distributed using the /etc/mail/aliases files. No name service is required.
To set up this kind of a mail configuration, assuming that the mail clients mount their mail files from /var/mail on the mail host, you need:
The main.cf file on the mail gateway (no editing required if MX records are used)
The default /etc/mail/sendmail.cf file on each mail client system (no editing required)
A server designated as the mail host (add mailhost.domainname to the /etc/hosts file on the mail host; if you are not running NIS or NIS+, add the mail host IP address line to the /etc/hosts file of all mail clients)
Matching /etc/mail/aliases files on any system that has a local mailbox (unless you are running NIS or NIS+)
Entries in each mail client's /etc/vfstab file or /etc/auto_direct (if autofs is used) to mount the /var/mail directory when mailboxes are located on the mail host
Enough space in /var/mail on the mail server to hold the client mailboxes
The mail configuration shown in Figure 2-3 has two domains and a mail gateway. In this configuration, the mail server, the mail host, and the mail gateway (or gateways) for each domain are likely to be different systems. To make the process of administering and distributing mail easier, a name service is used.
To set up this kind of a mail configuration, assuming that the mail clients mount their mail files from /var/mail on the mail host, you need:
Complex gateway systems requiring a customized sendmail.cf file with special rules added
The main.cf file on the mail gateway (no editing required if you use MX records)
A server designated as the mail host (add mailhost.domainname to the /etc/hosts file on the mail host; if you are not running NIS or NIS+, add the mail host IP address line to the /etc/hosts file of all mail clients)
Matching /etc/mail/aliases files on any system that has a local mailbox (unless you are running NIS or NIS+)
An alias entry for each user, to point to where the mail is stored, in mail_aliases.org_dir for NIS+ or the aliases map for NIS
The default /etc/mail/sendmail.cf file on each mail client system (no editing required)
Entries in each mail client's /etc/vfstab file or /etc/auto_direct (if autofs is used) to mount the /var/mail directory when mailboxes are located on the mail host
Enough space in /var/mail on the mail server to hold the client mailboxes