summaryrefslogtreecommitdiff
path: root/tools/libskrewt.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/libskrewt.h')
-rw-r--r--tools/libskrewt.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/libskrewt.h b/tools/libskrewt.h
index cfbbb79..5ae6ece 100644
--- a/tools/libskrewt.h
+++ b/tools/libskrewt.h
@@ -5,6 +5,14 @@
#include "qq_exit_codes.h" // a bit of a kludge
extern std::string progid;
+class xstr {
+public:
+ int err;
+ std::string str;
+ xstr() : err(1), str("") {}
+ xstr(const int foo, const std::string bar) : err(foo), str(bar) {}
+};
+
class skrewt{
public:
std::string received_from; // envelope HELO among other things
@@ -12,6 +20,7 @@ public:
std::string proximta_rDNS;
std::string proximta_IP;
std::string proximta_AuthUser;
+ SPF_result_t spf_result;
std::string return_path; // envelope MAIL FROM
std::string boundary;
std::string to;
@@ -20,7 +29,7 @@ public:
std::string date;
std::string message_id;
std::string content_type;
- std::string delivered_to;
+ std::list<std::string> delivered_to;
int msgsize;
std::vector<std::string> bigbuf;
int saw_blank_line;
@@ -32,15 +41,20 @@ public:
// constructor
skrewt()
- : boundary("x-xx-x"), msgsize(0), saw_blank_line(0), recno(0),
- maxsize(1000*1000), error_exit(0), mid_required(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),
+ lookahead(1, "")
{}
+ xstr getRecord(std::istream& xin);
+ xstr getLine(std::istream& xin);
int headers(std::istream& xin);
int dump_headers(std::ostream& xout);
int interstage();
int body(std::istream& xin, std::ostream& xout);
int krunch_rfrom();
+ xstr lookahead;
};
void parse_content(const std::string type_spec_line,