summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-07-21 11:43:00 -0700
committerJohn Denker <jsd@av8n.com>2012-07-29 15:32:35 -0700
commit46cb697732ea2c2c4a68358109a58232ef2666e7 (patch)
tree81f8dfa2c620b2c1dca249ed7778b7ba13eca8b1
parentbcce618000e74f0d36780b48c3c49f4a9b5914e5 (diff)
dns inconsistency is just a warning for the moment
-rw-r--r--tools/greylist.c22
-rw-r--r--tools/makefile1
2 files changed, 11 insertions, 12 deletions
diff --git a/tools/greylist.c b/tools/greylist.c
index 863a2fe..95a4f0b 100644
--- a/tools/greylist.c
+++ b/tools/greylist.c
@@ -436,6 +436,8 @@ int whatsit::check_dns(){
struct addrinfo *res;
addrinfo hints;
int error;
+ int ex_dnserr(ex_syserr);
+ ex_dnserr = 0; // temporarily just a warning
/* resolve the domain name into a list of addresses */
memset(&hints, 0, sizeof(struct addrinfo));
@@ -448,11 +450,11 @@ int whatsit::check_dns(){
if (error) {
cerr << "error in getaddrinfo for " << ipvar
<< " : " << gai_strerror(error) << endl;
- return ex_syserr;
+ return ex_dnserr;
}
if (!ipresult) {
cerr << "should never happen (addr with no addrs?)" << endl;
- return ex_syserr;
+ return ex_dnserr;
}
VUx ipAddr = parse_sockaddr(ipresult->ai_addr);
@@ -460,7 +462,7 @@ int whatsit::check_dns(){
if (error) {
cerr << "error in getaddrinfo for " << hostvar
<< " : " << gai_strerror(error) << endl;
- return ex_syserr;
+ return ex_dnserr;
}
// loop over all returned results and check for a match.
@@ -473,19 +475,15 @@ int whatsit::check_dns(){
goto done;
}
}
- cerr << "(warning) DNS inconsistency: "
- << ipAddr.str() << " does not match";
+ if (!ex_dnserr) cerr << "(warning) ";
+ cerr << "DNS inconsistency: "
+ << ipAddr.str() << " --> "
+ << hostvar << " ==>";
for (res = result; res != NULL; res = res->ai_next){
cerr << " " << parse_sockaddr(res->ai_addr).str();
}
cerr << endl;
-#if 1
- // temporary ... just a warning
- return 0;
-#else
- return ex_spam;
-#endif
-
+ return ex_dnserr;
done:
return 0;
diff --git a/tools/makefile b/tools/makefile
index 1f878f0..6fa9636 100644
--- a/tools/makefile
+++ b/tools/makefile
@@ -48,6 +48,7 @@ todo:
pass message-ID to greylist program \
... also provide a way for certain recipients to bypass some checks \
... both will require major restructuring, "cat" process \
+ ... IPv6 reverse-DNS recors \
.....
ALWAYS: