diff --git a/lib/Danga/DNS.pm b/lib/Danga/DNS.pm index e57a3a4..a3ba213 100644 --- a/lib/Danga/DNS.pm +++ b/lib/Danga/DNS.pm @@ -15,7 +15,7 @@ my $resolver; sub trace { my $level = shift; - print ("[$$] dns lookup: @_") if $::DEBUG >= $level; + print STDERR ("[$$] dns lookup: @_") if $::DEBUG >= $level; } sub new { @@ -93,7 +93,7 @@ sub DESTROY { my $now = time; foreach my $host (@{$self->{hosts}}) { if (!$self->{results}{$host}) { - print "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n"; + print STDERR "DNS timeout (presumably) looking for $host after " . ($now - $self->{start}) . " secs\n"; $self->{callback}->("NXDOMAIN", $host); } } diff --git a/plugins/check_earlytalker b/plugins/check_earlytalker index 950df60..29d79e9 100644 --- a/plugins/check_earlytalker +++ b/plugins/check_earlytalker @@ -71,7 +71,7 @@ sub register { sub connect_handler { my ($self, $transaction) = @_; - if ($self->can_read($self->{_args}->{'wait'})) { + if ($self->qp->can_read($self->{_args}->{'wait'})) { $self->log(LOGNOTICE, 'remote host started talking before we said hello'); if ($self->{_args}->{'defer-reject'}) { $self->connection->notes('earlytalker', 1); diff --git a/qpsmtpd b/qpsmtpd index 5296717..673eb46 100755 --- a/qpsmtpd +++ b/qpsmtpd @@ -9,7 +9,8 @@ BEGIN { use strict; use vars qw($DEBUG); -use FindBin; +use FindBin qw(); +# TODO: need to make this taint friendly use lib "$FindBin::Bin/lib"; use Danga::Socket; use Danga::Client; @@ -94,7 +95,7 @@ my $POLL = "with " . ($Danga::Socket::HaveEpoll ? "epoll()" : my $server; # Code for inetd/tcpserver mode -if ($ENV{REMOTE_HOST}) { +if ($ENV{REMOTE_HOST} or $ENV{TCPREMOTEHOST}) { run_as_inetd(); exit(0); }