Hi all,
I'm installing a mail filter and when I attempt to run amavis in debug mode I
get:
TROUBLE in pre_loop_hook: Error creating a DNS resolver socket: No such file
or directory
at /usr/lib/perl5/site_perl/5.8.6/Mail/SpamAssassin/DnsResolver.pm line 202.
Suicide () TROUBLE in pre_loop_hook: Error creating a DNS resolver socket: No
such file or directory
at /usr/lib/perl5/site_perl/5.8.6/Mail/SpamAssassin/DnsResolver.pm line 202.
I have tried everything I can think of and everything Google came up with. If
anyone has any insight I'd very much appreciate it.
Here's the function throwing the error (This is not my code, just so you know,
and the function is of course out of context):
sub connect_sock{
my ($self) = @_;
return if $self->{no_resolver};
$self->{sock}->close() if $self->{sock};
my $sock;
my $errno;
# IO::Socket::INET6 may choose wrong LocalAddr if family is unspecified,
# causing EINVAL failure when automatically assigned local IP address
# and remote address do not belong to the same address family:
use Mail::SpamAssassin::Constants qw(:ip);
my $ip64 = IP_ADDRESS;
my $ip4 = IPV4_ADDRESS;
my $ns = $self->{res}->{nameservers}[0];
my $ipv6 = 0;
# now, attempt to set the family to AF_INET6 if we can. Some
# platforms don't have it (bug 4412 comment 29)...
# also, only set $ipv6 to true if that succeeds.
my $family;
if (HAS_SOCKET_INET6 && $ns=~/^${ip64}$/o && $ns!~/^${ip4}$/o) {
eval '$family = AF_INET6; $ipv6 = 1;';
}
if (!defined $family) {
$family = AF_INET; # that didn't work ;)
}
dbg("dns: name server: $ns, family: $family, ipv6: $ipv6");
# find next available unprivileged port (1024 - 65535)
# starting at a random value to spread out use of ports
my $port_offset = int(rand(64511)); # 65535 - 1024
for (my $i = 0; $i<64511; $i++) {
my $lport = 1024 + (($port_offset + $i) % 64511);
my %args = (
PeerAddr => $ns,
PeerPort => $self->{res}->{port},
Proto => 'udp',
LocalPort => $lport,
Type => SOCK_DGRAM,
Domain => $family,
);
if (HAS_SOCKET_INET6) {
$sock = IO::Socket::INET6->new(%args);
} else {
$sock = IO::Socket::INET->new(%args);
}
$errno = $!;
if (defined $sock) { # ok, got it
last;
} elsif ($! == EADDRINUSE) { # in use, let's try another source port
dbg("dns: UDP port $lport already in use, trying another port");
} else {
# did we fail due to the attempted use of an IPv6 nameserver?
$self->_ipv6_ns_warning() if (!$ipv6 && $errno==EINVAL);
##########Error occurs here--->
die "Error creating a DNS resolver socket: $errno";
}
}
defined $sock or die "Can't create a DNS resolver socket: $errno";
$self->{sock} = $sock;
$self->{sock_as_vec} = $self->fhs_to_vec($self->{sock});
}
_______________________________________________
clug-talk mailing list
[email protected]
http://clug.ca/mailman/listinfo/clug-talk_clug.ca
Mailing List Guidelines (http://clug.ca/ml_guidelines.php)
**Please remove these lines when replying