In version 1.2 of DKIMproxy, sometimes when a client connects directly to DKIMproxy.out, DKIMproxy.out will not close the connection properly, and the connection will hang.
In MySmtpProxyServer.pm, in the process_request routine, I have added to the end, the following to explicitly close the connection:
# Make sure the connection is closed, as otherwise it hangs occasionally
$server->{in}->close;
$server->{out}->close;
Thus, the whole function now looks like:
sub process_request
{
my $self = shift;
my $server = $self->{smtp_server} = $self->setup_server_socket;
my $client = $self->{smtp_client} = $self->setup_client_socket;
# wait for SMTP greeting from destination
my $banner = $client->hear;
# emit greeting back to source
$server->ok($banner);
# begin main SMTP loop
# - wait for a command from source
while (my $what = $self->_chat)
{
if ($self->{debug})
{
print STDERR $what . "\n";
}
$self->handle_command($what)
or last;
}
# Make sure the connection is closed, as otherwise it hangs occasionally
$server->{in}->close;
$server->{out}->close;
}
This suggested fix has been incorporated into version 1.3 (released 2010-10-07). Thanks for the report.