Prior to V8 sendmail, only the class
w was used internally,
but recently, more and more classes have been added to that internal list.
Since internal class names always begin with a lowercase letter, you
should always begin your own class names with an uppercase letter
to avoid conflict.
Table 32.2 lists all the class macros used by sendmail as of version 8.8.4.
|$=e||Section 32.5.1, $=e||V8.7 and above||Encode this Content-Transfer-Encoding:|
|$=k||Section 32.5.2, $=k||V8.6.5 and above||The local UUCP name|
|$=m||Section 32.5.3, $=m||V8.7 and above||List of local domains|
|$=n||Section 32.5.4, $=n||V8.7 and above||Don't encode these Content-Types|
|$=q||Section 32.5.5, $=q||V8.8 and above||Always Quoted-Printable encode Content-Type:|
|$=s||Section 32.5.6, $=s||V8.7 and above||Presume an RFC822 7-bit body|
|$=t||Section 32.5.7, $=t||V8.7 and above||List trusted users|
|$=w||Section 32.5.8, $=w||All versions||List of our other names|
Note that these classes are really used internally by sendmail. Don't try to redefine their use in the configuration file. Such an attempt will be doomed to failure.
Encode this Content-Transfer-Encoding:(V8.7 and above)
F=7delivery agent flag (see Section 30.8.4, F=7) determines whether MIME-encoded data should be converted from 8 to 7 bits. If the message is in 8-bit format and if it is going to a MIME-capable destination that requires 7-bit data, the message body will be converted to 7 bits by using either Quoted-Printable or Base64 (see Section 34.8.22, EightBitMode (8)).
Not all data types should be converted to 7 bits, however. The types that might possibly be converted are listed with the
Content-Transfer-Encoding:header (see Section 35.10.8, Content-Transfer-Encoding:). One type that should not be converted, for example, is the
quoted-printabletype because it is already converted. Types that may be converted are
Beginning with version 8.7 sendmail, the class
eis used to determine whether or not a type will be encoded. Only those values listed in this class will be encoded. When sendmail first starts, it initializes the list of values in class
eto be7bit 8bit binary
You may add types to this class, but you may never remove them.
Note that a type in class
emay still be prevented from being encoded on the basis of the considerations imposed by class
n. Also note that the actual encoding can be restricted to quoted printable by use of the class
The local UUCP name(V8.6.5 and above)
When sendmail first begins to run, it figures out what your local UUCP node name is and assigns the result to the
$kmacro (see Section 31.10.21, $k). At the same time, it assigns the same name to this class
List of local domains(V8.7 and above)
When sendmail first begins to run, it figures out what your DNS domain is and assigns the result to the
$mmacro (see Section 31.10.24, $m). The sendmail program then processes the configuration file. This gives you the opportunity to redefine
$m. After that, sendmail assigns the final value in
$mto the class
Unfortunately, as of V8.8 sendmail, the class macro
mis not used by sendmail nor by any of the configuration files produced by the m4 technique. If you wish to have mail accepted as local under a variety of domains, use the
domaintableFEATURE instead (see Section 19.6.10, FEATURE(domaintable)).
Suggested uses for class
mmight include screening mail with the
check_compatrule set (see Section 29.10.4, "The check_compat Rule Set"), and detecting local domains by adding rules to rule set 0 with the LOCAL_RULE_0 m4 technique (see Section 19.6.32, LOCAL-RULE-0).
Don't encode these Content-Types(V8.7 and above)
Although some MIME content types may be converted to 7 bits, not all types should be. Content types are defined by the
Content-Type:header (see Section 35.10.9, Content-Type:). For example, the type
multipart/should not be converted, whereas its component boundary separated parts probably should be. Conversion is done by encoding with either Quoted-Printable or Base64 (see Section 34.8.22).
Beginning with V8.7 sendmail, types that should not be encoded are those defined as members of the class
n. When sendmail first starts to run, it defines the following list of values for class
As of this writing, no other useful values exist for this class.
Note that a type in class
nmay still be prevented from being encoded based on the considerations imposed by class
e. Also note that the actual encoding can be restricted to Quoted-Printable by use of the class
Always Quoted-Printable encode Content-Type:(V8.8 and above)
8) option (see Section 34.8.22) determines when and how 8-bit data will be encoded into a 7-bit format. Ordinarily, the decision to use Quoted-Printable as opposed to Base64 is made by examining the input stream and choosing Quoted-Printable if less than 1/8 of the first 4 kilobytes of data has the high bit set. Otherwise, encoding is with Base64.
Beginning with V8.8, sendmail offers the class
qas the means to force the selection of Quoted-Printable. Just before scanning the input data, sendmail extracts the
Content-Type:header (see Section 35.10.9):Content-Type:
typeis in the class
q, the body will definitely be encoded with Quoted-Printable if encoding occurs. Also if a concatenation of
type, a slash (
subtypeis in class
q, the body will definitely be encoded with Quoted-Printable.
When sendmail first begins to run, class
qis empty. A reasonable value in most countries might be
text/plain(although probably not in countries that use 16-bit characters, such as China). Other values for this class might be
Presume an RFC822 7-bit body(V8.7 and above)
An email message as defined by RFC822 may not contain 8-bit data. Consequently, when the MIME
Content-Type:header declares a message subtype that is
rfc822, we immediately know that it will contain nothing that needs 8- to 7-bit encoding.Content-Type: message/rfc822
As other message subtypes evolve, this assumption can safely be made about them too. So to make sendmail more adaptable, the
sclass was added beginning with V8.7. This class contains a list of subtypes that should be treated the same as
rfc822. When sendmail first begins to run, it initializes that list to contain:rfc822
Other subtypes that may legitimately appear here might be
Note that this provides only an initial hint to sendmail. The
rfc822subtype may itself contain MIME information that might require 8- to 7-bit encoding.
List trusted users(V8.7 and above)
Trusted users are those who may run sendmail with the
-fcommand line switch to specify who sent the message. Prior to V8.6 sendmail, such users had to be listed with the
Tcommand (see Section 188.8.131.52, "Declare trusted users (not V8.1 through V8.6)"). That command was ignored in V8.1 through V8.6, and with those versions anyone could use the
-fswitch. Beginning with V8.7 sendmail, the
Tcommand was reintroduced, but it now causes the list of trusted users to be added to the class
t. Now, any user who uses the
-fswitch and who is not listed in class
twill cause the following error message (see Section 35.10.35, X-Authentication-Warning:) to be included in the outgoing mail message:X-Authentication-Warning: user set sender to other using -f
use_ct_fileFEATURE (see Section 19.6.25, FEATURE(use-ct-file)) for an easy way to add users to this class using the m4 technique.
List of our other names(All versions)
Before the sendmail program reads its configuration file, it calls gethostbyname(3) to find all the known aliases for the local machine. The argument given to gethostbyname(3) is the value of the
$wmacro that was derived from a call to gethostname(3) (see Section 31.10.40, $w).
Depending on the version of sendmail you are running, the aliases that are found will either be those from your /etc/hosts file or those found as additional
Arecords in a DNS lookup. To see the aliases that sendmail found or to see what it missed and should have found, use the
-d0.4debugging switch (see Section 37.5.2, -d0.4). Any aliases that are found are printed asaka: alias
Depending on your version of sendmail, each alias is either a hostname (such as rog.stan.edu) or an Internet IP number (such as [184.108.40.206]).
Many sendmail.cf files use the
wclass macro to define all the ways users might reference the local machine. This list must contain all names for the local machine as given in the /etc/hosts file and all names for the local host as listed in DNS (including CNAME and MX records). For example,# All our routing identities Cw server1 server2 # All our local aliases Cw localhost mailhost tops-link print-router loghost # DNS records Cw serv-link # We are a bitnet registered node Cw bitserver
If you notice mail failing because users commonly misspell the local machine name (e.g., ol11l0 when they really mean o1ll10); you might want to consider adding that misspelled version to a
An easy way to add hostnames to class
wis with the
use_cw_fileFEATURE (see Section 19.6.26, FEATURE(use-cw-file)) of the m4 technique.