# opendmarc_policy_fetch_rua()

[back to index]

SYNOPSIS

    #include <dmarc.h>
    u_char ** opendmarc_policy_fetch_rua(
    	DMARC_POLICY_T *pctx,
    	u_char *list_buf, size_t size_of_buf, int constant
    );

Query the library to find the list of `rua=` values from the `DMARC` record.

DESCRIPTION

Called When | `opendmarc_policy_fetch_rua()` is called after the DMARC record has been fetched and parsed.

ARGUMENTS

Argument | Description
--- | ---
pctx | The address of a structure of type `DMARC_POLICY_T` as returned from opendmarc_policy_connect_init().
list_buf | If not NULL, the address of a buffer to receive a comma delimited list as a single string.
size_of_buf | If `list_buf` was not NULL, the the length of that buffer in bytes.
constant | This function returns an argv-style array of stings. Set this to 0 if you will free that array when you are finished with it. Set this to 1 if you want to treat that array as const and have the library magically free it for you.

RETURN VALUES

- `!= NULL` -- On success.
- `NULL` -- The `pctp` pointer was NULL.
- `NULL` -- If the `DMARC` record contained no `rua=`

NOTES

- If you set `constant` to 1, you must not free the array returned. To do so will have unpredictable results.
- Call this function only after a `DMARC` record was fetched and parsed with opendmarc_policy_query_dmarc() or supplied to the library with opendmarc_policy_store_dmarc().
- Note that each returned record is looked up using DNS to find if it is accepting reports for the from_domain. If not, it is eliminated from the returned list.

Copyright (c) 2012, The Trusted Domain Project. All rights reserved.
By using this file, you agree to the terms and conditions set forth in the license.