The rewriting rules are grouped into sets of one or more rules. Each set has an integer identifier called a rule set number. Each rule set acts like a subroutine: When the set is called, each rule is scanned in sequence until all rules have been scanned or until the rule set returns to the caller.
Some rule sets are used internally and have specific semantics. Others do not have specifically assigned semantics and can be referenced by mailer definitions or by other rule sets.
Each rule set begins with an S command, with the syntax
where n is the rule set identifier, an integer between 0 and 99. If the same rule set identifier is used more than once in a configuration file, the last definition is the one used.Sn
Each line within the rule set begins with an R command and defines a rewrite rule. R commands have the syntax
where the following conditions exist:Rlhs rhs [comments]
The Define Macro command takes one of the following forms:
where x is the name of the macro. The first form defines the macro to contain Value. The second form defines the macro as the first line seen on stdout of the specified shell command. The vertical bar must immediately follow the macro identifier; no white space is permitted. The remainder of the line is interpreted as arguments to the shell command.DxValue
Dx|shell_command [arguments]
Macros can be interpolated in most places by means of the escape sequence $x.
Caution: sendmail does not honor comments on macro definition lines. For example, the following line defines the D macro as "foo.com # my domain name":
DDfoo.com
#
my
domain
name
The C command takes one of the following forms:
where X is the class name. The first form defines the class to match any of the named words. The second form reads the elements of the class from the expansion of the listed macros. The macros to be expanded must be leftmost in each token. Only one macro can be expanded per token. Any remainder in a token following a macro expansion is added as a separate token.CX word1 [word2 ...]
CX $x [$y ...]
The F command defines a file from which to read the elements of a class, and takes either of the following forms:
The first form reads the elements of the class from the named file. If an optional format argument is present, it is passed as the control string to an sscanf() call and applied to each input line read from the named file, thus:FX file [format]
FX|shell_command [arguments]
There must be no white space to the left of the filename.sscanf(const char *line, const char *format, char *new-element);
The second form reads the elements of the class from stdout of the specified shell command. The entire contents of the line are taken to be a shell command followed by its arguments.
It is permissible to split class definitions across multiple lines. For example, these two forms are equivalent:
CHmonet picassoand
CHmonet CHpicassoIt is also permissible to define a class using both C and F commands. For example, the following commands define class H containing monet, picasso, the expansion of the $w macro, and all strings from the file /var/tmp/foofile appearing before the first number symbol (#) on each line:
CHmonet picasso $w FH/var/tmp/foofile %[^#]
Caution: sendmail does not honor comments that are not respected on class definition lines. For example, the following command defines the D class as containing "foo.com," "bar.com," "#," "my," "local," and "domains":
CD
foo.com
bar.com
#
my
local
domains
where name is the name of the mailer (used internally only) and the field=value pairs define attributes of the mailer. The asterisk (*) indicates that the preceding bracketed structure may be repeated 0 or more times. That is, there may be multiple field=value pairs. The following list defines valid field names:Mname, {field=value}*
Continuation lines for an H command line appear in the outgoing message. sendmail macro-expands the htemplate before inserting it into the message. If mflags (which must be surrounded by question marks) appear in the command line, at least one of the specified flags must also appear in the mailer definition or the header will not appear in the message. However, if a header appears in the input message, the header also appears in the output, regardless of these flags.H[?mflags?]hname: htemplate
Some headers have special semantics, which are described in "The Semantics".
The format of the O command line is as follows:
The command sets option o to value. Depending on the option, value is a string; an integer; a Boolean (with legal values "t," "T," "f," or "F" and a default of TRUE); or a time interval.Oo value
The K command is a new command available in IRIX sendmail. This command defines (K)eyed databases that are accessible by means of the lookup operators. See "Define Keyed Files--The K Command" for a complete description of the K command.
The format of the T command is as follows:
A configuration file can contain multiple T lines.Tuser1 user2...
When sendmail matches the value in a message's Precedence field with the name in a P command line, sendmail sets the message's class to num. A higher number indicates a higher precedence. Negative numbers indicate that error messages will not be returned to the sender. The default precedence is zero. For example, a list of precedences might bePname=num
Pfirst-class=0
Pspecial-delivery=100
Pjunk=-100
The name value is the name used to specify the database in a lookup command. The type defines the type of database file, which can be one of the following:Kname type file