Diffstat (limited to 'kmicromail/libmailwrapper/imapwrapper.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | kmicromail/libmailwrapper/imapwrapper.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/libmailwrapper/imapwrapper.cpp b/kmicromail/libmailwrapper/imapwrapper.cpp index 3aec13d..110583f 100644 --- a/kmicromail/libmailwrapper/imapwrapper.cpp +++ b/kmicromail/libmailwrapper/imapwrapper.cpp | |||
@@ -152,50 +152,51 @@ void IMAPwrapper::login() | |||
152 | } else { | 152 | } else { |
153 | // cancel | 153 | // cancel |
154 | return; | 154 | return; |
155 | } | 155 | } |
156 | } else { | 156 | } else { |
157 | user = account->getUser(); | 157 | user = account->getUser(); |
158 | pass = account->getPassword(); | 158 | pass = account->getPassword(); |
159 | } | 159 | } |
160 | 160 | ||
161 | m_imap = mailimap_new( 20, &imap_progress ); | 161 | m_imap = mailimap_new( 20, &imap_progress ); |
162 | 162 | ||
163 | /* connect */ | 163 | /* connect */ |
164 | bool ssl = false; | 164 | bool ssl = false; |
165 | bool try_tls = false; | 165 | bool try_tls = false; |
166 | bool force_tls = false; | 166 | bool force_tls = false; |
167 | 167 | ||
168 | if ( account->ConnectionType() == 2 ) { | 168 | if ( account->ConnectionType() == 2 ) { |
169 | ssl = true; | 169 | ssl = true; |
170 | } | 170 | } |
171 | if (account->ConnectionType()==1) { | 171 | if (account->ConnectionType()==1) { |
172 | force_tls = true; | 172 | force_tls = true; |
173 | } | 173 | } |
174 | 174 | ||
175 | if ( ssl ) { | 175 | if ( ssl ) { |
176 | //qDebug("using ssl "); | 176 | qDebug("using ssl "); |
177 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); | 177 | err = mailimap_ssl_connect( m_imap, (char*)server.latin1(), port ); |
178 | qDebug("back "); | ||
178 | } else { | 179 | } else { |
179 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); | 180 | err = mailimap_socket_connect( m_imap, (char*)server.latin1(), port ); |
180 | } | 181 | } |
181 | 182 | ||
182 | if ( err != MAILIMAP_NO_ERROR && | 183 | if ( err != MAILIMAP_NO_ERROR && |
183 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && | 184 | err != MAILIMAP_NO_ERROR_AUTHENTICATED && |
184 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { | 185 | err != MAILIMAP_NO_ERROR_NON_AUTHENTICATED ) { |
185 | QString failure = ""; | 186 | QString failure = ""; |
186 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { | 187 | if (err == MAILIMAP_ERROR_CONNECTION_REFUSED) { |
187 | failure="Connection refused"; | 188 | failure="Connection refused"; |
188 | } else { | 189 | } else { |
189 | failure="Unknown failure"; | 190 | failure="Unknown failure"; |
190 | } | 191 | } |
191 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); | 192 | Global::statusMessage(i18n("error connecting imap server: %1").arg(failure)); |
192 | mailimap_free( m_imap ); | 193 | mailimap_free( m_imap ); |
193 | m_imap = 0; | 194 | m_imap = 0; |
194 | return; | 195 | return; |
195 | } | 196 | } |
196 | 197 | ||
197 | if (!ssl) { | 198 | if (!ssl) { |
198 | try_tls = start_tls(force_tls); | 199 | try_tls = start_tls(force_tls); |
199 | } | 200 | } |
200 | 201 | ||
201 | bool ok = true; | 202 | bool ok = true; |