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 do 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:

C cphrase1 phrase2...
F cfile
The first form defines the class c to match any of the named words. It is permissible to split them among multiple lines; for example, the two forms:
CHmonet ucbmonet
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.

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

The class $=k is set to be the same as $k, that is, the UUCP node name.

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

The class $=t is 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.

The class $=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. The class $=e contains the Content-Transfer-Encodings that can be 8->7 bit encoded. It is predefined to contain 7bit, 8bit, and binary. The class $=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->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.

Sendmail can be compiled to allow a scanf(3) 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 %[^:]
which reads every line up to the first colon.

[Contents] [Previous] [Next]

Questions or problems regarding this web site should be directed to Steve Gielda.
Copyright 1999 www.cotse.com.  All rights reserved.
Last modified: Friday April 02, 1999.