Sendmail Operation Guide

C and F: define classes

Classes of phrases may be defined to match on the left hand side of rewriting rules, where a phrase is a sequence of characters that does not contain space characters. For example a class of all local names for this site might be created so that attempts to send to oneself can be eliminated. These can either be defined directly in the configuration file or read in from another file. Classes are named as a single letter or a word in braces ({}). Class names beginning with lower case letters and special characters are reserved for system use. Classes defined in config files may be given names from the set of upper case letters for short names or beginning with an upper case letter for long names.

The syntax is:

Cc phrase1 phrase2...
Ffile

The first form defines the class c to match any of the named words. If phrase1 or phrase2 is another class, (for example $=S), the contents of class S are added to class c. It is permissible to split them among multiple lines; for example, the two forms:

CHmonet ucbmonet

and:

CHmonet
CHucbmonet

are equivalent. The F form reads the elements of the class c from the named file.

Elements of classes can be accessed in rules using $= or $~. The $~ (match entries not in class) only matches a single word; multi-word entries in the class are ignored in this context.

Some classes have internal meaning to sendmail(1M):


$=e
Contains the Content-Transfer-Encodings that can be 8->7 bit encoded. It is predefined to contain 7bit, 8bit, and binary.

$=k
Set to be the same as $k, that is, the UUCP node name.

$=m
Set to the set of domains by which this host is known, initially just $m.

$=n
Can be set to the set of MIME body types that can never be eight to seven bit encoded. It defaults to multipart/signed. Message types message/* and multipart/* are never encoded directly. Multipart messages are always handled recursively. The handling of message/* messages are controlled by class $=s.

$=q
A set of Content-Types that will never be encoded as base64 (if they have to be encoded, they will be encoded as quoted-printable). It can have primary types (for example, text) or full types (such as text/plain). The class is initialized to have text/plain only.

$=s
Contains the set of subtypes of message that can be treated recursively. By default it contains only ``rfc822''. Other message/* types cannot be 8-to-7 bit encoded. If a message containing eight bit data is sent to a seven bit host, and that message cannot be encoded into seven bits, it will be stripped to 7 bits.

$=t
Set to the set of trusted users by the T configuration line. If you want to read trusted users from a file, use Ft /file/name.

$=w
Set to be the set of all names this host is known by. This can be used to match local hostnames.

$={persistentMacros}
set to the macros would should be saved across queue runs. Care should be taken when adding macro names to this class.
sendmail can be compiled to allow a scanf(3S) string on the F line. This lets you do simplistic parsing of text files. For example, to read all the user names in your system /etc/passwd file into a class, use:

FL/etc/passwd %[^:]

This reads every line up to the first colon.


© 2000 The Santa Cruz Operation, Inc. All rights reserved.