summaryrefslogtreecommitdiff
path: root/tools/sepofra.h
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-08-01 01:08:21 (GMT)
committerJohn Denker <jsd@av8n.com>2012-08-01 01:08:21 (GMT)
commit159a3f448ad2caf9468921a4387c2dbafe09c3a3 (patch)
treeb16f9593b43e0cada94d6a87c4380fd0ed1d56eb /tools/sepofra.h
parent3f3c46c8ee8ef118ce73da7d3235364edf390cfe (diff)
bring sepofra over from ~/hack/
Diffstat (limited to 'tools/sepofra.h')
-rw-r--r--tools/sepofra.h49
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);