SYNOPSIS |
#include <dkim.h>
DKIM_STAT dkim_set_policy_lookup(
DKIM_LIB *libopendkim,
DKIM_CBSTAT (*func) (DKIM *dkim,
unsigned char *query,
_Bool excheck,
unsigned char *buf,
size_t buflen,
int *qstat)
);
Defines a function which should do policy lookups rather than implementing
the DKIM specification (e.g a DNS lookup).
|
ARGUMENTS |
Argument | Description |
libopendkim |
Library-specific handle, returned by
dkim_init().
|
func |
A pointer to a function which the library should use in place
of its own code to do policy lookups. The function will receive
six things:
- a DKIM handle referencing the
job being processed;
- a pointer to the string that should be queried
- a Boolean indicating whether this query should verify domain
existence ("true") or retrieve the policy TXT record ("false")
- a pointer to a buffer that should receive the result of the
policy lookup
- the number of bytes available there
- a pointer to an integer which should receive the result of
the query attempt, and should be one of the known constants
used to report the status of a DNS query (e.g. NXDOMAIN,
NOERROR, SERVFAIL, etc., typically defined
in <arpa/nameser.h>)
The function should return a valid
DKIM_CBSTAT constant; in
particular, if no policy is found, the contents of buf
should be unchanged and DKIM_CBSTAT_CONTINUE should be
returned. If func is NULL, the internal policy lookup
implementation will be used. |
|