# opendmarc_policy_query_dmarc()

[back to index]

SYNOPSIS

    #include <dmarc.h>
    OPENDMARC_STATUS_T opendmarc_policy_query_dmarc(
    	DMARC_POLICY_T *pctx,
    	u_char *domain
    );

Cause the DMARC record to be looked up using DNS.

DESCRIPTION

Called When | `opendmarc_policy_query_dmarc()` may be called either before you have stored the From: domain, or in place of storing that domain.

ARGUMENTS

Argument | Description
--- | ---
pctx | The address of a structure of type `DMARC_POLICY_T` as returned from opendmarc_policy_connect_init().
domain | A string containing the domain to look up. If not NULL, should be the domain from the From: header. If NULL, you must already have stored the From: domain using opendmarc_policy_store_from_domain().

RETURN VALUES

- `DMARC_PARSE_OKAY` -- Success.
- `DMARC_PARSE_ERROR_NULL_CTX` -- If you passed in a `pctx` value that was NULL.
- `DMARC_PARSE_ERROR_EMPTY` -- if domain was NULL and there was no From: domain.
- `DMARC_PARSE_ERROR_NO_DOMAIN` -- if domain wasn't really a domain name.
- `DMARC_DNS_ERROR_NXDOMAIN` -- No such domain found in DNS.
- `DMARC_DNS_ERROR_TMPERR` -- DNS returned a temporary failure.
- `DMARC_DNS_ERROR_NO_RECORD` -- The domain exists but no DMARC record was found, either at that domain or a found organizational domain.

NOTES

- If the DMARC record is found it is parsed, so this function can also return the values of opendmarc_policy_parse_dmarc().
- This function uses the standard resolver library. As of this release there are no hooks for an asynchronous resolver library.

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.