MCPcopy Create free account
hub / github.com/acl-dev/acl / mail_from

Function mail_from

lib_acl_cpp/src/mime/internal/mime_state_parse.cpp:385–426  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

383}
384
385static void mail_from(MIME_NODE *node, const HEADER_OPTS *header_info)
386{
387 /* MIME_STATE *state = node->state; */
388 TOK822 *tree;
389 TOK822 **addr_list;
390 TOK822 **tpp;
391 ACL_VSTRING *temp;
392 const char *cp;
393
394 temp = acl_vstring_alloc(10);
395 cp = STR(node->buffer) + strlen(header_info->name) + 1;
396 tree = tok822_parse(cp);
397 addr_list = tok822_grep(tree, TOK822_ADDR);
398 for (tpp = addr_list; *tpp; tpp++) {
399 tok822_internalize(temp, tpp[0]->head, TOK822_STR_DEFL);
400 if (header_info->type == HDR_SENDER) {
401 if (node->header_sender)
402 acl_myfree(node->header_sender);
403 node->header_sender = acl_mystrdup(STR(temp));
404 break;
405 } else if (header_info->type == HDR_FROM) {
406 if (node->header_from)
407 acl_myfree(node->header_from);
408 node->header_from = acl_mystrdup(STR(temp));
409 break;
410 } else if (header_info->type == HDR_REPLY_TO) {
411 if (node->header_replyto)
412 acl_myfree(node->header_replyto);
413 node->header_replyto = acl_mystrdup(STR(temp));
414 break;
415 } else if (header_info->type == HDR_RETURN_PATH) {
416 if (node->header_returnpath)
417 acl_myfree(node->header_returnpath);
418 node->header_returnpath = acl_mystrdup(STR(temp));
419 }
420 }
421
422 acl_myfree(addr_list);
423
424 tok822_free_tree(tree);
425 acl_vstring_free(temp);
426}
427
428static void mail_subject(MIME_NODE *node, const HEADER_OPTS *header_info)
429{

Callers 2

send_envelopeMethod · 0.85
mime_header_lineFunction · 0.85

Calls 5

acl_vstring_allocFunction · 0.85
tok822_grepFunction · 0.85
tok822_internalizeFunction · 0.85
tok822_free_treeFunction · 0.85
acl_vstring_freeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…