From 6c0926be32e890baba2cac29c5398e82a49c7ab1 Mon Sep 17 00:00:00 2001 From: John Denker Date: Fri, 3 Aug 2012 22:04:43 -0700 Subject: a more logical way of keeping track of what hosts have been seen --- tools/sepofra.c | 9 +++++---- tools/sepofra.h | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'tools') 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 #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 #include "bad_thing.h" -typedef std::map MSI; +typedef std::map MSR; class sepofra{ public: SPF_result_t result; std::list authorities; - MSI seen; + MSR seen; std::string ip; std::string mailfrom; std::string helo; -- cgit v1.2.3