SMTP:\ r \ n \ r(没有第二个\ n)作为双换行符 [英] SMTP: \r\n\r (without second \n) as double newline
问题描述
我有可以正常工作的SMTP解析器.从第三方软件接收流量时出现问题,该软件发送双换行符为"\ r \ n \ r"(不包含第二个"\ n").当前,此类连接被终止为不兼容的SMTP.有人可以解释一下RFC关于这种有趣的"双换行符的确切含义吗?我可以假设发送这样的数据的软件确实做错了吗?
I have SMTP parser that works mostly fine. There is a problem when receiving traffic from third party software that sends double newlines as "\r\n\r" (without the second "\n"). Currently such connections are terminated as non-compliant SMTP. Can somebody explain what exactly RFC says about such "funny" double newlines? Can I asume that software that sends data like that is doing something really wrong?
推荐答案
RFC2821.第2.3.7节:
RFC2821. Section 2.3.7:
SMTP命令,并且,除非进行了更改 通过服务扩展,消息
数据以行"形式传输. 行包含零个或多个数据
由序列终止的字符 ASCII字符"CR"(十六进制值0D) 紧随其后的是ASCII 字符"LF"(十六进制值0A).
SMTP commands and, unless altered by a service extension, message
data, are transmitted in "lines". Lines consist of zero or more data
characters terminated by the sequence ASCII character "CR" (hex value 0D) followed immediately by ASCII character "LF" (hex value 0A).
http://www.ietf.org/rfc/rfc2821.txt
-戴夫
这篇关于SMTP:\ r \ n \ r(没有第二个\ n)作为双换行符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!