电子邮件标头是否区分大小写? [英] Are email headers case sensitive?

查看:21
本文介绍了电子邮件标头是否区分大小写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

电子邮件标题是否区分大小写?

Are email headers case sensitive?

例如,Content-Type 是否与 Content-type 不同?

For example, is Content-Type different from Content-type?

根据 RFC 5322,我没有看到任何关于区分大小写的内容.但是,我发现使用 PEAR Mail_mime 模块创建 MIME 消息时出现问题,并且一切都表明我们的 SMTP 服务器使用 Content-typeMIME-version 而不是 Content-TypeMIME-Version.我尝试使用另一个 SMTP 服务器(如 GMail),但不幸的是,我们的网络服务器的防火墙非常严密.

According to RFC 5322, I don't see anything about case sensitivity. However, I'm seeing a problem with creating MIME messages using the PEAR Mail_mime module, and everything is pointing to the fact that our SMTP server uses Content-type and MIME-version instead of Content-Type and MIME-Version. I tried using another SMTP server (like GMail), but unfortunately our web servers are firewalled pretty tightly.

推荐答案

RFC 5322 确实指定了这一点,但它是非常间接的.

RFC 5322 does actually specify this, but it is very indirect.

第 1.2.2 节 说:

本规范使用增强巴科斯-瑙尔形式 (ABNF) [RFC5234]的正式定义的符号消息的语法.

This specification uses the Augmented Backus-Naur Form (ABNF) [RFC5234] notation for the formal definitions of the syntax of messages.

反过来,RFC 5234 的第 2.3 节 说:

注意:

ABNF 字符串不区分大小写,其字符集为这些字符串是 US-ASCII.

ABNF strings are case insensitive and the character set for these strings is US-ASCII.

所以当 RFC 5322 指定 这样的生产规则时:

So when RFC 5322 specifies a production rule like this:

发件人 = 发件人:"邮箱列表 CRLF

from = "From:" mailbox-list CRLF

发件人:"是隐含的.不区分大小写.

It is implicit that the "From:" is not case-sensitive.

[更新]

对于 Content-Type 和 MIME-Version,它们由 MIME 规范指定(RFC 2045).这又是指原始 RFC 822 所描述的 BNF,这(幸运的是)也清楚地表明这些文字字符串不区分大小写.

As for Content-Type and MIME-Version, they are specified by the MIME spec (RFC 2045). That in turn refers to the BNF described by the original RFC 822, which (luckily) also makes it clear that these literal strings are case-insensitive.

底线:根据规范,电子邮件标头不区分大小写,因此听起来您的邮件服务器有问题.

Bottom line: According to the spec, Email headers are not case-sensitive, so it sounds like your mail server is buggy.

这篇关于电子邮件标头是否区分大小写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆