From dec6db4d78d6cc32bedf88618b7d4ab012aa7c6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Sat, 27 Feb 2021 14:37:03 +0200 Subject: [PATCH] Use Headers::FOLDING when folding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Elan Ruusamäe --- src/Protocol/Smtp.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Protocol/Smtp.php b/src/Protocol/Smtp.php index 00104973..5a11fadb 100644 --- a/src/Protocol/Smtp.php +++ b/src/Protocol/Smtp.php @@ -8,6 +8,8 @@ namespace Laminas\Mail\Protocol; +use Laminas\Mail\Headers; + /** * SMTP implementation of Laminas\Mail\Protocol\AbstractProtocol * @@ -335,7 +337,7 @@ public function data($data) if (strlen($line) > 998) { // Long lines are "folded" by inserting "" // https://tools.ietf.org/html/rfc5322#section-2.2.3 - $line = substr(chunk_split($line, 998, "\r\n "), 0, -3); + $line = substr(chunk_split($line, 998, Headers::FOLDING), 0, -strlen(Headers::FOLDING)); } $this->_send($line); }