Mail management

The mail facility provides a method for exchanging electronic mail (e-mail) with users on the same system or on multiple systems connected by a network. The mail system, the standard mail user interface, the Internet Message Access Protocol (IMAP), and the Post Office Protocol (POP) are described here.

The mail system is an internetwork mail delivery facility that consists of a user interface, a message routing program, and a message delivery program (or mailer). The mail system relays messages from one user to another on the same host, between hosts, and across network boundaries. It also performs a limited amount of message-header editing to put the message into a format that is appropriate for the receiving host.

A mail user interface enables users to create and send messages to, and receive messages from, other users. The mail system provides two user interfaces, mail and mhmail. The mail command is the standard mail user interface available on all UNIX systems. The mhmail command is the Message Handler (MH) user interface, an enhanced mail user interface designed for experienced users.

A message routing program routes messages to their destinations. The mail system message routing program is the sendmail program, which is part of the Base Operating System (BOS) and is installed with BOS. The sendmail program is a daemon that uses information in the /etc/mail/sendmail.cf file, the /etc/mail/aliases file to perform the necessary routing.

Depending on the type of route to the destination, the sendmail command uses different mailers to deliver messages.

Figure 1. Mailers used by the sendmail command
Mailers used by the sendmail command
This illustration is a type of top-down organizational chart with Mail and MH at the top. Branching from them are bellmail, BNU and SMTP. Underneath the previous level are local mailbox, UUCP link, and TCP/IP link respectively. Beneath UUCP link is remote mailbox and under TCP/IP link is remote mailbox.

As the figure illustrates:

  • To deliver local mail, the sendmail program routes messages to the bellmail program. The bellmail program delivers all local mail by appending messages to the user's system mailbox, which is in the /var/spool/mail directory.
  • To deliver mail over a UNIX-to-UNIX Copy Program (UUCP) link, the sendmail program routes messages using Basic Network Utilities (BNU).
  • To deliver mail routed through Transmission Control Protocol/Internet Protocol (TCP/IP), the sendmail command establishes a TCP/IP connection to the remote system then uses Simple Mail Transfer Protocol (SMTP) to transfer the message to the remote system.