mjo 15/02/27 23:30:33 Added: net-dns-0.76_compatibility.patch Log: Revbump to fix bug #541100. Thanks to Markus Oehme for the report and the fix. (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 0x6F48D3DA05C2DADB!)
Revision Changes Path 1.1 mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch?rev=1.1&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/mail-filter/spamassassin/files/net-dns-0.76_compatibility.patch?rev=1.1&content-type=text/plain Index: net-dns-0.76_compatibility.patch =================================================================== >From the upstream bug report at, https://bz.apache.org/SpamAssassin/show_bug.cgi?id=7057 Net::DNS version 0.76 changed the field name holding a set of nameservers in a Net::DNS::Resolver object: it used to be 'nameservers', but is now split into two fields: 'nameserver4' and 'nameserver6'. Mail/SpamAssassin/DnsResolver.pm relied on the internal field name of a Net::DNS::Resolver object to obtain a default list of recursive name servers, so the change in Net::DNS broke that. As a result, SpamAssassin now fails DNS checks and reports: dns: eval failed: available_nameservers: No DNS servers available! when used with Net::DNS 0.76 or later and no DNS servers are configured explicitly in a custom .cf file (config option: dns_server). The problem was reported by Walter Hurry on a mailing list, 2014-06-17. The solution is to use an official access method to obtain this information from Net::DNS::Resolver. Apparently early versions of Net::DNS lacked such official access method, which is why we needed to peek under the Net::DNS hood. --- spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:47:04 1603517 +++ spamassassin/trunk/lib/Mail/SpamAssassin/DnsResolver.pm 2014/06/18 16:48:04 1603518 @@ -204,8 +204,10 @@ @ns_addr_port = @{$self->{conf}->{dns_servers}}; dbg("dns: servers set by config to: %s", join(', ',@ns_addr_port)); } elsif ($res) { # default as provided by Net::DNS, e.g. /etc/resolv.conf - @ns_addr_port = map(untaint_var("[$_]:" . $res->{port}), - @{$res->{nameservers}}); + my @ns = $res->UNIVERSAL::can('nameservers') ? $res->nameservers + : @{$res->{nameservers}}; + my $port = $res->UNIVERSAL::can('port') ? $res->port : $res->{port}; + @ns_addr_port = map(untaint_var("[$_]:" . $port), @ns); dbg("dns: servers obtained from Net::DNS : %s", join(', ',@ns_addr_port)); } return @ns_addr_port;