| 402 | } |
| 403 | |
| 404 | String * Address::nonEncodedRFC822String() |
| 405 | { |
| 406 | struct mailimf_mailbox * mb; |
| 407 | MMAPString * str; |
| 408 | int col; |
| 409 | struct mailimf_mailbox_list * mb_list; |
| 410 | clist * list; |
| 411 | String * result; |
| 412 | char * display_name; |
| 413 | char * addr_spec; |
| 414 | |
| 415 | display_name = NULL; |
| 416 | if (displayName() != NULL) { |
| 417 | if (displayName()->length() > 0) { |
| 418 | display_name = strdup(displayName()->UTF8Characters()); |
| 419 | } |
| 420 | } |
| 421 | if ((mailbox() == NULL) || (mailbox()->length() == 0)) { |
| 422 | addr_spec = strdup("invalid"); |
| 423 | } |
| 424 | else { |
| 425 | addr_spec = strdup(mailbox()->UTF8Characters()); |
| 426 | } |
| 427 | mb = mailimf_mailbox_new(display_name, addr_spec); |
| 428 | |
| 429 | list = clist_new(); |
| 430 | clist_append(list, mb); |
| 431 | mb_list = mailimf_mailbox_list_new(list); |
| 432 | |
| 433 | str = mmap_string_new(""); |
| 434 | col = 0; |
| 435 | mailimf_mailbox_list_write_mem(str, &col, mb_list); |
| 436 | |
| 437 | result = String::stringWithUTF8Characters(str->str); |
| 438 | |
| 439 | mailimf_mailbox_list_free(mb_list); |
| 440 | mmap_string_free(str); |
| 441 | |
| 442 | return result; |
| 443 | } |
| 444 | |
| 445 | static Array * lep_address_list_from_lep_mailbox(struct mailimf_mailbox_list * mb_list, int encoded) |
| 446 | { |