'EightBitMode'' ''''


How to convert 8-bit input V8.7 and later

The data portion of an email message is transmitted during the DATA phase of an SMTP transaction. Prior to V8.6 the data were presumed to be 7-bit. That is, the high (8th) bit of every byte of the message could be cleared (reset or made zero) with no change in the meaning of that data. With the advent of ESMTP and MIME, it became possible for sendmail to receive data for which the preservation of the 8th bit is important.

There are two kinds of 8-bit data. Data that arrives with the high bit set and for which no notification was given is called "unlabeled" 8-bit data. Data for which notification was given (using BITMIME in the ESMTP session or with the -B8BITMIME command-line switch, -B, or with a MIME-Version: header in the message, MIME-Version:) is called "labeled."

The EightBitMode option tells sendmail how to treat incoming unlabeled 8-bit data. The forms of this option are as follows:

O EightBitMode=key                  configuration file (V8.7 and later) 
-OEightBitMode=key                  command line (V8.7 and later) 
define(`confEIGHT_BIT_HANDLING',key)    mc configuration (V8.7 and later) 
O8key                               configuration file (V8.6, deprecated) 
-o8key                              command line (V8.6, deprecated) 

The key is mandatory and must be selected from one of those shown in Table 24-19. If the key is missing or if key is not one of those listed, sendmail will print the following error and ignore the option:

Unknown 8-bit mode char

Only the first character of the key is recognized, but we still recommend that the full word be used for clarity.

Table 24-19. EightBitMode option characters





See this section

Do any necessary conversion of BITMIME to 7-bit


See this section

Pass unlabeled 8-bit input through as is


See this section

Reject unlabeled 8-bit input

If the entire EightBitMode option is missing, the default becomes p (pass 8-bit and convert MIME). If you configure with V8's mc technique, the default is also p.

Depending on the key selected and the nature of incoming mail, any of several error messages can be generated:

Eight bit data not allowed
Cannot send 8-bit data to 7-bit destination
host does not support 8BITMIME

Conversion from 8 to 7 bits is complex. First, sendmail looks for a MIME Content-Type: header. If the header is found, sendmail looks for and, if found, uses a MIME boundary definition to delimit conversion.[29] If more than one-fourth of a section has the high bit set after reading at least 4 kilobytes of data, sendmail presumes Base64 encoding[30] and inserts the following MIME header into the data stream:

[29] A boundary is used only for multipart messages.

[30] Also see the $=q class ($=q) for a way to require quoted-printable encoding.

Content-Transfer-Encoding: base64

Base64 encoding converts 8-bit data into a stream of 6-bit bytes that contain universally readable text. Base64 is described in RFC1521.

If less than one-fourth of the data that was scanned has the high bit set or if the type in the Content-Type: header is listed in $=q ($=q), the data is converted from 8 to 7 bits by using quoted-printable encoding, and the following MIME header is inserted into the stream:

Content-Transfer-Encoding: quoted-printable

Under quoted-printable encoding, ASCII control characters (in the range 0x00 through 0x20), the tab character, the = character, and all characters with the high bit set are converted. First an = character is output, then the character is converted to an ASCII representation of its hexadecimal value, and that value is output. For example:

0xb9    becomes   =B9

Under this scheme, the = character is considered binary and is encoded as =3D. If the F=3 flag (F=3) is set for a selected delivery agent, the characters:

! " # $ @ \ [ ] ^ ` { | } ~

are also converted. If F=3 is not set, those characters are output as is.

Lines longer than 72 characters (bytes) are broken with the insertion of an = character and the E= end-of-line characters defined for the current delivery agent. Any lines that end in a whitespace character have that whitespace character converted to quoted-printable, even if the line has fewer than 72 characters. Quoted-printable encoding is described in RFC1521.

Where m (mimefy) might not be appropriate for a given delivery agent, the F=8 flag (F=8) can be specified to force p (pass8bit) behavior.

The EightBitMode option is safe. Even if it is specified from the command line, sendmail retains its special privileges.


Convert unlabeled 8-bit input to BITMIME, and do any necessary conversion of BITMIME to 7 bits. When running as a daemon receiving mail via SMTP, advertise the BITMIME ESMTP keyword as valid. This key specifies that your site will be a MIME installation.


Pass unlabeled 8-bit input through as is. Convert labeled BITMIME input to 7 bits as required by any delivery agent with the F=7 flag set (F=7), or any SMTP server that does not advertise BITMIME.


Reject unlabeled 8-bit input. Convert BITMIME to 7 bits as required by any delivery agent with the F=7 flag set (F=7), or any SMTP server that does not advertise BITMIME.

    Part I: Build and Install
    Part II: Administration
    Part III: The Configuration File
    Chapter 21. The D (Define a Macro) Configuration Command
    Chapter 24. The O (Options) Configuration Command