From 72a3056e666438e72be8cbb956a2d4ee25e97816 Mon Sep 17 00:00:00 2001 From: Matt Sergeant Date: Fri, 29 Jul 2005 18:02:07 +0000 Subject: [PATCH] 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 --- lib/Qpsmtpd/Transaction.pm | 2 +- plugins/tls | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Qpsmtpd/Transaction.pm b/lib/Qpsmtpd/Transaction.pm index a6dc3be..59f7453 100644 --- a/lib/Qpsmtpd/Transaction.pm +++ b/lib/Qpsmtpd/Transaction.pm @@ -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); diff --git a/plugins/tls b/plugins/tls index 7379350..df094f4 100644 --- a/plugins/tls +++ b/plugins/tls @@ -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);