From ee93a6480215a104be42aca282dcc658ea5ce510 Mon Sep 17 00:00:00 2001 From: John Denker Date: Sun, 2 Dec 2012 13:58:56 -0700 Subject: fix some bit-rot; rename -error-exit to -strict --- tools/libskrewt.c | 15 +++++++++------ tools/libskrewt.h | 4 +++- tools/skrewt.c | 9 ++++++--- tools/ward.c | 7 ++++--- 4 files changed, 22 insertions(+), 13 deletions(-) (limited to 'tools') diff --git a/tools/libskrewt.c b/tools/libskrewt.c index 5e06dea..5461fdd 100644 --- a/tools/libskrewt.c +++ b/tools/libskrewt.c @@ -2,6 +2,9 @@ #include "utils.h" #include #include +#include +#include +#include using namespace std; @@ -327,7 +330,7 @@ void check_map2ip(name_tester& fqdn, const string ipstr) { void check_name_ip(name_tester& fqdn, const string ip) { if (ip == "") { - cerr << "check_nane_ip: should never happen: email with no IP?" < sitch){ // constructor skrewt::skrewt() - : spf_result(SPF_RESULT_INVALID), + : proximta_rDNS_flagged(0), spf_result(SPF_RESULT_INVALID), boundary("x-xx-x"), msgsize(0), saw_blank_line(0), recno(0), - maxsize(1000*1000), error_exit(0), mid_required(0), + maxsize(1000*1000), strictness(0), note(""), mid_required(0), headerbuf(0), bigbuf(0), lookahead(1, "") { @@ -632,8 +635,8 @@ int skrewt::body(std::istream& xin, std::ostream& xout){ if (verbosity) cerr << "textlines: " << textlines << endl; if (!textlines) { - cerr << progid << " rejection: no text: " << error_exit << endl; - maybe_exeunt(ex_spam, error_exit); + cerr << progid << " rejection: no text: " << strictness << endl; + maybe_exeunt(ex_spam, strictness); } cerr << progid << " normal completion" << endl; return(ex_good); diff --git a/tools/libskrewt.h b/tools/libskrewt.h index 2360b15..af488f2 100644 --- a/tools/libskrewt.h +++ b/tools/libskrewt.h @@ -40,6 +40,7 @@ public: std::string received_from; // envelope HELO among other things name_tester proximta_HELO; name_tester proximta_rDNS; + int proximta_rDNS_flagged; std::string proximta_IP; std::string proximta_AuthUser; SPF_result_t spf_result; @@ -56,7 +57,8 @@ public: int saw_blank_line; int recno; int maxsize; - int error_exit; + int strictness; + std::string note; int mid_required; std::vector headerbuf; std::vector bigbuf; diff --git a/tools/skrewt.c b/tools/skrewt.c index abea289..f7dd83b 100644 --- a/tools/skrewt.c +++ b/tools/skrewt.c @@ -28,7 +28,7 @@ void usage(const int sts){ " Options\n" " -help print this msg (and exit immediately).\n" " -maxsize ii msg size in bytes; anything bigger will be rejected.\n" -" -error-exit exit early if errors have been detected.\n" +" -strict exit early if errors have been detected.\n" "\n" " Messages containing the string '-please-bounce-this-' will be rejected.\n" " Messages with no date will be rejected.\n" @@ -97,8 +97,11 @@ int main(int _argc, const char** _argv){ if (0) { } else if (ARGS.prefix("-mid-required")) { mysk.mid_required++; - } else if (ARGS.prefix("-error-exit")) { - mysk.error_exit++; + } else if (ARGS.prefix("-error-exit") + || ARGS.prefix("-strict")) { + mysk.strictness++; + } else if (ARGS.prefix("-note", 1)) { + mysk.note = ARGS.shift(); } else if (ARGS.prefix("-maxsize", 1)) { mysk.maxsize = atoi(ARGS.shift().c_str()); } else if (arg.substr(0,1) == "-") { diff --git a/tools/ward.c b/tools/ward.c index abea289..e5667a4 100644 --- a/tools/ward.c +++ b/tools/ward.c @@ -28,7 +28,7 @@ void usage(const int sts){ " Options\n" " -help print this msg (and exit immediately).\n" " -maxsize ii msg size in bytes; anything bigger will be rejected.\n" -" -error-exit exit early if errors have been detected.\n" +" -strict exit early if errors have been detected.\n" "\n" " Messages containing the string '-please-bounce-this-' will be rejected.\n" " Messages with no date will be rejected.\n" @@ -97,8 +97,9 @@ int main(int _argc, const char** _argv){ if (0) { } else if (ARGS.prefix("-mid-required")) { mysk.mid_required++; - } else if (ARGS.prefix("-error-exit")) { - mysk.error_exit++; + } else if (ARGS.prefix("-error-exit") + || ARGS.prefix("-strict")) { + mysk.strictness++; } else if (ARGS.prefix("-maxsize", 1)) { mysk.maxsize = atoi(ARGS.shift().c_str()); } else if (arg.substr(0,1) == "-") { -- cgit v1.2.3