From 3341a5b4ab2634026a6f5f9b52073caa2bf1b3b6 Mon Sep 17 00:00:00 2001 From: Robert Spier Date: Sat, 27 Nov 2004 07:08:46 +0000 Subject: [PATCH] emacsisms, more timeouts git-svn-id: https://svn.perl.org/qpsmtpd/trunk@350 958fd67b-6ff1-0310-b445-bb7760255be9 --- plugins/dnsbl | 3 +++ plugins/queue/qmail-queue | 1 + plugins/require_resolvable_fromhost | 4 +++- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/plugins/dnsbl b/plugins/dnsbl index 8c0be1a..353a918 100644 --- a/plugins/dnsbl +++ b/plugins/dnsbl @@ -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; diff --git a/plugins/queue/qmail-queue b/plugins/queue/qmail-queue index e426759..b7bf475 100644 --- a/plugins/queue/qmail-queue +++ b/plugins/queue/qmail-queue @@ -1,3 +1,4 @@ +# -*- perl -*- =head1 NAME qmail-queue diff --git a/plugins/require_resolvable_fromhost b/plugins/require_resolvable_fromhost index c0869fb..a122bda 100644 --- a/plugins/require_resolvable_fromhost +++ b/plugins/require_resolvable_fromhost @@ -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) {