summaryrefslogtreecommitdiff
path: root/tools/greylist.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/greylist.c')
-rw-r--r--tools/greylist.c14
1 files changed, 10 insertions, 4 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.