From 0938509c09510a431386fa852aa2d831971a24d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20St=C3=BCrz?= Date: Tue, 21 Oct 2014 21:00:00 +0200 Subject: [PATCH] clean up debugs and fix encryption error on SSL connection --- .../deviceplugins/mailnotification/smtpclient.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/plugins/deviceplugins/mailnotification/smtpclient.cpp b/plugins/deviceplugins/mailnotification/smtpclient.cpp index c75fdd43..a99b8a5a 100644 --- a/plugins/deviceplugins/mailnotification/smtpclient.cpp +++ b/plugins/deviceplugins/mailnotification/smtpclient.cpp @@ -119,14 +119,16 @@ void SmtpClient::readData() break; case HandShakeState: if(responseLine == "250"){ - qDebug() << "Handshake"; - m_socket->startClientEncryption(); + if(!m_socket->isEncrypted() && m_encryptionType != EncryptionNone){ + m_socket->startClientEncryption(); + } send("EHLO localhost"); m_state = AuthentificationState; } if(responseLine == "220"){ - qDebug() << "TLS Handshake"; - m_socket->startClientEncryption(); + if(!m_socket->isEncrypted() && m_encryptionType != EncryptionNone){ + m_socket->startClientEncryption(); + } send("EHLO localhost"); m_state = AuthentificationState; } @@ -152,7 +154,7 @@ void SmtpClient::readData() break; case AuthentificationState: if(responseLine == "250"){ - if(m_authMethod == AuthMethodLogin){ + if(m_authMethod == AuthLogin){ send("AUTH LOGIN"); m_state = UserState; break;