elixir-mail
elixir-mail copied to clipboard
Default content-type header
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
Does RFC 2822 reference 1341 in any way? I cannot find one.
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.
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.
Closing per my comment https://github.com/DockYard/elixir-mail/pull/116#issuecomment-625240613