-rw-r--r-- | bin/kdepim/WhatsNew.txt | 4 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 17 | ||||
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.h | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 77f5829..1a3f827 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -7,2 +7,6 @@ Added global application font settings +Fixed a problem in OM/Pi when trying to login to some IMAP servers +(like the IMAP server of Apple: mail.mac.com ) + + ********** VERSION 2.0.6 ************ diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 93fb7de..09e52b8 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp @@ -125,3 +125,3 @@ bool IMAPwrapper::start_tls(bool force_tls) -void IMAPwrapper::login() +void IMAPwrapper::login(bool tryTLS) // = true) { @@ -197,7 +197,7 @@ void IMAPwrapper::login() } - - if (!ssl) { - try_tls = start_tls(force_tls); + if ( tryTLS ) { + if (!ssl) { + try_tls = start_tls(force_tls); + } } - bool ok = true; @@ -214,2 +214,9 @@ void IMAPwrapper::login() if ( err != MAILIMAP_NO_ERROR ) { + if ( tryTLS && !force_tls && !try_tls ) { + err = mailimap_close( m_imap ); + mailimap_free( m_imap ); + m_imap = 0; + login( false ); + return; + } Global::statusMessage(i18n("error logging in imap server: %1").arg(m_imap->imap_response)); diff --git a/kmicromail/libmailwrapper/imapwrapper.h b/kmicromail/libmailwrapper/imapwrapper.h index 5535d8d..31c60a8 100644 --- a/kmicromail/libmailwrapper/imapwrapper.h +++ b/kmicromail/libmailwrapper/imapwrapper.h @@ -58,3 +58,3 @@ protected: RecMail*parse_list_result(mailimap_msg_att*); - void login(); + void login(bool tryTLS = true); bool start_tls(bool force=true); |