Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Are email headers case sensitive?

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.

like image 413
Michael Irigoyen Avatar asked May 26 '11 18:05

Michael Irigoyen


People also ask

Are headers case sensitive?

An HTTP header consists of its case-insensitive name followed by a colon ( : ), then by its value. Whitespace before the value is ignored.

Can email addresses be case sensitive?

Unlike passwords, email addresses are not case sensitive. Whether or not you add capitals, your email server will read it the same way as long as the numbers and letters match your official email address.

Is Gmail case sensitive?

Gmail addresses are not case sensitive, meaning the email service doesn't distinguish between versions of the address with or without capitalized letters, so long as the spelling is the same.

Does case matter in HTTP headers?

The http header names are case-insensitive. So “Content-Type” is equivalent with “content-type”.


1 Answers

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.

like image 125
Nemo Avatar answered Sep 23 '22 20:09

Nemo