2.2.2 SMTP Server Messages
This section defines the creation of SMTP_AUTH_NTLM_BLOB_Response messages. These are NTLM messages that are sent by the server, and MUST be encapsulated as follows to conform to syntax specified by the SMTP-AUTH mechanism:
Encode the NTLM message data as base64 (as specified in [RFC1521]). This is required because NTLM messages contain data outside the ASCII character range whereas SMTP only supports the sending of ASCII characters within the context of SMTP-AUTH.
To the base64-encoded string, prefix the SMTP response code "334 " (that is, the numerals 334 followed by the ASCII space character 0x20).
Suffix the <CR> and <LF> characters (ASCII values 0x0D and 0x0A), as required by SMTP.
The definition of a server message is as follows:
-
334 <base64-encoded-NTLM-message><CR><LF>
De-encapsulation of these messages by the client follows the reverse logic:
Remove the <CR> and <LF> characters (ASCII values 0x0D and 0x0A).
Remove the SMTP response code "334" (that is, the numerals 334 followed by the ASCII space character 0x20).
base64 decode the SMTP data to produce the original NTLM message data.