Default capabilities to an empty arrayref
Copy relay_client setting when cloning connection in tls git-svn-id: https://svn.perl.org/qpsmtpd/trunk@532 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
006f129c21
commit
72a3056e66
@ -13,7 +13,7 @@ sub start {
|
||||
my $proto = shift;
|
||||
my $class = ref($proto) || $proto;
|
||||
my %args = @_;
|
||||
my $self = { _rcpt => [], started => time };
|
||||
my $self = { _notes => { capabilities => [] }, _rcpt => [], started => time };
|
||||
bless ($self, $class);
|
||||
my $sz = $self->config('memory_threshold');
|
||||
$sz = 10_000 unless defined($sz);
|
||||
|
@ -48,10 +48,8 @@ sub hook_ehlo {
|
||||
return DECLINED if $self->connection->notes('tls_enabled');
|
||||
return DENY, "Command refused due to lack of security" if $transaction->notes('ssl_failed');
|
||||
my $cap = $transaction->notes('capabilities');
|
||||
$cap ||= [];
|
||||
push @$cap, 'STARTTLS';
|
||||
$transaction->notes('tls_enabled', 1);
|
||||
$transaction->notes('capabilities', $cap);
|
||||
return DECLINED;
|
||||
}
|
||||
|
||||
@ -92,7 +90,7 @@ sub hook_unrecognized_command {
|
||||
my $conn = $self->connection;
|
||||
# Create a new connection object with subset of information collected thus far
|
||||
my $newconn = Qpsmtpd::Connection->new();
|
||||
for (qw(local_ip local_port remote_ip remote_port remote_host remote_info)) {
|
||||
for (qw(local_ip local_port remote_ip remote_port remote_host remote_info relay_client)) {
|
||||
$newconn->$_($conn->$_());
|
||||
}
|
||||
$self->qp->connection($newconn);
|
||||
|
Loading…
Reference in New Issue
Block a user