emacsisms, more timeouts
git-svn-id: https://svn.perl.org/qpsmtpd/trunk@350 958fd67b-6ff1-0310-b445-bb7760255be9
This commit is contained in:
parent
012c6db2d3
commit
3341a5b4ab
@ -67,6 +67,9 @@ sub process_sockets {
|
|||||||
my %dnsbl_zones = map { (split /:/, $_, 2)[0,1] } $self->qp->config('dnsbl_zones');
|
my %dnsbl_zones = map { (split /:/, $_, 2)[0,1] } $self->qp->config('dnsbl_zones');
|
||||||
|
|
||||||
my $res = new Net::DNS::Resolver;
|
my $res = new Net::DNS::Resolver;
|
||||||
|
$res->tcp_timeout(30);
|
||||||
|
$res->udp_timeout(30);
|
||||||
|
|
||||||
my $sel = $conn->notes('dnsbl_sockets') or return "";
|
my $sel = $conn->notes('dnsbl_sockets') or return "";
|
||||||
my $remote_ip = $self->qp->connection->remote_ip;
|
my $remote_ip = $self->qp->connection->remote_ip;
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
# -*- perl -*-
|
||||||
=head1 NAME
|
=head1 NAME
|
||||||
|
|
||||||
qmail-queue
|
qmail-queue
|
||||||
|
@ -7,7 +7,7 @@ sub register {
|
|||||||
|
|
||||||
sub mail_handler {
|
sub mail_handler {
|
||||||
my ($self, $transaction, $sender) = @_;
|
my ($self, $transaction, $sender) = @_;
|
||||||
|
|
||||||
$sender->format ne "<>"
|
$sender->format ne "<>"
|
||||||
and $self->qp->config("require_resolvable_fromhost")
|
and $self->qp->config("require_resolvable_fromhost")
|
||||||
and !check_dns($sender->host)
|
and !check_dns($sender->host)
|
||||||
@ -30,6 +30,8 @@ sub check_dns {
|
|||||||
return 1 if $host =~ m/^\[(\d{1,3}\.){3}\d{1,3}\]$/;
|
return 1 if $host =~ m/^\[(\d{1,3}\.){3}\d{1,3}\]$/;
|
||||||
|
|
||||||
my $res = new Net::DNS::Resolver;
|
my $res = new Net::DNS::Resolver;
|
||||||
|
$res->tcp_timeout(30);
|
||||||
|
$res->udp_timeout(30);
|
||||||
return 1 if mx($res, $host);
|
return 1 if mx($res, $host);
|
||||||
my $query = $res->search($host);
|
my $query = $res->search($host);
|
||||||
if ($query) {
|
if ($query) {
|
||||||
|
Loading…
Reference in New Issue
Block a user