diff options
Diffstat (limited to 'tools/sepofra.h')
-rw-r--r-- | tools/sepofra.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/sepofra.h b/tools/sepofra.h new file mode 100644 index 0000000..89719fb --- /dev/null +++ b/tools/sepofra.h @@ -0,0 +1,49 @@ +#include <string> +#include <list> +# include <sys/socket.h> /* inet_ functions / structs */ +# include <netinet/in.h> /* inet_ functions / structs */ +# include <arpa/inet.h> /* in_addr struct */ + +#ifdef __cplusplus +extern "C" { +# include "spf2/spf.h" +} +#else +# include "spf2/spf.h" +#endif + +#include <string.h> +#include "bad_thing.h" + +class sepofra{ +public: + SPF_result_t result; + std::list<std::string> authorities; + std::string ip; + std::string mailfrom; + SPF_request_t* spf_request; + SPF_response_t* spf_response; + + sepofra() + : result(SPF_RESULT_INVALID), + spf_request(NULL), + spf_response(NULL) + {} + void check( + const std::string opt_ip, + const std::string opt_helo, + const std::string opt_mailfrom, + const std::string opt_rcpt_to, + const int opt_debug); + + std::string explain() const; + SPF_result_t check1( + const std::string host, + const std::string msg, + const int debug); +}; + + +void dumpit(const int opt_debug, + SPF_response_t* spf_response, + const char* msg); |