Skip to content
Snippets Groups Projects
Commit 8663f1e2 authored by std-odoo's avatar std-odoo Committed by Julien Castiaux
Browse files

[FIX] base: specify the charset the the SMTP headers

The emails sent via Odoo reveive a poor score on various spam tools,
the reason being the missing `MIME-Version` message header. This header
inform what MIME version is in use in the message. Even if there is only
one standardized version of MIME (1.0), the header is mandatory.

Citing [rfc2045] "MIME: Format of Internet Message Bodies" section 4:

> the MIME-Version header field is required at the top level of a message.

Setting the charset on the envelop forces the EmailMessage API to also
include the missing `MIME-Version` header.

[rfc2045]: https://tools.ietf.org/html/rfc2045#section-4



Task 2393865

closes odoo/odoo#64651

Signed-off-by: default avatarJulien Castiaux <Julien00859@users.noreply.github.com>
parent 03788855
No related branches found
No related tags found
No related merge requests found
......@@ -288,6 +288,8 @@ class IrMailServer(models.Model):
body = body or u''
msg = EmailMessage(policy=email.policy.SMTP)
msg.set_charset('utf-8')
if not message_id:
if object_id:
message_id = tools.generate_tracking_message_id(object_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment