cvsuser 03/12/03 00:07:36
Modified: lib/Qpsmtpd Constants.pm SMTP.pm
Log:
DENYHARD - allows you to DENY with a disconnect
Revision Changes Path
1.6 +2 -1 qpsmtpd/lib/Qpsmtpd/Constants.pm
Index: Constants.pm
===================================================================
RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/Constants.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -w -r1.5 -r1.6
--- Constants.pm 24 Jul 2003 12:43:02 -0000 1.5
+++ Constants.pm 3 Dec 2003 08:07:36 -0000 1.6
@@ -2,7 +2,7 @@
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 DENYSOFT => 902;
use constant DECLINED => 909;
use constant DONE => 910;
+use constant DENYHARD => 903;
1;
1.20 +7 -0 qpsmtpd/lib/Qpsmtpd/SMTP.pm
Index: SMTP.pm
===================================================================
RCS file: /cvs/public/qpsmtpd/lib/Qpsmtpd/SMTP.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -w -r1.19 -r1.20
--- SMTP.pm 4 Nov 2003 22:52:49 -0000 1.19
+++ SMTP.pm 3 Dec 2003 08:07:36 -0000 1.20
@@ -115,6 +115,7 @@
sub reset_transaction {
my $self = shift;
+ $self->run_hooks("reset_transaction") if $self->{_transaction};
return $self->{_transaction} = Qpsmtpd::Transaction->new();
}
@@ -229,6 +230,12 @@
$msg ||= $from->format . ', temporarily denied';
$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);