From 7264336171cee7a7246027f00cf0053dee3198b6 Mon Sep 17 00:00:00 2001 From: Guenter Obiltschnig Date: Mon, 22 Apr 2013 07:18:23 +0200 Subject: [PATCH] fixed GH#155: MailOutputStream mangles consecutive newline sequences --- Net/src/MailStream.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Net/src/MailStream.cpp b/Net/src/MailStream.cpp index 892a88879..05be03f41 100644 --- a/Net/src/MailStream.cpp +++ b/Net/src/MailStream.cpp @@ -176,7 +176,9 @@ int MailStreamBuf::writeToDevice(char c) } else if (_state == ST_CR_LF_DOT) { - _pOstr->write("\r\n..", 4); + // buffer contains one or more CR-LF pairs + _pOstr->write(_buffer.data(), (std::streamsize) _buffer.length()); + _pOstr->write("..", 2); _state = ST_DATA; _buffer.clear(); }