diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/sepofra.c | 9 | ||||
-rw-r--r-- | tools/sepofra.h | 4 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tools/sepofra.c b/tools/sepofra.c index 0a731b9..7ee9c8a 100644 --- a/tools/sepofra.c +++ b/tools/sepofra.c @@ -2,7 +2,7 @@ #include <sstream> #include "sepofra.h" -#include "utils.h" +#include "utils.h" /* for trim() */ #ifndef HOST_NAME_MAX #define HOST_NAME_MAX 255 @@ -47,9 +47,9 @@ SPF_result_t sepofra::check1(const string _host, if (!host.length()) return SPF_RESULT_INVALID; if (seen.find(host) != seen.end()) { // already checked this one - return SPF_RESULT_SOFTFAIL; + return seen[host]; } - seen[host] = 1; + seen[host] = SPF_RESULT_TEMPERROR; authorities.push_back(host); if (SPF_request_set_env_from( spf_request, @@ -60,7 +60,8 @@ SPF_result_t sepofra::check1(const string _host, if (spf_response) SPF_response_free(spf_response); SPF_request_query_mailfrom(spf_request, &spf_response); if (debug) dumpit(debug, spf_response, ""); - return SPF_response_result(spf_response); + + return seen[host] = SPF_response_result(spf_response); } diff --git a/tools/sepofra.h b/tools/sepofra.h index 60a404f..17aa51a 100644 --- a/tools/sepofra.h +++ b/tools/sepofra.h @@ -16,13 +16,13 @@ extern "C" { #include <string.h> #include "bad_thing.h" -typedef std::map<std::string,int> MSI; +typedef std::map<std::string,SPF_result_t> MSR; class sepofra{ public: SPF_result_t result; std::list<std::string> authorities; - MSI seen; + MSR seen; std::string ip; std::string mailfrom; std::string helo; |