Content-Transfer-Encoding: 7bit
Content-Type: plain/text
As per rfc5322 you need to break line (add CRLF) after 78 characters.
My question is how can I decode the text/body back(remove the CRLF)? How do I know which CRLF was added by the encoder and which was part of the original body content? I've checked few implementations but most of them don't seem to bother though on encoding the rule is enforced.
The RFC doesn't say you have to break lines after 78 characters:
Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.
There is no way do “decode” a CRLF added by the sending system, the recipient will just leave it as it is.
If you don't want to modify the message, just don't add line breaks in any line with less than 998 characters.
Actually, rfc5322 states:
Each line of characters MUST be no more than 998 characters, and SHOULD
be no more than 78 characters, excluding the CRLF.
That said, it is recommended to limit lines to 78 characters.
For text-based MIME parts (such as the one in your example), you have a few options to achieve this:
text/plain; format=flowed
text/plain; format=flowed
. For more information about this format, check out rfc2646 . Essentially it provides a way of wrapping long lines that is reversible by the receiving client (hey! that's exactly what you wanted!) Content-Transfer-Encoding
, such as quoted-printable
or base64
.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.