DENYHARD - allows you to DENY with a disconnect

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@196 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Matt Sergeant 2003-12-03 08:07:36 +00:00
parent c1aa3ddb8a
commit c4903199ff
2 changed files with 9 additions and 1 deletions

View File

@ -2,7 +2,7 @@ package Qpsmtpd::Constants;
use strict;
require Exporter;
my (@common) = qw(OK DECLINED DONE DENY DENYSOFT TRACE);
my (@common) = qw(OK DECLINED DONE DENY DENYSOFT DENYHARD TRACE);
use vars qw($VERSION @ISA @EXPORT);
@ISA = qw(Exporter);
@ -15,6 +15,7 @@ use constant DENY => 901;
use constant DENYSOFT => 902;
use constant DECLINED => 909;
use constant DONE => 910;
use constant DENYHARD => 903;
1;

View File

@ -115,6 +115,7 @@ sub transaction {
sub reset_transaction {
my $self = shift;
$self->run_hooks("reset_transaction") if $self->{_transaction};
return $self->{_transaction} = Qpsmtpd::Transaction->new();
}
@ -230,6 +231,12 @@ sub mail {
$self->log(2, "denysoft mail from " . $from->format . " ($msg)");
$self->respond(450, $msg);
}
elsif ($rc == DENYHARD) {
$msg ||= $from->format . ', denied';
$self->log(2, "deny mail from " . $from->format . " ($msg)");
$self->respond(550, $msg);
$self->disconnect;
}
else { # includes OK
$self->log(2, "getting mail from ".$from->format);
$self->respond(250, $from->format . ", sender OK - how exciting to get mail from you!");