-rw-r--r-- | kmicromail/libmailwrapper/abstractmail.cpp | 3 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/smtpwrapper.cpp | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/kmicromail/libmailwrapper/abstractmail.cpp b/kmicromail/libmailwrapper/abstractmail.cpp index ed5c898..870985e 100644 --- a/kmicromail/libmailwrapper/abstractmail.cpp +++ b/kmicromail/libmailwrapper/abstractmail.cpp @@ -171,32 +171,35 @@ void AbstractMail::downloadNewMails(const FolderP&fromFolder, AbstractMail*targe if ( lfName.isEmpty() ) lfName = acc->getAccountName(); // create local folder if ( !targetMail->createMbox(lfName)) { QMessageBox::critical(0,i18n("Error creating new Folder"), i18n("Error while creating new folder\n%1\n\nCancelling action.").arg(lfName)); return; } QValueList<RecMailP> t; listMessages(fromFolder->getName(),t,acc->getMaxMailSize() ); if ( t.count() == 0 ) { qDebug("There are no new messages %s", fromFolder->getName().latin1()); Global::statusMessage(i18n("There are no new messages")); return; } + Global::statusMessage(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); + qDebug(i18n("%1 :Downloading mails..."). arg(acc->getAccountName())); + qApp->processEvents(); QValueList<RecMailP> e; targetMail->listMessages(lfName,e,acc->getMaxMailSize() ); //qDebug("target has mails %d ", e.count()); QValueList<RecMailP> n; int iii = 0; int count = t.count(); while (iii < count ) { RecMailP r = (*t.at( iii )); bool found = false; int jjj = 0; int countE = e.count(); while (jjj < countE ) { RecMailP re = (*e.at( jjj )); if ( re->isEqual(r) ) { found = true; break; diff --git a/kmicromail/libmailwrapper/smtpwrapper.cpp b/kmicromail/libmailwrapper/smtpwrapper.cpp index 845c71c..448a2e9 100644 --- a/kmicromail/libmailwrapper/smtpwrapper.cpp +++ b/kmicromail/libmailwrapper/smtpwrapper.cpp @@ -193,32 +193,33 @@ void SMTPwrapper::connect_server() bool ssl; uint16_t port; ssl = false; bool try_tls = false; bool force_tls=false; QString failuretext = ""; if (m_smtp || !m_SmtpAccount) { return; } server = m_SmtpAccount->getServer(); if ( m_SmtpAccount->ConnectionType() == 3 ) { ssl = true; try_tls = false; } else if (m_SmtpAccount->ConnectionType() == 2) { force_tls = true; + try_tls = true; } else if (m_SmtpAccount->ConnectionType() == 1) { try_tls = true; } int result = 1; port = m_SmtpAccount->getPort().toUInt(); m_smtp = mailsmtp_new( 20, &progress ); if ( m_smtp == NULL ) { /* no failure message cause this happens when problems with memory - than we we can not display any messagebox */ return; } int err = MAILSMTP_NO_ERROR; ; // odebug << "Servername " << server << " at port " << port << "" << oendl; if ( ssl ) { @@ -232,41 +233,43 @@ void SMTPwrapper::connect_server() qDebug("Error init SMTP connection" ); failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); result = 0; } qDebug("SMTP connection inited "); /* switch to tls after init 'cause there it will send the ehlo */ if (result) { err = mailsmtp_init( m_smtp ); if (err != MAILSMTP_NO_ERROR) { result = 0; qDebug("Error init SMTP connection "); failuretext = i18n("Error init SMTP connection:\n%1").arg(mailsmtpError(err)); } } if (result && try_tls) { - qDebug("Smpt: Try tls "); + qDebug("Smpt: Try TLS... "); err = start_smtp_tls(); if (err != MAILSMTP_NO_ERROR) { try_tls = false; - qDebug("no tls "); + qDebug("Smpt: No TLS possible "); } else { err = mailesmtp_ehlo(m_smtp); if ( err != MAILSMTP_NO_ERROR ) result = 0; + else + qDebug("Smpt: Using TLS "); } } //qDebug("mailesmtp_ehlo %d ",err ); if (!try_tls && force_tls) { result = 0; failuretext = i18n("Error init SMTP tls:%1").arg(mailsmtpError(err)); } if (result==1 && m_SmtpAccount->getLogin() ) { ; // odebug << "smtp with auth" << oendl; if ( m_SmtpAccount->getUser().isEmpty() || m_SmtpAccount->getPassword().isEmpty() ) { // get'em LoginDialog login( m_SmtpAccount->getUser(), m_SmtpAccount->getPassword(), NULL, 0, true ); login.show(); if ( QDialog::Accepted == login.exec() ) { |