Module: check_mk
Branch: master
Commit: e576f47b285645dbe308598be617701edc0aafe3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e576f47b285645…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Mon Apr 1 10:02:29 2019 +0200
7414 FIX mail: fix bug with multiple recipients and synchronous delivery
If Email notifictations were sent to multiple recipients and synchronous
delivery via SMTP was used mail servers may process the recipients of
Emails wrong. This may result in failed notifications or only partially
delivered Emails. The exact behaviour depends on the mail server.
Change-Id: Ifd252ca68be11239d905bc8c9d5c74f7a4e87e59
---
.werks/7414 | 14 ++++++++++++++
cmk/notification_plugins/mail.py | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)
diff --git a/.werks/7414 b/.werks/7414
new file mode 100644
index 0000000..1fab02a
--- /dev/null
+++ b/.werks/7414
@@ -0,0 +1,14 @@
+Title: mail: fix bug with multiple recipients and synchronous delivery
+Level: 1
+Component: notifications
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1554054898
+
+If Email notifictations were sent to multiple recipients and synchronous
+delivery via SMTP was used mail servers may process the recipients of
+Emails wrong. This may result in failed notifications or only partially
+delivered Emails. The exact behaviour depends on the mail server.
diff --git a/cmk/notification_plugins/mail.py b/cmk/notification_plugins/mail.py
index 5403488..049f9c7 100644
--- a/cmk/notification_plugins/mail.py
+++ b/cmk/notification_plugins/mail.py
@@ -614,7 +614,7 @@ def send_mail_smtp_impl(message, target, smarthost, from_address,
context):
# the first parameter here is actually used in the return_path header
try:
- conn.sendmail(from_address, target, message.as_string())
+ conn.sendmail(from_address, target.split(','), message.as_string())
sys.stdout.write("success %d - %s\n" % (conn.last_code,
conn.last_repl))
finally:
conn.quit()