From fe89b8d1372be2939c04b942bfc6fe8d59231fc8 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Sat, 16 Mar 2019 13:44:43 -0700 Subject: [PATCH] use CRLF for all email headers --- Zotlabs/Lib/Enotify.php | 22 +++++++++++----------- include/network.php | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Zotlabs/Lib/Enotify.php b/Zotlabs/Lib/Enotify.php index fdeee461c..dd7f904c5 100644 --- a/Zotlabs/Lib/Enotify.php +++ b/Zotlabs/Lib/Enotify.php @@ -758,9 +758,9 @@ class Enotify { // generate a multipart/alternative message header $messageHeader = $params['additionalMailHeader'] . - "From: $fromName <{$params['fromEmail']}>\n" . - "Reply-To: $fromName <{$params['replyTo']}>\n" . - "MIME-Version: 1.0\n" . + "From: $fromName <{$params['fromEmail']}>\r\n" . + "Reply-To: $fromName <{$params['replyTo']}>\r\n" . + "MIME-Version: 1.0\r\n" . "Content-Type: multipart/alternative; boundary=\"{$mimeBoundary}\""; // assemble the final multipart message body with the text and html types included @@ -768,14 +768,14 @@ class Enotify { $htmlBody = chunk_split(base64_encode($params['htmlVersion'])); $multipartMessageBody = - "--" . $mimeBoundary . "\n" . // plain text section - "Content-Type: text/plain; charset=UTF-8\n" . - "Content-Transfer-Encoding: base64\n\n" . - $textBody . "\n" . - "--" . $mimeBoundary . "\n" . // text/html section - "Content-Type: text/html; charset=UTF-8\n" . - "Content-Transfer-Encoding: base64\n\n" . - $htmlBody . "\n" . + "--" . $mimeBoundary . "\r\n" . // plain text section + "Content-Type: text/plain; charset=UTF-8\r\n" . + "Content-Transfer-Encoding: base64\r\n\r\n" . + $textBody . "\r\n" . + "--" . $mimeBoundary . "\r\n" . // text/html section + "Content-Type: text/html; charset=UTF-8\r\n" . + "Content-Transfer-Encoding: base64\r\n\r\n" . + $htmlBody . "\r\n" . "--" . $mimeBoundary . "--\n"; // message ending // send the message diff --git a/include/network.php b/include/network.php index d9703bca6..ab990b477 100644 --- a/include/network.php +++ b/include/network.php @@ -2010,8 +2010,8 @@ function z_mail($params) { $messageHeader = $params['additionalMailHeader'] . - "From: $fromName <{$params['fromEmail']}>\n" . - "Reply-To: $fromName <{$params['replyTo']}>\n" . + "From: $fromName <{$params['fromEmail']}>\r\n" . + "Reply-To: $fromName <{$params['replyTo']}>\r\n" . "Content-Type: text/plain; charset=UTF-8"; // send the message