Skip to content

Commit

Permalink
Use Headers::FOLDING when folding
Browse files Browse the repository at this point in the history
Signed-off-by: Elan Ruusamäe <[email protected]>
  • Loading branch information
glensc committed Feb 27, 2021
1 parent 9db0add commit dec6db4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Protocol/Smtp.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

namespace Laminas\Mail\Protocol;

use Laminas\Mail\Headers;

/**
* SMTP implementation of Laminas\Mail\Protocol\AbstractProtocol
*
Expand Down Expand Up @@ -335,7 +337,7 @@ public function data($data)
if (strlen($line) > 998) {
// Long lines are "folded" by inserting "<CR><LF><SPACE>"
// 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);
}
Expand Down

0 comments on commit dec6db4

Please sign in to comment.