some fixes from Michael C. Toren:
- Treat DENY(|SOFT)_DISCONNECT from connect hooks the same as DENY(|SOFT) - only append ESMTP to smtpgreeting if it's not already in there - Qpsmtpd::SMTP::fault(): parsing now unambigous and just first "word" of $0 see also http://www.nntp.perl.org/group/perl.qpsmtpd/5905 git-svn-id: https://svn.perl.org/qpsmtpd/branches/0.3x@699 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
dcb86d5a72
commit
6eefa97016
@ -85,7 +85,8 @@ sub unrecognized_command_respond {
|
||||
sub fault {
|
||||
my $self = shift;
|
||||
my ($msg) = shift || "program fault - command not performed";
|
||||
print STDERR "$0[$$]: $msg ($!)\n";
|
||||
my ($name) = split /\s+/, $0, 2;
|
||||
print STDERR $name,"[$$]: $msg ($!)\n";
|
||||
return $self->respond(451, "Internal error - try again later - " . $msg);
|
||||
}
|
||||
|
||||
@ -100,12 +101,12 @@ sub start_conversation {
|
||||
|
||||
sub connect_respond {
|
||||
my ($self, $rc, $msg) = @_;
|
||||
if ($rc == DENY) {
|
||||
if ($rc == DENY || $rc == DENY_DISCONNECT) {
|
||||
$msg->[0] ||= 'Connection from you denied, bye bye.';
|
||||
$self->respond(550, @$msg);
|
||||
$self->disconnect;
|
||||
}
|
||||
elsif ($rc == DENYSOFT) {
|
||||
elsif ($rc == DENYSOFT || $rc == DENYSOFT_DISCONNECT) {
|
||||
$msg->[0] ||= 'Connection from you temporarily denied, bye bye.';
|
||||
$self->respond(450, @$msg);
|
||||
$self->disconnect;
|
||||
@ -113,7 +114,7 @@ sub connect_respond {
|
||||
elsif ($rc != DONE) {
|
||||
my $greets = $self->config('smtpgreeting');
|
||||
if ( $greets ) {
|
||||
$greets .= " ESMTP";
|
||||
$greets .= " ESMTP" unless $greets =~ /(^|\W)ESMTP(\W|$)/;
|
||||
}
|
||||
else {
|
||||
$greets = $self->config('me')
|
||||
|
Loading…
Reference in New Issue
Block a user