电子邮件标题大小写敏感? [英] Are email headers case sensitive?

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

问题描述

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



例如,是内容类型不同于内容类型



根据 RFC 5322 ,我没有看到任何关于区分大小写的事情。但是,我看到使用PEAR Mail_mime模块创建MIME消息时遇到问题,并且一切都指向我们的SMTP服务器使用内容类型 MIME-version 而不是 Content-Type MIME-Version 。我尝试使用另一个SMTP服务器(如GMail),但不幸的是我们的Web服务器的防火墙相当紧密。

解决方案

RFC 5322实际上指定这个,但它是非常间接的。



第1.2.2节说:


本规范使用增加的
Backus-Naur表单(ABNF)[RFC5234]
对于
的正式定义的消息语法的符号。


RFC 5234第2.3节说:


注意:



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


所以当RFC 5322指定一个 produ这样的条款规则


from =发件人:邮箱列表CRLF


隐含的From:不区分大小写。



[update]



对于内容类型和MIME版本,它们由MIME规范指定( RFC 2045 )。这反过来指的是原始 RFC 822 描述的BNF,幸运的是)也明确表示这些文字字符串不区分大小写。



底线:根据规范,电子邮件头不区分大小写,所以听起来像你的邮件服务器是错误的。


Are email headers case sensitive?

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

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 does actually specify this, but it is very indirect.

Section 1.2.2 says:

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

In turn, Section 2.3 of RFC 5234 says:

NOTE:

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

So when RFC 5322 specifies a production rule like this:

from = "From:" mailbox-list CRLF

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

[update]

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天全站免登陆