diff options
author | Vincent Richard <[email protected]> | 2005-04-26 19:46:36 +0000 |
---|---|---|
committer | Vincent Richard <[email protected]> | 2005-04-26 19:46:36 +0000 |
commit | 44ff5f63a1fda3a7edbf7a2d8b72504cfc88f243 (patch) | |
tree | 3f67b77105478b2b59322ea4d3e5cf6fbf58cb09 | |
parent | Moved generic implementation of send() to 'transport'. (diff) | |
download | vmime-44ff5f63a1fda3a7edbf7a2d8b72504cfc88f243.tar.gz vmime-44ff5f63a1fda3a7edbf7a2d8b72504cfc88f243.zip |
Added missing case when replacing '.' in send().
-rw-r--r-- | src/messaging/smtp/SMTPTransport.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/messaging/smtp/SMTPTransport.cpp b/src/messaging/smtp/SMTPTransport.cpp index 58e000ac..16fc1454 100644 --- a/src/messaging/smtp/SMTPTransport.cpp +++ b/src/messaging/smtp/SMTPTransport.cpp @@ -310,6 +310,7 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients progress->start(total); char buffer[65536]; + char previousChar = '\0'; while (!is.eof()) { @@ -322,7 +323,13 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients while ((pos = std::find(pos, end, '.')) != end) { - if (pos > buffer && *(pos - 1) == '\n') + // '\n' in the previous buffer, '.' in the current one + if (pos == buffer && previousChar == '\n') + { + m_socket->sendRaw(".", 1); + } + // Both '\n' and '.' are in the current buffer + else if (pos > buffer && *(pos - 1) == '\n') { m_socket->sendRaw(start, pos - start); m_socket->sendRaw(".", 1); @@ -333,6 +340,11 @@ void SMTPTransport::send(const mailbox& expeditor, const mailboxList& recipients ++pos; } + if (read > 0) + previousChar = buffer[read - 1]; + else + previousChar = '\0'; + // Send the remaining data m_socket->sendRaw(start, end - start); |