-rw-r--r-- | noncore/net/mail/libmailwrapper/imapwrapper.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/net/mail/libmailwrapper/imapwrapper.cpp b/noncore/net/mail/libmailwrapper/imapwrapper.cpp index 8e5212b..576804d 100644 --- a/noncore/net/mail/libmailwrapper/imapwrapper.cpp +++ b/noncore/net/mail/libmailwrapper/imapwrapper.cpp | |||
@@ -68,19 +68,21 @@ bool IMAPwrapper::start_tls(bool force_tls) | |||
68 | } | 68 | } |
69 | } | 69 | } |
70 | } | 70 | } |
71 | if (cap_data) { | 71 | if (cap_data) { |
72 | mailimap_capability_data_free(cap_data); | 72 | mailimap_capability_data_free(cap_data); |
73 | } | 73 | } |
74 | if (try_tls) { | 74 | if (try_tls) { |
75 | err = mailimap_starttls(m_imap); | 75 | err = mailimap_starttls(m_imap); |
76 | if (err != MAILIMAP_NO_ERROR && force_tls) { | 76 | if (err != MAILIMAP_NO_ERROR) { |
77 | Global::statusMessage(tr("Server has no TLS support!")); | 77 | if (force_tls) { |
78 | odebug << "Server has no TLS support!" << oendl; | 78 | Global::statusMessage(tr("Server has no TLS support!")); |
79 | odebug << "Server has no TLS support!" << oendl; | ||
80 | } | ||
79 | try_tls = false; | 81 | try_tls = false; |
80 | } else { | 82 | } else { |
81 | mailstream_low * low; | 83 | mailstream_low * low; |
82 | mailstream_low * new_low; | 84 | mailstream_low * new_low; |
83 | low = mailstream_get_low(m_imap->imap_stream); | 85 | low = mailstream_get_low(m_imap->imap_stream); |
84 | if (!low) { | 86 | if (!low) { |
85 | try_tls = false; | 87 | try_tls = false; |
86 | } else { | 88 | } else { |
@@ -180,17 +182,17 @@ void IMAPwrapper::login() | |||
180 | odebug << "Server has no TLS support!" << oendl; | 182 | odebug << "Server has no TLS support!" << oendl; |
181 | ok = false; | 183 | ok = false; |
182 | } | 184 | } |
183 | 185 | ||
184 | 186 | ||
185 | /* login */ | 187 | /* login */ |
186 | 188 | ||
187 | if (ok) { | 189 | if (ok) { |
188 | err = mailimap_login_simple( m_imap, (char*)user, (char*)pass ); | 190 | err = mailimap_login( m_imap, (char*)user, (char*)pass ); |
189 | if ( err != MAILIMAP_NO_ERROR ) { | 191 | if ( err != MAILIMAP_NO_ERROR ) { |
190 | Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response)); | 192 | Global::statusMessage(tr("error logging in imap server: %1").arg(m_imap->imap_response)); |
191 | ok = false; | 193 | ok = false; |
192 | } | 194 | } |
193 | } | 195 | } |
194 | if (!ok) { | 196 | if (!ok) { |
195 | err = mailimap_close( m_imap ); | 197 | err = mailimap_close( m_imap ); |
196 | mailimap_free( m_imap ); | 198 | mailimap_free( m_imap ); |