-rw-r--r-- | kmicromail/libetpan/generic/pop3driver.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kmicromail/libetpan/generic/pop3driver.c b/kmicromail/libetpan/generic/pop3driver.c index 475dfcc..a4a4893 100644 --- a/kmicromail/libetpan/generic/pop3driver.c +++ b/kmicromail/libetpan/generic/pop3driver.c | |||
@@ -203,120 +203,120 @@ static int pop3driver_starttls(mailsession * session) | |||
203 | r = mailpop3_stls(pop3); | 203 | r = mailpop3_stls(pop3); |
204 | 204 | ||
205 | switch (r) { | 205 | switch (r) { |
206 | case MAILPOP3_NO_ERROR: | 206 | case MAILPOP3_NO_ERROR: |
207 | break; | 207 | break; |
208 | default: | 208 | default: |
209 | return pop3driver_pop3_error_to_mail_error(r); | 209 | return pop3driver_pop3_error_to_mail_error(r); |
210 | } | 210 | } |
211 | 211 | ||
212 | low = mailstream_get_low(pop3->pop3_stream); | 212 | low = mailstream_get_low(pop3->pop3_stream); |
213 | fd = mailstream_low_get_fd(low); | 213 | fd = mailstream_low_get_fd(low); |
214 | if (fd == -1) | 214 | if (fd == -1) |
215 | return MAIL_ERROR_STREAM; | 215 | return MAIL_ERROR_STREAM; |
216 | 216 | ||
217 | new_low = mailstream_low_ssl_open(fd); | 217 | new_low = mailstream_low_ssl_open(fd); |
218 | if (new_low == NULL) | 218 | if (new_low == NULL) |
219 | return MAIL_ERROR_STREAM; | 219 | return MAIL_ERROR_STREAM; |
220 | mailstream_low_free(low); | 220 | mailstream_low_free(low); |
221 | mailstream_set_low(pop3->pop3_stream, new_low); | 221 | mailstream_set_low(pop3->pop3_stream, new_low); |
222 | 222 | ||
223 | return MAIL_NO_ERROR; | 223 | return MAIL_NO_ERROR; |
224 | } | 224 | } |
225 | 225 | ||
226 | static int pop3driver_parameters(mailsession * session, | 226 | static int pop3driver_parameters(mailsession * session, |
227 | int id, void * value) | 227 | int id, void * value) |
228 | { | 228 | { |
229 | struct pop3_session_state_data * data; | 229 | struct pop3_session_state_data * data; |
230 | 230 | ||
231 | data = get_data(session); | 231 | data = get_data(session); |
232 | 232 | ||
233 | switch (id) { | 233 | switch (id) { |
234 | case POP3DRIVER_SET_AUTH_TYPE: | 234 | case POP3DRIVER_SET_AUTH_TYPE: |
235 | { | 235 | { |
236 | int * param; | 236 | int * param; |
237 | 237 | ||
238 | param = value; | 238 | param = value; |
239 | 239 | ||
240 | data->pop3_auth_type = * param; | 240 | data->pop3_auth_type = * param; |
241 | return MAIL_NO_ERROR; | 241 | return MAIL_NO_ERROR; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | return MAIL_ERROR_INVAL; | 245 | return MAIL_ERROR_INVAL; |
246 | } | 246 | } |
247 | 247 | ||
248 | static int pop3driver_login(mailsession * session, | 248 | static int pop3driver_login(mailsession * session, |
249 | char * userid, char * password) | 249 | char * userid, char * password) |
250 | { | 250 | { |
251 | int r; | 251 | int r;int ret ; |
252 | carray * msg_tab; | 252 | carray * msg_tab; |
253 | struct pop3_session_state_data * data; | 253 | struct pop3_session_state_data * data; |
254 | 254 | ||
255 | data = get_data(session); | 255 | data = get_data(session); |
256 | 256 | ||
257 | switch (data->pop3_auth_type) { | 257 | switch (data->pop3_auth_type) { |
258 | case POP3DRIVER_AUTH_TYPE_TRY_APOP: | 258 | case POP3DRIVER_AUTH_TYPE_TRY_APOP: |
259 | r = mailpop3_login_apop(get_pop3_session(session), userid, password); | 259 | r = mailpop3_login_apop(get_pop3_session(session), userid, password); |
260 | if (r != MAILPOP3_NO_ERROR) | 260 | if (r != MAILPOP3_NO_ERROR) |
261 | r = mailpop3_login(get_pop3_session(session), userid, password); | 261 | r = mailpop3_login(get_pop3_session(session), userid, password); |
262 | break; | 262 | break; |
263 | 263 | ||
264 | case POP3DRIVER_AUTH_TYPE_APOP: | 264 | case POP3DRIVER_AUTH_TYPE_APOP: |
265 | r = mailpop3_login_apop(get_pop3_session(session), userid, password); | 265 | r = mailpop3_login_apop(get_pop3_session(session), userid, password); |
266 | break; | 266 | break; |
267 | 267 | ||
268 | default: | 268 | default: |
269 | case POP3DRIVER_AUTH_TYPE_PLAIN: | 269 | case POP3DRIVER_AUTH_TYPE_PLAIN: |
270 | r = mailpop3_login(get_pop3_session(session), userid, password); | 270 | r = mailpop3_login(get_pop3_session(session), userid, password); |
271 | break; | 271 | break; |
272 | } | 272 | } |
273 | // LR 2 lines | 273 | // LR 2 lines |
274 | int ret = pop3driver_pop3_error_to_mail_error(r); | 274 | ret = pop3driver_pop3_error_to_mail_error(r); |
275 | if ( ret == MAIL_NO_ERROR ) | 275 | if ( ret == MAIL_NO_ERROR ) |
276 | mailpop3_list(get_pop3_session(session), &msg_tab); | 276 | mailpop3_list(get_pop3_session(session), &msg_tab); |
277 | 277 | ||
278 | // LR | 278 | // LR |
279 | return ret; | 279 | return ret; |
280 | } | 280 | } |
281 | 281 | ||
282 | static int pop3driver_logout(mailsession * session) | 282 | static int pop3driver_logout(mailsession * session) |
283 | { | 283 | { |
284 | int r; | 284 | int r; |
285 | 285 | ||
286 | r = mailpop3_quit(get_pop3_session(session)); | 286 | r = mailpop3_quit(get_pop3_session(session)); |
287 | 287 | ||
288 | return pop3driver_pop3_error_to_mail_error(r); | 288 | return pop3driver_pop3_error_to_mail_error(r); |
289 | } | 289 | } |
290 | 290 | ||
291 | static int pop3driver_noop(mailsession * session) | 291 | static int pop3driver_noop(mailsession * session) |
292 | { | 292 | { |
293 | int r; | 293 | int r; |
294 | 294 | ||
295 | r = mailpop3_noop(get_pop3_session(session)); | 295 | r = mailpop3_noop(get_pop3_session(session)); |
296 | 296 | ||
297 | return pop3driver_pop3_error_to_mail_error(r); | 297 | return pop3driver_pop3_error_to_mail_error(r); |
298 | } | 298 | } |
299 | 299 | ||
300 | static int pop3driver_status_folder(mailsession * session, char * mb, | 300 | static int pop3driver_status_folder(mailsession * session, char * mb, |
301 | uint32_t * result_messages, | 301 | uint32_t * result_messages, |
302 | uint32_t * result_recent, | 302 | uint32_t * result_recent, |
303 | uint32_t * result_unseen) | 303 | uint32_t * result_unseen) |
304 | { | 304 | { |
305 | uint32_t count; | 305 | uint32_t count; |
306 | int r; | 306 | int r; |
307 | 307 | ||
308 | r = pop3driver_messages_number(session, mb, &count); | 308 | r = pop3driver_messages_number(session, mb, &count); |
309 | if (r != MAIL_NO_ERROR) | 309 | if (r != MAIL_NO_ERROR) |
310 | return r; | 310 | return r; |
311 | 311 | ||
312 | * result_messages = count; | 312 | * result_messages = count; |
313 | * result_recent = count; | 313 | * result_recent = count; |
314 | * result_unseen = count; | 314 | * result_unseen = count; |
315 | 315 | ||
316 | return MAIL_NO_ERROR; | 316 | return MAIL_NO_ERROR; |
317 | } | 317 | } |
318 | 318 | ||
319 | static int pop3driver_messages_number(mailsession * session, char * mb, | 319 | static int pop3driver_messages_number(mailsession * session, char * mb, |
320 | uint32_t * result) | 320 | uint32_t * result) |
321 | { | 321 | { |
322 | carray * msg_tab; | 322 | carray * msg_tab; |