aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2013-07-24 11:30:57 +0000
committerVincent Richard <[email protected]>2013-07-24 11:30:57 +0000
commit820d44377e20c3a2ea31f848636c6f49877bdf7b (patch)
tree6ed1535f8a5438b065c7da62ee0fd82889d4f7c9
parentReturn real message UID from IMAP server. Added function to return the curren... (diff)
downloadvmime-820d44377e20c3a2ea31f848636c6f49877bdf7b.tar.gz
vmime-820d44377e20c3a2ea31f848636c6f49877bdf7b.zip
Added SMTP service properties to allow disabling PIPELINING and CHUNKING extensions.
-rw-r--r--doc/book/net.tex6
-rw-r--r--src/net/smtp/SMTPServiceInfos.cpp6
-rw-r--r--src/net/smtp/SMTPTransport.cpp9
-rw-r--r--vmime/net/smtp/SMTPServiceInfos.hpp3
4 files changed, 22 insertions, 2 deletions
diff --git a/doc/book/net.tex b/doc/book/net.tex
index 7653b48e..19a6ccb9 100644
--- a/doc/book/net.tex
+++ b/doc/book/net.tex
@@ -190,6 +190,12 @@ authentication is not used). \\
transport.smtp.options.need-authentication & bool & Set to \emph{true} if
the server requires to authenticate before sending messages. \\
\hline
+transport.smtp.options.pipelining & bool & Set to {\vcode false} to disable
+command pipelining, if the server supports it (default is {\vcode true}). \\
+\hline
+transport.smtp.options.chunking & bool & Set to {\vcode false} to disable
+CHUNKING extension, if the server supports it (default is {\vcode true}). \\
+\hline
% sendmail
\multicolumn{3}{|c|}{sendmail} \\
\hline
diff --git a/src/net/smtp/SMTPServiceInfos.cpp b/src/net/smtp/SMTPServiceInfos.cpp
index 2927495f..532bb8b8 100644
--- a/src/net/smtp/SMTPServiceInfos.cpp
+++ b/src/net/smtp/SMTPServiceInfos.cpp
@@ -61,6 +61,9 @@ const SMTPServiceInfos::props& SMTPServiceInfos::getProperties() const
property("options.sasl.fallback", serviceInfos::property::TYPE_BOOLEAN, "false"),
#endif // VMIME_HAVE_SASL_SUPPORT
+ property("options.pipelining", serviceInfos::property::TYPE_BOOLEAN, "true"),
+ property("options.chunking", serviceInfos::property::TYPE_BOOLEAN, "true"),
+
// Common properties
property(serviceInfos::property::AUTH_USERNAME, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::AUTH_PASSWORD, serviceInfos::property::FLAG_REQUIRED),
@@ -83,6 +86,9 @@ const SMTPServiceInfos::props& SMTPServiceInfos::getProperties() const
property("options.sasl.fallback", serviceInfos::property::TYPE_BOOLEAN, "false"),
#endif // VMIME_HAVE_SASL_SUPPORT
+ property("options.pipelining", serviceInfos::property::TYPE_BOOLEAN, "true"),
+ property("options.chunking", serviceInfos::property::TYPE_BOOLEAN, "true"),
+
// Common properties
property(serviceInfos::property::AUTH_USERNAME, serviceInfos::property::FLAG_REQUIRED),
property(serviceInfos::property::AUTH_PASSWORD, serviceInfos::property::FLAG_REQUIRED),
diff --git a/src/net/smtp/SMTPTransport.cpp b/src/net/smtp/SMTPTransport.cpp
index 46e47f35..c3431a43 100644
--- a/src/net/smtp/SMTPTransport.cpp
+++ b/src/net/smtp/SMTPTransport.cpp
@@ -169,7 +169,9 @@ void SMTPTransport::sendEnvelope
const bool needReset = m_needReset;
- const bool hasPipelining = m_connection->hasExtension("PIPELINING");
+ const bool hasPipelining = m_connection->hasExtension("PIPELINING") &&
+ getInfos().getPropertyValue <bool>(getSession(),
+ dynamic_cast <const SMTPServiceInfos&>(getInfos()).getProperties().PROPERTY_OPTIONS_PIPELINING);
ref <SMTPResponse> resp;
ref <SMTPCommandSet> commands = SMTPCommandSet::create(hasPipelining);
@@ -334,7 +336,10 @@ void SMTPTransport::send
// If CHUNKING is not supported, generate the message to a temporary
// buffer then use the send() method which takes an inputStream
- if (!m_connection->hasExtension("CHUNKING"))
+ if (!m_connection->hasExtension("CHUNKING") ||
+ !getInfos().getPropertyValue <bool>(getSession(),
+ dynamic_cast <const SMTPServiceInfos&>(getInfos()).getProperties().PROPERTY_OPTIONS_CHUNKING))
+
{
std::ostringstream oss;
utility::outputStreamAdapter ossAdapter(oss);
diff --git a/vmime/net/smtp/SMTPServiceInfos.hpp b/vmime/net/smtp/SMTPServiceInfos.hpp
index 0f38f841..f783194d 100644
--- a/vmime/net/smtp/SMTPServiceInfos.hpp
+++ b/vmime/net/smtp/SMTPServiceInfos.hpp
@@ -57,6 +57,9 @@ public:
serviceInfos::property PROPERTY_OPTIONS_SASL_FALLBACK;
#endif // VMIME_HAVE_SASL_SUPPORT
+ serviceInfos::property PROPERTY_OPTIONS_PIPELINING;
+ serviceInfos::property PROPERTY_OPTIONS_CHUNKING;
+
// Common properties
serviceInfos::property PROPERTY_AUTH_USERNAME;
serviceInfos::property PROPERTY_AUTH_PASSWORD;