Module: check_mk
Branch: master
Commit: 696466ae8fabb2ed3aa0ac7799aa0a77f7a27165
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=696466ae8fabb2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Feb 2 15:16:11 2016 +0100
#3042 FIX Fixed configuring the sender of mails (Text and HTML mails)
It is now really possible to configure the sender name and address
of notifications using the rule based notifications. This was not
completely working as sendmail was called with the wrong arguments
(-f instead of -F).
The from address can now be configured like this:
Company Mointoring <monitoring(a)example.com>
Tested with sendmail compatibility version from postfix.
---
.werks/3042 | 19 +++++++++++++++++++
ChangeLog | 1 +
notifications/asciimail | 2 +-
notifications/mail | 2 +-
4 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/.werks/3042 b/.werks/3042
new file mode 100644
index 0000000..ef26701
--- /dev/null
+++ b/.werks/3042
@@ -0,0 +1,19 @@
+Title: Fixed configuring the sender of mails (Text and HTML mails)
+Level: 1
+Component: notifications
+Compatible: compat
+Version: 1.2.7i4
+Date: 1454422472
+Class: fix
+
+It is now really possible to configure the sender name and address
+of notifications using the rule based notifications. This was not
+completely working as sendmail was called with the wrong arguments
+(-f instead of -F).
+
+The from address can now be configured like this:
+
+Company Mointoring <monitoring(a)example.com>
+
+Tested with sendmail compatibility version from postfix.
+
diff --git a/ChangeLog b/ChangeLog
index 7173abf..a72c685 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -338,6 +338,7 @@
* 2843 FIX: Hanging notification scripts could prevent all other notifications...
* 2815 FIX: Notification scripts: Fixed missing environment variables...
* 2821 FIX: WATO rule based notifications: Validate regular expression for service
conditions...
+ * 3042 FIX: Fixed configuring the sender of mails (Text and HTML mails)...
BI:
* 2882 Reorganize BI configuration into packs, add contacts and permissions...
diff --git a/notifications/asciimail b/notifications/asciimail
index 8ae5a53..fab04f9 100755
--- a/notifications/asciimail
+++ b/notifications/asciimail
@@ -86,7 +86,7 @@ def build_mail(target, subject, from_address, reply_to, content_txt):
def send_mail(m, target, from_address):
cmd = ["/usr/sbin/sendmail"]
if from_address:
- cmd += ['-f', from_address]
+ cmd += ['-F', from_address]
cmd += [ "-i", target.encode("utf-8")]
p = subprocess.Popen(cmd, stdin = subprocess.PIPE)
p.communicate(m.as_string())
diff --git a/notifications/mail b/notifications/mail
index 6e47b16..677e20a 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -410,7 +410,7 @@ def multipart_mail(target, subject, from_address, reply_to,
content_txt, content
def send_mail(m, target, from_address):
cmd = ["/usr/sbin/sendmail"]
if from_address:
- cmd += ['-f', from_address]
+ cmd += ['-F', from_address]
cmd += [ "-i", target.encode("utf-8")]
try:
p = subprocess.Popen(cmd, stdin = subprocess.PIPE)