Diffstat (limited to 'kmicromail/libmailwrapper/smtpwrapper.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 6a1b505..d5a528c 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -182,19 +182,18 @@ int SMTPwrapper::start_smtp_tls() void SMTPwrapper::connect_server() { - const char *server, *user, *pass; + QString server, user, pass; bool ssl; uint16_t port; ssl = false; bool try_tls = true; bool force_tls=false; - server = user = pass = 0; QString failuretext = ""; if (m_smtp || !m_SmtpAccount) { return; } - server = m_SmtpAccount->getServer().latin1(); + server = m_SmtpAccount->getServer(); if ( m_SmtpAccount->ConnectionType() == 2 ) { ssl = true; try_tls = false; @@ -215,10 +214,10 @@ void SMTPwrapper::connect_server() ; // odebug << "Servername " << server << " at port " << port << "" << oendl; if ( ssl ) { ; // odebug << "SSL session" << oendl; - err = mailsmtp_ssl_connect( m_smtp, server, port ); + err = mailsmtp_ssl_connect( m_smtp, server.latin1(), port ); } else { ; // odebug << "No SSL session" << oendl; - err = mailsmtp_socket_connect( m_smtp, server, port ); + err = mailsmtp_socket_connect( m_smtp, server.latin1(), port ); } if ( err != MAILSMTP_NO_ERROR ) { ; // odebug << "Error init connection" << oendl; @@ -258,19 +257,19 @@ void SMTPwrapper::connect_server() login.show(); if ( QDialog::Accepted == login.exec() ) { // ok - user = login.getUser().latin1(); - pass = login.getPassword().latin1(); + user = login.getUser(); + pass = login.getPassword(); } else { result = 0; failuretext=tr("Login aborted - storing mail to localfolder"); } } else { - user = m_SmtpAccount->getUser().latin1(); - pass = m_SmtpAccount->getPassword().latin1(); + user = m_SmtpAccount->getUser(); + pass = m_SmtpAccount->getPassword(); } ; // odebug << "session->auth: " << m_smtp->auth << "" << oendl; if (result) { - err = mailsmtp_auth( m_smtp, (char*)user, (char*)pass ); + err = mailsmtp_auth( m_smtp, (char*)user.latin1(), (char*)pass.latin1() ); if ( err == MAILSMTP_NO_ERROR ) { ; // odebug << "auth ok" << oendl; } else { |