#include <sys/types.h>
#include <arpa/inet.h>
Go to the source code of this file.
Data Structures | |
struct | spf_result_t |
struct | policy_addr_s |
struct | spf_config_s |
struct | strbuf_node_s |
struct | strbuf_s |
struct | split_str_node_s |
struct | split_str_s |
struct | peer_info_s |
Defines | |
#define | _SPF_H 1 |
#define | SPF_VERSION 1 |
#define | MAX_CNAME 5 /* we follow up max CNAMEs */ |
#define | MAX_DEBUG_LEN 1024 |
#define | MAX_MACRO_LEN 1024 /* max length of an expanded macro */ |
#define | MAX_PLEN 1024 /* buffer to make UTIL_printf thread safe */ |
#define | LOCAL_PART 256 /* local-part, text before @ in email addy */ |
#define | ENV_SENDER 512 /* entire FROM: string passed by MTA */ |
#define | CUR_DOM 256 /* text after @ in email addy for cur query */ |
#define | UTC_TIME 22 /* time since epoch */ |
#define | IP_ADDR 17 /* ip of remote peer - DON'T CHANGE FROM 17!! */ |
#define | IP_VER 8 /* ip protocol version */ |
#define | ENV_HELO 512 /* entire HELO string passed by MTA */ |
#define | MAX_HNAME 256 /* hostname of MTA */ |
#define | MAX_RESULT 64 /* human readable SPF result */ |
#define | MAX_ERROR 96 /* human readable error reason */ |
#define | EXPLAIN_S 256 /* change to EXPLAIN when cleaning up */ |
#define | ENV_RECV 512 /* Received-SPF: header string */ |
#define | MAX_RES_STR 12 /* maximum legnth of a res str eg: "pass" */ |
#define | MAX_MECHANISM 256 /* maximum length of a mechanism */ |
#define | MAX_HEADER 512 /* maximum length of header for prepend */ |
#define | MAX_SMTP_RES 256 /* maximum length of smtp resonse string */ |
#define | HR_PASS "pass" |
#define | HR_NONE "none" |
#define | HR_S_FAIL "softfail" |
#define | HR_H_FAIL "fail" |
#define | HR_ERROR "error" |
#define | HR_NEUTRAL "neutral" |
#define | HR_UNKNOWN "unknown" |
#define | HR_UNMECH "unknown mechanism" |
#define | SPF_EXPLAIN |
#define | SPF_GUESS "v=spf1 a/24 mx/24 ptr " |
#define | SPF_TRUSTED "v=spf1 include:spf.trusted-forwarder.org " |
Typedefs | |
typedef enum SPF_BOOL | SPF_BOOL |
typedef enum SPF_RESULT | SPF_RESULT |
typedef enum SPF_ACTION | SPF_ACTION |
typedef enum SPF_MECHANISM | SPF_MECHANISM |
typedef spf_result_t | spf_result_t |
typedef policy_addr_s | policy_addr_t |
typedef spf_config_s | spf_config_t |
typedef strbuf_node_s | strbuf_node_t |
typedef strbuf_s | strbuf_t |
typedef split_str_node_s | split_str_node_t |
typedef split_str_s | split_str_t |
typedef peer_info_s | peer_info_t |
Enumerations | |
enum | SPF_BOOL { FALSE = 0, TRUE } |
enum | SPF_RESULT { SPF_PASS = 0, SPF_NONE, SPF_S_FAIL, SPF_H_FAIL, SPF_ERROR, SPF_NEUTRAL, SPF_UNKNOWN, SPF_UNMECH } |
enum | SPF_ACTION { DEFER = 0, TARPIT, ALLOW, REJECT } |
enum | SPF_MECHANISM { NO_POLICY = 0, VERSION, ALL, INCLUDE, A, MX, PTR, IP4, IP6, EXISTS, REDIRECT, EXPLAIN, DEFAULT, UNMECH } |
Functions | |
void | SPF_dbg_level (int level) |
peer_info_t * | SPF_init (const char *local, const char *rip, const char *expl, const char *tf, const char *guess, u_int32_t use_trust, u_int32_t use_guess) |
peer_info_t * | SPF_close (peer_info_t *peer_info) |
SPF_RESULT | SPF_policy_main (peer_info_t *peer_info) |
SPF_RESULT | SPF_policy_main_rec (peer_info_t *peer_info, int rec) |
SPF_BOOL | SPF_parse_policy (peer_info_t *peer_info, const char *policy) |
char * | SPF_result (peer_info_t *peer_info) |
SPF_BOOL | SPF_smtp_from (peer_info_t *peer_info, const char *s) |
SPF_BOOL | SPF_smtp_helo (peer_info_t *peer_info, const char *s) |
char * | SPF_build_header (peer_info_t *peer_info) |
char * | SPF_get_explain (peer_info_t *peer_info) |
Variables | |
spf_config_t | confg |
u_int8_t | spf_rlevel |
|
|
|
|
|
|
|
|
|
|
|
|
|
Definition at line 99 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 98 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 100 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 96 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 95 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 97 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 101 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 102 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 79 of file spf.h. Referenced by UTIL_cidr_cmp(), and UTIL_validate_hostname(). |
|
|
|
Definition at line 75 of file spf.h. Referenced by SPF_init(), and SPF_smtp_from(). |
|
Definition at line 69 of file spf.h. Referenced by SPF_policy_main_rec(). |
|
Definition at line 71 of file spf.h. Referenced by _printf_dbg(), and UTIL_log_result(). |
|
Definition at line 85 of file spf.h. Referenced by DNS_query(), SPF_init(), SPF_policy_main_rec(), and UTIL_assoc_prefix(). |
|
Definition at line 91 of file spf.h. Referenced by SPF_build_header(), and SPF_result(). |
|
|
|
|
|
Definition at line 90 of file spf.h. Referenced by SPF_init(), and SPF_parse_policy(). |
|
|
|
|
|
|
|
Definition at line 92 of file spf.h. Referenced by SPF_result(). |
|
Value:
Definition at line 105 of file spf.h. Referenced by SPF_get_explain(), and SPF_policy_main_rec(). |
|
Definition at line 109 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 112 of file spf.h. Referenced by SPF_init(). |
|
Definition at line 55 of file spf.h. Referenced by SPF_parse_policy(), and UTIL_log_result(). |
|
Definition at line 78 of file spf.h. Referenced by MACRO_process(). |
|
Referenced by DNS_query(), and SPF_init(). |
|
Referenced by SPF_parse_policy(). |
|
|
|
|
|
|
Referenced by SPF_parse_policy(), and UTIL_get_policy_mech(). |
|
Referenced by SPF_parse_policy(), SPF_policy_main(), SPF_policy_main_rec(), and UTIL_get_mech_prefix(). |
|
|
|
|
|
|
|
Referenced by MACRO_expand(). |
|
Referenced by MACRO_expand(). |
|
|
|
|
|
|
|
|
|
Definition at line 975 of file main.c. References peer_info_s::cur_dom, peer_info_s::error, peer_info_s::from, peer_info_s::last_m, MAX_HEADER, peer_info_s::mta_hname, peer_info_s::r_ip, peer_info_s::RES, SPF_ERROR, SPF_H_FAIL, SPF_NEUTRAL, SPF_NONE, SPF_PASS, peer_info_s::spf_result, SPF_S_FAIL, SPF_UNKNOWN, SPF_UNMECH, xmalloc, and xvprintf. |
|
Definition at line 207 of file main.c. References peer_info_s::cur_dom, peer_info_s::cur_eaddr, peer_info_s::explain, peer_info_s::from, peer_info_s::guess, peer_info_s::helo, peer_info_s::mta_hname, peer_info_s::ptr_mhost, peer_info_s::r_ip, peer_info_s::r_vhname, peer_info_s::trusted, xeprintf, and xfree. Referenced by main(). |
|
|
|
Definition at line 944 of file main.c. References peer_info_s::explain, MACRO_expand(), SPF_EXPLAIN, and xprintf. |
|
|
|
Definition at line 247 of file main.c. References SPF_policy_main_rec(), and SPF_RESULT. Referenced by main(), and SPF_parse_policy(). |
|
Definition at line 268 of file main.c. References peer_info_s::addr, peer_info_s::cur_dom, DNS_query(), peer_info_s::error, peer_info_s::explain, peer_info_s::guess, peer_info_s::last_m, MACRO_expand(), MAX_CNAME, MAX_ERROR, peer_info_s::RES, peer_info_s::rs, SPF_ERROR, SPF_EXPLAIN, SPF_NONE, SPF_parse_policy(), SPF_PASS, SPF_RECURSE, SPF_RESULT, spf_rlevel, SPF_UNKNOWN, TRUE, peer_info_s::trusted, peer_info_s::use_guess, peer_info_s::use_trust, UTIL_assoc_prefix(), UTIL_log_result(), xeprintf, xfree, xprintf, and xvprintf. Referenced by SPF_policy_main(). |
|
Definition at line 886 of file main.c. References peer_info_s::from, MAX_HEADER, MAX_SMTP_RES, peer_info_s::r_ip, peer_info_s::RES, RES_ERROR, RES_H_FAIL, RES_NEUTRAL, RES_NONE, RES_PASS, RES_S_FAIL, RES_UNKNOWN, RES_UNMECH, SPF_ERROR, SPF_H_FAIL, SPF_NEUTRAL, SPF_NONE, SPF_PASS, SPF_S_FAIL, SPF_UNKNOWN, SPF_UNMECH, xmalloc, and xprintf. |
|
Definition at line 1077 of file main.c. References peer_info_s::cur_dom, FALSE, peer_info_s::from, peer_info_s::helo, peer_info_s::local_part, LOCAL_PART, SPF_BOOL, TRUE, xfree, xprintf, xstrdup, and xvprintf. Referenced by main(). |
|
Definition at line 1043 of file main.c. References peer_info_s::ehlo, peer_info_s::helo, SPF_BOOL, xfree, xprintf, and xstrdup. Referenced by main(). |
|
Definition at line 353 of file spf.h. Referenced by _printf_dbg(), and main(). |
|
Definition at line 354 of file spf.h. Referenced by SPF_parse_policy(), SPF_policy_main_rec(), UTIL_assoc_prefix(), UTIL_get_mech_prefix(), and UTIL_log_result(). |