4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Kyuho Jo <kyuho.jo@samsung.com>, Sunghyun Kwon <sh0701.kwon@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 /******************************************************************************
24 * File : email-core-api.h
25 * Desc : Mail Engine API
30 * 2006.08.16 : created
31 *****************************************************************************/
37 #include "email-core-global.h"
38 #include "email-network.h"
39 #include "email-core-event.h"
40 #include "email-core-mailbox.h"
41 #include "email-core-utils.h"
42 #include "email-debug-log.h"
45 pop3_parameters(long function, void *value);
47 imap_parameters(long function, void *value);
51 /* initialize mail core */
52 INTERNAL_FUNC int emcore_init(int *err_code)
54 EM_DEBUG_FUNC_BEGIN();
56 if (err_code != NULL) {
57 *err_code = EMAIL_ERROR_NONE;
60 mail_link(&imapdriver); /* link in the imap driver */
61 mail_link(&pop3driver); /* link in the pop3 driver */
63 mail_link(&unixdriver); /* link in the unix driver */
64 mail_link(&dummydriver); /* link in the dummy driver */
68 auth_link(&auth_md5); /* link in the md5 authenticator */
69 auth_link(&auth_pla); /* link in the pla authenticator */
70 auth_link(&auth_log); /* link in the log authenticator */
72 /* Disabled to authenticate with plain text */
73 mail_parameters(NIL, SET_DISABLEPLAINTEXT, (void *) 2);
75 /* Set max trials for login */
76 imap_parameters(SET_MAXLOGINTRIALS, (void *)1);
77 pop3_parameters(SET_MAXLOGINTRIALS, (void *)1);
78 smtp_parameters(SET_MAXLOGINTRIALS, (void *)1);
80 mail_parameters(NIL, SET_SSLCERTIFICATEQUERY, (void *)emnetwork_callback_ssl_cert_query);
81 mail_parameters(NIL, SET_SSLCAPATH, (void *)SSL_CERT_DIRECTORY);
83 /* Set time out in second */
84 mail_parameters(NIL, SET_OPENTIMEOUT , (void *)50);
85 mail_parameters(NIL, SET_READTIMEOUT , (void *)180);
86 mail_parameters(NIL, SET_WRITETIMEOUT , (void *)180);
87 mail_parameters(NIL, SET_CLOSETIMEOUT , (void *)30);
90 *err_code = EMAIL_ERROR_NONE;