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)
Module: check_mk
Branch: master
Commit: 850a657aba253aa7b6a3f34fe9dd76bd7d9afb09
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=850a657aba253a…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Tue Feb 2 16:36:24 2016 +0100
clang-tidy fixes for google-readability-todo check.
Note that mentioning the user in the TODO doesn't mean that *this* user has
to do the fix, it just means that the given user can be asked about the
background of the TODO etc.
---
livestatus/src/InputBuffer.cc | 2 +-
livestatus/src/LogEntry.cc | 2 +-
livestatus/src/Logfile.cc | 3 ++-
livestatus/src/OutputBuffer.cc | 3 ++-
livestatus/src/Store.cc | 2 +-
livestatus/src/TableStateHistory.cc | 4 ++--
livestatus/src/TableTimeperiods.cc | 2 +-
livestatus/src/pnp4nagios.cc | 2 +-
8 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/livestatus/src/InputBuffer.cc b/livestatus/src/InputBuffer.cc
index dad51ab..2d148c8 100644
--- a/livestatus/src/InputBuffer.cc
+++ b/livestatus/src/InputBuffer.cc
@@ -41,7 +41,7 @@ extern int g_idle_timeout_msec;
namespace {
const size_t initial_buffer_size = 4096;
-// TODO: Make this configurable?
+// TODO(sp): Make this configurable?
const size_t maximum_buffer_size = 500 * 1024 * 1024;
const int read_timeout_usec = 200000;
diff --git a/livestatus/src/LogEntry.cc b/livestatus/src/LogEntry.cc
index 22cfd8a..f5c8385 100644
--- a/livestatus/src/LogEntry.cc
+++ b/livestatus/src/LogEntry.cc
@@ -310,7 +310,7 @@ bool LogEntry::handleExternalCommandEntry() {
_logclass = LOGCLASS_COMMAND;
char *scan = _text;
_text = next_token(&scan, ':');
- return true; // TODO: join with host/service information?
+ return true; // TODO(mk): join with host/service information?
/* Damit wir die restlichen Spalten ordentlich befuellen, braeuchten
wir eine komplette Liste von allen external commands und
deren Parameteraufbau. Oder gibt es hier auch eine bessere
diff --git a/livestatus/src/Logfile.cc b/livestatus/src/Logfile.cc
index 8404734..9d946f5 100644
--- a/livestatus/src/Logfile.cc
+++ b/livestatus/src/Logfile.cc
@@ -46,7 +46,8 @@ using std::make_pair;
extern unsigned long g_max_lines_per_logfile;
-// TODO: We need the suppression pragma below because _readpos and _linebuffer
+// TODO(sp): We need the suppression pragma below because _readpos and
+// _linebuffer
// is not initialized in the constructor. Just replace all this manual fiddling
// with pointers, offsets, etc. with vector.
diff --git a/livestatus/src/OutputBuffer.cc b/livestatus/src/OutputBuffer.cc
index 261e4d1..eb199b1 100644
--- a/livestatus/src/OutputBuffer.cc
+++ b/livestatus/src/OutputBuffer.cc
@@ -72,7 +72,8 @@ void OutputBuffer::addBuffer(const char *buf, unsigned len) {
_writepos += len;
}
-// TODO: All this code is highly error-prone due to overflow, failed allocations
+// TODO(sp): All this code is highly error-prone due to overflow, failed
+// allocations
// etc. We should just use vector instead.
void OutputBuffer::needSpace(unsigned len) {
if (_writepos + len > _end) {
diff --git a/livestatus/src/Store.cc b/livestatus/src/Store.cc
index 94f4b8a..a83b5d6 100644
--- a/livestatus/src/Store.cc
+++ b/livestatus/src/Store.cc
@@ -35,7 +35,7 @@
#include "logger.h"
#include "strutil.h"
-// TODO: Remove this hack.
+// TODO(sp): Remove this hack.
#ifdef EXTERN
#undef EXTERN
#endif
diff --git a/livestatus/src/TableStateHistory.cc b/livestatus/src/TableStateHistory.cc
index 7a2ff98..8ccbff1 100644
--- a/livestatus/src/TableStateHistory.cc
+++ b/livestatus/src/TableStateHistory.cc
@@ -831,8 +831,8 @@ int TableStateHistory::updateHostServiceState(Query *query,
hs_state->_log_output = 0;
else
- // TODO: Do we really need to strdup? How are the lifetimes of entry
- // and hs_state related? This is highly unclear. This strdup
+ // TODO(sp): Do we really need to strdup? How are the lifetimes of
+ // entry and hs_state related? This is highly unclear. This strdup
// complicates things like hell, because HostServiceState owns
// _log_output because of it. If this is really needed (hopefully
// not), we should better change the type from a naked pointer to a
diff --git a/livestatus/src/TableTimeperiods.cc b/livestatus/src/TableTimeperiods.cc
index 58093aa..50fb76e 100644
--- a/livestatus/src/TableTimeperiods.cc
+++ b/livestatus/src/TableTimeperiods.cc
@@ -48,7 +48,7 @@ void TableTimeperiods::addColumns(Table *table, string prefix,
table->addColumn(new OffsetTimeperiodColumn(
prefix + "in", "Wether we are currently in this period (0/1)", -1,
indirect_offset));
- // TODO: add days and exceptions
+ // TODO(mk): add days and exceptions
}
void TableTimeperiods::answerQuery(Query *query) {
diff --git a/livestatus/src/pnp4nagios.cc b/livestatus/src/pnp4nagios.cc
index 0f3abda..d37aed4 100644
--- a/livestatus/src/pnp4nagios.cc
+++ b/livestatus/src/pnp4nagios.cc
@@ -35,7 +35,7 @@ extern char* g_pnp_path;
namespace {
-// TODO: Move this to some kind of C++ string utility file.
+// TODO(sp): Move this to some kind of C++ string utility file.
string replace_all(const string& str, const string& chars, char replacement) {
string result(str);
size_t i = 0;