Attached please find a proposed patch to fix the TLS/relaying problems.
This actually undoes some changes that were made on the 0.30 branch.
I'm going to work on some other changes and apply them to the 0.3x
branch (and then merge back to trunk), since it is odd that
Qpsmtpd::Connection->new() doesn't do anything with any initializing
parameters passed in (there is the start() sub to do that).
I'm also going to check in a script to make self-signed SSL certs for
use TLS (I've got a hacked up version of a hacked up version of
mkcert.sh, but I'll probably rewrite it in Perl to make it nicer), just
so it is easier to run/test TLS.
John
=== plugins/tls
==================================================================
--- plugins/tls (revision 727)
+++ plugins/tls (local)
@@ -21,7 +21,7 @@
=cut
-use IO::Socket::SSL qw(debug1 debug2 debug3 debug4);
+use IO::Socket::SSL;# qw(debug1 debug2 debug3 debug4);
sub init {
my ($self, $qp, $cert, $key) = @_;
@@ -94,17 +94,11 @@
my $conn = $self->connection;
# Create a new connection object with subset of information collected
thus far
- $self->qp->connection(Qpsmtpd::Connection->new(
- map { $_ => $conn->$_ }
- qw(
- local_ip
- local_port
- remote_ip
- remote_port
- remote_host
- remote_info
- ),
- ));
+ my $newconn = Qpsmtpd::Connection->new();
+ for (qw(local_ip local_port remote_ip remote_port remote_host
remote_info relay_client)) {
+ $newconn->$_($conn->$_());
+ }
+ $self->qp->connection($newconn);
$self->qp->reset_transaction;
*STDIN = *STDOUT = $self->connection->notes('tls_socket', $tlssocket);
$self->connection->notes('tls_enabled', 1);
@@ -116,7 +110,7 @@
return DENY, "TLS Negotiation Failed";
}
- warn("TLS setup returning\n");
+ $self->log(LOGWARN, "TLS setup returning\n");
return DONE;
}