libspf2
1.2.11
|
Go to the source code of this file.
Data Structures | |
struct | SPF_data_str_t |
struct | SPF_data_var_t |
struct | SPF_data_cidr_t |
union | SPF_data_t |
struct | SPF_mech_t |
struct | SPF_mod_t |
struct | SPF_record_t |
struct | SPF_macro_t |
Macros | |
#define | SPF_MAX_STR_LEN 255 /* limits on SPF_data_str_t.len, */ |
#define | SPF_MAX_MECH_LEN 511 |
#define | SPF_MAX_MOD_LEN 511 |
#define | PARM_LP_FROM 0 |
#define | PARM_ENV_FROM 1 |
#define | PARM_DP_FROM 2 |
#define | PARM_CUR_DOM 3 |
#define | PARM_CLIENT_IP 4 |
#define | PARM_CLIENT_IP_P 5 |
#define | PARM_TIME 6 |
#define | PARM_CLIENT_DOM 7 |
#define | PARM_CLIENT_VER 8 |
#define | PARM_HELO_DOM 9 |
#define | PARM_REC_DOM 10 |
#define | PARM_CIDR 11 |
#define | PARM_STRING 12 |
#define | PREFIX_PASS SPF_RESULT_PASS |
#define | PREFIX_FAIL SPF_RESULT_FAIL |
#define | PREFIX_SOFTFAIL SPF_RESULT_SOFTFAIL |
#define | PREFIX_NEUTRAL SPF_RESULT_NEUTRAL |
#define | PREFIX_UNKNOWN SPF_RESULT_PERMERROR |
#define | MECH_UNKNOWN 0 |
#define | MECH_A 1 |
#define | MECH_MX 2 |
#define | MECH_PTR 3 |
#define | MECH_INCLUDE 4 |
#define | MECH_IP4 5 |
#define | MECH_IP6 6 |
#define | MECH_EXISTS 7 |
#define | MECH_ALL 8 |
#define | MECH_REDIRECT 9 |
Functions | |
SPF_record_t * | SPF_record_new (SPF_server_t *spf_server, const char *text) |
void | SPF_record_free (SPF_record_t *rp) |
void | SPF_macro_free (SPF_macro_t *mac) |
SPF_errcode_t | SPF_record_find_mod_value (SPF_server_t *spf_server, SPF_request_t *spf_request, SPF_response_t *spf_response, SPF_record_t *spf_record, const char *mod_name, char **bufp, size_t *buflenp) |
SPF_errcode_t | SPF_record_compile (SPF_server_t *spf_server, SPF_response_t *spf_response, SPF_record_t **spf_recordp, const char *record) |
SPF_errcode_t | SPF_record_compile_macro (SPF_server_t *spf_server, SPF_response_t *spf_response, SPF_macro_t **spf_macrop, const char *record) |
SPF_errcode_t | SPF_record_interpret (SPF_record_t *spf_record, SPF_request_t *spf_request, SPF_response_t *spf_response, int depth) |
SPF_errcode_t | SPF_record_expand_data (SPF_server_t *spf_server, SPF_request_t *spf_request, SPF_response_t *spf_response, SPF_data_t *data, size_t data_len, char **bufp, size_t *buflenp) |
SPF_errcode_t | SPF_record_print (SPF_record_t *spf_record) |
SPF_errcode_t | SPF_record_stringify (SPF_record_t *spf_record, char **bufp, size_t *buflenp) |
Compiled SPF record
The compiled form of the SPF record is as follows:
Definition in file spf_record.h.
#define MECH_A 1 |
Definition at line 163 of file spf_record.h.
#define MECH_ALL 8 |
Definition at line 170 of file spf_record.h.
#define MECH_EXISTS 7 |
Definition at line 169 of file spf_record.h.
#define MECH_INCLUDE 4 |
Definition at line 166 of file spf_record.h.
#define MECH_IP4 5 |
Definition at line 167 of file spf_record.h.
#define MECH_IP6 6 |
Definition at line 168 of file spf_record.h.
#define MECH_MX 2 |
Definition at line 164 of file spf_record.h.
#define MECH_PTR 3 |
Definition at line 165 of file spf_record.h.
#define MECH_REDIRECT 9 |
Definition at line 171 of file spf_record.h.
#define MECH_UNKNOWN 0 |
Mechanisms Return PERMERROR
Definition at line 162 of file spf_record.h.
#define PARM_CIDR 11 |
CIDR lengths (IPv4 and v6)
Definition at line 99 of file spf_record.h.
#define PARM_CLIENT_DOM 7 |
p = SMTP client domain name
Definition at line 95 of file spf_record.h.
#define PARM_CLIENT_IP 4 |
i = SMTP client IP
Definition at line 92 of file spf_record.h.
#define PARM_CLIENT_IP_P 5 |
c = SMTP client IP (pretty)
Definition at line 93 of file spf_record.h.
#define PARM_CLIENT_VER 8 |
v = IP ver str - in-addr/ip6
Definition at line 96 of file spf_record.h.
#define PARM_CUR_DOM 3 |
d = current-domain
Definition at line 91 of file spf_record.h.
#define PARM_DP_FROM 2 |
o = envelope-domain
Definition at line 90 of file spf_record.h.
#define PARM_ENV_FROM 1 |
s = envelope-sender
Definition at line 89 of file spf_record.h.
#define PARM_HELO_DOM 9 |
h = HELO/EHLO domain
Definition at line 97 of file spf_record.h.
#define PARM_LP_FROM 0 |
Tokens and macros to be expanded in SPF_data_str_t in mech/mod l = local-part of envelope-sender
Definition at line 88 of file spf_record.h.
#define PARM_REC_DOM 10 |
r = receiving domain
Definition at line 98 of file spf_record.h.
#define PARM_STRING 12 |
literal string
Definition at line 100 of file spf_record.h.
#define PARM_TIME 6 |
t = time in UTC epoch secs
Definition at line 94 of file spf_record.h.
#define PREFIX_FAIL SPF_RESULT_FAIL |
Definition at line 154 of file spf_record.h.
#define PREFIX_NEUTRAL SPF_RESULT_NEUTRAL |
Definition at line 156 of file spf_record.h.
#define PREFIX_PASS SPF_RESULT_PASS |
Prefixes
Definition at line 153 of file spf_record.h.
#define PREFIX_SOFTFAIL SPF_RESULT_SOFTFAIL |
Definition at line 155 of file spf_record.h.
#define PREFIX_UNKNOWN SPF_RESULT_PERMERROR |
Definition at line 157 of file spf_record.h.
#define SPF_MAX_MECH_LEN 511 |
Definition at line 77 of file spf_record.h.
#define SPF_MAX_MOD_LEN 511 |
Definition at line 78 of file spf_record.h.
#define SPF_MAX_STR_LEN 255 /* limits on SPF_data_str_t.len, */ |
Definition at line 73 of file spf_record.h.
void SPF_macro_free | ( | SPF_macro_t * | mac | ) |
Definition at line 73 of file spf_record.c.
Referenced by SPF_server_free(), and SPF_server_set_explanation().
SPF_errcode_t SPF_record_compile | ( | SPF_server_t * | spf_server, |
SPF_response_t * | spf_response, | ||
SPF_record_t ** | spf_recordp, | ||
const char * | record | ||
) |
The SPF compiler.
It converts the SPF record in string format that is easy for people to deal with into a compact binary format that is easy for computers to deal with.
Definition at line 1180 of file spf_compile.c.
Referenced by SPF_server_set_localpolicy().
SPF_errcode_t SPF_record_compile_macro | ( | SPF_server_t * | spf_server, |
SPF_response_t * | spf_response, | ||
SPF_macro_t ** | spf_macrop, | ||
const char * | record | ||
) |
Definition at line 1499 of file spf_compile.c.
Referenced by SPF_server_set_explanation().
SPF_errcode_t SPF_record_expand_data | ( | SPF_server_t * | spf_server, |
SPF_request_t * | spf_request, | ||
SPF_response_t * | spf_response, | ||
SPF_data_t * | data, | ||
size_t | data_len, | ||
char ** | bufp, | ||
size_t * | buflenp | ||
) |
In spf_expand.c
This could better collect errors, like the compiler does. This requires that *bufp be either malloced to *buflenp, or NULL This may realloc *bufp.
Definition at line 81 of file spf_expand.c.
SPF_errcode_t SPF_record_find_mod_value | ( | SPF_server_t * | spf_server, |
SPF_request_t * | spf_request, | ||
SPF_response_t * | spf_response, | ||
SPF_record_t * | spf_record, | ||
const char * | mod_name, | ||
char ** | bufp, | ||
size_t * | buflenp | ||
) |
Definition at line 126 of file spf_record.c.
void SPF_record_free | ( | SPF_record_t * | rp | ) |
Definition at line 63 of file spf_record.c.
Referenced by SPF_server_free(), and SPF_server_set_localpolicy().
SPF_errcode_t SPF_record_interpret | ( | SPF_record_t * | spf_record, |
SPF_request_t * | spf_request, | ||
SPF_response_t * | spf_response, | ||
int | depth | ||
) |
Definition at line 585 of file spf_interpret.c.
SPF_record_t* SPF_record_new | ( | SPF_server_t * | spf_server, |
const char * | text | ||
) |
In spf_record.c
Definition at line 48 of file spf_record.c.
SPF_errcode_t SPF_record_print | ( | SPF_record_t * | spf_record | ) |
In spf_print.c
Definition at line 45 of file spf_print.c.
References NULL, SPF_E_RESULT_UNKNOWN, SPF_E_SUCCESS, SPF_info, SPF_infof, SPF_record_stringify(), and SPF_strerror().
SPF_errcode_t SPF_record_stringify | ( | SPF_record_t * | spf_record, |
char ** | bufp, | ||
size_t * | buflenp | ||
) |
Definition at line 245 of file spf_id2str.c.
References debug, MECH_A, MECH_INCLUDE, MECH_IP4, MECH_MX, MECH_PTR, SPF_mech_t::mech_type, PREFIX_FAIL, PREFIX_NEUTRAL, PREFIX_PASS, PREFIX_SOFTFAIL, SPF_mech_t::prefix_type, PREFIX_UNKNOWN, SPF_ASSERT_NOTNULL, SPF_debugf, SPF_E_INTERNAL_ERROR, SPF_E_INVALID_PREFIX, SPF_E_RESULT_UNKNOWN, SPF_E_SUCCESS, SPF_recalloc(), and SPF_VER_STR.
Referenced by SPF_record_print().