clean up debugs and fix encryption error on SSL connection

This commit is contained in:
Simon Stürz 2014-10-21 21:00:00 +02:00 committed by Michael Zanetti
parent a056371a4d
commit 7a6dacff9f

View File

@ -93,7 +93,6 @@ void SmtpClient::readData()
switch (m_state) { switch (m_state) {
case InitState: case InitState:
if(responseLine == "220"){ if(responseLine == "220"){
qDebug() << "Init";
send("EHLO localhost"); send("EHLO localhost");
if(m_encryptionType == EncryptionNone){ if(m_encryptionType == EncryptionNone){
m_state = AuthentificationState; m_state = AuthentificationState;
@ -111,14 +110,16 @@ void SmtpClient::readData()
break; break;
case HandShakeState: case HandShakeState:
if(responseLine == "250"){ if(responseLine == "250"){
qDebug() << "Handshake"; if(!m_socket->isEncrypted() && m_encryptionType != EncryptionNone){
m_socket->startClientEncryption(); m_socket->startClientEncryption();
}
send("EHLO localhost"); send("EHLO localhost");
m_state = AuthentificationState; m_state = AuthentificationState;
} }
if(responseLine == "220"){ if(responseLine == "220"){
qDebug() << "TLS Handshake"; if(!m_socket->isEncrypted() && m_encryptionType != EncryptionNone){
m_socket->startClientEncryption(); m_socket->startClientEncryption();
}
send("EHLO localhost"); send("EHLO localhost");
m_state = AuthentificationState; m_state = AuthentificationState;
} }
@ -131,7 +132,6 @@ void SmtpClient::readData()
break; break;
case AuthentificationState: case AuthentificationState:
if(responseLine == "250"){ if(responseLine == "250"){
qDebug() << "Autentificate";
if(m_authMethod == AuthLogin){ if(m_authMethod == AuthLogin){
send("AUTH LOGIN"); send("AUTH LOGIN");
m_state = UserState; m_state = UserState;