From: Minsoo Kim Date: Mon, 25 Feb 2013 10:53:33 +0000 (+0900) Subject: sync sended mail to server in sentbox X-Git-Tag: submit/submit/20141001.115906~33^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=72ea98448b86d7ed4d2b1d2c343d67aab7a44590;p=platform%2Fframework%2Fnative%2Fmessaging.git sync sended mail to server in sentbox --- diff --git a/email-core/email-core-mail.c b/email-core/email-core-mail.c index 7106687..9c06cd7 100755 --- a/email-core/email-core-mail.c +++ b/email-core/email-core-mail.c @@ -4865,8 +4865,11 @@ INTERNAL_FUNC int emcore_move_mail_on_server(int account_id, int src_mailbox_id, EM_DEBUG_LOG("Mail MOVE SUCCESS "); } } - else + else { EM_DEBUG_EXCEPTION(">>>> Server MAIL ID IS NULL >>>> "); + ret = 0; + goto FINISH_OFF; + } } else { EM_DEBUG_EXCEPTION(">>>> STREAM DATA IS NULL >>> "); diff --git a/email-core/email-core-mailbox-sync.c b/email-core/email-core-mailbox-sync.c index 57f7642..c7432da 100755 --- a/email-core/email-core-mailbox-sync.c +++ b/email-core/email-core-mailbox-sync.c @@ -2463,7 +2463,7 @@ INTERNAL_FUNC int emcore_sync_mail_from_client_to_server(int mail_id) goto FINISH_OFF; } - if (mailbox_tbl->local_yn == 0) { + if (mailbox_tbl->local_yn) { EM_DEBUG_EXCEPTION("The mailbox [%s] is not on server.", mail_table_data->mailbox_name); err = EMAIL_ERROR_INVALID_MAILBOX; goto FINISH_OFF; diff --git a/email-core/email-core-smtp.c b/email-core/email-core-smtp.c index 96467e8..e8bca48 100755 --- a/email-core/email-core-smtp.c +++ b/email-core/email-core-smtp.c @@ -1279,9 +1279,7 @@ INTERNAL_FUNC int emcore_send_mail(int account_id, int input_mailbox_id, int mai goto FINISH_OFF; } dst_mailbox_id = local_mailbox->mailbox_id; - - if(local_mailbox) - emstorage_free_mailbox(&local_mailbox, 1, NULL); + emstorage_free_mailbox(&local_mailbox, 1, NULL); if (!emcore_connect_to_remote_mailbox(account_id, EMAIL_CONNECT_FOR_SENDING, (void **)&tmp_stream, &err)) { @@ -1328,9 +1326,7 @@ INTERNAL_FUNC int emcore_send_mail(int account_id, int input_mailbox_id, int mai goto FINISH_OFF; } dst_mailbox_id = local_mailbox->mailbox_id; - - if(local_mailbox) - emstorage_free_mailbox(&local_mailbox, 1, NULL); + emstorage_free_mailbox(&local_mailbox, 1, NULL); /* unsent mail is moved to 'OUTBOX'. */ if (!emcore_move_mail(&mail_id, 1, dst_mailbox_id, EMAIL_MOVED_BY_COMMAND, 0, NULL)) @@ -1395,6 +1391,24 @@ INTERNAL_FUNC int emcore_send_mail(int account_id, int input_mailbox_id, int mai #endif #endif + if (ref_account->incoming_server_type == EMAIL_SERVER_TYPE_IMAP4) { + emstorage_mailbox_tbl_t* src_mailbox = NULL; + if (!emstorage_get_mailbox_by_mailbox_type(account_id, EMAIL_MAILBOX_TYPE_OUTBOX, &src_mailbox, true, &err)) { + EM_DEBUG_EXCEPTION("emstorage_get_mailbox_by_mailbox_type failed [%d]", err); + goto FINISH_OFF; + } + + if (src_mailbox->local_yn) + emcore_sync_mail_from_client_to_server(mail_id); + else { + if (!emcore_move_mail_on_server(account_id, src_mailbox->mailbox_id, &mail_id, 1, local_mailbox->mailbox_name, &err)) { + EM_DEBUG_EXCEPTION(" emcore_move_mail_on_server falied [%d]", err); + } + } + + emstorage_free_mailbox(&src_mailbox, 1, NULL); + } + /* On Successful Mail sent remove the Draft flag */ mail_tbl_data->flags_draft_field = 0; diff --git a/packaging/email-service.spec b/packaging/email-service.spec index 292bdd6..39aa585 100755 --- a/packaging/email-service.spec +++ b/packaging/email-service.spec @@ -1,6 +1,6 @@ Name: email-service Summary: E-mail Framework Middleware package -Version: 0.10.85 +Version: 0.10.86 Release: 1 Group: System/Libraries License: TBD