From d58b9e2d904435394df067f4fe736c2bf80c0628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Krier?= Date: Mon, 14 Apr 2025 15:56:38 +0200 Subject: [PATCH] Set Message-Id to email sent Closes #13974 --- trytond/CHANGELOG | 1 + trytond/trytond/ir/email_.py | 2 ++ trytond/trytond/ir/view/email_form.xml | 4 ++++ trytond/trytond/ir/view/email_list.xml | 1 + trytond/trytond/sendmail.py | 7 +++++- trytond/trytond/tests/test_ir.py | 5 ++++ trytond/trytond/tests/test_sendmail.py | 32 +++++++++++++++++++++++--- 7 files changed, 48 insertions(+), 4 deletions(-) diff --git a/trytond/CHANGELOG b/trytond/CHANGELOG index 639015b8f7..ce605b6bba 100644 --- a/trytond/CHANGELOG +++ b/trytond/CHANGELOG @@ -1,3 +1,4 @@ +* Set Message-Id to email sent * Add pair/unpair in tools Version 7.6.0 - 2025-04-28 diff --git a/trytond/trytond/ir/email_.py b/trytond/trytond/ir/email_.py index 04a242f8d3..71ee919409 100644 --- a/trytond/trytond/ir/email_.py +++ b/trytond/trytond/ir/email_.py @@ -69,6 +69,7 @@ class Email(ResourceAccessMixin, ModelSQL, ModelView): 'ir.email.address', 'email', "Addresses", readonly=True) subject = fields.Char("Subject", readonly=True) body = fields.Text("Body", readonly=True) + message_id = fields.Char("Message-ID", readonly=True) @classmethod def __setup__(cls): @@ -228,6 +229,7 @@ class Email(ResourceAccessMixin, ModelSQL, ModelView): recipients_hidden=msg['Bcc'], addresses=[{'address': a} for a in to_addrs], subject=msg['Subject'], + message_id=msg['Message-ID'], **values) diff --git a/trytond/trytond/ir/view/email_form.xml b/trytond/trytond/ir/view/email_form.xml index b60307d7fa..2620b6b277 100644 --- a/trytond/trytond/ir/view/email_form.xml +++ b/trytond/trytond/ir/view/email_form.xml @@ -6,6 +6,10 @@ this repository contains the full copyright notices and license terms. -->