[英]How to decode 7bit plain/text email body (how to remove CRLF)?
Content-Transfer-Encoding: 7bit
Content-Type: plain/text
As per rfc5322 you need to break line (add CRLF) after 78 characters. 根据rfc5322,您需要在78个字符后断行(添加CRLF)。
My question is how can I decode the text/body back(remove the CRLF)? 我的问题是如何解码文本/正文(删除CRLF)? How do I know which CRLF was added by the encoder and which was part of the original body content?
我怎么知道编码器添加了哪个CRLF,哪个是原始正文内容的一部分? 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: RFC没有说你必须在78个字符后断行:
Each line of characters MUST be no more than 998 characters, and SHOULD be no more than 78 characters, excluding the CRLF.
每行字符必须不超过998个字符,并且不应超过78个字符,不包括CRLF。
There is no way do “decode” a CRLF added by the sending system, the recipient will just leave it as it is. 没有办法“解码”发送系统添加的CRLF,收件人将保持原样。
If you don't want to modify the message, just don't add line breaks in any line with less than 998 characters. 如果您不想修改消息,请不要在任何小于998个字符的行中添加换行符。
Actually, rfc5322 states: 实际上,rfc5322声明:
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. 这就是说, 建议行限制为78个字符。
For text-based MIME parts (such as the one in your example), you have a few options to achieve this: 对于基于文本的MIME部分(例如示例中的部分),您有几个选项可以实现此目的:
text/plain; format=flowed
text/plain; format=flowed
text/plain; format=flowed
. text/plain; format=flowed
。 For more information about this format, check out rfc2646 . Content-Transfer-Encoding
, such as quoted-printable
or base64
. Content-Transfer-Encoding
,例如quoted-printable
或base64
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.