Commit b31da9c6 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

* Added support for OK in access control module

parent fd22c11d
......@@ -155,6 +155,14 @@ sub check {
$sessionData->{'Recipient'});
return $server->protocol_response(PROTO_REDIRECT,$row->{'data'});
} elsif ($row->{'verdict'} =~ /^ok$/i) {
$server->maillog("module=AccessControl, action=ok, host=%s, helo=%s, from=%s, to=%s, reason=verdict",
$sessionData->{'ClientAddress'},
$sessionData->{'Helo'},
$sessionData->{'Sender'},
$sessionData->{'Recipient'});
return $server->protocol_response(PROTO_OK,$row->{'data'});
} else {
$server->log(LOG_ERR,"[ACCESSCONTROL] Unknown Verdict specification in access control '".$row->{'verdict'}."'");
$server->maillog("module=AccessControl, action=none, host=%s, helo=%s, from=%s, to=%s, reason=invalid_verdict",
......
......@@ -35,6 +35,7 @@ our (@ISA,@EXPORT,@EXPORT_OK);
CBP_SKIP
PROTO_PASS
PROTO_OK
PROTO_REJECT
PROTO_DEFER
PROTO_HOLD
......
......@@ -144,6 +144,11 @@ sub protocol_response
$response_data = $data;
return CBP_CONTINUE;
} elsif ($resp == PROTO_OK) {
$response = "200";
$response_data = $data;
return CBP_STOP;
} elsif ($resp == PROTO_REJECT) {
if ($data =~ /^(5[0-9]{2}) (.*)/) {
$response = "403";
......
......@@ -128,6 +128,11 @@ sub protocol_response
$response_data = $data;
return CBP_CONTINUE;
} elsif ($resp == PROTO_OK) {
$response = "OK";
$response_data = $data;
return CBP_STOP;
} elsif ($resp == PROTO_REJECT) {
if ($data =~ /^(5[0-9]{2}) (.*)/) {
$response = $1;
......
......@@ -77,6 +77,7 @@ if ($_POST['frmaction'] == "add") {
<option value="DISCARD">Discard (drop)</option>
<option value="FILTER">Filter</option>
<option value="REDIRECT">Redirect</option>
<option value="OK">Ok</option>
</select>
</td>
</tr>
......
......@@ -116,6 +116,7 @@ if ($_POST['frmaction'] == "change") {
<option value="DISCARD">Discard (drop)</option>
<option value="FILTER">Filter</option>
<option value="REDIRECT">Redirect</option>
<option value="OK">Ok</option>
</select>
</td>
</tr>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment