author | zautrix <zautrix> | 2005-03-18 22:05:02 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-18 22:05:02 (UTC) |
commit | 297208a61298fceab6d96bbd1c46198b1c0f7a76 (patch) (side-by-side diff) | |
tree | 50f0c6f775393c1eec15b71691a798d1dacab86d /libetpan/src/low-level | |
parent | f0232b7801f098b5842e3cd5a1fd804af98ab862 (diff) | |
download | kdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.zip kdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.tar.gz kdepimpi-297208a61298fceab6d96bbd1c46198b1c0f7a76.tar.bz2 |
fixes applied
-rw-r--r-- | libetpan/src/low-level/imap/mailimap_parser.c | 22 | ||||
-rw-r--r-- | libetpan/src/low-level/maildir/maildir.c | 17 | ||||
-rw-r--r-- | libetpan/src/low-level/mh/mailmh.c | 3 | ||||
-rw-r--r-- | libetpan/src/low-level/pop3/mailpop3.c | 7 |
4 files changed, 43 insertions, 6 deletions
diff --git a/libetpan/src/low-level/imap/mailimap_parser.c b/libetpan/src/low-level/imap/mailimap_parser.c index ab4db67..071891c 100644 --- a/libetpan/src/low-level/imap/mailimap_parser.c +++ b/libetpan/src/low-level/imap/mailimap_parser.c @@ -2399,8 +2399,26 @@ mailimap_body_fld_enc_parse(mailstream * fd, MMAPString * buffer, r = mailimap_string_parse(fd, buffer, &cur_token, &value, NULL, progr_rate, progr_fun); if (r != MAILIMAP_NO_ERROR) { - res = r; - goto err; + // LR start + // accept NIL and set type to utf8 + int ret = r; + r = mailimap_char_parse(fd, buffer, &cur_token, 'N'); + if (r == MAILIMAP_NO_ERROR) { + r = mailimap_char_parse(fd, buffer, &cur_token, 'I'); + if (r == MAILIMAP_NO_ERROR) { + r = mailimap_char_parse(fd, buffer, &cur_token, 'L'); + if (r == MAILIMAP_NO_ERROR) { + type = 4; + ret = MAILIMAP_NO_ERROR; + value = NULL; + } + } + } + if ( ret != MAILIMAP_NO_ERROR ) { + res = ret; + goto err; + } + // LR end } } else { diff --git a/libetpan/src/low-level/maildir/maildir.c b/libetpan/src/low-level/maildir/maildir.c index 98b9f87..e81625d 100644 --- a/libetpan/src/low-level/maildir/maildir.c +++ b/libetpan/src/low-level/maildir/maildir.c @@ -110,6 +110,8 @@ static char * maildir_get_new_message_filename(struct maildir * md, char basename[PATH_MAX]; int k; time_t now; + //LR + struct stat f_stat; int got_file; int r; @@ -121,7 +123,18 @@ static char * maildir_get_new_message_filename(struct maildir * md, (unsigned long) now, md->mdir_pid, md->mdir_counter, md->mdir_hostname); snprintf(filename, sizeof(filename), "%s/tmp/%s", md->mdir_path, basename); - + + // LR changed following lines + if ( stat( filename, &f_stat ) == -1 ) { + char * dup_filename; + + dup_filename = strdup(filename); + if (dup_filename == NULL) { + //unlink(filename); + return NULL; + } + rename (tmpfile,dup_filename ); +#if 0 if (link(tmpfile, filename) == 0) { got_file = 1; unlink(tmpfile); @@ -147,7 +160,7 @@ static char * maildir_get_new_message_filename(struct maildir * md, unlink(filename); return NULL; } - +#endif md->mdir_counter ++; return dup_filename; diff --git a/libetpan/src/low-level/mh/mailmh.c b/libetpan/src/low-level/mh/mailmh.c index 42cab9d..f8c694d 100644 --- a/libetpan/src/low-level/mh/mailmh.c +++ b/libetpan/src/low-level/mh/mailmh.c @@ -920,6 +920,9 @@ int mailmh_folder_remove_message(struct mailmh_folder * folder, #endif chash_delete(folder->fl_msgs_hash, &key, NULL); } + // LR memory leak fixed + mailmh_msg_info_free( msg_info ); + free(filename); return MAILMH_NO_ERROR; diff --git a/libetpan/src/low-level/pop3/mailpop3.c b/libetpan/src/low-level/pop3/mailpop3.c index 6f77a3a..bca62d5 100644 --- a/libetpan/src/low-level/pop3/mailpop3.c +++ b/libetpan/src/low-level/pop3/mailpop3.c @@ -508,8 +508,11 @@ int mailpop3_pass(mailpop3 * f, const char * password) return MAILPOP3_ERROR_STREAM; r = parse_response(f, response); - if (r != RESPONSE_OK) - return MAILPOP3_ERROR_BAD_PASSWORD; + if (r != RESPONSE_OK) { + // LR + fprintf(stderr,"POP3 login error. Response from server:\n%s\n",response ); + return MAILPOP3_ERROR_BAD_PASSWORD; + } f->pop3_state = POP3_STATE_TRANSACTION; |