Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it correct that sometimes I get angle brackets in "From" field of an e-mail message?

My software is working with incoming e-mail from the one and only particular sender (let it be [email protected]). According to RFC-2616 section 14 "From" header

MAY be used for logging purposes and as a means for identifying the source of invalid or unwanted requests.

That's exactly what I needed, so I wrote a code, which ignores all the messages where "From" field doesn't equal [email protected]. It worked good, but one day things changed, and now all the messages form Santa Claus contains a different string in "From" field (exactly <[email protected]>). I already fixed my code, but I just wonder, is this header legal? Because the same RFC-2616 section 14 says:

The address SHOULD be machine-usable, as defined by "mailbox" in RFC 822 [9] as updated by RFC 1123 [8]:

   From   = "From" ":" mailbox

An example is:

   From: [email protected]

Note the absense of angle brackets. But at the same time, many e-mail messages I receive on my Gmail account has something like this in the "From" field: "Santa Claus" <[email protected]>

like image 922
Graf Avatar asked Dec 17 '10 18:12

Graf


People also ask

What do angle brackets mean in email?

Angle brackets are used when a more human-readable name is also included. Every so often I see email addresses listed like this: Name <[email protected]> or even.

Can an email address have brackets?

An email address, such as [email protected], is made up from a local-part, the symbol @, and a domain, which may be a domain name or an IP address enclosed in brackets.

Why does one use bracketed text in an email?

Round brackets can help break up the content and make reading easier by separating information within the text. The type of text you would include in brackets could be a clarification, an aside, or a definition or example. You can use round brackets to enclose a single word, a phrase, or even an entire sentence.

What are angle brackets in typing?

The "<" and ">" symbols that are on the comma and period keys on the keyboard. Angle brackets are commonly used to enclose a code of some type. For example, HTML tags and PageMaker tags are enclosed in angle brackets.


1 Answers

RFC-822 allows email addresses to be specified either by a pure email-style address, called an "addr-spec" (e.g., [email protected]); or by using a nickname ("phrase") with the email-style address (the "addr-spec") enclosed in angle brackets (Foo Bar <[email protected]>). Your sender has gone from the first format to the second format, although here the nickname part seems to be empty.

By the way, RFC-2616 is for HTTP; you're looking at the definition of an optional, and (I imagine) rarely-used, From: header in the HTTP protocol. That doesn't seem to have any direct relevance on email formats.

like image 52
Dan Breslau Avatar answered Sep 18 '22 22:09

Dan Breslau