s/qmail 4.3.17
Next generation secure email transport
|
Go to the source code of this file.
Macros | |
#define | SPF_INIT -1 |
#define | SPF_EXT -2 /* x */ |
#define | SPF_ME -3 |
#define | SPF_EXHAUST -4 |
#define | SPF_LOOP -5 |
#define | SPF_MULTIRR -6 |
#define | SPF_LOCAL -7 |
#define | SPF_ERROR -8 |
#define | SPF_NOMEM -9 |
#define | SPF_SYNTAX -10 /* Setup problem */ |
#define | SPF_OK 0 /* + Pass */ |
#define | SPF_NONE 1 /* o None */ |
#define | SPF_UNKNOWN 2 /* u Unknown method */ |
#define | SPF_NEUTRAL 3 /* ? Neutral */ |
#define | SPF_SOFTFAIL 4 /* ~ Softfail */ |
#define | SPF_FAIL 5 /* - Not Permitted */ |
#define | SPF_DNSSOFT 6 /* d From DNS; not used */ |
#define | LOOKUP_LIMIT 10 |
#define | SPF_DEFEXP "See http://%{d}/why.html?sender=%{s}&ip=%{i}&receiver=%{r}" |
#define | WSPACE(x) ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n') |
#define | NXTOK(b, p, a) |
Functions | |
int | match_ip4 (unsigned char[4], int, char[4]) |
match_ip compares IPv4/IPv6 addreses up to prefix length | |
int | match_ip6 (unsigned char[16], int, char[16]) |
int | get_prefix (char *) |
get_prefix return integer value of prefix length | |
int | spf_records (stralloc *, stralloc *) |
spf_records get TXT records for domain and extract SPF information | |
int | spf_include (char *, char *) |
spf_include deals with recursive evaluation of SPF record [RFC7208 Sec. 5.2] | |
int | spf_a (char *, char *) |
spf_a (a; a:fqdns; a:fqdns/56) compares A + AAAA records for SPF info and client host | |
int | spf_mx (char *, char *) |
spf_mx (mx; mx:domain; mx:domain/24) compares MX records for SPF info and client host | |
int | spf_ptr (char *, char *) |
spf_ptr (ptr; ptr:fqdn) compares PTR records from SPF info and client host | |
int | spf_ip4 (char *, char *) |
spf_ip4 (ip4; ip4:fqdn; ip4:fqdn/24) compares A records for SPF info and client host | |
int | spf_ip6 (char *, char *) |
spf_ip6 (ip6; ip6:fqdn; ip6:fqdn/56) compares AAAA records for SPF info and client host | |
int | spf_exists (char *, char *) |
spf_exists (exists; exists:fqdn) simply looks for a A records only for SPF info and client host | |
int | spf_query (const char *, const char *, const char *, const char *, const int) |
spf_query prepares the SPF TXT record query | |
int | spf_lookup (stralloc *) |
spf_lookup calles the actual (recursive) SPF DNS query | |
int | spf_mechanism (char *, char *, char *, char *) |
spf_mechanism evaluates the provided mechanisms in the SPF record [RFC7208 Sec 5.] | |
int | spf_parse (stralloc *, char *, char *) |
spf_parse parses the substructure of the SPF record and calls spf_macros | |
int | spf_macros (stralloc *, char *, char *) |
spf_macros deals with macros in the SPF specificaton [RFC7208 Sec. 7ff] | |
int | spf_info (char *, const char *) |
Variables | |
int | flagip6 |
stralloc | spfmf |
stralloc | spfhelo |
stralloc | spfinfo |
stralloc | spfdomain |
stralloc | dnsname |
stralloc | spflocalrules |
stralloc | spfrecord |
stralloc | expdomain |
stralloc | spfexplain |
stralloc | spfexpmsg |
#define WSPACE | ( | x | ) | ((x) == ' ' || (x) == '\t' || (x) == '\r' || (x) == '\n') |
int get_prefix | ( | char * | prefix | ) |
get_prefix return integer value of prefix length
input | pointer to prefix |
Definition at line 65 of file spfdnsip.c.
match_ip compares IPv4/IPv6 addreses up to prefix length
input | ip_address1,prefix length, ip_address2 |
Definition at line 30 of file spfdnsip.c.
int spf_a | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_a (a; a:fqdns; a:fqdns/56) compares A + AAAA records for SPF info and client host
input | pointer to spfspecification, pointer to prefix |
Definition at line 145 of file spfdnsip.c.
int spf_exists | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_exists (exists; exists:fqdn) simply looks for a A records only for SPF info and client host
input | pointer to spfspecification, prefix not used |
Definition at line 391 of file spfdnsip.c.
int spf_include | ( | char * | spfspec, |
char * | prefix | ||
) |
int spf_info | ( | char * | s, |
const char * | t | ||
) |
int spf_ip4 | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_ip4 (ip4; ip4:fqdn; ip4:fqdn/24) compares A records for SPF info and client host
input | pointer to spfspecification, pointer to prefix |
Definition at line 345 of file spfdnsip.c.
int spf_ip6 | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_ip6 (ip6; ip6:fqdn; ip6:fqdn/56) compares AAAA records for SPF info and client host
input | pointer to spfspecification, pointer to prefix |
Definition at line 368 of file spfdnsip.c.
int spf_lookup | ( | stralloc * | domain | ) |
spf_lookup calles the actual (recursive) SPF DNS query
input | pointer to stralloc domain (fqdn) @input stralloc spflocalrules (if provided – for artificial results) @output stralloc spfdata with RDATA (+ artificial information) |
Definition at line 158 of file spf.c.
int spf_macros | ( | stralloc * | expand, |
char * | macro, | ||
char * | domain | ||
) |
spf_macros deals with macros in the SPF specificaton [RFC7208 Sec. 7ff]
input | pointer to SPF macro, pointer to domain output: pointer to stralloc expand(ed information) |
Definition at line 502 of file spf.c.
int spf_mechanism | ( | char * | mechanism, |
char * | spfspec, | ||
char * | prefix, | ||
char * | domain | ||
) |
spf_mechanism evaluates the provided mechanisms in the SPF record [RFC7208 Sec 5.]
input | pointer to mechanism, SPF specification from record, CIDR prefix length, domain @input stralloc spflocalrules (if provided) @output pointer to spfspec: data evaluated |
Definition at line 391 of file spf.c.
int spf_mx | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_mx (mx; mx:domain; mx:domain/24) compares MX records for SPF info and client host
input | pointer to spfspecification, pointer to prefix |
Definition at line 192 of file spfdnsip.c.
int spf_parse | ( | stralloc * | sa, |
char * | spfspec, | ||
char * | domain | ||
) |
spf_parse parses the substructure of the SPF record and calls spf_macros
input | pointer to SPF specification, pointer to domain output: stralloc sa – @output pointer to spfspec: with found data |
Definition at line 461 of file spf.c.
int spf_ptr | ( | char * | spfspec, |
char * | prefix | ||
) |
spf_ptr (ptr; ptr:fqdn) compares PTR records from SPF info and client host
input | pointer to spfspecification; prefix not used |
Definition at line 235 of file spfdnsip.c.
int spf_records | ( | stralloc * | spfrec, |
stralloc * | domain | ||
) |
spf_records get TXT records for domain and extract SPF information
input | pointer stralloc domain output: pointer to stralloc spf records |
Definition at line 93 of file spfdnsip.c.
|
extern |