libspf2 1.2.11
Macros | Functions
spf.h File Reference
#include "spf_lib_version.h"
#include "spf_server.h"
#include "spf_request.h"
#include "spf_response.h"
#include "spf_dns.h"
#include "spf_log.h"
Include dependency graph for spf.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __attribute__(x)
 
#define SPF_VERSION   1
 
#define SPF_VER_STR   "v=spf1"
 
#define SPF_C_ERR_MSG_SIZE   (2*80)
 
#define SPF_SMTP_COMMENT_SIZE   (4*80)
 
#define SPF_RECEIVED_SPF_SIZE   (6*80)
 
#define SPF_SYSLOG_SIZE   (10*80)
 
#define SPF_DEFAULT_MAX_DNS_MECH   10
 
#define SPF_DEFAULT_MAX_DNS_PTR   10
 
#define SPF_DEFAULT_MAX_DNS_MX   10
 
#define SPF_DEFAULT_SANITIZE   1
 
#define SPF_DEFAULT_WHITELIST   "include:spf.trusted-forwarder.org"
 
#define SPF_EXP_MOD_NAME   "exp-text"
 
#define SPF_DEFAULT_EXP   "Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}"
 

Functions

const char * SPF_strerror (SPF_errcode_t spf_err)
 
const char * SPF_strresult (SPF_result_t result)
 
const char * SPF_strreason (SPF_reason_t reason)
 
void SPF_get_lib_version (int *major, int *minor, int *patch)
 
const char * SPF_strrrtype (ns_type rr_type)
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   x)

Definition at line 17 of file spf.h.

◆ SPF_C_ERR_MSG_SIZE

#define SPF_C_ERR_MSG_SIZE   (2*80)

FYI only – can't be changed without recompiling the library Most error messages are under 80 characters and we don't want bad/malicious input to cause huge error messages.

Definition at line 46 of file spf.h.

◆ SPF_DEFAULT_EXP

#define SPF_DEFAULT_EXP   "Please%_see%_http://www.openspf.org/Why?id=%{S}&ip=%{C}&receiver=%{R}"

The default SPF explanation, if no other is provided in the SPF_server_t object.

Definition at line 67 of file spf.h.

◆ SPF_DEFAULT_MAX_DNS_MECH

#define SPF_DEFAULT_MAX_DNS_MECH   10

FYI only – can't be changed without recompiling the library DoS limit on SPF mechanisms.

Definition at line 59 of file spf.h.

◆ SPF_DEFAULT_MAX_DNS_MX

#define SPF_DEFAULT_MAX_DNS_MX   10

DoS limit on MX records.

Definition at line 61 of file spf.h.

◆ SPF_DEFAULT_MAX_DNS_PTR

#define SPF_DEFAULT_MAX_DNS_PTR   10

DoS limit on PTR records.

Definition at line 60 of file spf.h.

◆ SPF_DEFAULT_SANITIZE

#define SPF_DEFAULT_SANITIZE   1

Definition at line 62 of file spf.h.

◆ SPF_DEFAULT_WHITELIST

#define SPF_DEFAULT_WHITELIST   "include:spf.trusted-forwarder.org"

Definition at line 63 of file spf.h.

◆ SPF_EXP_MOD_NAME

#define SPF_EXP_MOD_NAME   "exp-text"

Definition at line 64 of file spf.h.

◆ SPF_RECEIVED_SPF_SIZE

#define SPF_RECEIVED_SPF_SIZE   (6*80)

Definition at line 48 of file spf.h.

◆ SPF_SMTP_COMMENT_SIZE

#define SPF_SMTP_COMMENT_SIZE   (4*80)

Definition at line 47 of file spf.h.

◆ SPF_SYSLOG_SIZE

#define SPF_SYSLOG_SIZE   (10*80)

Definition at line 49 of file spf.h.

◆ SPF_VER_STR

#define SPF_VER_STR   "v=spf1"

Definition at line 35 of file spf.h.

◆ SPF_VERSION

#define SPF_VERSION   1

Definition at line 34 of file spf.h.

Function Documentation

◆ SPF_get_lib_version()

void SPF_get_lib_version ( int *  major,
int *  minor,
int *  patch 
)

Returns the version information library. Useful if the library is a shared library and may differ from when the application was compiled.

Returns the version numbers of this library.

Definition at line 41 of file spf_utils.c.

References SPF_LIB_VERSION_MAJOR, SPF_LIB_VERSION_MINOR, and SPF_LIB_VERSION_PATCH.

Referenced by main().

◆ SPF_strerror()

const char * SPF_strerror ( SPF_errcode_t  spf_err)

◆ SPF_strreason()

const char * SPF_strreason ( SPF_reason_t  reason)

SPF_strreason() translates the SPF reason number into a readable string

Converts an SPF reason to a short human-readable string.

Definition at line 131 of file spf_utils.c.

References SPF_REASON_2MX, SPF_REASON_DEFAULT, SPF_REASON_LOCAL_POLICY, SPF_REASON_LOCALHOST, SPF_REASON_MECH, and SPF_REASON_NONE.

Referenced by SPF_record_interpret().

◆ SPF_strresult()

const char * SPF_strresult ( SPF_result_t  result)

SPF_strresult() translates the SPF result number into a readable string

Converts an SPF result to a short human-readable string.

Definition at line 84 of file spf_utils.c.

References SPF_RESULT_FAIL, SPF_RESULT_INVALID, SPF_RESULT_NEUTRAL, SPF_RESULT_NONE, SPF_RESULT_PASS, SPF_RESULT_PERMERROR, SPF_RESULT_SOFTFAIL, and SPF_RESULT_TEMPERROR.

Referenced by main(), and SPF_record_interpret().

◆ SPF_strrrtype()

const char * SPF_strrrtype ( ns_type  rr_type)

Definition at line 166 of file spf_utils.c.

References ns_t_a, ns_t_aaaa, ns_t_any, ns_t_invalid, ns_t_mx, ns_t_ptr, ns_t_spf, and ns_t_txt.