diff options
author | Don Sanders <don.sanders@nokia.com> | 2011-06-08 18:54:14 +0300 |
---|---|---|
committer | Don Sanders <don.sanders@nokia.com> | 2011-06-08 18:54:14 +0300 |
commit | 1fb93e6efa0ecb6c857301d084498de3bb51edf4 (patch) | |
tree | bb4869f008dd4c7c232960ed29b047f36d3f66c3 | |
parent | b17e950047e846e331e80944fd19c8e282637aae (diff) |
Fix for NB#195729 smtp authentication error not shown when account is configured with wrong settings
Patch from Eric.
-rw-r--r-- | src/plugins/messageservices/smtp/smtpclient.cpp | 16 | ||||
-rw-r--r-- | src/plugins/messageservices/smtp/smtpclient.h | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/plugins/messageservices/smtp/smtpclient.cpp b/src/plugins/messageservices/smtp/smtpclient.cpp index c6453d58..93f18354 100644 --- a/src/plugins/messageservices/smtp/smtpclient.cpp +++ b/src/plugins/messageservices/smtp/smtpclient.cpp @@ -107,6 +107,7 @@ SmtpClient::SmtpClient(QObject* parent) , transport(0) , temporaryFile(0) , waitingForBytes(0) + , notUsingAuth(false) { connect(QMailStore::instance(), SIGNAL(accountsUpdated(const QMailAccountIdList&)), this, SLOT(accountsUpdated(const QMailAccountIdList&))); @@ -319,6 +320,15 @@ void SmtpClient::incomingData() QString response = transport->readLine(); qMailLog(SMTP) << "RECV:" << response.left(response.length() - 2) << flush; + if (notUsingAuth) { + if (response.startsWith("530")) { + operationFailed(QMailServiceAction::Status::ErrConfiguration, response); + return; + } else { + notUsingAuth = false; + } + } + if (outstandingResponses > 0) { --outstandingResponses; } @@ -489,6 +499,12 @@ void SmtpClient::nextAction(const QString &response) sendCommand(authCmd); status = Authenticating; } else { + foreach (QString const& capability, capabilities) { + if (capability.startsWith("AUTH", Qt::CaseInsensitive)) { + notUsingAuth = true; + break; + } + } status = Authenticated; nextAction(QString()); } diff --git a/src/plugins/messageservices/smtp/smtpclient.h b/src/plugins/messageservices/smtp/smtpclient.h index 9a32f925..c52c261a 100644 --- a/src/plugins/messageservices/smtp/smtpclient.h +++ b/src/plugins/messageservices/smtp/smtpclient.h @@ -145,6 +145,7 @@ private: bool linestart; QString bufferedResponse; + bool notUsingAuth; }; #endif |