我正在调试一个无法解析来自一个电子邮件服务的标头的 MIME 解析器。电子邮件服务包含一个标题,该标题由一个完全位于下一行的字段正文组成,如下所示:
Message-Id:
<12345.67890.abcdef@example.com>
这合法吗?
RFC-822 为有效标头指定以下语法:
3.2. HEADER FIELD DEFINITIONS
These rules show a field meta-syntax, without regard for the
particular type or internal syntax. Their purpose is to permit
detection of fields; also, they present to higher-level parsers
an image of each field as fitting on one line.
field = field-name ":" [ field-body ] CRLF
field-name = 1*<any CHAR, excluding CTLs, SPACE, and ":">
field-body = field-body-contents
[CRLF LWSP-char field-body]
field-body-contents =
<the ASCII characters making up the field-body, as
defined in the following sections, and consisting
of combinations of atom, quoted-string, and
specials tokens, or else consisting of texts>
空字符串是否满足 field-body-contents 以允许[CRLF LWSP field-body]
field-body 的一部分?