4. The 8bit-MIMEtransport service extension
When a client SMTP wishes to submit (using the MAIL command) a content body consisting of a MIME message containing arbitrary octet-aligned material, it first issues the EHLO command to the server SMTP. If the server SMTP responds with code 250 to the EHLO command, and the response includes the EHLO keyword value 8BITMIME, then the server SMTP is indicating that it supports the extended MAIL command and will accept MIME messages containing arbitrary octet-aligned material.
The extended MAIL command is issued by a client SMTP when it wishes to transmit a content body consisting of a MIME message containing arbitrary octet-aligned material. The syntax for this command is identical to the MAIL command in [1], except that a BODY parameter must appear after the address.
The complete syntax of this extended command is defined in [5]. The esmtp-keyword is BODY and the syntax for esmtp-value is given by the syntax for body-value shown above.
The value associated with the BODY parameter indicates whether the content body which will be passed using the DATA command consists of a MIME message containing some arbitrary octet-aligned material ("8BITMIME") or is encoded entirely in accordance with [1] ("7BIT").
A server which supports the 8-bit MIME transport service extension shall preserve all bits in each octet passed using the DATA command.
Naturally, the usual SMTP data-stuffing algorithm applies so that a content which contains the five-character sequence of
Once a server SMTP supporting the 8bit-MIMEtransport service extension accepts a content body containing octets with the high-order (8th) bit set, the server SMTP must deliver or relay the content in such a way as to preserve all bits in each octet.
If a server SMTP does not support the 8-bit MIME transport extension (either by not responding with code 250 to the EHLO command, or by not including the EHLO keyword value 8BITMIME in its response), then the client SMTP must not, under any circumstances, attempt to transfer a content which contains characters outside the US ASCII octet range (hex 00-7F).
A client SMTP has two options in this case: first, it may implement a gateway transformation to convert the message into valid 7bit MIME, or second, or may treat this as a permanent error and handle it in the usual manner for delivery failures. The specifics of the transformation from 8bit MIME to 7bit MIME are not described by this RFC; the conversion is nevertheless constrained in the following ways:
it must cause no loss of information; MIME transport encodings must be employed as needed to insure this is the case, and
the resulting message must be valid 7bit MIME.