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
2
votes
2 answers

PHP filter_var and RFC 5322

Is the PHP function filter_var('bob@example.com', FILTER_VALIDATE_EMAIL) validating the email using the standard RFC 5322?
Marin Bînzari
  • 5,208
  • 2
  • 26
  • 43
2
votes
2 answers

rfc5322: how to fold values without spaces?

I've already seen answer on similar topic, but rfc5322 says: Unfolding is accomplished by simply removing any CRLF that is immediately followed by WSP. this can break source spaceless text by adding into it spaces. so how to fold values without…
Alexey
  • 75
  • 6
2
votes
0 answers

Reasoning behind change in destination address requirement from RFC 822 to RFC 2822

In RFC 822 a destination address was required to appear in the headers, section C.3.4. reads "A message must contain at least one destination address field. 'To' and 'CC' are required to contain at least one address." In RFCs 2822 and 5322, section…
craigyurt
  • 21
  • 3
1
vote
0 answers

Add an additional condition to RFC 5322 Email Regex

I took this regex from a top rated Stackoverflow answer to make the mails RFC 5322 compliant and it seems to work fine. const re =…
Sharan Mohandas
  • 861
  • 1
  • 9
  • 25
1
vote
3 answers

Email Id validation according to RFC5322 and https://en.wikipedia.org/wiki/Email_address

Validating E-mail Ids according to RFC5322 and following https://en.wikipedia.org/wiki/Email_address Below is the sample code using java and a regular expression to validate E-mail Ids. public void checkValid() { List emails = new…
Mihir
  • 572
  • 1
  • 6
  • 24
1
vote
2 answers

How to decode 7bit plain/text email body (how to remove CRLF)?

Content-Transfer-Encoding: 7bit Content-Type: plain/text As per rfc5322 you need to break line (add CRLF) after 78 characters. My question is how can I decode the text/body back(remove the CRLF)? How do I know which CRLF was added by the encoder…
The user with no hat
  • 10,166
  • 20
  • 57
  • 80
1
vote
1 answer

rfc5322: what are the line limits?

I'm trying to make sense of rfc5322 Line Length Limits . Is the line limit 78 chars or 998 chars? Is one for the body and the other for the headers? I can't find anything to specify that. Each line of characters MUST be no more than 998 characters,…
themihai
  • 7,903
  • 11
  • 39
  • 61
1
vote
1 answer

How to fold an email header with long email addresses according to RFC 5322?

Assume that an email has the following header field: To: =?utf-8?q?Foo_Bar?= <1234567890123456789012345678901234567890123456789012345678901234@abcdefghiabcdefghiabcdefghiabcdefghiabcdefghiabcdefghiabcdefghi.com> Is there a way to fold the…
Jo Bain
  • 13
  • 4
1
vote
0 answers

SMTP with Python, can't send emails to domains other than gmail

I'm trying to send an email using a Python script and smtp (I made an account on sendgrid.com), and I found this code on http://www.mkyong.com/python/how-do-send-email-in-python-via-smtplib/ and I can make it work just fine for gmail, but no other…
Angelica
  • 11
  • 2
0
votes
1 answer

How should Quoted-Printable Mime-Words be wrapped to the correct line length?

I ran into a bug in a mime parsing library where it blows up on subject lines that contain foreign characters beyond a certain length. It turns out that it would convert the subject into a Quoted-Printable MIME "Encoded-Word" and then try to…
Dobes Vandermeer
  • 8,463
  • 5
  • 43
  • 46
0
votes
0 answers

Sending bounce e-mails to the "header from" address

I want the bounced messages are delivered to "Header From" instead of "Header ReturnPath". See Case 2 below. Here is the setup: Envelop RFC5321.MailFrom RFC5321.RcptTo Header RFC5322.From RFC5322.To RFC5322.ReturnPath (injected from…
Eugenio
  • 1
  • 1
0
votes
0 answers

Malformed eMail Date Header Field with Address Specification

When parsing a collection of MBox files, I came across a surprising number of Date header fields of the form: "Date:" date-time "<" addr-spec ">" Reading the available RFCs I find no matching syntax. The valid form appears to be: "Date:" date-time…
Ben Crowhurst
  • 8,204
  • 6
  • 48
  • 78
0
votes
1 answer

Email with special characters rejected - RFC-6532 and "quoted-printable"

One email provider rejected an email containing special characters (e.g. umlaute). They say that they are RFC-5321 and RFC-5322 compliant. Now I browsed those standards however they are not supporting international emails (thus no umlaute). Only…
Lonzak
  • 9,334
  • 5
  • 57
  • 88
0
votes
1 answer

Email label vs local-part and hyphens

I've been reading through RFC, summaries, wikipedia, etc. I'm super confused about local-part vs labels. It seems to me that the local-part is before the @. That much seems straightforward. The label is any part of the domain separated by a dot.…
claudekennilol
  • 992
  • 2
  • 13
  • 26
0
votes
0 answers

What is the special syntax for a sub email address in local part of address

I have read somewhere, when searching on how to parse email addresses the best way, that it is possible to have a special string in front or after your local-part of the email address, which is ignored for assigning it to a special mailbox. So…
velop
  • 3,102
  • 1
  • 27
  • 30