summaryrefslogtreecommitdiffstats
path: root/plugins.d
diff options
context:
space:
mode:
authorAustin S. Hemmelgarn <ahferroin7@gmail.com>2017-08-11 09:35:24 -0400
committerGitHub <noreply@github.com>2017-08-11 09:35:24 -0400
commit4e79eb91a517e88a022e9604c407fccaffc56f26 (patch)
treeea874c8c21ede424197f3379cdb9571e03a0595c /plugins.d
parentd75508b1c95a6344411e8aa0c513c58ab769f52e (diff)
Reduce notification e-mail spam score.
This adds Content-Disposition and Content-Transfer-Encoding headers to the HTML and text/plain e-mail bodies, thus eliminating one of the issues that tools like Spamassassin check for. The value `inline` for the Content-Disposition is largely ignored by most e-mail clients these days, but may cause some older clients to display both parts of the message. It's usage here is consistent with what most e-mail clients set when sending both HTML and text/plain components. The value `8bit` for the Content-Type-Encoding clarifies that there is unescaped binary data in the text, but that it is limited to 998 character lines and only uses CR and LF at the end of the lines. `7bit` would work also when dealing with sending the messages in English, and technically be more widely compatible, but we can't assume that the message content will not contain 8-bit characters because certain components (specifically, at least the host name and chart name) may contain Unicode codepoints above 127. Ideally, we also need to add `charset=` parameters to the Content-Type header for both components, but that requires a bit more work because it's non-trivial to translate the locale's character set to an IANA character set. Partially fixes #2587
Diffstat (limited to 'plugins.d')
-rwxr-xr-xplugins.d/alarm-notify.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins.d/alarm-notify.sh b/plugins.d/alarm-notify.sh
index af15494017..1c0c1d548b 100755
--- a/plugins.d/alarm-notify.sh
+++ b/plugins.d/alarm-notify.sh
@@ -1402,6 +1402,8 @@ This is a MIME-encoded multipart message
--multipart-boundary
Content-Type: text/plain
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
${host} ${status_message}
@@ -1418,6 +1420,8 @@ Notification generated on ${this_host}
--multipart-boundary
Content-Type: text/html
+Content-Disposition: inline
+Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0; padding: 0;">