Questions tagged [rfc5322]

RFC5322 specifies the Internet Message Format (IMF), a syntax for text messages that are sent between computer users, within the framework of "electronic mail" messages.

RFC5322 is a revision of RFC2822, which itself superseded RFC822 ("Standard for the Format of ARPA Internet Text Messages". RFC5322 updates the Internet Message Format (IMF) to reflect current practice and incorporating incremental changes that were specified in other RFC's.

Multimedia Content

RFC5322 only specifies the syntax for textual messages. It makes no provision for the transmission of images, audio, or other sorts of structure data in electronic mail messages. There are several extensions published, such as the Multipurpose Internet Mail Extensions (MIME), which specifies multimedia inclusion in electronic mail messages. These provisions are outlined in RFC2045, RFC2046, and RFC2049.

Electronic Mail Envelopes

Electronic mail messages are composed of two parts, the envelope and the content. The IMF only addresses the content portion of the electronic mail message. For more information on the envelope, refer to RFC5321.

31 questions
53
votes
3 answers

Is the "Message ID" Email Header unique for each recipient?

How unique is the Message ID header of an email? If I address an email to two people, will the both have the same Message ID? Or will they be different? (This is assuming nobody's doing any funny business. I know that with spam, all the rules go…
Evan
  • 715
  • 1
  • 7
  • 9
41
votes
8 answers

Parsing date with timezone from an email?

I am trying to retrieve date from an email. At first it's easy: message = email.parser.Parser().parse(file) date = message['Date'] print date and I receive: 'Mon, 16 Nov 2009 13:32:02 +0100' But I need a nice datetime object, so I…
gruszczy
  • 40,948
  • 31
  • 128
  • 181
40
votes
1 answer

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…
Michael Irigoyen
  • 22,513
  • 17
  • 89
  • 131
23
votes
3 answers

Are international characters (e.g. umlaut characters) valid in the local part of email addresses?

Are german umlauts (ä, ö, ü) and the sz-character (ß) valid in the local part of an email-address? For example take this email-address: björn.nußbaum@trouble.org RFC 5322 quite clearly says, that umlauts (and other international characters) aren't…
Jan Köhler
  • 5,817
  • 5
  • 26
  • 35
18
votes
2 answers

Persistence of custom headers within an email thread

I this is probably a strange question, but I thought I'd go ahead and ask. Say, I send an email, using IMAP SMTP, through a special client. This client adds a few custom headers to the email message before sending it on its way. The recipient…
Wilhelm Murdoch
  • 1,806
  • 1
  • 22
  • 42
16
votes
3 answers

Is there a "no-reply" email header?

I often see automated emails postfixed with a message like Amazon: *Please note: this e-mail was sent from an address that cannot accept incoming e-mail. Please use the link above if you need to contact us again about this same…
Evan Krall
  • 2,915
  • 3
  • 23
  • 20
16
votes
5 answers

Set the Message-ID mail header in Rails3 / ActionMailer

I would like to alter the Message-ID header that is in the header portion of an email sent from a Ruby on Rails v3 application using ActionMailer. I am using Sendmail on localhost for mail delivery. Do I configure this in Sendmail or…
Teddy
  • 18,357
  • 2
  • 30
  • 42
9
votes
1 answer

Historically, why were the RFCs about email addresses made so complicated?

RFCs 5321, 5322 and 6531 have complex rules for validating email addresses. They: allow creating comments inside an email address offer complicated restriction rules for symbols: "() ,:;<>@[\] treat postmaster localpart as case-insensitive but all…
Andrei Botalov
  • 20,686
  • 11
  • 89
  • 123
5
votes
1 answer

Does RFC 5322 allow reply-to header without any actual e-mail address? If so, what is its semantic?

Section 3.6.2 of RFC 5322 defines the reply-to header as: reply-to = "Reply-To:" address-list CRLF Where address-list is defined at section 3.4. When unfolding the ABNF grammar, I find that address-list can consist of nothing but phrase…
dermiste
  • 121
  • 1
  • 5
4
votes
2 answers

PHP mail() docs say that I should only use LF in the body, but RFC 5322 says otherwise.

PHP manual (http://php.net/manual/en/function.mail.php) says: Each line should be separated with a LF (\n). Lines should not be larger than 70 characters. But actual RFC 5322 gives totallty different information: 2.3. Body The body of a…
Stann
  • 13,518
  • 19
  • 65
  • 73
4
votes
1 answer

Incorrect decoding in Python3 email module

I have recently run into an EML file I wanted to parse with Python email module. In from header, there was following text: From: "=?utf-8?b?5b2t5Lul5Zu9L+esrOS6jOS6i+S4mumDqOmhueebrumDqC/nrKzkuozkuovkuJrp?= =?utf-8?b?g6g=?=" So…
Larrax
  • 87
  • 1
  • 8
3
votes
1 answer

Choosing the right ReadP parse result

I'm trying to parse a RFC5322 email address. My parser works in the sense that among the results, one of them is correct. However, how do I go about selecting the “correct” result? Given the string Foo Bar , my parser should produce a…
Jezen Thomas
  • 13,619
  • 6
  • 53
  • 91
3
votes
3 answers

RFC 5322 email format validation

How can I check if emails that are generated by my code a valid according to RFC 5322 ?
tomsv
  • 7,207
  • 6
  • 55
  • 88
2
votes
2 answers

Does order matter in email header?

I am using smtplib to create a MIMEMultipart email and the result is a header that looks as follows. MIME-Version: 1.0 Content-Type: multipart/alternative; charset="utf-8"; boundary="===============2613033831060434871==" Content-Transfer-Encoding:…
rayosunny
  • 21
  • 3
2
votes
1 answer

What really is the maximum length of email address local part?

According to Wikipedia (https://en.wikipedia.org/wiki/Email_address) and http://isemail.info/about the maximal length of the local part of an email address is 64 characters. However, I just received email from this address:…
user254173
  • 152
  • 6
1
2 3