@cryptotaxi247 / netdata-1 / commits / 4e79eb91a

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

Austin S. Hemmelgarn committed Aug 11, 2017 at 09:35 UTC 4e79eb91a517e88a022e9604c407fccaffc56f26
1 file changed +4
plugins.d/alarm-notify.sh
+4
@@ -1402,6 +1402,8 @@ This is a MIME-encoded multipart message
1402
1403 --multipart-boundary
1404 Content-Type: text/plain
1405 +Content-Disposition: inline
1406 +Content-Transfer-Encoding: 8bit
1407
1408 ${host} ${status_message}
1409
@@ -1418,6 +1420,8 @@ Notification generated on ${this_host}
1420
1421 --multipart-boundary
1422 Content-Type: text/html
1423 +Content-Disposition: inline
1424 +Content-Transfer-Encoding: 8bit
1425
1426 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
1427 <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;">