tags 340753 + patch
thanks
Hi,
I've run into this same problem, and it's very annoying. So I made a
quick fix to cause spamd not to abort just because DNS is not available;
it just sets a flag to pretend that DNS was never asked for in the first
place, and continues normal operation. The patch is attached. Hopefully,
this will help in the interim.
(Warning: I have no idea what side-effects this patch may have. It *is*
a quick-n-dirty fix after all. It hasn't caused me any problems, but you
should keep an eye on spamd after applying this patch to make sure it
isn't doing something wrong.)
To the Debian maintainer: forward this patch upstream and see what they
say. Thanks!
--T
--- lib/Mail/SpamAssassin/DnsResolver.pm 2005-09-13 19:07:31.000000000
-0700
+++ DnsResolver.pm.FIXED 2006-01-07 09:30:55.000000000 -0800
@@ -199,10 +199,19 @@
} else {
# did we fail due to the attempted use of an IPv6 nameserver?
$self->_ipv6_ns_warning() if (!$ipv6 && $errno==EINVAL);
- die "Error creating a DNS resolver socket: $errno";
+ # Don't abort; just turn off DNS
+ #die "Error creating a DNS resolver socket: $errno";
+ undef $sock;
+ last;
}
}
- defined $sock or die "Can't create a DNS resolver socket: $errno";
+ defined $sock or do {
+ # Don't abort; just turn off DNS
+ #die "Can't create a DNS resolver socket: $errno";
+ warn "Can't create a DNS resolver socket: $errno, disabling DNS\n";
+ $self->{no_resolver}=1;
+ return;
+ };
$self->{sock} = $sock;