summaryrefslogtreecommitdiff
path: root/email-core/email-core-mm-callbacks.c
diff options
context:
space:
mode:
Diffstat (limited to 'email-core/email-core-mm-callbacks.c')
-rwxr-xr-xemail-core/email-core-mm-callbacks.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/email-core/email-core-mm-callbacks.c b/email-core/email-core-mm-callbacks.c
index 5bbb5ea..8990b9f 100755
--- a/email-core/email-core-mm-callbacks.c
+++ b/email-core/email-core-mm-callbacks.c
@@ -210,16 +210,26 @@ INTERNAL_FUNC void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
char *password = NULL;
char *token = NULL;
char *save_ptr = NULL;
+ char *user_info = NULL;
+ char *temp = NULL;
+ char *multi_user_name = NULL;
if (!mb->user[0]) {
EM_DEBUG_EXCEPTION("invalid account_id...");
goto FINISH_OFF;
}
- account_id = atoi(mb->user);
+ user_info = EM_SAFE_STRDUP(mb->user);
- ref_account = emcore_get_account_reference(account_id);
+ token = strtok_r(user_info, TOKEN_FOR_MULTI_USER, &temp);
+ EM_DEBUG_LOG_SEC("Token : [%s], multi_user_name:[%s][%d]", token, temp, EM_SAFE_STRLEN(temp));
+ account_id = atoi(token);
+ token = NULL;
+ if (temp != NULL && EM_SAFE_STRLEN(temp) > 0)
+ multi_user_name = EM_SAFE_STRDUP(temp);
+
+ ref_account = emcore_get_account_reference(multi_user_name, account_id, true);
if (!ref_account) {
EM_DEBUG_EXCEPTION("emcore_get_account_reference failed");
goto FINISH_OFF;
@@ -240,7 +250,6 @@ INTERNAL_FUNC void mm_login(NETMBX *mb, char *user, char *pwd, long trial)
EM_DEBUG_LOG("incoming_server_authentication_method [%d]", ref_account->incoming_server_authentication_method);
if(ref_account->incoming_server_authentication_method == EMAIL_AUTHENTICATION_METHOD_XOAUTH2) {
-
token = strtok_r(ref_account->incoming_server_password, "\001", &save_ptr);
EM_DEBUG_LOG_SEC("token [%s]", token);
password = EM_SAFE_STRDUP(token);
@@ -263,8 +272,10 @@ FINISH_OFF:
EM_SAFE_FREE(ref_account);
}
+ EM_SAFE_FREE(user_info);
EM_SAFE_FREE(username);
EM_SAFE_FREE(password);
+ EM_SAFE_FREE(multi_user_name);
EM_DEBUG_FUNC_END();
}
@@ -280,7 +291,7 @@ INTERNAL_FUNC void mm_dlog(char *string)
INTERNAL_FUNC void mm_log(char *string, long errflg)
{
- switch ((short)errflg) {
+ switch (errflg) {
case NIL:
EM_DEBUG_LOG("IMAP_TOOLKIT_LOG [%s]", string);
break;