4 * Copyright (c) 2012 - 2013 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.
26 * This file contains the data structures and interfaces needed for application,
27 * to interact with Email Engine.
28 * @file email-api-smime.c
29 * @brief This file contains the data structures and interfaces of SMIME related Functionality provided by
34 #include "email-api-mail.h"
35 #include "email-convert.h"
36 #include "email-api-account.h"
37 #include "email-storage.h"
38 #include "email-utilities.h"
39 #include "email-core-mail.h"
40 #include "email-core-mime.h"
41 #include "email-core-account.h"
42 #include "email-core-cert.h"
43 #include "email-core-smime.h"
44 #include "email-core-pgp.h"
45 #include "email-core-signal.h"
46 #include "email-ipc.h"
48 EXPORT_API int email_add_certificate(char *certificate_path, char *email_address)
50 EM_DEBUG_API_BEGIN("");
51 return EMAIL_ERROR_NOT_SUPPORTED;
54 EXPORT_API int email_delete_certificate(char *email_address)
56 EM_DEBUG_API_BEGIN("");
57 return EMAIL_ERROR_NOT_SUPPORTED;
60 EXPORT_API int email_get_certificate(char *email_address, email_certificate_t **certificate)
62 EM_DEBUG_API_BEGIN("");
63 return EMAIL_ERROR_NOT_SUPPORTED;
66 EXPORT_API int email_verify_certificate(char *certificate_path, int *verify)
68 EM_DEBUG_API_BEGIN("");
69 return EMAIL_ERROR_NOT_SUPPORTED;
72 EXPORT_API int email_get_decrypt_message(int mail_id, email_mail_data_t **output_mail_data,
73 email_attachment_data_t **output_attachment_data,
74 int *output_attachment_count, int *verify)
76 EM_DEBUG_API_BEGIN("mail_id[%d]", mail_id);
77 int err = EMAIL_ERROR_NONE;
78 int p_output_attachment_count = 0;
80 char *decrypt_filepath = NULL;
82 char *multi_user_name = NULL;
83 email_mail_data_t *p_output_mail_data = NULL;
84 email_attachment_data_t *p_output_attachment_data = NULL;
85 emstorage_account_tbl_t *p_account_tbl = NULL;
87 EM_IF_NULL_RETURN_VALUE(mail_id, EMAIL_ERROR_INVALID_PARAM);
89 if (!output_mail_data || !output_attachment_data || !output_attachment_count) {
90 EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
91 err = EMAIL_ERROR_INVALID_PARAM;
95 if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
96 EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]");
100 if ((err = emcore_get_mail_data(multi_user_name, mail_id, &p_output_mail_data)) != EMAIL_ERROR_NONE) {
101 EM_DEBUG_EXCEPTION("emcore_get_mail_data failed");
105 if (!emstorage_get_account_by_id(multi_user_name, p_output_mail_data->account_id, EMAIL_ACC_GET_OPT_OPTIONS, &p_account_tbl, false, &err)) {
106 EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed : [%d]", err);
110 if ((err = emcore_get_attachment_data_list(multi_user_name, mail_id, &p_output_attachment_data, &p_output_attachment_count)) != EMAIL_ERROR_NONE) {
111 EM_DEBUG_EXCEPTION("emcore_get_attachment_data_list failed");
115 for (i = 0; i < p_output_attachment_count; i++) {
116 EM_DEBUG_LOG("mime_type : [%s]", p_output_attachment_data[i].attachment_mime_type);
117 if (p_output_attachment_data[i].attachment_mime_type && (search = strcasestr(p_output_attachment_data[i].attachment_mime_type, "PKCS7-MIME"))) {
118 EM_DEBUG_LOG("Found the encrypt file");
120 } else if (p_output_attachment_data[i].attachment_mime_type && (search = strcasestr(p_output_attachment_data[i].attachment_mime_type, "octet-stream"))) {
121 EM_DEBUG_LOG("Found the encrypt file");
127 EM_DEBUG_EXCEPTION("No have a decrypt file");
128 err = EMAIL_ERROR_INVALID_PARAM;
132 if (p_output_mail_data->smime_type == EMAIL_SMIME_ENCRYPTED || p_output_mail_data->smime_type == EMAIL_SMIME_SIGNED_AND_ENCRYPTED) {
133 emcore_init_openssl_library();
134 if (!emcore_smime_get_decrypt_message(p_output_attachment_data[i].attachment_path, p_account_tbl->certificate_path, &decrypt_filepath, &err)) {
135 EM_DEBUG_EXCEPTION("emcore_smime_get_decrypt_message failed");
136 emcore_clean_openssl_library();
139 emcore_clean_openssl_library();
140 } else if (p_output_mail_data->smime_type == EMAIL_PGP_ENCRYPTED) {
141 if ((err = emcore_pgp_get_decrypted_message(p_output_attachment_data[i].attachment_path, p_output_mail_data->pgp_password, false, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
142 EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
145 } else if (p_output_mail_data->smime_type == EMAIL_PGP_SIGNED_AND_ENCRYPTED) {
146 if ((err = emcore_pgp_get_decrypted_message(p_output_attachment_data[i].attachment_path, p_output_mail_data->pgp_password, true, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
147 EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
151 EM_DEBUG_LOG("Invalid encrypted mail");
152 err = EMAIL_ERROR_INVALID_PARAM;
156 /* Change decrpyt_message to mail_data_t */
157 if (!emcore_parse_mime_file_to_mail(decrypt_filepath, output_mail_data, output_attachment_data, output_attachment_count, &err)) {
158 EM_DEBUG_EXCEPTION("emcore_parse_mime_file_to_mail failed : [%d]", err);
162 (*output_mail_data)->subject = EM_SAFE_STRDUP(p_output_mail_data->subject);
163 (*output_mail_data)->date_time = p_output_mail_data->date_time;
164 (*output_mail_data)->full_address_return = EM_SAFE_STRDUP(p_output_mail_data->full_address_return);
165 (*output_mail_data)->email_address_recipient = EM_SAFE_STRDUP(p_output_mail_data->email_address_recipient);
166 (*output_mail_data)->email_address_sender = EM_SAFE_STRDUP(p_output_mail_data->email_address_sender);
167 (*output_mail_data)->full_address_reply = EM_SAFE_STRDUP(p_output_mail_data->full_address_reply);
168 (*output_mail_data)->full_address_from = EM_SAFE_STRDUP(p_output_mail_data->full_address_from);
169 (*output_mail_data)->full_address_to = EM_SAFE_STRDUP(p_output_mail_data->full_address_to);
170 (*output_mail_data)->full_address_cc = EM_SAFE_STRDUP(p_output_mail_data->full_address_cc);
171 (*output_mail_data)->full_address_bcc = EM_SAFE_STRDUP(p_output_mail_data->full_address_bcc);
172 (*output_mail_data)->flags_flagged_field = p_output_mail_data->flags_flagged_field;
176 EM_SAFE_FREE(decrypt_filepath);
179 emstorage_free_account(&p_account_tbl, 1, NULL);
181 if (p_output_mail_data)
182 email_free_mail_data(&p_output_mail_data, 1);
184 if (p_output_attachment_data)
185 email_free_attachment_data(&p_output_attachment_data, p_output_attachment_count);
187 EM_SAFE_FREE(multi_user_name);
189 EM_DEBUG_API_END("err[%d]", err);
193 EXPORT_API int email_get_decrypt_message_ex(email_mail_data_t *input_mail_data,
194 email_attachment_data_t *input_attachment_data,
195 int input_attachment_count,
196 email_mail_data_t **output_mail_data,
197 email_attachment_data_t **output_attachment_data,
198 int *output_attachment_count,
201 EM_DEBUG_API_BEGIN();
202 int err = EMAIL_ERROR_NONE;
204 char *decrypt_filepath = NULL;
206 char *multi_user_name = NULL;
207 emstorage_account_tbl_t *p_account_tbl = NULL;
209 EM_IF_NULL_RETURN_VALUE(input_mail_data, EMAIL_ERROR_INVALID_PARAM);
211 if (!output_mail_data || !output_attachment_data || !output_attachment_count) {
212 EM_DEBUG_EXCEPTION("EMAIL_ERROR_INVALID_PARAM");
213 err = EMAIL_ERROR_INVALID_PARAM;
217 if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
218 EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
222 if (!emstorage_get_account_by_id(multi_user_name, input_mail_data->account_id, EMAIL_ACC_GET_OPT_OPTIONS, &p_account_tbl, false, &err)) {
223 EM_DEBUG_EXCEPTION("emstorage_get_account_by_id failed : [%d]", err);
227 for (i = 0; i < input_attachment_count; i++) {
228 EM_DEBUG_LOG("mime_type : [%s]", input_attachment_data[i].attachment_mime_type);
229 if (input_attachment_data[i].attachment_mime_type && (search = strcasestr(input_attachment_data[i].attachment_mime_type, "PKCS7-MIME"))) {
230 EM_DEBUG_LOG("Found the encrypt file");
232 } else if (input_attachment_data[i].attachment_mime_type && (search = strcasestr(input_attachment_data[i].attachment_mime_type, "octet-stream"))) {
233 EM_DEBUG_LOG("Found the encrypt file");
239 EM_DEBUG_EXCEPTION("No have a decrypt file");
240 err = EMAIL_ERROR_INVALID_PARAM;
244 if (input_mail_data->smime_type == EMAIL_SMIME_ENCRYPTED || input_mail_data->smime_type == EMAIL_SMIME_SIGNED_AND_ENCRYPTED) {
245 emcore_init_openssl_library();
246 if (!emcore_smime_get_decrypt_message(input_attachment_data[i].attachment_path, p_account_tbl->certificate_path, &decrypt_filepath, &err)) {
247 EM_DEBUG_EXCEPTION("emcore_smime_get_decrypt_message failed");
248 emcore_clean_openssl_library();
251 emcore_clean_openssl_library();
252 } else if (input_mail_data->smime_type == EMAIL_PGP_ENCRYPTED) {
253 if ((err = emcore_pgp_get_decrypted_message(input_attachment_data[i].attachment_path, input_mail_data->pgp_password, false, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
254 EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
257 } else if (input_mail_data->smime_type == EMAIL_PGP_SIGNED_AND_ENCRYPTED) {
258 if ((err = emcore_pgp_get_decrypted_message(input_attachment_data[i].attachment_path, input_mail_data->pgp_password, true, &decrypt_filepath, verify)) != EMAIL_ERROR_NONE) {
259 EM_DEBUG_EXCEPTION("emcore_pgp_get_decrypted_message failed : [%d]", err);
263 EM_DEBUG_LOG("Invalid encrypted mail");
264 err = EMAIL_ERROR_INVALID_PARAM;
268 /* Change decrpyt_message to mail_data_t */
269 if (!emcore_parse_mime_file_to_mail(decrypt_filepath, output_mail_data, output_attachment_data, output_attachment_count, &err)) {
270 EM_DEBUG_EXCEPTION("emcore_parse_mime_file_to_mail failed : [%d]", err);
274 (*output_mail_data)->subject = EM_SAFE_STRDUP(input_mail_data->subject);
275 (*output_mail_data)->date_time = input_mail_data->date_time;
276 (*output_mail_data)->full_address_return = EM_SAFE_STRDUP(input_mail_data->full_address_return);
277 (*output_mail_data)->email_address_recipient = EM_SAFE_STRDUP(input_mail_data->email_address_recipient);
278 (*output_mail_data)->email_address_sender = EM_SAFE_STRDUP(input_mail_data->email_address_sender);
279 (*output_mail_data)->full_address_reply = EM_SAFE_STRDUP(input_mail_data->full_address_reply);
280 (*output_mail_data)->full_address_from = EM_SAFE_STRDUP(input_mail_data->full_address_from);
281 (*output_mail_data)->full_address_to = EM_SAFE_STRDUP(input_mail_data->full_address_to);
282 (*output_mail_data)->full_address_cc = EM_SAFE_STRDUP(input_mail_data->full_address_cc);
283 (*output_mail_data)->full_address_bcc = EM_SAFE_STRDUP(input_mail_data->full_address_bcc);
284 (*output_mail_data)->flags_flagged_field = input_mail_data->flags_flagged_field;
288 EM_SAFE_FREE(decrypt_filepath);
289 EM_SAFE_FREE(multi_user_name);
292 emstorage_free_account(&p_account_tbl, 1, NULL);
294 EM_DEBUG_API_END("err[%d]", err);
298 EXPORT_API int email_verify_signature(int mail_id, int *verify)
300 EM_DEBUG_API_BEGIN("mail_id[%d]", mail_id);
303 EM_DEBUG_EXCEPTION("Invalid parameter");
304 return EMAIL_ERROR_INVALID_PARAM;
307 int result_from_ipc = 0;
309 int err = EMAIL_ERROR_NONE;
311 HIPC_API hAPI = emipc_create_email_api(_EMAIL_API_VERIFY_SIGNATURE);
313 EM_DEBUG_EXCEPTION("emipc_create_email_api failed");
314 err = EMAIL_ERROR_NULL_VALUE;
318 if (!emipc_add_parameter(hAPI, ePARAMETER_IN, &mail_id, sizeof(int))) {
319 EM_DEBUG_EXCEPTION("emipc_add_parameter pass_phrase[%d] failed", mail_id);
320 err = EMAIL_ERROR_NULL_VALUE;
324 if (emipc_execute_proxy_api(hAPI) < 0) {
325 EM_DEBUG_EXCEPTION("emipc_execute_proxy_api failed");
326 err = EMAIL_ERROR_IPC_SOCKET_FAILURE;
330 result_from_ipc = emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &p_verify);
331 if (result_from_ipc != EMAIL_ERROR_NONE) {
332 EM_DEBUG_EXCEPTION("emipc_get_parameter failed");
333 err = EMAIL_ERROR_IPC_CRASH;
340 emipc_destroy_email_api(hAPI);
345 EM_DEBUG_API_END("err[%d]", err);
349 EXPORT_API int email_verify_signature_ex(email_mail_data_t *input_mail_data, email_attachment_data_t *input_attachment_data, int input_attachment_count, int *verify)
351 EM_DEBUG_API_BEGIN();
353 if (!input_mail_data || !input_attachment_data || input_attachment_count <= 0) {
354 EM_DEBUG_EXCEPTION("Invalid parameter");
355 return EMAIL_ERROR_INVALID_PARAM;
359 int err = EMAIL_ERROR_NONE;
361 for (count = 0; count < input_attachment_count ; count++) {
362 if (input_attachment_data[count].attachment_mime_type && strcasestr(input_attachment_data[count].attachment_mime_type, "SIGNATURE"))
366 if (count == input_attachment_count) {
367 EM_DEBUG_LOG("No have the signed attachment");
368 EM_DEBUG_EXCEPTION("Invalid parameter");
369 return EMAIL_ERROR_INVALID_PARAM;
372 if (input_mail_data->smime_type == EMAIL_SMIME_SIGNED) {
373 emcore_init_openssl_library();
374 if (!emcore_verify_signature(input_attachment_data[count].attachment_path, input_mail_data->file_path_mime_entity, verify, &err))
375 EM_DEBUG_EXCEPTION("emcore_verify_signature failed : [%d]", err);
377 emcore_clean_openssl_library();
378 } else if (input_mail_data->smime_type == EMAIL_PGP_SIGNED) {
379 if ((err = emcore_pgp_get_verify_signature(input_attachment_data[count].attachment_path, input_mail_data->file_path_mime_entity, input_mail_data->digest_type, verify)) != EMAIL_ERROR_NONE)
380 EM_DEBUG_EXCEPTION("emcore_pgp_get_verify_siganture failed : [%d]", err);
382 EM_DEBUG_LOG("Invalid signed mail : mime_type[%d]", input_mail_data->smime_type);
383 err = EMAIL_ERROR_INVALID_PARAM;
387 EM_DEBUG_API_END("err[%d]", err);
392 EXPORT_API int email_check_ocsp_status(char *email_address, char *response_url, unsigned *handle)
394 EM_DEBUG_FUNC_BEGIN_SEC("email_address : [%s], response_url : [%s], handle : [%p]", email_address, response_url, handle);
396 EM_IF_NULL_RETURN_VALUE(email_address, EMAIL_ERROR_INVALID_PARAM);
398 int err = EMAIL_ERROR_NONE;
399 HIPC_API hAPI = NULL;
401 hAPI = emipc_create_email_api(_EMAIL_API_CHECK_OCSP_STATUS);
403 EM_IF_NULL_RETURN_VALUE(hAPI, EMAIL_ERROR_NULL_VALUE);
405 if (!emipc_add_parameter(hAPI, ePARAMETER_IN, email_address, EM_SAFE_STRLEN(email_address)+1)) {
406 EM_DEBUG_EXCEPTION("email_check_ocsp_status--ADD Param email_address failed");
407 EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
410 if (!emipc_add_parameter(hAPI, ePARAMETER_IN, response_url, EM_SAFE_STRLEN(response_url)+1)) {
411 EM_DEBUG_EXCEPTION("email_check_ocsp_status--ADD Param response_url failed");
412 EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
415 if (emipc_execute_proxy_api(hAPI) != EMAIL_ERROR_NONE) {
416 EM_DEBUG_EXCEPTION("email_check_oscp_status--emipc_execute_proxy_api failed");
417 EM_PROXY_IF_NULL_RETURN_VALUE(0, hAPI, EMAIL_ERROR_NULL_VALUE);
420 emipc_get_parameter(hAPI, ePARAMETER_OUT, 0, sizeof(int), &err);
421 if (err == EMAIL_ERROR_NONE) {
423 emipc_get_parameter(hAPI, ePARAMETER_OUT, 1, sizeof(int), handle);
427 EXPORT_API int email_validate_certificate(int account_id, char *email_address, unsigned *handle)
429 EM_DEBUG_API_BEGIN("account_id[%d]", account_id);
430 EM_DEBUG_FUNC_BEGIN_SEC("account_id[%d] email_address[%s] handle[%p]", account_id, email_address, handle);
432 EM_IF_NULL_RETURN_VALUE(account_id, EMAIL_ERROR_INVALID_PARAM);
433 EM_IF_NULL_RETURN_VALUE(email_address, EMAIL_ERROR_INVALID_PARAM);
435 int err = EMAIL_ERROR_NONE;
437 char *multi_user_name = NULL;
438 email_account_server_t account_server_type;
439 ASNotiData as_noti_data;
441 if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
442 EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
446 memset(&as_noti_data, 0x00, sizeof(ASNotiData));
448 if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false) {
449 EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
450 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
454 if (account_server_type != EMAIL_SERVER_TYPE_ACTIVE_SYNC) {
455 EM_DEBUG_EXCEPTION("This api is not supported except of active sync");
456 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
460 if (em_get_handle_for_activesync(&as_handle, &err) == false) {
461 EM_DEBUG_EXCEPTION("em_get_handle_for_activesync_failed[%d]", err);
462 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
466 as_noti_data.validate_certificate.handle = as_handle;
467 as_noti_data.validate_certificate.account_id = account_id;
468 as_noti_data.validate_certificate.email_address = email_address;
469 as_noti_data.validate_certificate.multi_user_name = multi_user_name;
471 if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_VALIDATE_CERTIFICATE, &as_noti_data) == false) {
472 EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed");
473 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
482 EM_SAFE_FREE(multi_user_name);
483 EM_DEBUG_API_END("err[%d]", err);
487 EXPORT_API int email_get_resolve_recipients(int account_id, char *email_address, unsigned *handle)
489 EM_DEBUG_API_BEGIN("account_id[%d]", account_id);
490 EM_DEBUG_FUNC_BEGIN_SEC("account_id[%d] email_address[%s] handle[%p]", account_id, email_address, handle);
492 EM_IF_NULL_RETURN_VALUE(account_id, EMAIL_ERROR_INVALID_PARAM);
493 EM_IF_NULL_RETURN_VALUE(email_address, EMAIL_ERROR_INVALID_PARAM);
495 int err = EMAIL_ERROR_NONE;
497 char *multi_user_name = NULL;
498 email_account_server_t account_server_type;
499 ASNotiData as_noti_data;
501 if ((err = emipc_get_user_name(&multi_user_name)) != EMAIL_ERROR_NONE) {
502 EM_DEBUG_EXCEPTION("emipc_get_user_name failed : [%d]", err);
506 memset(&as_noti_data, 0x00, sizeof(ASNotiData));
508 if (em_get_account_server_type_by_account_id(multi_user_name, account_id, &account_server_type, false, &err) == false) {
509 EM_DEBUG_EXCEPTION("em_get_account_server_type_by_account_id failed[%d]", err);
510 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
514 if (account_server_type != EMAIL_SERVER_TYPE_ACTIVE_SYNC) {
515 EM_DEBUG_EXCEPTION("This api is not supported except of active sync");
516 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
520 if (em_get_handle_for_activesync(&as_handle, &err) == false) {
521 EM_DEBUG_EXCEPTION("em_get_handle_for_activesync_failed[%d]", err);
522 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
526 as_noti_data.get_resolve_recipients.handle = as_handle;
527 as_noti_data.get_resolve_recipients.account_id = account_id;
528 as_noti_data.get_resolve_recipients.email_address = email_address;
529 as_noti_data.get_resolve_recipients.multi_user_name = multi_user_name;
531 if (em_send_notification_to_active_sync_engine(ACTIVE_SYNC_NOTI_RESOLVE_RECIPIENT, &as_noti_data) == false) {
532 EM_DEBUG_EXCEPTION("em_send_notification_to_active_sync_engine failed");
533 err = EMAIL_ERROR_ACTIVE_SYNC_NOTI_FAILURE;
542 EM_SAFE_FREE(multi_user_name);
543 EM_DEBUG_API_END("err[%d]", err);
547 EXPORT_API int email_free_certificate(email_certificate_t **certificate, int count)
549 EM_DEBUG_API_BEGIN("");
550 return EMAIL_ERROR_NOT_SUPPORTED;