From: Lorenz Bausch Date: Tue, 8 Mar 2022 13:36:20 +0000 (+0100) Subject: mgr/alerts: Generate Message-Id for mails sent by alerts module X-Git-Tag: v16.2.11~534^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=2861d97c90ed67f40677fa58d8b53686dd95f56b;p=ceph.git mgr/alerts: Generate Message-Id for mails sent by alerts module Signed-off-by: Lorenz Bausch (cherry picked from commit ef5975e701cfeb58f2dd8fb9f0410d08692fa757) Conflicts: src/pybind/mgr/alerts/module.py: Fixed imports --- diff --git a/src/pybind/mgr/alerts/module.py b/src/pybind/mgr/alerts/module.py index e0b6cbcaa42..db970d7dbc7 100644 --- a/src/pybind/mgr/alerts/module.py +++ b/src/pybind/mgr/alerts/module.py @@ -4,6 +4,7 @@ A simple cluster health alerting module. """ from mgr_module import MgrModule, HandleCommandResult +from email.utils import make_msgid from threading import Event import errno import json @@ -210,12 +211,14 @@ class Alerts(MgrModule): message = ('From: {from_name} <{sender}>\n' 'Subject: {status}\n' 'To: {target}\n' + 'Message-Id: {message_id}\n' '\n' '{status}\n'.format( sender=self.smtp_sender, from_name=self.smtp_from_name, status=status['status'], - target=self.smtp_destination)) + target=self.smtp_destination, + message_id=make_msgid())) if 'new' in diff: message += ('\n--- New ---\n')