Menu

#34 Client connection to DKIMproxy does not always close

open-fixed
dkimproxy (14)
5
2010-11-14
2009-08-03
No

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;
}

Discussion

  • Alex Wheeler

    Alex Wheeler - 2009-08-03
    • summary: Client connection to DKIMProxy does not always close --> Client connection to DKIMproxy does not always close
     
  • Jason Long

    Jason Long - 2010-11-14

    This suggested fix has been incorporated into version 1.3 (released 2010-10-07). Thanks for the report.

     
  • Jason Long

    Jason Long - 2010-11-14
    • assigned_to: nobody --> jasonlong
     
  • Jason Long

    Jason Long - 2010-11-14
    • status: open --> open-fixed
     

Log in to post a comment.

Monday.com Logo