diff options
author | John Denker <jsd@av8n.com> | 2012-07-21 06:26:42 -0700 |
---|---|---|
committer | John Denker <jsd@av8n.com> | 2012-07-21 06:26:42 -0700 |
commit | 7c091c9326d86c7b144b1af7159206c47695778e (patch) | |
tree | e4dc9624c8e851d3aa9ddbc61cf6182927dc5390 | |
parent | 7c1ce87457e0eb69f7b9989c8538a169b6744d23 (diff) |
don't return messy exit status codes in non-check mode
-rw-r--r-- | tools/greylist.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/greylist.c b/tools/greylist.c index c5c891f..d76ba08 100644 --- a/tools/greylist.c +++ b/tools/greylist.c @@ -264,19 +264,20 @@ int main(int _argc, char** _argv){ } int sts = foo.doit(penalty); + if (sts == ex_syserr) return sts; + if (!check) return ex_good; -// perform some extra checks. +// check mode ... perform some extra checks. // Probably a better design would be to // a) make more thorough DNS checks, and // b) move all the DNS checking to a separate module - if (check){ - char* hostvar = getenv("TCPREMOTEHOST"); - if (!hostvar) { - cerr << foo.progid - << " from " << foo.ipbase - << " ... TCPREMOTEHOST not set???" << endl; - exeunt(ex_spam); - } + + char* hostvar = getenv("TCPREMOTEHOST"); + if (!hostvar) { + cerr << foo.progid + << " from " << foo.ipbase + << " ... TCPREMOTEHOST not set???" << endl; + exeunt(ex_spam); } exeunt(sts); } |