From 1a20f11005ba72b3cfda5c5f5a0a78f6ef585e00 Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Thu, 10 Dec 2020 16:10:47 +0000 Subject: [PATCH] [FIX] mail: Receive EML file in attachment Configure the incomming mail server, use another mail client to send a message to Odoo with an EML file as attachment. The fetchmail server fails. Since the introduction of the new EmailMessage python API to encode/decode email messages, every EML attachment is automatically parsed into a EmailMessage. closes odoo/odoo#63255 Task: 2329606 X-original-commit: e628defec14f3b36612951bc698fa51b7c9f56bb Signed-off-by: Julien Castiaux --- addons/mail/models/mail_thread.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/mail/models/mail_thread.py b/addons/mail/models/mail_thread.py index b5f83f14deb..2c0c57cac51 100644 --- a/addons/mail/models/mail_thread.py +++ b/addons/mail/models/mail_thread.py @@ -1702,6 +1702,8 @@ class MailThread(models.AbstractModel): continue if isinstance(content, str): content = content.encode('utf-8') + elif isinstance(content, EmailMessage): + content = content.as_bytes() elif content is None: continue attachement_values= {