]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mailers: use <CRLF> for all line endings
authorPieter Baauw <piba.nl.dev@gmail.com>
Sat, 13 Feb 2016 15:27:35 +0000 (16:27 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Feb 2016 09:19:09 +0000 (10:19 +0100)
Not doing so causes issues with Exchange2013 not processing the message
body from the email. Specification seems to specify that as correct
behavior : https://www.ietf.org/rfc/rfc2821.txt # 2.3.7 Lines

 > SMTP client implementations MUST NOT transmit "bare" "CR" or "LF" characters.

This patch should be backported to 1.6.

Acked-by: Simon Horman <horms@verge.net.au>
src/checks.c

index 9d6d33e5b59fae0ddd560dd796a565893b92be57..2cfb01f6a59e9d998f5d3077ab912f14752ec4ea 100644 (file)
@@ -3249,12 +3249,12 @@ static int enqueue_one_email_alert(struct email_alertq *q, const char *msg)
                struct tm tm;
                char datestr[48];
                const char * const strs[18] = {
-                       "From: ", p->email_alert.from, "\n",
-                       "To: ", p->email_alert.to, "\n",
-                       "Date: ", datestr, "\n",
-                       "Subject: [HAproxy Alert] ", msg, "\n",
-                       "\n",
-                       msg, "\n",
+                       "From: ", p->email_alert.from, "\r\n",
+                       "To: ", p->email_alert.to, "\r\n",
+                       "Date: ", datestr, "\r\n",
+                       "Subject: [HAproxy Alert] ", msg, "\r\n",
+                       "\r\n",
+                       msg, "\r\n",
                        "\r\n",
                        ".\r\n",
                        NULL