summaryrefslogtreecommitdiff
path: root/email-core
diff options
context:
space:
mode:
authorMinsoo Kim <minnsoo.kim@samsung.com>2013-02-25 19:53:33 +0900
committerMinsoo Kim <minnsoo.kim@samsung.com>2013-02-25 19:54:28 +0900
commit72ea98448b86d7ed4d2b1d2c343d67aab7a44590 (patch)
treec222b83eef99ca5d5e3411a072a5027825ce1f46 /email-core
parent885280e3902fc26b4ded50324e6a5bbfc7637ddb (diff)
downloademail-service-72ea98448b86d7ed4d2b1d2c343d67aab7a44590.tar.gz
email-service-72ea98448b86d7ed4d2b1d2c343d67aab7a44590.tar.bz2
email-service-72ea98448b86d7ed4d2b1d2c343d67aab7a44590.zip
sync sended mail to server in sentbox
Diffstat (limited to 'email-core')
-rwxr-xr-xemail-core/email-core-mail.c5
-rwxr-xr-xemail-core/email-core-mailbox-sync.c2
-rwxr-xr-xemail-core/email-core-smtp.c26
3 files changed, 25 insertions, 8 deletions
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;