summaryrefslogtreecommitdiff
path: root/tools/sepofra.c
diff options
context:
space:
mode:
authorJohn Denker <jsd@av8n.com>2012-08-01 01:48:21 (GMT)
committerJohn Denker <jsd@av8n.com>2012-08-01 01:48:21 (GMT)
commitcff5a7b49c4151fdc55e085b150385259d0dc781 (patch)
tree2b454bf555a8422e4bde885967f58cb4240404d3 /tools/sepofra.c
parentea83c5d01a7e075dc5cd7ddf808e2a275f2dd68b (diff)
might actually have a working SPF check
Diffstat (limited to 'tools/sepofra.c')
-rw-r--r--tools/sepofra.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/sepofra.c b/tools/sepofra.c
index a0b9294..d41e5ad 100644
--- a/tools/sepofra.c
+++ b/tools/sepofra.c
@@ -2,12 +2,16 @@
#include <sstream>
#include "sepofra.h"
-
+#include "utils.h"
#ifndef HOST_NAME_MAX
#define HOST_NAME_MAX 255
#endif
+///// Important reference:
+///// http://www.ietf.org/rfc/rfc4408.txt
+/////
+
using namespace std;
string domain_part(const string ema){
@@ -58,7 +62,8 @@ void sepofra::check(
SPF_server_t* spf_server = NULL;
sepofra rslt;
ip = opt_ip;
- mailfrom = opt_mailfrom;
+ helo = opt_helo;
+ mailfrom = trim(opt_mailfrom, " \t\r\n<>");
string mailfrom_domain = domain_part(opt_mailfrom);
do {
@@ -139,6 +144,7 @@ string sepofra::explain() const {
/* ( */ build << ")";
build << " client-ip=" << ip << ";";
build << " envelope-from=" << mailfrom << ";";
+ build << " helo=" << helo;
return build.str();
}