You can define classes of words to match the left-hand side of address-rewriting rules. For example, you might create a class of all local names for this site so that you can eliminate attempts to send mail to yourself.
You can give classes names from the set of uppercase letters. Lowercase letters and special characters are reserved for system use.
You can define classes in three ways:
Use C to assign the values directly specified.
Use F to read in the values from another file or from another command.
Use G to assign the values looked up in the sendmailvars database (either the NIS+ sendmailvars table or /etc/mail/sendmailvars file). The G command is classified as a Sun uncommitted interface.
Table 3-6 shows the syntaxes of the different forms of class definition.
Table 3-6 Syntax of Class Definitions in the Configuration File
Rule |
Description |
---|---|
CX word1 word2 |
Class X to match any of the named words |
FX fi1e [pattern] |
Reads words from file into class X |
FX | command |
Reads output from command into class X |
GXsearch_key |
Reads search_key from the sendmailvars database and assigns it to Class X |
The first form simply assigns the named words to match the class X. This example assigns the names monet and ucbmonet to class H:
CHmonet ucbmonet |
The second form reads words from the file into the class X, for example, FC /.rhosts. The pattern argument to the FC class is used with scanf to read from the file; otherwise, the first word from each line is used.
The third form executes the given command and reads the elements of the class from standard output of the command. For example:
FC | awk '{print $2}' /etc/hosts |
The fourth form reads the elements of the class from the entry in the sendmailvars database pointed to by the search key. For example:
GVuucp-list |
gets the definition of class V from the uucp-list entry in the sendmailvars database.
If the entry in the sendmailvars database appears as follows:
uucp-list sunmoon hugo comic |
the value of V becomes sunmoon hugo comic.
sendmail uses the sendmailvars entry in the /etc/nsswitch.conf file to determine the order in which to search the name space and /etc/mail/sendmailvars file.
You could split class definitions among multiple lines. For example, the following:
CHmonet ucbmonet |
is equivalent to:
CHmonet CHucbmonet |