Questions tagged [rfc822]

RFC822 is the historical original standard for the format of email messages.

RFC5322 (which supersedes 2822, which in turn superseded the original 822) defines the basic format of email messages. Its companion document RFC5321 documents the SMTP transport protocol.

These days, you also need to know about and the various internationalization features which have been added to the email infrastructure over the years.

The protocol is used for mail transport between servers; for mailbox access from clients, perhaps you need to look at and/or .

Resources:

See for more details on the Internet Engineering Task Force RFC (Request For Comments) documents and process.

128 questions
48
votes
5 answers

How can I get an email message's text content using Python?

Given an RFC822 message in Python 2.6, how can I get the right text/plain content part? Basically, the algorithm I want is this: message = email.message_from_string(raw_message) if has_mime_part(message, "text/plain"): mime_part =…
Chris R
  • 17,546
  • 23
  • 105
  • 172
41
votes
6 answers

How do I parse and convert DateTime’s to the RFC 822 date-time format?

How do I convert a DateTime structure to its equivalent RFC 822 date-time formatted string representation and parse this string representation back to a DateTime structure in .NET? The RFC-822 date-time format is used in a number of specifications…
Oppositional
  • 11,141
  • 6
  • 50
  • 63
22
votes
3 answers

Is there a difference between MIME and content type?

While using the f12 tools on ie, when I request a web page, the response header has a content type. Can this also be called MIME type? Or is there a difference?
developer747
  • 15,419
  • 26
  • 93
  • 147
21
votes
4 answers

Why does email need an envelope, and what does the "envelope" mean?

What is the exact difference between the envelope and the email in smtp? Why does the protocol need the envelope? In snail mail, the letter needs not contain addresses and is not visible to the postman (at least that's what you want to believe), so…
flybywire
  • 261,858
  • 191
  • 397
  • 503
18
votes
2 answers

MIME RFC "Content-Type" parameter confusion? Unclear RFC specification

I'm trying to implement a basic MIME parser for the multipart/related in C++/Qt. So far I've been writing some basic parser code for headers, and I'm reading the RFCs to get an idea how to do everything as close to the specification as possible.…
BastiBen
  • 19,679
  • 11
  • 56
  • 86
18
votes
4 answers

How do I elegantly print the date in RFC822 format in Perl?

How can I elegantly print the date in RFC822 format in Perl?
Tom Feiner
  • 20,656
  • 20
  • 48
  • 51
18
votes
3 answers

How do I convert RFC822 to a python datetime object?

I know how to do this the other way around... it would be: >>> dt.rfc822() 'Sun, 09 Mar 1997 13:45:00 -0500'
Udbhav
  • 353
  • 1
  • 3
  • 10
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
11
votes
2 answers

In Python how to convert an `email.message.Message` object into an `email.message.EmailMessage` object

From my understanding the mbox class in Python 3.6's standard library generates old-style message objects of the type email.message.Message. The newer class email.message.EmailMessage introduced in 3.4/3.6 offers easier access to the content of the…
halloleo
  • 9,216
  • 13
  • 64
  • 122
10
votes
1 answer

How do you extract multiple email addresses from an RFC 2822 mail header in python?

Python's email module is great for parsing headers. However, the To: header can have multiple recipients, and there may be multiple To: headers. So how do I split out each of the email addresses? I can't split on the comma, since the comma can be…
vy32
  • 28,461
  • 37
  • 122
  • 246
10
votes
1 answer

What is the RFC 822 format for the email addresses?

I have to make a regular expression for the email addresses (RFC 822) and I want to know which characters are allowed in the local part and in the domain. I found this https://www.rfc-editor.org/rfc/rfc822#section-6.1 but I don't see that it says…
Adrian
  • 829
  • 5
  • 14
  • 21
10
votes
1 answer

Does Gmail set an invalid Content-ID header for inline attachments?

Short Version A Content-ID header on an attachment must be of the form local-part "@" domain. Gmail's Content-IDs do not have an @ in them. Is this a real bug, or am I misreading the spec? Long Version I noticed this problem when I tried to resend…
Alex Grin
  • 8,121
  • 6
  • 33
  • 57
9
votes
2 answers

Elegant way to serialize a MailMessage object in .NET

I'm currently looking at serializing a MailMessage object in C# and although there are a couple of variations of an example on the net, they serialize to binary which kind of misses the point IMO. My approach is that I'd like to serialize a…
PaulV
  • 195
  • 1
  • 9
8
votes
7 answers

RFC822 Timezone Parsing in Java

I have a JS date that is being converted by Dojo into RFC822 format. The function call - dojo.date.toRfc3339(jsDate), generates the following date - 2007-02-26T20:15:00+02:00. I have an application that uses a Java date SimpleDateFormat to parse in…
Jamen
  • 81
  • 1
  • 1
  • 2
7
votes
2 answers

Is there a non-deprecated equivalent of rfc822.AddressList?

I need something like rfc822.AddressList to parse, say, the content of the "TO" header field of an email into individual addresses. Since rfc822 is deprecated in favor of the email package, I looked for something similar there but couldn't find…
Chung Wu
  • 2,357
  • 3
  • 21
  • 19
1
2 3
8 9