elixir-mail icon indicating copy to clipboard operation
elixir-mail copied to clipboard

Default content-type header

Open TylerPachal opened this issue 4 years ago • 3 comments

Changes proposed in this pull request

If an email (or a part of a multipart email) has no content-type header, a default of Content-Type: text/plain; charset=us-ascii is assumed.


This is not part of the RFC 2822 but is part of RFC 1341:

If no Content-Type is specified, either by error or by an older user agent, this default is assumed

TylerPachal avatar Feb 24 '20 16:02 TylerPachal

Does RFC 2822 reference 1341 in any way? I cannot find one.

bcardarella avatar Apr 30 '20 19:04 bcardarella

I am not sure - at least not directly. This came about because I essentially have a wrapper module around elixir-mail that does this same functionality because everything downstream in my application expects a Content-Type.

I suppose that if we are sticking to a strict implementation of RFC 2822 then this can be closed.

This is kind of related to our conversation in https://github.com/DockYard/elixir-mail/issues/83 where we talked about having a more lenient parser because of all of the bad email out there.

TylerPachal avatar May 07 '20 12:05 TylerPachal

I think there could/should be a more lenient parser but it doesn't need to be RFC 2822 parser, it can borrow from it though. It could be something like CommonParser that is more true to real-world implementations.

bcardarella avatar May 07 '20 13:05 bcardarella

Closing per my comment https://github.com/DockYard/elixir-mail/pull/116#issuecomment-625240613

bcardarella avatar Feb 04 '24 14:02 bcardarella