diff options
-rw-r--r-- | tools/greylist.c | 14 | ||||
-rw-r--r-- | tools/libltgrey.c | 14 | ||||
-rw-r--r-- | tools/sepofra.c | 3 |
3 files changed, 22 insertions, 9 deletions
diff --git a/tools/greylist.c b/tools/greylist.c index 9af70eb..aaa9510 100644 --- a/tools/greylist.c +++ b/tools/greylist.c @@ -413,7 +413,7 @@ int whatsit::check_dns(){ int sts = check_dns_sub(addr, host, checked); if (sts == 0) return sts; if (sts != ex_badDNS) return sts; // possible ex_syserr -#if 1 +#ifndef badDNSfatal sts = 0; // demote badDNS to just a warning #endif cerr << progid; @@ -431,6 +431,11 @@ int whatsit::check_dns(){ int whatsit::check_dns_sub(string &addr, string &host, vector<string> &checked){ +#ifdef badDNSfatal + int ex_dns_fail = ex_syserr; +#else + int ex_dns_fail = ex_badDNS; +#endif struct addrinfo *result; struct addrinfo *ipresult; struct addrinfo *res; @@ -450,11 +455,12 @@ int whatsit::check_dns_sub(string &addr, string &host, vector<string> &checked){ << " odd error " << error << " in getaddrinfo for " << ipvar << " : " << gai_strerror(error) << endl; - return ex_syserr; + + return ex_dns_fail; } if (!ipresult) { cerr << "should never happen (addr with no addrs?)" << endl; - return ex_syserr; + return ex_dns_fail; } VUx ipAddr = parse_sockaddr(ipresult->ai_addr); addr = ipAddr.str(); @@ -471,7 +477,7 @@ int whatsit::check_dns_sub(string &addr, string &host, vector<string> &checked){ << " compare " << EAI_NONAME << " in getaddrinfo for " << ipvar << " :: " << gai_strerror(error) << endl; - return ex_syserr; + return ex_dns_fail; } // loop over all returned results and check for a match. diff --git a/tools/libltgrey.c b/tools/libltgrey.c index 827dcee..eb6d904 100644 --- a/tools/libltgrey.c +++ b/tools/libltgrey.c @@ -217,7 +217,7 @@ int whatsit::check_dns(const char* ipvar, const char* namevar){ vector<string> checked; int rslt = check_dns_sub(ipvar, namevar, addr, host, checked); int sts = rslt; -#if 1 +#ifndef badDNSfatal sts = 0; // demote badDNS to just a warning #endif if (rslt || verbosity) { @@ -238,6 +238,12 @@ int whatsit::check_dns(const char* ipvar, const char* namevar){ int whatsit::check_dns_sub(const char* ipvar, const char* namevar, string &addr, string &host, vector<string> &checked){ +#ifdef badDNSfatal + int ex_dns_fail = ex_syserr; +#else + int ex_dns_fail = ex_badDNS; +#endif + struct addrinfo *result; struct addrinfo *ipresult; struct addrinfo *res; @@ -259,11 +265,11 @@ int whatsit::check_dns_sub(const char* ipvar, const char* namevar, << " odd error " << error << " in getaddrinfo for " << ipvar << " : " << gai_strerror(error) << endl; - return ex_syserr; + return ex_dns_fail; } if (!ipresult) { cerr << "should never happen (addr with no addrs?)" << endl; - return ex_syserr; + return ex_dns_fail; } // reconvert from bits to string + family info @@ -304,7 +310,7 @@ int whatsit::check_dns_sub(const char* ipvar, const char* namevar, << " compare " << EAI_NONAME << " in getaddrinfo for " << ipvar << " :: " << gai_strerror(error) << endl; - return ex_syserr; + return ex_dns_fail; } // loop over all returned results and check for a match. diff --git a/tools/sepofra.c b/tools/sepofra.c index 69575c4..56d02a9 100644 --- a/tools/sepofra.c +++ b/tools/sepofra.c @@ -91,7 +91,8 @@ void sepofra::check( break; } - if ( SPF_request_set_ipv4_str( spf_request, opt_ip.c_str() ) ) { + if ( SPF_request_set_ipv4_str( spf_request, opt_ip.c_str() ) + && SPF_request_set_ipv6_str( spf_request, opt_ip.c_str() ) ) { cerr << "Invalid IP address: " << opt_ip << endl; break; } |