summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--bin/kdepim/WhatsNew.txt4
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.cpp13
-rw-r--r--kmicromail/libmailwrapper/imapwrapper.h2
3 files changed, 15 insertions, 4 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
@@ -4,8 +4,12 @@ Info about the changes in new versions of KDE-Pim/Pi
Added global application font settings
(for all KDE-Pim/Pi apps) to the general 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 ************
Some bugfixes in the pi-sync mode.
Added German translation for pi-sync mode.
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
@@ -122,9 +122,9 @@ bool IMAPwrapper::start_tls(bool force_tls)
}
return try_tls;
}
-void IMAPwrapper::login()
+void IMAPwrapper::login(bool tryTLS) // = true)
{
QString server, user, pass;
uint16_t port;
int err = MAILIMAP_NO_ERROR;
@@ -194,13 +194,13 @@ void IMAPwrapper::login()
mailimap_free( m_imap );
m_imap = 0;
return;
}
-
+ if ( tryTLS ) {
if (!ssl) {
try_tls = start_tls(force_tls);
}
-
+ }
bool ok = true;
if (force_tls && !try_tls) {
Global::statusMessage(i18n("Server has no TLS support!"));
ok = false;
@@ -211,8 +211,15 @@ void IMAPwrapper::login()
if (ok) {
err = mailimap_login_simple( m_imap, (char*)user.latin1(), (char*)pass.latin1() );
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));
ok = false;
}
}
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
@@ -55,9 +55,9 @@ public:
virtual Account* getAccount() { return account; };
protected:
RecMail*parse_list_result(mailimap_msg_att*);
- void login();
+ void login(bool tryTLS = true);
bool start_tls(bool force=true);
virtual QString fetchTextPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call=false,const QString&enc="");
virtual encodedString*fetchRawPart(const RecMailP&mail,const QValueList<int>&path,bool internal_call);