Mail Administration Guide

sendmail Implementation

You can follow flag arguments with recipient name arguments unless you run sendmail in SMTP mode. In brief, the format of recipient names is:

You must properly balance and nest parentheses, angle brackets, and double quotation marks. The rewriting rules control the rest of the needed processing.

Mail to Files and Programs

Files and programs are legitimate message recipients. Files provide archival storage of messages, useful for project administration and history. Programs are useful as recipients in a variety of situations, for example, to use mailsort to sort mail or to have the vacation program respond with an informational message when users are away.

Any name passing through the initial parsing algorithm as a local name is scanned for two special cases:

Configuration Overview

Primarily the configuration file read at startup controls configuration. Adding mailers or changing the name-rewriting or routing information does not require recompiling. The configuration file encodes macro definitions, header definitions, mailer definitions, name-rewriting rules, and options.

Macros

You can use macros in several ways. Certain macros transmit unstructured textual information into the mail system, like the name that sendmail uses to identify itself in error messages. Other macros are unused internally and you can use them as shorthand in the configuration file.

Header Declarations

Header declarations inform sendmail of the format of known header lines. Knowledge of a few header lines is built into sendmail, like the From: and Date: lines.

Most configured headers are automatically inserted into the outgoing message if they do not exist in the incoming message. Some mailers suppress certain headers.

Mailer Declarations

Mailer declarations specify the internal name of the mailer, some flags associated with the mailer, and an argument vector to be used on the call. This vector is expanded by macro before use.

Name-Rewriting Rules

Name-rewriting rules are the heart of name parsing in sendmail. They are an ordered list of pattern-replacement rules that are applied to each name. For example, rule set 0 determines which mailer to use. sendmail rewrites the message until it is in a form that can be parsed. When a pattern matches the rule is reapplied until it fails.

The configuration file also supports the editing of names into different formats. For example, a name in this form:


ucsfcgl!tef

might be mapped into:


tef@ucsfcgl.UUCP

to conform to the internal syntax. Translations can also be done in the other direction for particular mailers.

Option Setting

You can set several options from the configuration file. These include the path names of various support files, timeouts, default modes, and so forth.