summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-12-02 20:58:56 (GMT)
committerJohn Denker <jsd@av8n.com>2012-12-02 20:58:56 (GMT)
commitee93a6480215a104be42aca282dcc658ea5ce510 (patch)
tree2e4195311410676a41bc6fe2fdafd14d334ecfb0
parent46ba7e646390dbd5eb896525e6dac27f884096cb (diff)
fix some bit-rot; rename -error-exit to -strict
-rw-r--r--tools/libskrewt.c15
-rw-r--r--tools/libskrewt.h4
-rw-r--r--tools/skrewt.c9
-rw-r--r--tools/ward.c7
4 files changed, 22 insertions, 13 deletions
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 <sstream>
#include <signal.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netdb.h>
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?" <<endl;
+ cerr << "check_name_ip: should never happen: email with no IP?" <<endl;
fqdn.spf = fqdn.map2ip = neutral;
return;
}
@@ -500,7 +503,7 @@ int skrewt::interstage(){
if (badnews.size() && !whitelisted){
cerr << progid << " " << join(", ", badnews) << endl;
- if (error_exit){
+ if (strictness){
cerr << progid << " ... badnews from '" << from
<< "' to '" << to
<< "'" << endl;
@@ -529,9 +532,9 @@ void dump(const list<conner> 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<std::string> headerbuf;
std::vector<std::string> 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) == "-") {