emacsisms, more timeouts

git-svn-id: https://svn.perl.org/qpsmtpd/trunk@350 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
Robert Spier 2004-11-27 07:08:46 +00:00
parent 012c6db2d3
commit 3341a5b4ab
3 changed files with 7 additions and 1 deletions

View File

@ -67,6 +67,9 @@ sub process_sockets {
my %dnsbl_zones = map { (split /:/, $_, 2)[0,1] } $self->qp->config('dnsbl_zones');
my $res = new Net::DNS::Resolver;
$res->tcp_timeout(30);
$res->udp_timeout(30);
my $sel = $conn->notes('dnsbl_sockets') or return "";
my $remote_ip = $self->qp->connection->remote_ip;

View File

@ -1,3 +1,4 @@
# -*- perl -*-
=head1 NAME
qmail-queue

View File

@ -7,7 +7,7 @@ sub register {
sub mail_handler {
my ($self, $transaction, $sender) = @_;
$sender->format ne "<>"
and $self->qp->config("require_resolvable_fromhost")
and !check_dns($sender->host)
@ -30,6 +30,8 @@ sub check_dns {
return 1 if $host =~ m/^\[(\d{1,3}\.){3}\d{1,3}\]$/;
my $res = new Net::DNS::Resolver;
$res->tcp_timeout(30);
$res->udp_timeout(30);
return 1 if mx($res, $host);
my $query = $res->search($host);
if ($query) {