The mailTransferEncoding is an interface that represents the “Content-Transfer-Encoding” header in the message. The header controls how the body of the message itself is encoded. The absence of this header means that the body of the message contains data in 7-bits. If the message contains data other than 7-bit, it must be explicitly stated in the header. For example, a message containing binary data should have the following header:
Content-Transfer-Encoding: binary
Encoding is the process whereby data is transformed by replacing bytes of data with their equivalent bytes based on a mapping so that every byte of data falls within a defined set of characters. The resulting encoded data may be transformed such that it no longer looks like the original. When this resulting data is decoded, the process is reversed so that the encoded data is transformed back to the original.
When a message is encoded, only the body is encoded not the header.
Content-Transfer-Encoding in AS2 and AS3
Transfer of messages in AS2 or AS3 is done via HTTP or FTP respectively which can handle binary data. The "Content-Transfer-Encoding" header is not required, and the absence of this header means that the message should be translated as either having binary or 8-bit content. In AS3 particularly where the message is transferred using FTP, the "Content-Transfer-Encoding" header SHOULD NOT be used.
FREDI determines a MIME-formatted message as being an AS2 message if it contains the headers "AS2-To" and "AS2-From". Example,
AS2-To: ABCCompany
AS2-From: XYZCompany
Likewise, a message is determined to be AS3 if it has the headers "AS3-To" and "AS3-From". Example,
AS3-To: ABCCompany
AS3-From: XYZCompany
These headers must already be present in the message before the encoding operation takes place, which happens during the following calls to:
Decoding of the message occurs when the following methods are called:
If no "Content-Transfer-Encoding" header is present in an AS2 or AS3 message, FREDI will treat the body of the message as having binary data. Non-AS2/AS3 messages is assumed to be in 7-bits if the header is not present.
Properties