remove way too agressive blocking of DENY'd servers
git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@628 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
bd19ded5a2
commit
3aa64debd8
@ -433,14 +433,6 @@ sub auth_mechanism {
|
|||||||
my $self = shift;
|
my $self = shift;
|
||||||
return (defined $self->{_auth_mechanism} ? $self->{_auth_mechanism} : "" );
|
return (defined $self->{_auth_mechanism} ? $self->{_auth_mechanism} : "" );
|
||||||
}
|
}
|
||||||
|
|
||||||
sub denied {
|
|
||||||
my ($self, $value) = @_;
|
|
||||||
$self->transaction->{_denied} = $value if defined $value;
|
|
||||||
return (defined $self->transaction->{_denied}
|
|
||||||
? $self->transaction->{_denied}
|
|
||||||
: "" );
|
|
||||||
}
|
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
|
||||||
|
@ -50,12 +50,6 @@ sub dispatch {
|
|||||||
|
|
||||||
$self->{_counter}++;
|
$self->{_counter}++;
|
||||||
|
|
||||||
if ( $cmd !~ /^(rset|quit)$/ and $self->denied ) { # RFC non-compliant
|
|
||||||
$self->log(LOGWARN, "non-RFC compliant MTA disconnected");
|
|
||||||
$self->respond(521, "non-RFC compliant MTA disconnected (#5.7.0)");
|
|
||||||
$self->disconnect;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($cmd !~ /^(\w{1,12})$/ or !exists $self->{_commands}->{$1}) {
|
if ($cmd !~ /^(\w{1,12})$/ or !exists $self->{_commands}->{$1}) {
|
||||||
my ($rc, $msg) = $self->run_hooks("unrecognized_command", $cmd, @_);
|
my ($rc, $msg) = $self->run_hooks("unrecognized_command", $cmd, @_);
|
||||||
if ($rc == DENY_DISCONNECT) {
|
if ($rc == DENY_DISCONNECT) {
|
||||||
@ -156,10 +150,8 @@ sub helo {
|
|||||||
if ($rc == DONE) {
|
if ($rc == DONE) {
|
||||||
# do nothing
|
# do nothing
|
||||||
} elsif ($rc == DENY) {
|
} elsif ($rc == DENY) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
} elsif ($rc == DENYSOFT) {
|
} elsif ($rc == DENYSOFT) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(450, $msg);
|
$self->respond(450, $msg);
|
||||||
} elsif ($rc == DENY_DISCONNECT) {
|
} elsif ($rc == DENY_DISCONNECT) {
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
@ -186,10 +178,8 @@ sub ehlo {
|
|||||||
if ($rc == DONE) {
|
if ($rc == DONE) {
|
||||||
# do nothing
|
# do nothing
|
||||||
} elsif ($rc == DENY) {
|
} elsif ($rc == DENY) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
} elsif ($rc == DENYSOFT) {
|
} elsif ($rc == DENYSOFT) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(450, $msg);
|
$self->respond(450, $msg);
|
||||||
} elsif ($rc == DENY_DISCONNECT) {
|
} elsif ($rc == DENY_DISCONNECT) {
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
@ -300,13 +290,11 @@ sub mail {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
elsif ($rc == DENY) {
|
elsif ($rc == DENY) {
|
||||||
$self->denied(1);
|
|
||||||
$msg ||= $from->format . ', denied';
|
$msg ||= $from->format . ', denied';
|
||||||
$self->log(LOGINFO, "deny mail from " . $from->format . " ($msg)");
|
$self->log(LOGINFO, "deny mail from " . $from->format . " ($msg)");
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
}
|
}
|
||||||
elsif ($rc == DENYSOFT) {
|
elsif ($rc == DENYSOFT) {
|
||||||
$self->denied(1);
|
|
||||||
$msg ||= $from->format . ', temporarily denied';
|
$msg ||= $from->format . ', temporarily denied';
|
||||||
$self->log(LOGINFO, "denysoft mail from " . $from->format . " ($msg)");
|
$self->log(LOGINFO, "denysoft mail from " . $from->format . " ($msg)");
|
||||||
$self->respond(450, $msg);
|
$self->respond(450, $msg);
|
||||||
@ -348,12 +336,10 @@ sub rcpt {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
elsif ($rc == DENY) {
|
elsif ($rc == DENY) {
|
||||||
$self->denied(1);
|
|
||||||
$msg ||= 'relaying denied';
|
$msg ||= 'relaying denied';
|
||||||
$self->respond(550, $msg);
|
$self->respond(550, $msg);
|
||||||
}
|
}
|
||||||
elsif ($rc == DENYSOFT) {
|
elsif ($rc == DENYSOFT) {
|
||||||
$self->denied(1);
|
|
||||||
$msg ||= 'relaying denied';
|
$msg ||= 'relaying denied';
|
||||||
return $self->respond(450, $msg);
|
return $self->respond(450, $msg);
|
||||||
}
|
}
|
||||||
@ -611,11 +597,9 @@ sub queue {
|
|||||||
$self->respond(250, ($msg || 'Queued'));
|
$self->respond(250, ($msg || 'Queued'));
|
||||||
}
|
}
|
||||||
elsif ($rc == DENY) {
|
elsif ($rc == DENY) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(552, $msg || "Message denied");
|
$self->respond(552, $msg || "Message denied");
|
||||||
}
|
}
|
||||||
elsif ($rc == DENYSOFT) {
|
elsif ($rc == DENYSOFT) {
|
||||||
$self->denied(1);
|
|
||||||
$self->respond(452, $msg || "Message denied temporarily");
|
$self->respond(452, $msg || "Message denied temporarily");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
Loading…
Reference in New Issue
Block a user