aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-06-22 08:42:36 +0000
committerVincent Richard <[email protected]>2013-06-22 08:42:36 +0000
commit87f6acb0b5e291f1b59b2b007a5c2226a6d2362f (patch)
treec8149c1c204f2032efcedc101990e621e6ec9b2a
parentAdded support for CHUNKING SMTP extension (RFC-3030). More robust unit tests ... (diff)
downloadvmime-87f6acb0b5e291f1b59b2b007a5c2226a6d2362f.tar.gz
vmime-87f6acb0b5e291f1b59b2b007a5c2226a6d2362f.zip
Return after sending message when sending is supported.
-rw-r--r--src/net/smtp/SMTPTransport.cpp1
-rw-r--r--tests/net/smtp/SMTPTransportTest.cpp3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index fb951bad..40b6375c 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -308,6 +308,7 @@ void SMTPTransport::send
utility::inputStreamStringAdapter isAdapter(str);
send(expeditor, recipients, isAdapter, str.length(), progress, sender);
+ return;
}
// Send message envelope
diff --git a/tests/net/smtp/SMTPTransportTest.cpp b/tests/net/smtp/SMTPTransportTest.cpp
index e1c32a9a..c91ffe90 100644
--- a/tests/net/smtp/SMTPTransportTest.cpp
+++ b/tests/net/smtp/SMTPTransportTest.cpp
@@ -211,6 +211,7 @@ public:
else if (cmd == "MAIL")
{
VASSERT("Client must send the HELO command", m_heloSent);
+ VASSERT("The MAIL command must be sent only one time", !m_mailSent);
VASSERT_EQ("MAIL", std::string("MAIL FROM:<[email protected]>"), line);
@@ -399,6 +400,8 @@ public:
}
else if (cmd == "MAIL")
{
+ VASSERT("The MAIL command must be sent only one time", !m_mailSent);
+
localSend("250 OK\r\n");
m_mailSent = true;